You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When enabling debug mode and letting a write command run into a timeout, the displayed roundtrip time is displayed in ms but is not converted from the internal value stored in s. So the shown roundtrip time is 1000 times smaller as it actually was.
Code:
ser = serial.Serial(
PORT, BAUDRATE, BYTESIZE, PARITY, stopbits=STOPBITS
)
dev = minimalmodbus.Instrument(ser, ADDRESS, debug=True)
dev.serial.timeout = X
dev.write_register(..., ...)
Output:
MinimalModbus debug mode. Will write to instrument (expecting 8 bytes back): ... (x bytes)
MinimalModbus debug mode. Clearing serial buffers for port ...
MinimalModbus debug mode. Sleeping 0.87 ms before sending. Minimum silent period: 1.75 ms, time since read: 0.88 ms.
MinimalModbus debug mode. Response from instrument: 10 90 04 1D C6 (5 bytes), roundtrip time: X ms. Timeout for reading: 200.0 ms.
When enabling debug mode and letting a write command run into a timeout, the displayed roundtrip time is displayed in ms but is not converted from the internal value stored in s. So the shown roundtrip time is 1000 times smaller as it actually was.
Code:
Output:
Solution:
minimalmodbus/minimalmodbus.py
Lines 1510 to 1517 in 785262d
Change
roundtrip_time
to:roundtrip_time * _SECONDS_TO_MILLISECONDS
The text was updated successfully, but these errors were encountered: