Communication processor and Modbus TCP
13.9 Legacy Modbus RTU communication (CM/CB 1241 only)
S7-1200 Programmable controller
1272 System Manual, V4.2, 09/2016, A5E02486680-AK
MB_COMM_LOAD data block variables
The following table shows the public static variables stored in the instance DB for the
MB_COMM_LOAD that can be used in your program.
Table 13- 145 Static variables in the instance DB
ICHAR_GAP UInt Delay for Inter-character gap between characters. This parameter is specified
in milliseconds and is used to increase the expected amount of time between
received characters. The corresponding number of bit times for this parameter
is added to the Modbus default of 35 bit times (3.5 character times).
RETRIES UInt
Number of retries that the master will attempt before returning the no response
error code 0x80C8.
Number of stop bits used in framing each character. Valid values are 1 and 2.
Table 13- 146 MB_COMM_LOAD execution condition codes
1
Invalid port ID value (wrong port/hardware identifier for communication module)
Invalid flow control value
Invalid response timeout value (response timeout less than the 5 ms minimum)
8185 MB_DB parameter is not an instance data block of a MB_MASTER or MB_SLAVE instruc-
In addition to the MB_COMM_LOAD errors listed above, errors can be returned from the underlying PtP communication
MB_MASTER (Communicate using the PtP port as Modbus RTU master)
Table 13- 147 MB_MASTER instruction
REQ:=_bool_in_,
MB_ADDR:=_uint_in_,
MODE:=_usint_in_,
DATA_ADDR:=_udint_in_,
DATA_LEN:=_uint_in_,
DONE=>_bool_out_,
BUSY=>_bool_out_,
ERROR=>_bool_out_,
STATUS=>_word_out_,
DATA_PTR:=_variant_inout_);
The MB_MASTER instruction communicates as a
Modbus master using a port that was configured by
a previous execution of the MB_COMM_LOAD
instruction. An instance data block is assigned
automatically when you place the MB_MASTER
instruction in your program. This MB_MASTER
instance data block is used when you specify the
MB_DB parameter for the MB_COMM_LOAD in-
struction.