简体   繁体   中英

Read RTU Pymodbus data through TCP/Forwarder

I have Energy Meter connected through RTU and i am able to get holding registers data through simple RTU Code. Now i want to make Convert this RTU to TCP through Forwarder. I want to send data to TCP which forwards the command to RTU and fetches data of RTU connected device for me.

I have implement the Forwarder code just dont know how to fetch the holding register of RTU through it.

If you are working with real device, make sure you are explicitly initialising the remote slave context with the unit Id.

context = RemoteSlaveContext(serial_client, unit=<unit-id-of-slave>)

The default is 0 which works fine with simulated slaves but would be considered as a broadcast address with the real devices generally and no response would be returned back.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM