7 Applied Instructions
7.1 Program Flow
129
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
8
Interrupt Function
and Pulse Catch
Function
A
Relationships
between devices
and addresses
Program examples
[Structured ladder]
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
IRET
EN ENO
Input interrupt routine
IRET
EN ENO
High speed counter routine
IRET
EN ENO
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
FEND
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.
Timer interrupt routine
Y000: =X000;
IRET(TRUE);
High speed counter routine
Y000: =X000;
IRET(TRUE);
Input interrupt routine
Y000: =X000;
IRET(TRUE);
Main program
EI(TRUE);
OUT_C(M8000, CC255, K100);
FEND(TRUE)
Task for main program
Task for main program