Services Supported by a Modbus Link Master Processor
(Original Document)
Communication Functions
Three specific communication functions are defined for sending and receiving data via a Modbus communication channel:
For detailed information on these communication functions, refer to the chapter General Information on M340 Communication Functions.
Data Exchanges
Reading or writing of variables are carried out by addressing following requests to the targeted slave device.
These requests use the READ_VAR, WRITE_VAR, and DATA_EXCH communication functions:
Modbus request
Function code
Communication function
Read bits
16#01 or 16#02
READ_VAR
Read words
16#03 or 16#04
READ_VAR
Write bits
16#0F
WRITE_VAR
Write words
16#10
WRITE_VAR
Other request
all
DATA_EXCH
NOTE: WRITE_VAR can be used in broadcast mode (READ_VAR can't be used in broadcast mode). In this case, the PLC doesn't receive a response. Sending a broadcast request resets the activity bit and the code 16#01 (Exchange stop on timeout) is returned into the EF second management word.
NOTE: The objects read by Modicon M340 PLC can be of the type %I and %IW.In this case, READ_VAR function generates a Modbus request: FC 0x2 or 0x4. In a Quantum PLC, it allows accessing the Input Status or Input Status Registers.
More generally, it is possible to send any Modbus requests to a slave device by using the DATA_EXCH communication function.
Cancelling an Exchange
There are two ways of programming that enable an exchange executed by the communication functions to be cancelled:
For detailed information on cancelling a communication function, refer to EcoStruxure™ Control Expert, Communication, Block Library.