EasyManua.ls Logo

Mitsubishi Electric MELSEC FX Series - Page 124

Mitsubishi Electric MELSEC FX Series
838 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
7 Applied Instructions
7.1 Program Flow
122
FXCPU Structured Programming Manual
(Basic & Applied Instruction)
Program examples
1. Example of fundamental use (no nesting)
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.
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.
Label
P 10
X000
CALL
EN ENO
p
SRET
EN ENO
FEND
EN ENO
P10
Label
P 11
Label
P 12
Main program
When X001 turns ON from OFF, the program
execution jumps to the label P11 only once.
Subroutine program1
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 program2
The subroutine program with P12 is executed,
and then the program execution returns to the subroutine program
with P11 by SRET instruction.
X001
X002
X003
CALLP
EN ENO
p
FEND
EN ENO
SRET
EN ENO
CALL
EN ENO
p
SRET
EN ENO
P12
P11

Table of Contents

Other manuals for Mitsubishi Electric MELSEC FX Series

Related product manuals