Mitsubishi FX3G Series Programming Manual page 225

Programmable controllers
Hide thumbs Also See for FX3G Series:
Table of Contents

Advertisement

FX
/FX
/FX
/FX
3G
3U
3GC
3UC
Programming Manual - Basic & Applied Instruction Edition
Caution
1. Using a label (P) number two or more times
In CALL instructions, the same number can be used two or more times in operands (P).
However, do not use a label (P) and number used in another instruction (CJ instruction).
X020
X030
Label
P 9
Program examples
1. Example of fundamental use (no nesting)
X000
Label
P 10
2. Example of multiple CALL instructions in subroutines (multiple nesting)
CALL instruction can be used up to 4 times in subroutine programs. Nesting of up to five layers is allowed.
X001
Label
P 11
X002
Label
X003
P 12
Series
FNC 00
CJ
FNC 01
CALLP
User program
FNC 01
P 10
CALL
FNC 06
FEND
FNC 02
SRET
END
FNC 01
P 11
CALLP
FNC 06
FEND
FNC 01
P 12
CALL
FNC 02
SRET
FNC 02
SRET
END
8 Program Flow – FNC 00 to FNC 09
P 9
Bad
P 9
Main program
While X000 is ON, the program execution jumps to a
step with the label P10.
Subroutine program
When SRET instruction is executed after the subroutine
program has executed, the program execution returns to
the original step +1.
Main program
When X001 turns from OFF to ON, the program execution
jumps to the label P11 only once.
Subroutine program 1
When SRET instruction is executed, the program
execution returns to the main program.
If X002 is ON while the subroutine program 1 is
executed, the program execution jumps to a step with the
label P12.
Subroutine program 2
The subroutine program with P12 is executed, and then
the program execution returns to the subroutine program
with P11 by SRET instruction.
8.2 FNC 01 – CALL / Call Subroutine
1
2
3
4
5
6
7
8
9
10
223

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx3u seriesFx3gc seriesFx3uc series

Table of Contents