Gateway with a Modbus RTU server and client

111 views
Skip to first unread message

Mikael Andersson

unread,
Sep 2, 2021, 6:27:25 AM9/2/21
to pymodbus

Hi,

Can someone point me in the direction to an example or explain how to best implement a gateway function with a Modbus RTU server and a Modbus RTU client.

Currently I am using the Python class Thread to create a Modbus RTU client thread before starting the Modbus RTU server. I am also using this:


This seems to work, but is there a better, more reliable way to do it with e.g. asyncio?

I want the gateway to normally pass the data on unaltered. As far as I understand this is realised in this example:


But, since I want to alter the data, based on a condition, above example is probably not relevant to use as a foundation.

Thanks,

Mikael

Mikael Andersson

unread,
Sep 9, 2021, 2:52:28 PM9/9/21
to pymodbus
I found a solution based on the examples serial_forwarder and custom_message. :)

Thanks,

Mikael
Reply all
Reply to author
Forward
0 new messages