Skip to content

Register offset and Modbus Error Code bug #71

@aliihsancengiz

Description

@aliihsancengiz

Hello , recently found a bug about register offset and modbus error codes.
Register Offset(u8regsize) is a uint8_t variable, you cannot exceed address range 255.

When ever you try to read a address(uint16_t) out of the this range , address is down casted to uint8_t and compared to table size in order to decide whether read address is exceeded this range.
image

Example case:

Register Table size 250.
Intended register read adress is 2000.
In that case we expect an EXC_ADDR_RANGE error code but we got successfull reading.

image

Modbus Frames decomposition

image

image

But if we want to read register at offset 509.

image

Modbus Frames decomposition

image

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