Termination Instructions; End Main Routine Program (Fend) - Mitsubishi MELSEC QCPU Programming Manual

Programmable logic controller
Table of Contents

Advertisement

5 SEQUENCE INSTRUCTIONS

5.6 Termination Instructions

5.6.1 End main routine program (FEND)

Internal Devices
Set
(System, User)
Data
Bit
Word
[Instruction Symbol] [Execution Condition]
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.)
Operations when
the CJ instruction
is not executed
[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.
• A FEND instruction is executed after the execution of a FOR instruction, and before the
execution of a NEXT instruction.
5 - 46
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com
MELSECNET/10(H)
File
Direct J \
Register
Bit
0
Main routine
program
P
CJ
Main routine
program
FEND
P
Main routine
program
FEND
END
(a) When using the CJ instruction
QCPU
PLC CPU
Basic
High Performance
Usable Devices
Special
Function
Module
Word
U \G
Jump caused by
the CJ instruction
Operation
P
performed when
the CJ instruction
was executed
I
(b) When there is a subroutine
MELSEC-Q/QnA
QnA
Process CPU
Index
Register
Constant
Other
Zn
FEND
CALL
P
Main routine
program
FEND
Subroutine
program
Interrupt program
END
or interrupt program
(Error code: 4211)
(Error code: 4200)
5 - 46
Q4AR

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec qnacpuMelsec q modeMelsec q series

Table of Contents