Omron CQM1H - PROGRAM Programming Manual page 54

Programmable controllers; inner boards
Table of Contents

Advertisement

Interrupt Functions
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.)
25315 (ON for 1 scan)
MOV(21)
00100
(@)INT(89)
(@)INT(89)
(@)INT(89)
BCD (24)
INC(38)
00100
(@)INT(89)
SBN(92)
25313 (Always ON)
ADB(50)
INT(89)
RET(93)
SBN(92)
RET(93)
Sets 10 as the counter mode SV for input interrupt 1.
#000A
245
When IR 00100 turns ON:
Masked interrupts for input interrupts 0 and 1 are cleared.
001
000
#0003
Interrupts are enabled in input interrupt mode for interrupt 0.
000
000
#000E
Interrupts are enabled in counter mode for interrupt 1.
(SV: 10 )
003
000
#000D
The contents of SR 249 (PV −1) are converted to BCD
249
and stored in DM 0000.
D0000
The content to DM 0000 is incremented to the PC.
D0000
000
When IR 00100 turns OFF, input interrupts 0 and 1 are
masked and interrupts are prohibited.
000
#000F
000
245
#000A
245
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)
003
000
#000D
When the count is reached for the input interrupt 1
001
counter, subroutine 001 is called and the interrupt sub-
routine is executed.
Section 1-4
29

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents