Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect lenght of the shortest frame for Modbus Master #65

Open
aleksander1084 opened this issue Jan 19, 2022 · 0 comments
Open

Incorrect lenght of the shortest frame for Modbus Master #65

aleksander1084 opened this issue Jan 19, 2022 · 0 comments

Comments

@aleksander1084
Copy link

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:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant