3. Instruction Set API 06 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 7. When CALL instruction is executed, executing FEND before SRET will result in errors. programs between the final FEND and END instruction. 8. When FOR instruction is executed, executing FEND before NEXT will result in errors. 3-51 Mnemonic Function Controllers SA2 ES2/EX2 SS2 SX2 SE Controllers FEND The End of The Main Program (First End) SA2 ES2/EX2 SS2 SX2 SE OP Descriptions Program Steps N/A No contact to drive the instruction is required.
FEND: 1 step PULSE 16-bit 32-bit ES2/EX2 SS2 SA2 SE SX2 SA2 ES2/EX2 SS2 SA2 SE SX2 ES2/EX2 SS2 SX2 SE