rtu-over-tcp connect fail

6 views
Skip to first unread message

劉姿汶

unread,
Jul 4, 2023, 8:31:01 PM7/4/23
to pymodbus

I am trying to read and write data on RTU over Modbus TCP with python. But it prints false, this means client.connect() has failed.


from pymodbus.client import ModbusTcpClient 
from pymodbus.transaction import ModbusRtuFramer as ModbusFramer 

client = ModbusTcpClient("192.168.1.232", port=502, framer=ModbusFramer) 
success = client.connect() 
print(success)
Reply all
Reply to author
Forward
0 new messages