4 Special Functions
3-76 SmartAXIS Touch User's Manual
● Example: Interrupt Input
The following example demonstrates a program using the interrupt input function, with input I2 designated as an
interrupt input. When the interrupt input is turned on, the input I0 status is immediately transferred to output Q0
using the IOREF (I/O refresh) instruction before the END instruction is executed. For the IOREF instruction, refer to
Chapter 21 "Trigonometric Function Instructions" in the "SmartAXIS Ladder Programming Manual".
M8120 is the initialize pulse special internal relay.
D8033 stores 0 to designate jump destination label 0 for
interrupt input I2.
The interrupt program is separated from the main program by
the END instruction.
When input I2 is on, program execution jumps to label 0.
M8125 is the in-operation output special internal relay.
IOREF immediately reads input I0 status to internal relay
M0300.
M0300 turns on or off the output Q0 internal memory.
Another IOREF immediately writes the output Q0 internal
memory status to actual output Q0.
Program execution returns to the main program.
Insert LRET at the end of the subroutine to return to the main
program.
To change input/output information during execution of an interrupt program, use the IOREF (Input/Output
Refresh) instruction. The IOREF instruction is used to freely change input/output data before the END scan.
For details, refer to Chapter 15 "Refresh Instruction" in "SmartAXIS Ladder Programming Manual".