3 interrupt priority, 4 interrupt program, Visual kv series – KEYENCE Visual KV Series User Manual

Page 220

Advertising
background image

3.2 Interrupt Processing

3-196

Visual KV

Series

3

Chapter 3 Interrupts

Use SET-RES instructions to turn the special utility relays ON/OFF.

The input capture function stores the high-order bit data only when the 24-
bit high-speed counter is used. The data is undefined when the 16-bit high-
speed counter is used.

➮ "4.4.1 24-bit High-speed Counter" (p. 3-221)

Timing of the input capture execution depends on the input polarity setting
specified with special utility relays 2402 through 2405 and 2410 through
2413.

3.2.3

Interrupt Priority

When many interrupts occur sequentially, priority is given to the interrupt which
occurs earlier.
When two or more interrupts occur simultaneously, priority is given in the order of
0000, 0001, 0002, 0003, CTC2, CTC3, CTC0, and CTC1.

Note 1: While one interrupt is being executed, other interrupts are disabled. (Multi-
level interrupts are possible by placing an EI instruction within an interrupt routine.)

Note 2: When other interrupts occur during execution of an interrupt, other interrupts
are stored up to 8 levels deep. The stored interrupts are executed after completion
of the previous interrupt, according to the priority order. However, an interrupt which
uses the same device as a previous interrupt cannot be stored.

3.2.4

Interrupt Program

The interrupt program is a program which is executed by an interrupt. It is necessary
to execute an EI (Interrupt enabled) instruction before executing an interrupt pro-
gram.
To temporarily disable an interrupt, execute a DI (Interrupt disabled) instruction.
When an interrupt is disabled, subsequent interrupts are not executed but stored
until the next EI instruction.

➮ "EI instruction", "DI instruction" (p. 3-193)

Example of an interrupt program

Note 1: To shorten the input time constant, use the HSP instruction (to 10 µs) or
specify the desired value in DM1940 and turn ON special utility relay 2813.

Note 2: For more about the input time constant, refer to "1.4.1 Input Time Constant
Change Function" (p. 3-23).

Note 3: Use SET-RES instructions instead of OUT-OUTB instructions within inter-
rupt programs.

The following instructions cannot be used within interrupt programs:
TMR, TMH, TMS, DIFU, DIFD, W-ON, W-OFF, W-UE, W-DE, STG, JMP, ENDS,
HKEY, ITVL, @xxxx (differentiation type instructions), C, UDC, SFT

CAUTION

2008

EI

HSP

0000

END

RETI

ENDH

INT

0000

An interrupt program is not executed unless an EI instruction is executed.

Set the input time constant shorter by using the HSP instruction
(to 10 µs) or by turning ON special utility relay 2813.

Write the interrupt program between the END and ENDH
instructions.

KVNKA Chap 03.p65

08.3.11, 0:05 PM

196

Advertising