Communication processor and Modbus TCP
13.9 Legacy Modbus RTU communication (CM/CB 1241 only)
S7-1200 Programmable controller
1280 System Manual, V4.2, 09/2016, A5E02486680-AK
The following table shows examples of Modbus address to holding register mapping that is
used for Modbus function codes 03 (read words), 06 (write word), and 16 (write words). The
actual upper limit of DB addresses is determined by the maximum work memory limit and M
memory limit, for each CPU model.
Table 13- 156 Mapping of Modbus addresses to CPU memory
MB_HOLD_REG parameter examples
40003 MW104 DB10.DBW4 MW124 DB10.DBW54 "Recipe".ingredient[3]
Table 13- 157 Diagnostic functions
S7-1200 MB_SLAVE Modbus diagnostic functions
08 0000H Return query data echo test: The MB_SLAVE will echo back to a Modbus master a
word of data that is received.
08 000AH Clear communication event counter: The MB_SLAVE will clear out the communication
event counter that is used for Modbus function 11.
11 Get communication event counter: The MB_SLAVE uses an internal communication
event counter for recording the number of successful Modbus read and write requests
that are sent to the Modbus slave. The counter does not increment on any Function 8,
Function 11, or broadcast requests. It is also not incremented on any requests that
result in a communication error (for example, parity or CRC errors).
The MB_SLAVE instruction supports broadcast write requests from any Modbus master as
long as the request is for accessing valid addresses. MB_SLAVE will produce error code
0x8188 for function codes not supported in broadcast.