Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual page 415

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

Timer and Counter Instructions
Common Characteristics
of Target Value and
Range Comparisons
1, 2, 3...
Target Value Comparison
The port specifier (P) specifies the high-speed counter that will be used in the
comparison. Always set P to 000.
The function of CTBL(63) is determined by the control data, C, as shown in the
following table. These functions are described after the table.
C
000
Registers a target value comparison table and starts comparison. (See
note.)
001
Registers a range comparison table and starts comparison. (See note.)
002
Registers a target value comparison table. Start comparison with INI(61).
003
Registers a range comparison table. Start comparison with INI(61).
Note If C is set to 000 or 001, CTBL(63) will continue the comparison operation even
when executed only once. As a rule, use the differentiated form (@) of the
instruction or an input condition that turns ON for only one cycle.
When the PV agrees with a target value or falls within a specified range, the spe-
cified subroutine is called and executed. Refer to 2-3-5 High-speed Counter In-
terrupts 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 CPM2A/CPM2C begins operation. The PV will not
be compared to the comparison table until the table is registered and compari-
son is initiated with INI(61) or CTBL(63). Comparison can be stopped and
started, or the PV can be reset with INI(61).
The operation of a target value comparison is different from a range comparison,
but the two functions share some common characteristics.
1. Subroutine numbers 000 to 049 can be used and the same subroutine num-
ber can be used more than once in the table.
2. An undefined subroutine number or FFFF can be set for the subroutine
number if interrupt processing is not required.
3. Comparison can be stopped with INI(61). A registered table is valid until PC
operation stops or a new comparison table is registered.
4. CTBL(62) cannot be executed if the high-speed counter is disabled in the
PC Setup (DM 6642). (An error will occur if CTBL(63) is executed when the
high-speed counter is disabled.)
A target value comparison table contains up to sixteen target values. A subrou-
tine number is also registered for each target value. The corresponding subrou-
tine is called and executed when the PV matches a target value. (When interrupt
processing is not required, an undefined subroutine number may be entered.)
In the CPM1/CPM1A, target value comparisons are performed one item at a
time in order of the comparison table. When the PV reaches the first target val-
ue 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.
In the CPM2A/CPM2C, the PV is compared to all of the target values in the
table each time CTBL(63) is executed. When the PV matches a target value
the corresponding subroutine is called and executed.
CTBL(63) function
Section
7-15
397

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents