MODBUS Instruction Application
MODBUS Instruction Application
Slave station 2
Slave station 3
Slave station 4
D10D14 (send)
D10D14
D15D19 (receive)
D15D19
D20D24 (send)
D10D14
D25D29 (receive)
D15D19
D30D34 (send)
D10D14
D35D39 (receive)
D15D19
3. parameters setting
PLC communication parameters setting are shown as below:
Communication port 2
FD8220
Communication mode
FD8221
Communication format
FD8222
FD8223
FD8224
Start sign
FD8225
End sign
FD8226
Communication port 2
M8130
M8132
M8134
M8135
M8137
M8138
M8139
All the PLCs in this example communicate with each other via port 2.
Setting method of communication parameters:
FD8221 (port 2 communication parameters):
Default value FD8221=8710. 19200, 8 data bits, 1 stop bit, even check. ( this example uses default
value )
FD8220 ( communication port 2): station number setting. Master station 1(FD8220=1), slave
station 2(FD8220=2), slave station 3 (FD8220=3), slave station 4 (FD8220=4).
4. sequence chart
Master station reads and writes once from one slave station.
5. ladder chart
Program explanation:
PLC starts to run, M8002 is ON in the first PLC scan period. S0 is ON, PLC writes the data from
D10D14 of master station to D10D14 of slave station 2. Communication over sign M8138 is
ON, then PLC reads the data from D15D19 of slave station 2 to D15D19 of master station,
communication over sign M8138 is ON. At this time, PLC has completed the process of reading
and writing the data with one slave station. Process S2 will judge the station number. If the station
number is less than 4, station number will increase 1, offset value will increase 10; otherwise the
station number will start from 2 again.