Modbus RTU over TCP or UDP

1,247 views
Skip to first unread message

Josep L. Guallar-Esteve

unread,
Oct 17, 2013, 10:59:01 AM10/17/13
to libm...@googlegroups.com
Hello,

Has anyone tried to use Modbus RTU over TCP or UDP using Stéphane's libmodbus library? Did you succeed?

I'm looking to implement Modbus RTU over UDP in C/C++ , so any hints/advice/help is greatly appreciated.

(Note: I managed to get Modbus RTU over UDP working on C#, but C/C++ is a different beast.)


Thank you in advance,
Josep

Tom Younger

unread,
Oct 17, 2013, 11:18:26 AM10/17/13
to libm...@googlegroups.com
Yes, on multiple platforms. DevStudio C/Win, and GNU C/Linux (Intel and Arm).

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes libmodbus.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse libmodbus+...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .

Josep L. Guallar-Esteve

unread,
Oct 17, 2013, 11:31:38 AM10/17/13
to libm...@googlegroups.com
Tom,

Excellent! Was it very hard to modify libmodbus? Do you have those modifications somewhere? Or could you elaborate a little on how you went into mixing RTU and TCP or UDP?

Thank you in advance,
Josep

Thomas Younger

unread,
Oct 17, 2013, 12:27:21 PM10/17/13
to libm...@googlegroups.com

Do you mean the serial protocol over UDP?

 

I didn’t do that, but I would imagine it is not difficult to write your own backend.

 

I had to modify the TCP backend to support an additional protocol between that layer and the application layer. The protocol was difficult, but adding it to promodbus (same as libmodbus but different licence at our client’s request) was easy.

--

Josep L. Guallar-Esteve

unread,
Oct 17, 2013, 12:56:31 PM10/17/13
to libm...@googlegroups.com, tyou...@questertangent.com


On Thursday, October 17, 2013 12:27:21 PM UTC-4, Thomas Younger wrote:

Do you mean the serial protocol over UDP?


Exactly. Using the serial protocol Modbus RTU sent as a data inside a UDP datagram. This is due to the scenario provided by the client: PLC connected to a device that turns UDP datagrams into serial 485 packets.I didn't choose it. In fact, I requested to use plain ModbusTCP. Oh, well.

didn't do that, but I would imagine it is not difficult to write your own backend.


That will be challenging.
 

I had to modify the TCP backend to support an additional protocol between that layer and the application layer. The protocol was difficult, but adding it to promodbus (same as libmodbus but different licence at our client’s request) was easy.


Thanks,
Josep

Juan Carlos Martinez Chaves

unread,
Sep 5, 2016, 3:12:11 PM9/5/16
to libmodbus
Hello Josep,

did you find a solution to use libmodbus using Modbus RTU over TCP?

This thread was writing long time ago, then maybe you have good news about this topic.

Thanks a lot.

Juan C.
Reply all
Reply to author
Forward
0 new messages