![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/3/8d/38d56254-54fe-46e3-85ae-d3f5260e1091/38d56254-54fe-46e3-85ae-d3f5260e1091-bg89.png)
FX Series Programmable Controlers Applied Instructions 5
5-11
5.1.5 FEND (FNC 06)
Operation:
An FEND instruction indicates the first end of a main pro
ram and the start of the pro
ram
area to be used for subroutines. Under normal operatin
circumstances the FEND instruction
performs a similar action to the END instruction, i.e. output processin
, input processin
and
watchdo
timer refresh are all carried out on execution.
Points to note:
a) The FEND instruction is commonl
used with CJ-P-FEND, CALL-P-SRET and I-IRET
pro
ram constructions (P refers to pro
ram pointer, I refers to interrupt pointer).
Both CALL pointers/subroutines and interrupt pointers (I) subroutines are ALWAYS
pro
rammed after an FEND instruction, i.e. these pro
ram features NEVER appear in the
bod
of a main pro
ram.
b) Multiple occurrences of FEND instructions can be used to separate different subroutines
(see dia
ram above).
c) The pro
ram flow constructions are NOT allowed to be split b
an FEND instruction.
d) FEND can never be used after an END instruction.
Mnemonic Function
Operands
Program steps
D
FEND
FNC 06
(First end)
Used to indicate
the end of the
main pro
ram
block
N/A
Note:
Can be used with CJ (FNC 00), CALL (FNC 01)
and interrupt routines
FEND:
1 step
FEND
X10
P 20CJ
FEND
FEND
X11
P 21CJ
END END
P20 P21
0
0
I100
Main program
Main program
Main program Main program
Subroutine
Main program
Main program
Interrupt prog'
X10
=
OFF
X10
=
ON
X11
=
ON
X11
=
OFF