Mitsubishi MELSEC-Q/L Programming Manual page 408

Table of Contents

Advertisement

XCALL
[Main routine program]
X0
XCALL
P0
(4)
to
can be used by the XCALL instruction.
S1
S5
(5) The number of function devices used by a subroutine program must be identical to the number of arguments in the
XCALL instruction. Also, the function device and the type of XCALL argument should be identical.
(6) Device numbers specified in the argument of the XCALL instruction should not overlap.
If they do overlap, it will not be possible to obtain accurate calculations.
(7) Up to 16 nesting levels can be used with the XCALL instruction. However, this 16 levels is the total number of levels in
the CALL(P), FCALL(P), ECALL(P), EFCALL(P), and XCALL instructions.
XCALL
FEND
END
(8) The device used for the argument of the XCALL instruction must not be used in a subroutine program.
If used, it will not be possible to perform correct calculations.
(Refer to the following program example.)
The processing to be executed when D1 is used in a subroutine program with D0 designated for FD0 in a subroutine
program is shown below.
[Program example]
[Operation performed after subroutine program execution]
Before the execution
of subroutine program
D0
0
D1
10
D2
100
D3
1000
Indefinite
Indefinite
FD0
Indefinite
Indefinite
*1:
Stores the execution result of the subroutine program.
*2:
Replaced by the value of the function device. D1 does not reflect the operation result in the subroutine program.
406
M0
D0
D30
Occupies from D30 to D33 (Transfer to FD2).
Occupies from D0 to D3 (Transfer to FD1).
Occupies M0 (Transfer to FX0).
P0
P0 X0
XCALL
P10 X10
RET
Immediately after the
execution of
XCALL instruction
D0
0
D1
10
D2
100
Transfer
D3
1000
0
10
FD0
100
1000
XCALL
P20 X20
RET
At the time of
subroutine program
execution
D0
0
D1
110
*1
D2
100
Transfer
D3
1000
*1
1
10
FD0
FD0
100
1000
P20
RET
After the execution
of RET instruction
*2
D0
1
D1
10
*2
*2
D2
100
*2
D3
1000
Indefinite
Indefinite
Indefinite
Indefinite

Advertisement

Table of Contents
loading

Table of Contents