84
CPM1/CPM1A Interrupt Functions Section 1-6
The following diagram shows the example ladder program. DM 6642 must be
set to 01@4, where @ is the reset method which can be set to 0 or 1.
Application Example
(Up/Down Mode)
This example shows a program that uses the high-speed counter with phase-
difference 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
subroutine 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
25315 (ON for first cycle)
SBN(92) 030
CTBL(63)
000
000
DM 0000
Registers comparison table, target value mode
First word of the comparison table
Interrupt program 30
SBN(92) 031
Interrupt program 31
RET(93)
RET(93)