221
Timer and Counter Instructions Section 5-15
Counter 0 Interrupts (CQM1 PCs) or 1-6-5 High-speed Counter Interrupts
(CPM1/CPM1A PCs) for more details on table comparison.
If the high-speed counter is enabled in the PC Setup (DM 6642), it will begin
counting from zero when the CQM1 begins operation. The PV will not be com-
pared to the comparison table until the table is registered and comparison is
initiated with INI(61) or CTBL(63). Comparison can be stopped and started, or
the PV can be reset with INI(61).
Once a comparison table has been registered, it is valid until the CQM1 is
halted or until a error occurs in attempting to register a new table. The differ-
entiated form of CTBL(63) is recommended when possible to reduce cycle
time.
Target Value Comparison A target value comparison table contains up to sixteen target values. For the
CQM1-CPU4@-EV1 CPU Units, up to 48 target values can be registered. A
subroutine number is also registered for each target value. The corresponding
subroutine is called and executed when the PV matches a target value.
(When interrupt processing is not required, an undefined subroutine number
may be entered.)
Target value comparisons are performed one item at a time in order of the
comparison table. When the PV reaches the first target value in the table, the
interrupt subroutine is executed and comparison continues to the next value in
the table. When processing has been completed for the last target value in the
table, comparison returns to the first value in the table and the process is
repeated.
The following diagram shows the structure of a target value comparison table
for use with high-speed counter 0, or high-speed counters 1 or 2 in linear
mode.
The following diagram shows the structure of a target value comparison table
for use with high-speed counters 1 or 2 in ring mode. Input the target values in
ascending or descending order.
The ring value specifies the number of points in the ring and the maximum
count value (ring value = max. count value+1). Do not change the ring value
while a comparison is in progress.
TB Number of target values (BCD)
TB+1 Target value #1, lower 4 digits (BCD)
TB+2 Target value #1, upper 4 digits (BCD)
TB+3 Subroutine number (See note.)
One target value setting
TB Ring value, lower 4 digits (BCD)
TB+1 Ring value, upper 4 digits (BCD)
TB+2 Number of target values (BCD)
TB+3 Target value #1, lower 4 digits (BCD)
TB+4 Target value #1, upper 4 digits (BCD)
TB+5 Subroutine number (See note.)
One target value setting
Ring value setting