Fnc 01 - Call / Call Subroutine - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
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
FNC 01
CALL
P
2. Set data
Operand type
Pn
For the pointer
PLCs, and P0 to P62 and P64 to P2047 can be specified in FX
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
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
Pn
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
.
Pn
Then, a subroutine program with the label
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.
Command
Label
M8000
Pn
RUN monitor
(normally ON)
Mnemonic
16-bit Instruction
CALL
3 steps
CALLP
Pointer number (P) indicating the label number for the jump destination
(FX
/FX
: P0 to P62 and P64 to P4095, FX
3U
3UC
in the CALL instruction, P0 to P62 and P64 to P4095 can be specified in FX
Pn
Digit Specification
User program
FNC 01
CALL
User program
FNC 06
FEND
User program
FNC 02
SRET
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
: P0 to P62 and P64 to P2047)
3G
PLCs.
3G
Word Devices
Special
System User
Unit
V Z Modify K H
is executed.
Pn
Pn
Pn
Main program
Program area from the step 0 to FEND
instruction
Subroutine program
Program area from a label
instruction
8 Program Flow – FNC 00 to FNC 09
8.2 FNC 01 – CALL / Call Subroutine
Mnemonic
Operation Condition
Data type
Pointer number
Others
Con-
Real
Charac-
Index
stant
Number
ter String
E
" "
Pn
to SRET
1
2
3
4
/FX
3U
3UC
5
Pointer
P
6
7
8
9
10
235

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents