![background image](http://html1.mh-extra.com/html/omron/srm1-programing-02-2001/srm1-programing-02-2001_programming-manual_742414114.webp)
2-3
Section
CPM1/CPM1A Interrupt Functions
93
This example shows a program that uses the high-speed counter with phase-dif-
ference inputs in the Up/Down Mode, making comparisons by means of the
range comparison method.
The comparison conditions (upper/lower limits of the ranges) are stored in the
comparison table with the subroutine numbers. Up to 8 separate ranges can be
defined. The corresponding subroutine is executed when the counter’s PV is
within the range.
Note
Always set 8 ranges. If fewer than 8 ranges are needed, set the remaining sub-
routine numbers to FFFF. A value of FFFF indicates that no subroutine is to be
executed.
The following data is stored for the comparison table:
DM 0000
1500
DM 0001
0000
Lower limit 1: 1,500 counts
DM 0002
3000
DM 0003
0000
Upper limit 1: 3,000 counts
DM 0004
0040
Range 1 interrupt subroutine no.: 40
DM 0005
7500
DM 0006
0000
Lower limit 2: 7,500 counts
DM 0007
0000
DM 0008
0001
Upper limit 2: 10,000 counts
DM 0009
0041
Range 2 interrupt subroutine no.: 41
DM 0010
0000
DM 0011
0000
DM 0012
0000
DM 0013
0000
DM 0014
FFFF
Range 3 interrupt subroutine not executed
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
DM 0035
0000
DM 0036
0000
DM 0037
0000
DM 0038
0000
DM 0039
FFFF
Range 8 interrupt subroutine not executed
Application Example
(Up/Down Mode)