Relative Addressing functionality?

8 views
Skip to first unread message

Sam Samco

unread,
Mar 17, 2023, 5:23:00 PM3/17/23
to libmodbus
Good day All,
I was curious if there is a way to use the library with relative addressing of the respective modbus data object?  I ask, as during my testing I see that libmodbus uses absolute addressing when doing say a "modbus_read_registers" function.  If I pass a starting address of say 101 when is sent is actually 40101.  This is correct, but the modbus device I am communicating with expects a relative address of 101, as the equipment uses the read holding register function of 03 as  the address reference.
Sadly, there is no way for me to change the slave's modbus functionality and so relative addressing must be used.   That said, this is not uncommon, as I have encountered many Modbus that use relative addressing.
Given that the source code of libmodbus is available, I could modify the code to accommodate, but wanted to see if I missed a setting or parameter that would enable relative modbus register addressing.
Thanks in advance!
Cheers,
Sam

Sam Samco

unread,
Mar 17, 2023, 6:14:27 PM3/17/23
to libmodbus
Good day All,

You can ignore my previous post, as I reviewed the source code and it does not appear to use absolute addressing at all... and so the issue appears to be something else despite my packet captures.  Something is certainly odd...

Cheers,

Sam
Reply all
Reply to author
Forward
0 new messages