Parameter and type
RTS_ON_DLY
IN
RTS_OFF_DLY
IN
RESP_TO
IN
MB_DB
IN
DONE
OUT
ERROR
OUT
STATUS
OUT
MB_COMM_LOAD is executed to configure a port for the Modbus RTU protocol. Once a port
is configured for the Modbus RTU protocol, it can only be used by either the MB_MASTER or
MB_SLAVE instructions.
One execution of MB_COMM_LOAD must be used to configure each communication port
that is used for Modbus communication. Assign a unique MB_COMM_LOAD instance DB for
each port that you use. You can install up to three communication modules (RS232 or
RS485) and one communication board (RS485) in the CPU. Call MB_COMM_LOAD from a
startup OB and execute it one time or use the first scan system flag (Page 78) to initiate the
call to execute it one time. Only execute MB_COMM_LOAD again if communication
parameters like baud rate or parity must change.
An instance data block is assigned for MB_MASTER or MB_SLAVE when you place these
instructions in your program. This instance data block is referenced when you specify the
MB_DB parameter for the MB_COMM_LOAD instruction.
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
Data type
Description
UInt
RTS ON delay selection:
0 – (default) No delay from RTS active until the first character of the
message is transmitted
1 to 65535 – Delay in milliseconds from RTS active until the first
character of the message is transmitted (does not apply to RS485
ports). RTS delays shall be applied independent of the FLOW_CTRL
selection.
UInt
RTS OFF delay selection:
0 – (default) No delay from the last character transmitted until RTS
goes inactive
1 to 65535 – Delay in milliseconds from the last character transmitted
until RTS goes inactive (does not apply to RS485 ports). RTS delays
shall be applied independent of the FLOW_CTRL selection.
UInt
Response timeout:
Time in milliseconds allowed by MB_MASTER for the slave to respond. If
the slave does not respond in this time period, MB_MASTER will retry the
request or terminate the request with an error when the specified number
of retries has been sent.
5 ms to 65535 ms (default value = 1000 ms).
Variant
A reference to the instance data block used by the MB_MASTER or
MB_SLAVE instructions. After MB_SLAVE or MB_MASTER is placed in
your program, the DB identifier appears in the parameter helper drop-list
available at the MB_DB box connection.
Bool
The DONE bit is TRUE for one scan, after the last request was completed
with no error. (Version 2.0 only)
Bool
The ERROR bit is TRUE for one scan, after the last request was
terminated with an error. The error code value at the STATUS parameter
is valid only during the single scan where ERROR = TRUE.
Word
Execution condition code
105BCommunication processor
12.5 Modbus communication
601