Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
7 Applied Instructions (Program Flow)
7.4 IRET / Interrupt Return
119
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied Instructions
(Program Flow)
8
Applied Instructions
(Move and
Compare)
9
Applied Instructions
(Arithmetic and
Logical Operation)
10
Applied Instructions
(Rotation and
Shift Operation)
Program examples
[Structured ladder/FBD]
Task for interrupt program(Interrupt pointer I001 is set by event.)
I001:The rising edge of X000 is detected.
Task for interrupt program(Interrupt pointer I620 is set by event.)
I620:Interrupt every 20 ms.
Task for interrupt program(Interrupt pointer I010 is set by event.)
I010:High speed counter interrupt
Timer interrupt routine
Input interrupt routine
High speed counter routine
Interrupts are usually disabled in PLCs.
Use EI instruction to enable interrupts.
When X000 turns ON while the main program is
executed,instructions after the interrupt
routine pointer I001 are executed, and the
program execution returns to the original main
program by IRET instruction.
The timer interrupt of the pointer I620 is executed
every timer time of 20 ms, and the program execution
is returned to the original main program by IRET
instruction each time.
M8000
Main program
EI
EN ENO
OUT_C
EN ENO
CCoil
CValue
CC255
K100
The high speed counter interrupt of the pointer I010
is executed when the current value of a high speed
counter becomes equivalent to a value specified by
DHSCS instruction, and the program execution returns
to the original main program by IRET.
[ ST ]
Task for interrupt program(Interrupt pointer I001 is set by event.)
I001:The rising edge of X000 is detected.
Task for interrupt program(Interrupt pointer I620 is set by event.)
I620:Interrupt every 20 ms.
Task for interrupt program(Interrupt pointer I010 is set by event.)
I010:High speed counter interrupt
Interrupts are usually disabled in PLCs.
Use EI instruction to enable interrupts.
When X000 turns ON while the main program is
executed,instructions after the interrupt
routine pointer I001 are executed, and the
program execution returns to the original main
program by IRET instruction.
The timer interrupt of the pointer I620 is executed
every timer time of 20 ms, and the program execution
is returned to the original main program by IRET
instruction each time.
The high speed counter interrupt of the pointer I010
is executed when the current value of a high speed
counter becomes equivalent to a value specified by
DHSCS instruction, and the program execution returns
to the original main program by IRET.
Y000: =X000;
Y000: =X000;
Y000: =X000;
EI(TRUE);
OUT_C(M8000, CC255, K100);
Task for main program
Task for main program
Timer interrupt routine
High speed counter routine
Input interrupt routine
Main program