224
Timer and Counter Instructions Section 5-15
Note 1. The subroutine number can be 0000 to 0255 (0000 to 0127 for the CQM1-
CPU11/21-E, 0000 to 0049 for the CPM1/CPM1A) and the subroutine will
be executed as long as the counter’s PV is within the specified range. A
value of FFFF indicates that no subroutine is to be executed.
2. The subroutine number can be 0000 to 0255 (0000 to 0127 for the CQM1-
CPU11/21-E, 0000 to 0049 for the CPM1/CPM1A) to activate the subrou-
tine when incrementing.
3. Allow a time interval of at least 2 ms between the lower and upper limits
(upper limit – lower limit > 0.002
× input pulse frequency) in range compar-
isons with high-speed counters 1 and 2.
The following table shows the possible values for target values, lower limit val-
ues, and upper limit values. The hexadecimal value F in the most significant
digit of indicates that the value is negative.
In 360
° mode the absolute high-speed counter’s angular values are internally
converted to binary values. The binary value after conversion depends on the
resolution selected in the PC Setup (DM 6643 and/or DM 6644). The following
table shows the converted values for 5
° to 45°.
For higher values, find the converted value to the nearest 45
° and add the
remainder from the table. For example, to convert 145
° into 8-bit resolution:
32
×3 (for 135°) + 7 (for 10°) = 103.
!Caution With 10-bit and 12-bit resolution, interrupt processing might not be triggered
when the angular value matches the comparison value because the con-
verted values do not match exactly.
Counter Possible values
High-speed counter 0 Up/Down mode: F003 2767 to 0003 2767
Incrementing mode: 0000 0000 to 0006 5535
High-speed counters 1 and 2 Linear mode: F838 8607 to 0838 8607
Ring mode: 0000 0000 to 0006 4999
Absolute high-speed counters 1
and 2
BCD mode: 0000 to 4095
360° mode: 0000 to 0355 (5° units)
Resolution Converted value
5° 10° 15° 20° 25° 30° 35° 40° 45°
8-bit (0 to 255) 4 7 11 14 18 21 25 28 32
10-bit (0 to 1023) 14 28 43 57 71 85 100 114 128
12-bit (0 to 4095) 57 114 171 228 284 341 398 455 512