Skip to content

Incorrect lenght of the shortest frame for Modbus Master #65

@aleksander1084

Description

@aleksander1084

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions