Mitsubishi Electric MELSEC iQ-R Series Programming Manual page 573

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

Advertisement

Ex.
Correct operation: While D0 is specified for FD0 in the subroutine program, D4 is used in the subroutine program.
[MAIN]
M0
[ABC]
P0
M0
Before the execution of
Immediately after the execution of
the subroutine program
the ECALL instruction
D0
0
D1
10
D2
100
D3
1000
0
D4
(3)
(3)
FD0
(3)
(3)
(1) The operation result of the subroutine program is stored.
(2) These values are replaced with the function device values.
(3) Undefined values are stored.
• The device numbers specified by the ECALL(P) instruction arguments must not be overlapping. If they are overlapping,
normal operation cannot be performed.
• Up to 16 ECALL(P) instructions can be nested. Note that the 16-level nesting is the total of the CALL(P), FCALL(P),
ECALL(P), EFCALL(P), and XCALL instructions.
P0
ECALL
ʺABCʺ P0
ECALL ʺDEFʺ P10
FEND
RET
END
• Devices which are turned on in the subroutine program are retained even while the subroutine program is not executed.
Devices which are turned on during execution of the subroutine program can be turned off by the EFCALL(P) instruction.
Precautions
• An FBD/LD program cannot be created as a subroutine program.
• FBD/LD does not support the execution of a subroutine program with an argument.
ECALL
"ABC"
/
K100
D0
0
D1
10
D2
100
D3
1000
0
D4
D4
D4
0
10
FD0
100
1000
P10
ECALL ʺGHIʺ P20
RET
P0
D0
FEND
K3
FD0
+
K100
D4
RET
At the execution of
the subroutine program
D0
0
D1
10
D2
100
D3
1000
(1)
100
D4
33
(1)
(1)
1
FD0
100
1000
P20
RET
After the execution of
the RET instruction
(2)
D0
D0
D0
D0
D0
33
(2)
D1
D1
1
(2)
D2
D2
100
(2)
D3
D3
1000
100
D4
D4
D4
(3)
(3)
FD0
(3)
(3)
7 APPLICATION INSTRUCTIONS
7.4 Structure Creation Instructions
7
571

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents