Communication instructions Chapter 9
Rockwell Automation Publication 2080-RM001D-EN-E - February 2015 205
MSG_MODBUS2 sends a MODBUS/TCP message over an Ethernet Channel.
MSG_MODBUS2 operation
A maximum of four message requests per channel can be processed in one scan.
For Ladder Diagram programs, message requests are executed at the end of a
ladder scan.
Arguments
When the MSG_MODBUS2 function block is enabled, the receive buffers for
Read operations are cleared on the rising edge of Enable.
Parameter
Parameter
type
Data type Description
IN Input BOOL If Rising Edge (IN turns from FALSE to TRUE), start the function block with the
precondition that the last operation has been completed.
Cancel Input BOOL TRUE - Cancel the execution of the function block.
LocalCfg Input MODBUS2LOCPARA Define structure input (local device).
Defines the input structure for the local device.
See MODBUS2LOCPARA data type on page 208.
TargetCfg Input MODBUS2TARPARA Define structure input (target device).
Defines the input structure for the target device.
See MODBUS2TARPARA data type on page 210.
LocalAddr Input MODBUSLOCADDR
MODBUSLOCADDR data type is a 125 Word array that is used by Read commands to
store the data (1-125 words) returned by the Modbus slave and by Write
commands to buffer the data (1-125 words) to be sent to the Modbus slave.
Q Output BOOL Outputs of this instruction are updated asynchronously from the program scan.
Output Q cannot be used to re-trigger the instruction since IN is edge triggered.
TRUE - MSG instruction is finished.
FALSE - MSG instruction is not finished.