开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜