7 Applied Instructions
7.1 Program Flow
124
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
1) Example in which outputs are latched
In the following program example, the counter C0 is provided to count X001. When X000 is input, the
subroutine P0 is executed only in one scan, and then the counter is reset and Y007 is output.
• Program examples
• Timing chart
X000
X000
X001
P0
CALLP
EN ENO
p
SRET
EN ENO
FEND
EN ENO
OUT_C
EN ENO
CCoil
CValue
RST
EN ENO
d
Y007
P0
CC0
K10
CN0
Execution of subroutine
P0 triggered by X000
X001
Current value
of C0
1
2
3
Counter is
reset.
Because the reset instruction for C0 is valid,
the current value of C0 remains unchanged
even if pulses are input.
Remains reset
Y007 is being output.
Outputs are held.
RST
C0
Y007
Subroutine is executed.