5 - 46 5 - 46
MELSEC-Q/QnA
5 SEQUENCE INSTRUCTIONS
High Performance
QnA Q4AR
Basic
QCPU
PLC CPU
Process CPU
5.6 Termination Instructions
5.6.1 End main routine program (FEND)
Usable Devices
Internal Devices
(System, User)
MELSECNET/10(H)
Direct J
\
Set
Data
Bit Word
File
Register
Bit Word
Special
Function
Module
U
\G
Index
Register
Zn
Constant Other
[Instruction Symbol] [Execution Condition]
FEND
FEND
[Functions]
(1) The FEND instruction is used in cases where the CJ instruction or other instructions are used
to cause a branch in the sequence program operations, and in cases where the main routine
program is to be split from a subroutine program or an interrupt program.
(2) Execution of the FEND instruction will cause the CPU module to terminate the program it was
executing.
(3) Even sequence programs following the FEND instruction can be displayed in ladder display at
a peripheral devices. (Peripheral devices continue to display ladders until encountering an
END instruction.)
Main routine
program
CJ
Main routine
program
FEND
Main routine
program
FEND
END
0
P
(a) When using the CJ instruction
Main routine
program
CALL
Subroutine
program
FEND
Interrupt program
END
(b) When there is a subroutine
or interrupt program
Jump caused by
the CJ instruction
Operation
performed when
the CJ instruction
was executed
Operations when
he CJ instruction
is not executed
P
P
I
P
[Operation Errors]
(1) In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
code is stored at SD0.
• A FEND instruction is executed after the execution of a CALL, FCALL, ECALL, or EFCALL
instruction, and before the execution of the RET instruction. (Error code: 4211)
• A FEND instruction is executed after the execution of a FOR instruction, and before the
execution of a NEXT instruction. (Error code: 4200)
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com