11.3.5
Program example
The following is an example program to be written to a CPU module on the master station.
(1) Devices used in the program
(a) Link special relay (SB), link special register (SW)
Device
SB0049
(b) Devices used by the user
Device
M0
M1
N0
N1
(2) Program example
1.
Create the following program in the project for the master station using GX Works2.
If a response is not received for several link scans, the station is determined as a cyclic transmission faulty station, and the
status is stored in Data link status (each station) (SW00B0 to SW00B7).
2.
Write the program to the CPU module on the master station. Then reset the CPU module or turn off
and on the power.
[Online]
3.
Set the CPU module on the master station to RUN.
Description
Data link status (own station)
Communication condition establishment flag (station No.1)
Communication condition establishment flag (station No.2)
Nesting (station No.1)
Nesting (station No.2)
Communication program with station No.1
Communication program with station No.2
[Write to PLC]
RESET
Device
Data link status (each station) (station
SW00B0.0
No.1)
Data link status (each station) (station
SW00B0.1
No.2)
Description
or Power OFF
ON
RUN
CHAPTER 11 PROGRAMMING
Description
407
11