77
CPM1/CPM1A Interrupt Functions Section 1-6
Application Example
(One-shot Mode)
In this example, an interrupt is generated 2.4 ms (0.6 ms × 4) after input
00005 goes ON; the interrupt executes interrupt subroutine number 23.
Application Example
(Scheduled Interrupt
Mode)
In this example, an interrupt is generated every 4.0 ms (1.0 ms
× 4) after input
00005 goes ON; the interrupts execute interrupt subroutine number 23.
1-6-5 High-speed Counter Interrupts
CPM1/CPM1A PCs have a high-speed counter function that can be used in
incrementing mode or up/down mode. The high-speed counter can be com-
bined with input interrupts to perform target value control or zone comparison
control that isn’t affected by the PC’s cycle time.
High-speed counter signals can be input to CPU bits 00000 through 00002.
RET(93)
MOV(21)
#0004
DM 0010
MOV(21)
#0006
DM 0011
SBN(92) 023
@STIM(69)
000
DM 0010
#0023
00005
Interrupt program
Sets the decrementing counter's set value to 4.
(BCD: 0000 to 9999)
Sets the decrementing time interval to 0.6 ms.
(BCD: 0005 to 0320)
Starts the interval timer in one-shot mode.
Specifies the first word containing the set value.
Specifies the subroutine number (23).
25315 First Cycle Flag
ON for 1 cycle
RET(93)
MOV(21)
#0004
DM 0010
MOV(21)
#0010
DM 0011
SBN(92) 023
@STIM(69)
003
DM 0010
#0023
00005
25315 First Cycle Flag
ON for 1 cycle
Interrupt program
Sets the decrementing counter's set value to 4.
(BCD: 0000 to 9999)
Sets the decrementing time interval to 1.0 ms.
(BCD: 0005 to 0320)
Starts the interval timer in scheduled interrupt mode.
Specifies the first word containing the set value.
Specifies the subroutine number (23).