-
It seems to me, that some Modbus device doesn't need the register addresse from the manufactors doc 1:1, but with an offset depending on the length. e.g. 40068 is int32 must be requested with an offset -2: 40066 provides proper results. Another register 40096 is int16 must be requested with an offset -1: 40095 for values I don't know why some manufactors don't calculate the offset in the doc already for there customers. makes no sense from my perspective as the length is fixed for each register. Before I implement such an offset compensation based on the type length the question: Do you have heard of this? Or is this a rookies question and this is usual? And you may have implemented this as an option already? I suppose no, but I want to sure before I start. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Starting address and offset is device/manufactures specific - how they choose to address data. In Modbus packet addresses are 0-based - so first address is 0 (term If you want to read more see modbus spec page 7 - "4.4 MODBUS Addressing model" See this #79 (comment) I highly recommend:
|
Beta Was this translation helpful? Give feedback.
-
Thank you, Martti. Topic is solved for me. :) |
Beta Was this translation helpful? Give feedback.
Starting address and offset is device/manufactures specific - how they choose to address data. In Modbus packet addresses are 0-based - so first address is 0 (term
data address
). In documentation they are sometimes/often referred as 1-based. Often in form of40001
where first number represents function type because some modbus devices can have different memory for different functions - so FC3 can not read FC1 data.If you want to read more see modbus spec page 7 - "4.4 MODBUS Addressing model"
https://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf
See this #79 (comment)
I highly recommend: