EasyManua.ls Logo

Siemens SIMATIC S7-1200 - Page 1282

Siemens SIMATIC S7-1200
1614 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Communication processor and Modbus TCP
13.9 Legacy Modbus RTU communication (CM/CB 1241 only)
S7-1200 Programmable controller
1282 System Manual, V4.2, 09/2016, A5E02486680-AK
Modbus slave variables
This table shows the public static variables stored in the MB_SLAVE instance data block that
can be used in your program
Table 13- 158 Modbus slave variables
Variable
Data type
Description
Request_Count
Word
The number of all requests received by this slave
Slave_Message_Count Word The number of requests received for this specific slave
Bad_CRC_Count
Word
The number of requests received that have a CRC error
Broadcast_Count
Word
The number of broadcast requests received
Exception_Count
Word
Modbus specific errors that require a returned exception
Success_Count Word The number of requests received for this specific slave that have no protocol
errors
HR_Start_Offset
Word
Specifies the starting address of the Modbus Holding register (default = 0)
Extended_Addressing Bool Configures single or double-byte slave addressing
(0=single byte address, 1=double-byte address, default = 0)
Your program can write values to the HR_Start_Offset and Extended_Addressing variables
and control Modbus slave operations. The other variables can be read to monitor Modbus
status.
HR_Start_Offset
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- 159 Example of Modbus holding register addressing
HR_Start_Offset
Address
Minimum
Maximum
0
Modbus address (Word)
40001
40099
S7-1200 address
MW100
MW298
20
Modbus address (Word)
40021
40119
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_SLAVE instance data block. You can set this public static
variable value by using the parameter helper drop-list, after MB_SLAVE is placed in your
program.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals