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

Issue specifying <object_type>+<start_address> #29

Closed
digispiders opened this issue Jan 29, 2024 · 2 comments
Closed

Issue specifying <object_type>+<start_address> #29

digispiders opened this issue Jan 29, 2024 · 2 comments
Labels
question Further information is requested

Comments

@digispiders
Copy link

Unless Im missing something, here is whats happening:
When preparing the config file, it appears that its pulling an offset in the modbus addresses from the object type, and adding the starting_address value to it. So, if you specify:

poll,holding_register,40001,10,BE_BE
ref,objectname,40001,uint16,r

It throws an error. It appears that it might be adding 40001 from the type=holding_register to the specified address (40001) to be polling at the wrong place.
If you specify:

poll,holding_register,1,10,BE_BE
ref,objectname,1,uint16,r

It pulls from 40001 (the first holding_register).

Problem:
This conflicts with the documentation: helloysd

Suggested Resolution:
Should either pull offset from object_type and be documented as such, or ignore type and only pull from specified start_address.
outputwith40001
configwith40001
configwith1
outputwith1

Uploading config files and screen shots to demonstrate.

@gavinying
Copy link
Owner

@digispiders Firstly, congratulate you have actually retrieved data according to your last screenshot.

As you mentioned, instead of polling start from the standard holding_register address 40001,

poll,holding_register,40001,10,BE_BE
ref,objectname,40001,uint16,r

you end up with polling start from address 1,

poll,holding_register,1,10,BE_BE
ref,objectname,1,uint16,r

This happens quite often because Modbus is an open protocol, different vendors have their own interpretation on the standard, that's why we have many different variants, e.g. zero-based vs one-based, big-endian vs small-endian, etc. Usually vendors will provide documents/examples to help developers for integration.

In your case, your device vendor is using relative address (offset address) rather than absolute address for data comm.

Hope that helps for clarification.

@gavinying gavinying added the question Further information is requested label Jan 30, 2024
@digispiders
Copy link
Author

digispiders commented Jan 30, 2024

Okay. It was a little unclear to me based on the documentation in modpoll + what the manufacturer put out, in combination with my poor understanding of modbus addresses. I assumed that an address was an address, and if an 'offset' to an 'address' was specified (e.g. 1 to 40001), I should call the address (40002) which was probably wrong to assume. Feel to close.

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

No branches or pull requests

2 participants