我在读取Modbus时遇到了一个循环,但是在退役3次后出现了failed connection
错误:
ERR 2018-11-27 18:08:47,99 [pymodbus.client.sync:connect] {300} Connection to (192.168.1.51, 502) failed: timed out
ERR 2018-11-27 18:08:51,12 [pymodbus.client.sync:connect] {300} Connection to (192.168.1.51, 502) failed: timed out
ERR 2018-11-27 18:08:54,26 [pymodbus.client.sync:connect] {300} Connection to (192.168.1.51, 502) failed: timed out
我还更改了retires
中的默认ModbusTcpClient('192.168.1.51', port=502, timeout=3, retries=10)
参数,但结果相同。
我也尝试了此指令,但不幸的是,行为仍然相同。
from pymodbus.constants import Defaults
Defaults.Retries = 5
Defaults.RetryOnEmpty = True