96
(a) Creating subroutine and/or interrupt programs in a single stand-by type program
When creating subroutine and/or interrupt programs in a single stand-by type program, start the program from
the step 0. The FEND instruction used in creation of a subroutine or interrupt program is not required after a
main routine program.
After execution of the standby type program, the CPU module re-executes the program that called a program in
the standby type program. The following figure shows the operation when the subroutine and interrupt
programs in the standby type program are executed.
● For restrictions on programming of subroutine and interrupt programs, refer to the following.
• Subroutine program: Page 69, Section 2.4.3
• Interrupt program: Page 82, Section 2.9
● Use common pointers. ( Page 409, Section 4.10.2) If local pointers are used, subroutine programs in a stand-by
type program cannot be executed from any other program.
P508
RET
RET
Y10
RET
END
Y11
Y12
P500
P501
Program B (Stand-by type program)
Program A
Main routine
program
Use common pointer.
P100 RET
I0 IRET
END processing END processing END processing
CALL P100
instruction execution
Interrupt factor
occurrence
Subroutine program within
a stand-by type program
Interrupt program within a
stand-by type program
Main routine program