Modbus native addressing is known also as Modicon addressing, meaning requests refer to four original address spaces:
Discrete Inputs - 1,2,3... 65536, bit size
Output Coils - 1,2,3... 65536, bit size
Input Registers - 1,2,3... 65536, 16 bit word
Holding Registers - 1,2,3... 65536, 16 bit word
Documentation of a device could refer to addresses of registers in these address spaces. Note, they all start from 1, not from 0.
IEC 61131 refers to variables based on %I, %Q %IW, %QW, %MW, %M address spaces. They start from 0.
As you consult documentation of specific device and see register address 2700, then try to read %MW2700 the Holding registry address 2699 is used.
Depending on which of the two addressing options above (Modicon vs IEC) are used the resulting request can be shifted with one.
In your case there is something more - address of holding register 2700 probably refers to the first word of a two-word (32bit) variable. If you read only half of this variable, the specific device warns you with error code 16#03
From Modbus documentation:
"
16#03 - ILLEGAL DATA VALUE - A value contained in the query data field is not an allowable value for server. This indicates a fault in the structure of the remainder of a complex request, such as that the implied length is incorrect. It specifically does NOT mean that a data item submitted for storage in a register has a value outside the expectation of the application program, since the MODBUS protocol is unaware of the significance of any particular value of any particular register.
"
In your case, colloquially : the request surprises the Modbus server - it expected to respond with a complete variable (of two words) but you request only one half plus another word.
So, for the application to be processed correctly - instead of 2700 refer to 2701 and request at least for 2 words (request even amount of words for all two-word variables).
If the shift was the opposite way, using 2699 could solve the problem.
Modbus Server Device in this example can be Power Meter 8000, 5000 or many other devices.
Modbus Client Device can be any PLC or HMI, freely configurable Modbus Gateway.
Publicado para: Schneider Electric España









