55
CQM1 Interrupt Functions Section 1-5
1-5-7 High-speed Counter 1 and 2 Interrupts (CQM1-CPU43-EV1)
Pulse signals from a pulse encoder to ports 1 and 2 of the CQM1-CPU43-EV1
can be counted at high speed, and interrupt processing can be executed
according to the count.
The 2 ports can be operated separately. The counter for port 1 is called high-
speed counter 1 and the counter for port 2 is called high-speed counter 2.
This section describes how to use high-speed counters 1 and 2. Refer to the
CQM1 Operation Manual for hardware information such as equipment and
wiring specifications.
Note 1. High-speed counters 1 and 2 can be used with the CQM1-CPU43-E/-EV1
only.
2. Some instructions cannot be used when the PC Setup (DM 6611) is set to
high-speed counter mode.
Processing Input Signals and Count Modes
Three types of signals can be input to ports 1 and 2. The count modes used
for high-speed counters 1 and 2 are set in DM 6643 and DM 6644 respec-
tively.
1,2,3... 1. Differential Phase Mode (Counting Rate = 25 kHz):
A phase-difference 4X two-phase signal (A-phase and B-phase) and a Z-
phase signal are used for inputs. The count is incremented or decrement-
ed according to differences in the 2-phase signals. This mode is identical
to high-speed counter 0’s up/down mode.
2. Pulse/Direction Mode (Counting Rate = 50 kHz):
The A-phase is the direction signal and the B-phase is the count pulse. The
counter increments when the A-phase signal is OFF and decrements
when it is ON.
3. Up/Down Mode (Counting Rate = 50 kHz):
The A-phase is the decrementing signal and the B-phase is the increment-
ing signal. The counter decrements when an A-phase pulse is detected
and increments when a B-phase pulse is detected.
Counting Modes
The counting modes (ring mode or linear mode) for high-speed counters 1
and 2 are specified in DM 6643 and DM 6644 respectively.
1,2,3... 1. Ring Mode:
In ring mode, the maximum count value +1 is set in CTBL(63). The counter
will go from the maximum count value to 0 when incrementing, and from 0
DM 6611 setting Affected instructions
High-speed counter mode
(0000)
PLS2(––) and mode 0 of ACC(––) cannot be used.
Pulse output mode (0001) CTBL(63) cannot be used with ports 1 and 2.
12345678765432
A-phase
B-phase
Differential Phase Mode
Count
Incremented Decremented
12
A-phase
(Direction)
B-phase
(Pulse)
Pulse/Direction Mode
Count
Incremented Decremented
A-phase
(Down)
B-phase
(Up)
Up/Down Mode
Count
3 2 1 12
Incremented Decremented
3 2 1