7-25
7 High-speed Counters
CJ2M CPU Unit Pulse I/O Module User’s Manual
7-3 High-speed Counter Interrupts
7
7-3-2 Present Value Comparison
There are two ways to compare the high-speed counter PV: Target Value Comparison and Range Com-
parison.
Target comparison and range comparison cannot be used for the same high-speed counter at the same
time.
The specified interrupt task is executed when the high-speed counter PV matches a target value regis-
tered in the table.
• The comparison conditions (target values and counting directions) are registered in the comparison
table along with the corresponding interrupt task number. The specified interrupt task will be exe-
cuted when the high-speed counter PV matches the registered target value.
• When using target values, comparisons are made for all of the target values in the comparison table
regardless of the order of the target values in the table.
The following examples show the operation of an interrupt task for a comparison table.
• Between 1 and 48 target values can be registered in the comparison table.
• A different interrupt task can be registered for each target value.
• If the PV is changed, the changed PV will be compared with the target values in the table, even if the
PV is changed while the target value comparison operation is in progress.
7-3-2 Present Value Comparison
Target Value Comparison
No.001
No.015
No.000 No.020
High-speed Counter PV
Comparison is
executed
regardless of
the order of
the ranges in
the table.
Target value 1
Target value 4
Target value 2
Target value 3
Interrupt task number to execute
Time
Comparison Table
No. of target values: 4
Target value 1 (when counting up)
Interrupt task number: 000 (0000 hex)
Target value 2 (when incrementing)
Interrupt task number: 001 (0001 hex)
Target value 3 (when decrementing)
Interrupt task number: 020 (8014 hex)
Target value 4 (when incrementing)
Interrupt task number: 015 (000F hex)