Programs that use pointers (P) or interrupt pointers (I) are explained below.
This is the program from pointer (P) up to the RET instruction. Subroutine programs are executed only when they are called
by the CALL instruction. Pointer type labels also can be used instead of pointers (P). The applications of subroutine programs
are as follows:
• By grouping programs that are executed multiple times in one scan into a single subroutine program, the number of steps
in the entire program can be reduced.
• A program that is executed only under certain conditions can be saved as a subroutine program which shortens the scan
Subroutine program 1
Subroutine program 2
Subroutine program 3
• Subroutine programs can also be managed as separate programs by turning them into standby type
programs. (Page 31 Stand-by type program)
• Pointers need not be programmed starting with the smallest number.
The precautions when using subroutine programs are explained below.
• Do not use timers (T, ST). Note, however, that timers can be used when a timer coil (OUT T instruction) is always
executed only once in one scan.
• An error occurs when program execution returns to the call source program and the program is terminated without using
the RET instruction.
• An error occurs when there is no pointer (P) or pointer type global label in FB or FUN.
1 PROGRAM EXECUTION
1.5 Program Type
Main routine program