我正在尝试运行这段代码:
from pymodbus.client.sync import ModbusTcpClient
client = ModbusTcpClient('192.168.1.142', port=5020)
client.connect()
try:
res = client.read_holding_registers(0x02, count=1, unit=1)
if res.isError():
print(res)
else:
print(res.registers)
exception Exception as exc:
print(exc)
出局:
ValueError: Exception Response(131, 3, GatewayNoResponse)
这是什么例外?我已经多次遇到此错误。