7-31
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
The INI(880) instruction is used for the following items.
• Starting and Stopping Comparison for a High-speed Counter Comparison Table
Use the CTBL(882) instruction to register the target value or range comparison table before using
INI(880) to start or stop comparison.
If the comparison is started simultaneously with registering the comparison table and the high-
speed counter interrupts are always enabled, the INI(880) instruction is not required.
• Changing the PV of a High-speed Counter
In this example, high-speed counter 0 operates in linear mode and starts interrupt task 10 when the PV
reaches 30,000 (0000 7530 hex) and starts interrupt task 11 when the PV reaches 20,000 (0000 4E20
hex).
1 Set high-speed counter 0 on the I/O Module Tab Page in the PLC Setup.
MODE CONTROL Instruction: INI(880)
Operand Setting
P Port specifier #0010 High-speed counter 0
#0011 High-speed counter 1
#0012 High-speed counter 2
#0013 High-speed counter 3
C Control data #0000 Starts comparison.
#0001 Stops comparison.
#0002 Changes the PV.
#0006 Changes the maximum ring count.
NV First word of
new PV
Stores the new value when changing the PV (C = #0002)
or when changing the ring counter maximum value (C =
#0006)
Example 1: Target Value Comparison
Item Setting
Counter setting Input pulse frequency (60 kHz max.)
Counting Mode Linear mode
Ring Counter Max. Value ---
Reset Method Software reset
Comparing After Counter Reset Stop
Pulse Input Mode Up/Down pulses
@INI
P
C
NV
P: Port Specifier
C: Control Data
NV: First word with new PV
Execution condition