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
if (i8state < 6) //7 was incorrect for functions 1 and 2 the smallest frame could be 6 bytes long
Hi, while reading your library I have noticed that in a poll method for master module you have defined shortest possible frame as 6 bytes. What is correct but only for correct responses, for the error responses it should be 5 (including CRC).
For example error response for command 0x01 will look like:
[Address] [Function code] [exception] [CRC HI] [CRC LO]
so even though you are later validating answer to be an error in validateAnswer it will never come true since those frames are prevously eliminated due to the lenght.
Part of the Modbus 1.1b documentation:
The text was updated successfully, but these errors were encountered:
Modbus-Master-Slave-for-Arduino/ModbusRtu.h
Line 668 in df2fc9b
Hi, while reading your library I have noticed that in a poll method for master module you have defined shortest possible frame as 6 bytes. What is correct but only for correct responses, for the error responses it should be 5 (including CRC).
For example error response for command 0x01 will look like:
[Address] [Function code] [exception] [CRC HI] [CRC LO]
so even though you are later validating answer to be an error in validateAnswer it will never come true since those frames are prevously eliminated due to the lenght.
Part of the Modbus 1.1b documentation:
The text was updated successfully, but these errors were encountered: