Porting Modbus C++ program to RevPi

Topics about the Software of Revolution Pi
Ryan_Hoffmann45
Posts: 1
Joined: 17 Sep 2026, 14:09

Porting Modbus C++ program to RevPi

Post by Ryan_Hoffmann45 »

Hello there,

I am a controls engineer that is very new to the C++ development world, so I apologize if any of this seems basic or slightly incorrect in thinking. I have a very large C++ program on an older controller that I will be reusing on a Revolution Pi Connect SE. This program has a fairly robust Modbus library, but it is tied to the hardware of the old controller. I am struggling to remove the old controller specific code in favor of using the Revolution Pi libraries. All of the documentation I have found is either for PiCtory, Node-Red, or Codesys, and I'm curious if there are any working libraries, tutorials, or examples for using Modbus in C++ on the RevPi. I am only interested in porting the RS-485 serial communication to the new controller in C++ if possible.

Thank you in advance.
NickEng
Posts: 3
Joined: 07 May 2023, 00:27

Re: Porting Modbus C++ program to RevPi

Post by NickEng »

Hi Ryan,

FWIW, I used the libmodbus library in a C program that runs on the RevPi and it worked really well (for reading and writing registers of an Automation-Direct P3-550E PLC). The C program was required for interative calculatiions that determined mass flow-rate, as the PLC wasn't very well suited to carry out these calculations.

In my case, we utilized Modbus-TCP over Ethernet, but according to their webite, the libmodbus libary also works over serial connections.

https://libmodbus.org/

The libmodbus library is well documented and I found it fairly straightforward to use. Perhaps you may find it worth a try.

Nick