7-33
7 High-speed Counters
CJ2M CPU Unit Pulse I/O Module User’s Manual
7-3 High-speed Counter Interrupts
7
7-3-3 High-speed Counter Interrupt Instructions
In this example, high-speed counter 1 operates in Ring Mode and starts interrupt task 12 when the PV
enters the range from 25,000 (0000 61A8 hex) to 25,500 (0000 639C hex).
The ring counter maximum value is set to 50,000 (0000 C350 hex).
1 Set high-speed counter 1 on the I/O Module Tab Page in the PLC Setup.
2 Set the range comparison table starting at word D2000. Even though range 1 is the only range
being used, all 40 words must still be dedicated to the range comparison table.
3 Create the program for interrupt task 12.
4 Use the CTBL(882) instruction to start the comparison operation with high-speed counter 1 and
interrupt task 12.
Example 2: Range Comparison
Item Setting
Counter setting Input pulse frequency (100 kHz max.)
Counting Mode Ring mode
Ring Counter Max. Value 50,000
Reset Method Software reset
Comparing After Counter
Reset
Continue
Pulse Input Mode Up/Down pulses
Word Setting Description
D2000 #61A8 Rightmost 4 digits of range 1 lower
limit
Lower limit value: 25,000
D2001 #0000 Leftmost 4 digits of range 1 lower limit
D2002 #639C Rightmost 4 digits of range 1 upper
limit
Upper limit value: 25,500
D2003 #0000 Leftmost 4 digits of range 1 upper limit
D2004 #000C Range 1, Interrupt task 12 (C hex), when entering range (leftmost bit
= ON)
D2005 to
D2008
All 0000 Range 2 lower and upper limit values
(Not used and do not need to be set.)
Range 2 settings
D2009 #FFFF Disables range 2.
~
D2014
D2019
D2024
D2029
D2034
D2039
#FFFF Set the 5th word for ranges 3 to 8 (listed at left) to FFFF hex (range
settings are invalid) to disable those ranges.