Calling A Subroutine Program - Mitsubishi MELSEC iQ-F FX5 series Programming Manual

Melsec iq-f fx5 series
Hide thumbs Also See for MELSEC iQ-F FX5 series:
Table of Contents

Advertisement

Calling a subroutine program

CALL(P)
This instruction executes the subroutine program specified by (P).
Ladder diagram
(P)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(P)
Start pointer number of the subroutine program
■Applicable devices
Operand
Bit
X, Y, M, L,
SM, F, B, SB
(P)
Processing details
• When the CALL(P) instructions are executed, the subroutine program specified by the pointer (P) is executed. The
CALL(P) instructions can execute a subroutine program specified by a pointer in the same program file or by a common
pointer.
Main routine program
CALL (P)
END
• While the command input is ON, the CALL instruction is executed and the program execution jumps to a step with a label
(Pn). Then, a subroutine program with the label (Pn) is executed. When the RET (SRET) instruction is executed, the
program execution returns to the step following the CALL instruction. At the end of the main program, put FEND instruction.
Put a label (Pn) for the CALL instruction after the FEND instruction.
Command
SM400
Label
Pn
RUN Monitor
(normally on)
7 APPLICATION INSTRUCTION
344
7.4 Structuring instruction
Word
U\G T, ST,
T, ST, C, D,
C, LC
W, SD, SW, R
Subroutine program
(P)
RET(SRET)
User program
CALL
Pn
User program
FEND
User program
RET
Structured text
Not supported
Range
Double word Indirect
U\G
Z
LC
LZ
Main program
Program area from the step 0 to FEND instruction
Subroutine program
Program area from a label Pn to RET instruction
Data type
Data type (label)
Device name
ANY16
Constant
specification
K, H
E
Others
$

Advertisement

Table of Contents
loading

Table of Contents