In the following program example, the counter C0 is provided to count X1. When X0 is input, the subroutine P0 is executed only in one scan, and then the
counter is reset and Y7 is output.
[Program example]
X0
CALLP
X1
X0
P0
RST
[Timing chart]
A
X1
3
2
Current
value of
1
C0
RST
Remains reset
C0
Y7
Y7 being output
Example in which latched outputs are reset (countermeasures)
[Program example]
X0
CALLP
X1
X2
RST
X0
P0
RST
SM401
RST
RUN Monitor
(normally OFF)
P0
K10
C0
FEND
C0
Y7
RET
Subroutine is executed.
(1)
Counter
reset
(2)
P0
K10
C0
(1)
Y7
FEND
C0
A
C0
B
(2)
Y7
RET
A: Execution of subroutine P0 triggered by X0
(1): Because the C0 reset instruction is valid, the