-
Notifications
You must be signed in to change notification settings - Fork 73
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
start reference is off by -1 #51
Comments
Modbus spec in early days was not clear on that hence |
splatch, thank you sir. I didn't come here for that specific question but I couldn't get any data out of a mikrotik knot modbus tcp bridge to a mean well DRS-480-24 unit. I didn't know the +/- 1 issue existed. For anyone else that ends up searching and finding this, do hex to decimal and add 1 for the register address. (modbus mikrotik knot meanwell mean well DRS) |
I believe this behavior is defined by the Modbus specification (didn't look it up, though). mbpoll has command line argument |
IMHO it's worth making this situation clearer in the help message: -r is the OFFSET from register 1 (or register 0 if -0 is specified) |
Hello,
Testing mbpoll with Victron Energry Color GX. The Victron Energry Color GX error logs shows
mbpoll 1.0-0 (Debian 1.4.11+dfsg-2~bpo10+1) starting reference (-r) is off by -1.
Example: ./mbpoll -1 -a 100 -t 3 -r 840 -c 1 192.168.10.180
mbpoll will starts at 839 not 840.
Fix source file mbpoll.c
change line 952~
iStartReg = ctx.piStartRef[j] - ctx.iPduOffset;
to
iStartReg = ctx.piStartRef[j];
The text was updated successfully, but these errors were encountered: