AttributeError: 'ModbusIOException' object has no attribute 'bits'
from pymodbus.client import ModbusTcpClient
PLC_IP = '192.168.0.200'
PLC_PORT = 502
client = ModbusTcpClient(PLC_IP, PLC_PORT)
status = client.connect()
print(status)
result = client.read_coils(1,5)
if result.bits[0] == True:
print("Hello world")
client.close()
It shows the error I put in the title. I recently changed my pc and I think it might be my pymodbus version. Thanks and I wish to have luck finding a solution to my prob开发者_如何学Pythonlem.
精彩评论