Modbus Master Communication Function
(Original Document)
At a Glance
This page describes the services available on master Premium stations of a Modbus link General functions.
Exchange of Data
The following requests are addressed to the slave device with which you wish to carry out read or write operations of variables.
These requests use the READ_VAR, SEND_REQ and WRITE_VAR communication functions.
Modbus Request
Function Code
Communication Function
Read bits
16#01
READ_VAR
Read words (until 125 registers)
16#03
READ_VAR
Writing a bit or n bits
16#0F
WRITE_VAR
Writing a word or n words
16#06 or 16#10
WRITE_VAR
Input bits reading
16#02
SEND_REQ
Read input words (until 124 registers)
16#04
SEND_REQ
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. It is therefore recommendable to configure a time-out to acknowledge the activity bit of the function. Since TSX SCP ••• V3.2 and TSX SCY  ••• V2.8 the value returned in the second management word is 16#00FF.
Example of Reading Words
The example applies to the reading of word 4 (%MW4) in the Modbus slave 3.
READ_VAR (ADDR('0.0.1.3'), '%MW',4,1,%MW200:4,%MW100:1)
Diagnostics and Maintenance
The diagnostics and maintenance information of Modbus slaves uses the SEND_REQ communication function.
Modbus Request
Function Code / Sub Function Code
Communication Function
Exception status
16#07
SEND_REQ
Diagnostics
16#08/16#xx
SEND_REQ
Event counter
16#0B
SEND_REQ
Connection event
16#0C
SEND_REQ
Slave identification
16#11
SEND_REQ