Mitsubishi MELSEC-Q/L Programming Manual page 390

Table of Contents

Advertisement

CALL, CALLP
(4) The number of function devices to be used by a subroutine program must be identical to the number of arguments in the
CALL (P) instruction.
Also, the types of the function device and CALL (P) argument used should be identical.
(5) Device numbers specified by the CALL (P) instruction should not overlap.
If they do overlap, it will not be possible to obtain accurate calculations.
(6) The device used in the argument of the CALL (P) instruction should not be used in a subroutine program. If used, it will
not be possible to obtain accurate calculations. (Refer to the following program example.)
(7) When the device, either timer or counter, is used in the argument of the CALL(P) instruction, only the current value is
transmitted/received.
Incorrect operation example
The following example shows the operation performed when D0 is specified for FD0 in the subroutine program and D1 is
used in the subroutine program.
[Program example]
[Operation performed after subroutine program execution]
Before the execution
of subroutine program
D0
0
D1
10
D2
100
Transfer
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.
*3:
D1 does not reflect the value of the function device.
Correct operation example
The following example shows the operation performed when D0 is specified for FD0 in the subroutine program and D4 is
used in the subroutine program.
[Program example]
388
Immediately after the
execution of CALL
instruction
D0
0
D1
10
D2
100
D3
1000
0
10
FD0
FD0
100
1000
At the time of
subroutine program
execution
D0
0
D0
D1
110 *1
D1
D2
100
D2
Transfer
D3
1000
D3
33 *1
1 *1
FD0
100
1000
After the execution
of RET instruction
33 *2
110 *3
100 *2
1000 *2
Indefinite
Indefinite
Indefinite
Indefinite

Advertisement

Table of Contents
loading

Table of Contents