Modbus signal timing
Modbus_Slave must be executed periodically to receive each request from the
Modbus_Master and then respond as required. The frequency of execution for
Modbus_Slave is dependent upon the response timeout period of the Modbus_Master. This
is illustrated in the following diagram.
The response timeout period RESP_TO is the amount of time a Modbus_Master waits for the
start of a response from a Modbus_Slave. This time period is not defined by the Modbus
protocol, but is a parameter of each Modbus_Master. The frequency of execution (the time
between one execution and the next execution) of Modbus_Slave must be based upon the
particular parameters of your Modbus_Master. At a minimum, you should execute
Modbus_Slave twice within the response timeout period of the Modbus_Master.
Modbus_Slave instruction data block (DB) tags
The following table shows the public static tags stored in the Modbus_Slave instance DB that
you can use in your program:
Table 13- 85 Modbus_Slave instance DB static tags
Tag
HR_Start_Offset
Extended_Addressing
Request_Count
Slave_Message_Count
Bad_CRC_Count
Broadcast_Count
Exception_Count
Success_Count
MB_DB
Your program can write values to the HR_Start_Offset and Extended_Addressing tags and
control the Modbus slave operations. You can read the other tags to monitor the Modbus
status.
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
Data type
Default
Word
0
Bool
FALSE
Word
0
Word
0
Word
0
Word
0
Word
0
Word
0
MB_BASE
-
Communication processor and Modbus TCP
Description
Assigns the starting address of the Modbus holding register (default =
0)
Configures single or double-byte slave addressing:
FALSE = single byte address
•
TRUE = double-byte address
•
Total of all requests received by this slave
Number of requests received for this specific slave
Number of requests received that have a CRC error
Number of broadcast requests received
Modbus-specific errors that require an acknowledgement with a re-
turned exception to the master
Number of requests received for this specific slave that have no proto-
col errors
The MB_DB parameter of the Modbus_Comm_Load instruction must
be connected to the MB_DB parameter of the Modbus_Slave instruc-
tion.
13.5 Modbus communication
1209