7.6 Structured Instructions
7.6.3 Subroutine program call
7-107
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
CALL
CALL
(2) Up to 16 nesting levels are applicable for the CALL(P) instruction.
(3) Devices which are turned ON within subroutine programs will be latched even if the
subroutine program is not executed.
O
peration Error
In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and
the corresponding error code is stored to SD0.
• The FEND, GOEND, or STOP instruction is executed after the execution of the CALL(P)
instruction, and prior to the execution of the RET instruction.
(Error code: 4211)
• The RET instruction is executed prior to the execution of the CALL(P) instruction.
(Error code: 4212)
• The 17th nesting level is executed.
(Error code: 4213)
• There is no subroutine program for the pointer specified in the CALL(P) instruction.
(Error code: 4210)
Program Example
In the following program, the subroutine program is executed when X20 turns ON.
[Structured ladder]
P
0
CA
LL
FEND
R
ET
R
ET
R
ET
END
p
0
p
10
p
20
CA
LL
P
10
CA
LL
P
20
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......