75
4
4 Instructions 4.2.2 Interrupt
Interrupt programming specication and execution features:
• An interrupt that occurs within the interrupt disabled range (between the Dl and EI instructions) can be memorized
and executed after the EI instruction.
• An interrupt subprogram must be programmed after the FEND instruction and appended with IRET. In AutoShop,
an interrupt subprogram cannot be programmed in the main program, and IRET can be omitted at the end of the
subprogram.
• Pointer numbers cannot be used repeatedly.
• When multiple interrupts occur in sequence, the interrupt that occurs rst takes precedence over the interrupt that
occurs later. When multiple interrupts occur simultaneously, the interrupt with a higher priority takes precedence
over that with a lower priority. Interrupts are sorted by priority in descending order as follows: high-speed counter
interrupt, external signal input interrupt, timer interrupt, and pulse output complete interrupt.
• Other interrupts are disabled when an interrupt routine is executed.
• When the input relay and output relay are controlled during interrupt processing, the I/O refresh instruction REFF
can be used to read the latest input status or immediately output the operation result to achieve high-speed
control.
• The number of the input relay used as an interrupt pointer cannot be the same as the ID of any application
command within the same input range, such as the high-speed counter command and pulse density (FNC56)
command.
• Timers T192–T199 used by routines are recommended for subprograms and interrupt routines. The timing function
of general-purpose timers is disabled when used with subroutines and interrupt programs. Attention must be paid
when using the 1-ms cumulative timer.
• The input lter feature of the input relay is automatically disabled if an external signal input interrupt pointer is
specied in the format of I□0□. In this case, the REFE (FNC51) instruction and the special data register D8020 (used
for input lter adjustment) are not required. The input lter of the input relay not used as an external signal input
interrupt pointer remains effective for 10 ms (initial value).
The H2U model is added with 24 high-speed counter interrupts during running of a high-speed counter.
Any high-speed counter can be designated to generate 24 interrupt responses. This function is called high-
speed counter multi-user interrupt (not available in the XP model). The setting principle is as follows:
Flag Description
M8084
If it is set to ON, the high-speed counter multi-user interrupt function is enabled. (This
function is not available in the XP model.)
D8084
Indicates a high-speed counter number in the range C235 to C255.
D8085
Indicates the number of user interrupts. A maximum of 24 user interrupts are supported
and numbered from I507 to I530.
D8086
Indicates the serial numbers of multiple comparative values and is only applicable to the
D element. For example, 200 is a double word from head address D200.
Example of comparative value placement:
D8084 = 235; D8086 = 200; D8085 = 5; M8084 = ON
C235
Data Record Unit Stored Unit Value User Interrupt
D8131
Value
100
D200 and
D201
= 100 I507 0
200
D202 and
D203
= 200 I508 1
300
D204 and
D205
= 300 I509 2
400
D206 and
D207
= 400 I510 3
500
D208 and
D209
= 500 I511 4
->
0 (M8133 = ON)