234
FX3G/FX3U/FX3UC Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
8 Program Flow – FNC 00 to FNC 09
8.7 FNC 06 – Main Routine Program End
2. In the case of CALL instruction
Cautions
1. When FEND instruction is programmed two or more times
Put a subroutine program or interrupt routine program between last FEND instruction and END instruction.
2. When CALL or CALLP instruction is used
Put a label after FEND instruction. And the SRET instruction is required in every case.
3. When CALL or CALLP instruction is used
If FEND instruction is executed after CALL or CALLP instruction was executed and before SRET instruction is
executed, an error is caused.
4. When FOR instruction is used
If FEND instruction is executed after FOR instruction was executed and before NEXT instruction is executed, an error
is caused.
5. When the interrupt function (I) is used
Make sure to program an interrupt label (pointer) after FEND instruction. And IRET instruction is required in every
case.
I100
P21
0
When X011
is ON
When X011 is OFF
X011
Main routine
program
Main routine
program
Subroutine
program
Interrupt routine
program
FNC 01
CALL
P 21
FNC 06
FEND
END