DVP-ES2/EX2/EC5/SS2/SA2/SX2/SE&TP Operation Manual - Programming
API
Mnemonic Function
SS2
SX2
06 FEND The End of The Main Program (First End)
OP Descriptions Program Steps
N/A No contact to drive the instruction is required. FEND: 1 step
SS2
SX2
SS2
SX2
SS2
SX2
Explanations:
1. Use FEND instruction when the program uses either CALL instructions or interrupts. If no
CALL instruction or interrupts are used, use END instruction to end the main program.
2. The instruction functions same as END instruction in PLC operation process.
3. CALL subroutines must be placed after the FEND instruction. Each CALL subroutine must end
with the SRET instruction.
4. Interrupt subroutines must be placed after the FEND instruction. Each interrupt subroutine
must end with the IRET instruction.
5. When using the FEND instruction, an END instruction is still required, but should be placed as
the last instruction after the main program and all subroutines.
6. If several FEND instructions are in use, place the subroutine and interruption service
programs between the final FEND and END instruction.
7. When CALL instruction is executed, executing FEND before SRET will result in errors.
8. When FOR instruction is executed, executing FEND before NEXT will result in errors.
CJ Instruction Program Flow
X1
CALL P63
P0
P63
CJ P0
I301
X0
0
The program flow
when X0=off,
X1=off
Main program
Main program
Main program
Interrupt subroutine
Command CALL subroutine
EI
DI
FEND
FEND
SRET
IRET
END
The program flow when X0=On
program jumps to P0