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

Register offset and Modbus Error Code bug #71

Open
aliihsancengiz opened this issue Aug 2, 2022 · 0 comments
Open

Register offset and Modbus Error Code bug #71

aliihsancengiz opened this issue Aug 2, 2022 · 0 comments

Comments

@aliihsancengiz
Copy link

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

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