105BCommunication processor
12.5 Modbus communication
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
593
Variable
Data type Default
value
Description
Exception_Count
Word
0
Modbus specific errors that require a returned exception
Success_Count
Word
0
The number of requests received for this specific server that have no
protocol errors.
Connected
Bool
0
Indicates whether the connection to the assigned client is connected or
disconnected: 1=connected, 0=disconnected
Your program can write values to the HR_Start_Offset and control Modbus server
operations. The other variables can be read to monitor Modbus status.
HR_Start_Offset
Modbus holding register addresses begin at 40001 . 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.
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 40119 will result in an addressing error.
Table 12- 61 Example of Modbus holding register addressing
HR_Start_Offset
Address
Minimum
Maximum
Modbus address (Word)
40001
40099
0
S7-1200 address
MW100
MW298
Modbus address (Word)
40021
40119
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 MB_SERVER instance data block. You can set this public static
variable value by using the parameter helper drop-list, after MB_SERVER is placed in your
program.