4 - 4 4 - 4
MELSEC-Q
4 SEQUENCE PROGRAM CONFIGURATION AND EXECUTION
CONDITIONS
4.1.2 Sub-routine programs
(1) Definition of sub-routine program
(a) A sub-routine program begins from a pointer (P
) and ends at a RET
instruction.
(b) A sub-routine program is executed only when called by a CALL instruction
(e.g. CALL(P), FCALL(P)) from the main routine program.
(c) Sub-routine program application
1) The overall step count can be reduced by using a sub-routine program
as a program which is executed several times in one scan.
2) The step count of a constantly executed program can be reduced by
using a sub-routine program as a program which is executed only
when a given condition is satisfied.
(2) Sub-routine program management
Sub-routine programs are created after the main routine program (after FEND
instruction), and the combination of main and sub-routine programs can be
managed as one program.
(a) When created after the main routine program
• A sub-routine program is created between the main routine program's
FEND and END instructions.
• Because there are no restrictions on the order in which sub-routine
programs are created, it is not necessary to set the pointers in ascending
order when creating multiple sub-routine programs.
• Either a local pointer or a common pointer can be used.
Program A
Sub-routine
program
Write
High Performance model QCPU
Main routine
program
FEND
END
P8
RET
RET
Y10
RET
Y11
Y12
P0
P1
Program memory / Standard
ROM / Memory card
File of
program A
REMARK
: See Section 10.9 for details on local and common pointers.
See Section 10.8 for details on sub-routine program nesting.
Содержание QCPU (Q Mode)
Страница 111: ...5 19 5 19 MELSEC Q 5 ASSIGNMENT OF I O NUMBERS MEMO ...
Страница 450: ...App 59 App 59 MELSEC Q APPENDICES MEMO ...