Communication processor and Modbus TCP
13.5 Modbus communication
S7-1200 Programmable controller
1210 System Manual, V4.2, 09/2016, A5E02486680-AK
Modbus holding register addresses begin at 40001 or 400001. These addresses correspond
to the beginning PLC memory address of the holding register. However, you can configure
the "HR_Start_Offset" variable to start the beginning Modbus holding register address at
another value instead of 40001 or 400001.
For example, if the holding register is configured to start at MW100 and is 100 words long.
An offset of 20 specifies a beginning holding register address of 40021 instead of 40001.
Any address below 40021 and above 400119 will result in an addressing error.
Table 13- 86 Example of Modbus holding register addressing
0
S7-1200 address MW100 MW298
20
S7-1200 address MW100 MW298
HR_Start_Offset is a word value that specifies the starting address of the Modbus holding
register and is stored in the Modbus_Slave instance data block. You can set this public static
variable value by using the parameter helper drop-list, after Modbus_Slave is placed in your
program.
For example, after Modbus_Slave is placed in a LAD network, you can go to a previous
network and assign the HR_Start_Offset value. The value must be assigned prior to
execution of Modbus_Slave.
us slave variable using the
Set the cursor in the parameter field and
type an m character.
Select "Modbus_Slave_DB" from the drop-
list.
Set the cursor at the right side of the DB
name (after the quote character) and enter
a period character.
Select
"Modbus_Slave_DB.HR_Start_Offset" from
the drop list.