227
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
Introdu
ction
2
Ov
ervi
ew
3
Instruction
Li
st
4
D
evices
in Det
ail
5
Specifi
ed the
De
vice
&
C
onst
ant
6
Bef
ore
Pr
og
ra
mmi
ng
7
Bas
ic
Instruction
8
FN
C00-FN
C0
9
Program Fl
ow
9
FNC
10-FN
C19
Mov
e & Com
pare
10
FNC
20-FNC
29
Arith. & Lo
gi
c
Operati
on
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
Содержание FX3G SERIES
Страница 1: ...FX3G FX3U FX3UC SERIES PROGRAMMABLE CONTROLLERS PROGRAMMING MANUAL Basic Applied Instructions Edition ...
Страница 2: ......
Страница 947: ......