Sub-Routine Programs - Mitsubishi Electric MELSEC-Q Series User Manual

Hide thumbs Also See for MELSEC-Q Series:
Table of Contents

Advertisement

4 SEQUENCE PROGRAM CONFIGURATION & EXECUTION
CONDITIONS

4.1.2 Sub-routine programs

4 - 4
(1) Definition of sub-routine program
(a)
A sub-routine program is a program which begins from a pointer (P
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 is managed
as one program.
Create a sub-routine program as described below.
• A sub-routine program is created between the main routine program's FEND
and END instructions.
• Because there are no restrictions regarding the order in which sub-routine
programs are created, there is no need to set the pointers in ascending order
when creating multiple sub-routine programs.
MAIN
P0
Sub-routine
program
P8
P1
Main routine
program
FEND
Y10
RET
Y11
RET
Y12
RET
END
MELSEC-Q
Basic model QCPU
Program memory
Write
Program file
) and
4 - 4

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec qcpuMelsec q00jcpuMelsec q00cpuMelsec q01cpu

Table of Contents