73
4
4 Instructions 4.2.2 Interrupt
◆
Function
The IRET
statement is located at the end of an interrupt subprogram. After the IRET instruction is executed,
the PLC returns to the statement that calls the interrupt subprogram and continues program execution.
Interrupt programs are programmed in an independent window in AutoShop. The IRET instruction does not
need to be programed at the end of an interrupt program.
4.2.2 Interrupt
EI: Enable interrupt; DI: Disable interrupt
◆
Overview
The EI instruction enables the interrupt function, whereas the DI instruction disables the interrupt function.
EI
Enable interrupt Applicable model:
H3U
DI
Disable interrupt
An independent instruction without operands and contact driving
16-bit instruction (1
step)
IRET, EI, and DI:
Continuous execution
◆
Function
When the PLC program starts running, the interrupt function is disabled by default. Use the EI statement to
enable the interrupt function, or use the DI statement to disable the interrupt function. The DI instruction is
not required when the program does not have the interrupt insertion disabled range.
Interrupt types and setting:
1) External signal input interrupt: classied into the rising pulse interrupt and falling pulse interrupt
triggered by input signals X0–X5. The pulse capture function can be enabled for the X signal that does
not require instant response.
2) High-speed counter interrupt: used with the FNC53 (DHSCS) instruction for comparison setting. This
interrupt is generated when the high-speed counter value equals the designated value.
3) Timer interrupt: an interrupt that occurs with a xed cycle of 1–99 ms.
4) Pulse output complete interrupt: an interrupt that is executed immediately after the designated number
of pulses are sent.
5) Multi-user interrupt (not available in the XP model): A maximum of 24 interrupts can be implemented by
any high-speed counter.