5 SEQUENCE INSTRUCTIONS
5.6 Termination Instructions
141
5
5.6 Termination Instructions
Ending the main routine program
FEND
This instruction is used to branch operation of the sequence program by the CJ instruction or to divide the main routine
program into a subroutine program or an interrupt program.
• This instruction branches operation of the sequence program by the CJ instruction or dividing the main routine program into
subroutine programs and interrupt programs.
• When this instruction is executed, program execution returns to the program at step 0 after output processing, input
processing and refreshing of the watchdog timer.
• The sequence program from this instruction onwards can also be displayed as ladder by the engineering tool.
Ladder diagram Structured text
ENO:=FEND(EN);
(1) Operation when the CJ instruction is not executed
(2) Jump by the CJ instruction
(3) Operation when the CJ instruction has been executed
Error code
(SD0/SD8067)
Remarks
3340 The FEND instruction is executed before the NEXT instruction after the FOR instruction is executed.
3381 The FEND instruction is executed before the RET instruction after the CALL(P) instruction is executed.
33E3 The FEND instruction is programmed between FOR-NEXT.
33E4 The FEND instruction is programmed between MC-MCR.
33E7 The FEND instruction is programmed between I-IRET.
3100 The FEND instruction is programmed in standby type program.
The FEND instruction is programmed in FB file.
CJ
FEND
FEND
END
0
P**
P**CALL
FEND
END
(2)
(3)
(1)
P**
P**
I**
Main routine
program
Main routine
program
When the CJ instruction is used(a)
Main routine
program
Subroutine program
Interrupt Program
(b)
Main routine
program
When there are subroutine programs
and interrupt programs