Communication processor and Modbus TCP
13.5 Modbus communication
S7-1200 Programmable controller
1208 System Manual, V4.2, 09/2016, A5E02486680-AK
Table 13- 84 Diagnostic functions
S7-1200 Modbus_Slave Modbus diagnostic functions
08 0000H Return query data echo test: The Modbus_Slave will echo back to a Modbus master a
word of data that is received.
08 000AH Clear communication event counter: The Modbus_Slave will clear out the communica-
tion event counter that is used for Modbus function 11.
11 Get communication event counter: The Modbus_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 Modbus_Slave instruction supports broadcast write requests from any Modbus master
as long as the request is for accessing valid addresses. Modbus_Slave will produce error
code "0x8188" for function codes not supported in broadcast.
Modbus_Slave communication rules
● Modbus_Comm_Load must be executed to configure a port, before a Modbus_Slave
instruction can communicate through that port.
● If a port is to respond as a slave to a Modbus_Master, then do not program that port with
the Modbus_Master instruction.
● Only one instance of Modbus_Slave can be used with a given port, otherwise erratic
behavior may occur.
● The Modbus instructions do not use communication interrupt events to control the
communication process. Your program must control the communication process by
polling the Modbus_Slave instruction for transmit and receive complete conditions.
● The Modbus_Slaveinstruction must execute periodically at a rate that allows it to make a
timely response to incoming requests from a Modbus_Master. It is recommended that you
execute Modbus_Slave every scan from a program cycle OB. Executing Modbus_Slave
from a cyclic interrupt OB is possible, but is not recommended because of the potential
for excessive time delays in the interrupt routine to temporarily block the execution of
other interrupt routines.