![Mitsubishi Electric MELSEC FX3G Скачать руководство пользователя страница 237](http://html.mh-extra.com/html/mitsubishi-electric/melsec-fx3g/melsec-fx3g_programming-manual_239083237.webp)
235
FX
3G
/FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
8 Program Flow – FNC 00 to FNC 09
8.2 FNC 01 – CALL / Call Subroutine
1
Int
roduct
ion
2
O
ver
view
3
In
str
uc
tion
Li
st
4
D
evices
in D
etail
5
Spec
ified t
he
D
evice &
C
onst
ant
6
Bef
ore
Pr
ogr
am
m
ing
7
B
asic
In
st
ru
ct
io
n
8
FN
C
00-FN
C
09
P
rogr
am
F
low
9
FN
C
10
-FN
C
19
Mo
ve
&
Co
mp
are
10
FNC2
0-F
NC2
9
Ar
ith.
&
Logic
O
per
ation
8.2
FNC 01 – CALL / Call Subroutine
Outline
This instruction calls and executes a program which should be processed commonly in a sequence program.
This instruction reduces the number of program steps, and achieves efficient program design.
For creating a subroutine program, FEND (FNC 06) and SRET (FNC 02) instructions are required.
1. Instruction format
2. Set data
For the pointer
in the CALL instruction, P0 to P62 and P64 to P4095 can be specified in FX
3U
/FX
3UC
PLCs, and P0 to P62 and P64 to P2047 can be specified in FX
3G
PLCs.
Because P63 is dedicated to CJ (FNC 00) instruction (for jump to END step), it cannot be used as a pointer
for CALL (FNC 01) instruction.
3. Applicable devices
Explanation of function and operation
1. 16-bit operation
While the command input is ON, CALL instruction is executed and the program execution jumps to a step with
a label
.
Then, a subroutine program with the label
is executed.
When SRET (FNC 02) instruction is executed, the program execution returns to the step after CALL
instruction.
• At the end of the main program, put FEND instruction.
• Put a label (P) for CALL instruction after FEND instruction.
Operand type
Description
Data type
Pointer number (P) indicating the label number for the jump destination
(FX
3U
/FX
3UC
: P0 to P62 and P64 to P4095, FX
3G
: P0 to P62 and P64 to P2047)
Pointer number
Oper-
and
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
X Y M T C S D
.b KnX KnY KnM KnS T C D R U
\G
V Z Modify K H
E
"
"
P
3
3
−
−
P
FNC 01
CALL
CALL
CALLP
Continuous
Operation
Pulse (Single)
Operation
Mnemonic
Operation Condition
16-bit Instruction
3 steps
32-bit Instruction
Mnemonic
Operation Condition
Pn
Pn
Pn
Pn
Pn
M8000
FNC 01
CALL
Pn
FNC 06
FEND
RUN monitor
(normally ON)
FNC 02
SRET
Command
User program
User program
Main program
Program area from the step 0 to FEND
instruction
Subroutine program
Program area from a label to SRET
instruction
User program
Label
Pn
Pn
Pn