29
Interrupt Functions
Section 1-4
Application Example
In this example, input interrupt 0 is used in Input Interrupt Mode and input
interrupt 1 is used in Counter Mode. Before executing the program, check to
be sure the PC Setup.
PC Setup: DM 6628: 0011 (IR 00000 and IR 00001 used for input interrupts)
The default settings are used for all other PC Setup parameters. (Inputs are
not refreshed at the time of interrupt processing.)
SBN(92) 000
00100
MOV(21)
#000A
245
25315 (ON for 1 scan)
(@)INT(89)
000
000
#000E
(@)INT(89)
003
000
#000D
(@)INT(89)
000
000
#000F
00100
25313 (Always ON)
ADB(50)
245
#000A
245
INT(89)
003
000
#000D
RET(93)
SBN(92) 001
RET(93)
BCD (24)
249
D0000
INC(38)
D0000
Sets 10 as the counter mode SV for input interrupt 1.
When IR 00100 turns ON:
Masked interrupts for input interrupts 0 and 1 are cleared.
Interrupts are enabled in input interrupt mode for interrupt 0.
Interrupts are enabled in counter mode for interrupt 1.
(SV: 10 )
When IR 00100 turns OFF, input interrupts 0 and 1 are
masked and interrupts are prohibited.
When the Input interrupt is executed for interrupt 0, sub-
routine 000 is called and the counter mode is refreshed
with the SV for input interrupt 1 with 10 added (SV = 20)
When the count is reached for the input interrupt 1
counter, subroutine 001 is called and the interrupt sub-
routine is executed.
The contents of SR 249 (PV
−
1) are converted to BCD
and stored in DM 0000.
The content to DM 0000 is incremented to the PC.
(@)INT(89)
001
000
#0003