Special Functions
7-2. Example of MODBUS Instructions
E.g.: The following is the communication program of one master station and 4 slave stations
Each par
T er s ation
2:
Ladder program:
ameters:
he mast tation number is 1, slave st s numbers are 2, 3, 4, 5. This example, we use COM
33
Program description:
When PLC changes from STOP to RUN, M8002 coil gets through a scan cycle. S0 flow
open, write master machine’s D10——D14 into No.2 slave machine’s D10——D14. after
finish communication, set M8138, at the same time write slave machine’s D15——D19 into
master machine’s D15——D19,set communication finish flag. Realize write and read to a
slave station. At this time flow S3 will judge with the slave station. If the station number is
less than 5,station number add 1,offset add 10;or else station number starts from number 2
station again.