App
-
35
(c) Program after replacement
In the sequence program after replacement, two programs are required as shown below.
1) Main routine program
• Replace the CHKST and CHK instructions with the CALL instructions so that a subroutine program is
called.
• One CALL instruction is required for each device specified as check condition in front of the CHK
instruction. (In the program before replacement shown in (b), four CALL instructions need to be added
since there are four check conditions in front of the CHK instruction.)
• Device number and contact number of X devices (check condition) are specified in each CALL instruc-
tion.
• Contact number is used to display failure number when a failure is detected.
Figure App.12 Program execution
Figure App.13 Sample program
FEN
D
R
ET
EN
D
<
After
trans
i
t
i
on
>
EN
D
<
Before
trans
i
t
i
on
>
I
n
i
t
i
a
l
process
i
ng
P0
M
a
i
n
rout
i
ne
program
M
a
i
n
rout
i
ne
program
Subrout
i
ne
program
An
fa
il
ure
status
i
s
checked
,
and
i
f
a
fa
il
ure
i
s
detected
,
a
fa
il
ure
number
i
s
stored
i
n
D200
.