modbus
modbus copied to clipboard
Added a receive flush timeout just prior to launching the next poll when
using a TCP connection. Without this, a slow response can cause transaction ID mismatches for the life of this TCP connection (it never recovers). This occurs when a remote device does answer, but it answers too slowly. The request has already timed out, and when the next request is launched the previous response is read (rather than the new one) causing this error.
hi,i think you should change the SetReadDeadline(time.now) to SetReadDeadline(time.now().add(time.millisecod*1))