![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/3/8d/38d56254-54fe-46e3-85ae-d3f5260e1091/38d56254-54fe-46e3-85ae-d3f5260e1091-bg87.png)
FX Series Programmable Controlers Applied Instructions 5
5-9
5.1.4 IRET, EI, DI
(FNC 03, 04, 05)
General description of an interrupt routine:
An interrupt routine is a section of pro
ram which is, when tri
ered, operated immediatel
interruptin
the main pro
ram flow. Once the interrupt has been processed the main pro
ram
flow continues from where it was,
ust before the interrupt ori
inall
occurred.
Operation:
Interrupts are tri
ered b
different input conditions, sometimes a direct input such as X0 is
used other times a timed interval e.
. 30 msec can be used. The availabilit
of different
interrupt t
pes and the number operational points for each PLC t
pe are detailed on pa
e 4-
12, Interrupt Pointers. To pro
ram and operate interrupt routines requires up to 3 dedicated
instructions (those detailed in this section) and an interrupt pointer.
Defining an interrupt routine:
An interrupt routine is specified between its own
unique interrupt pointer and the first occurrence of an
IRET instruction.
Interrupt routines are ALWAYS pro
rammed after an
FEND instruction.
The IRET instruction ma
onl
be used within
interrupt routines.
Mnemonic Function
Operands
Program steps
D
IRET
FNC 03
(Interrupt
return)
Forces the
pro
ram to return
from the active
interrupt routine
N/A
Automaticall
returns to the main pro
ram step
which was bein
processed at the time of the
interrupt call.
IRET:
1 step
EI
FNC 04
(Enable
interrupts)
Enables interrupt
inputs to be pro-
cessed
N/A
An
interrupt input bein
activated after an EI
instruction and before FEND or DI instructions
will be processed immediatel
unless it has
been specificall
disabled.
EI:
1 step
DI
FNC 05
(Disable
interrupts)
Disables the
processin
of
interrupt routines
N/A
An
interrupt input bein
activated after a DI
instruction and before an EI instruction will be
stored until the next sequential EI instruction is
processed.
DI:
1 step
I
(Interrupt
pointer)
Identifies the
be
innin
of an
interrupt routine
A 3 di
it numeric code relatin
to the interrupt
t
pe and operation.
I
:
1 step
FEND
I001
IRET
IRET
I201
Interrupt Program I001
Interrupt Program I201