Present Value Comparison - Omron SYSMAC CP Series User Manual

Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

Execution of CTBL and INI Instructions for Cyclic Task
Execute the instructions in the following order.
Register the comparison table
Start comparison
Stop comparison
Refer to 11-3-2 Present Value Comparison for details.

11-3-2 Present Value Comparison

The comparison of the high-speed counter PV has the following two ways: Target Value Comparison
and Range Comparison.
Target Value Comparison
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.
• Comparison is executed in the order set in the comparison table. Once comparison has cycled
through the comparison table, it will return and wait for a match with the first target value again.
The following examples show the operation of an interrupt task for a comparison table.
Example 1
High-speed counter PV
Target value 4
Target value 3
Comparison is
executed according
to the order of the
Target value 2
values in the table.
Target value 1
Interrupt task number that is started.
CP2E CPU Unit Software User's Manual(W614)
Register the comparison table with the CTBL (COMPARISON
TABLE LOAD) instruction. Specify the interrupt tasks to be
started in this step.
Start comparison with the CTBL (COMPARISON TABLE
LOAD) or INI (MODE CONTROL) instruction. Here, high-
speed counter interrupts will be valid.
Stop with the INI (MODE CONTROL) instruction.
No.0 No.1
No.5 No.8
11 High-speed Counters
Comparison table
Number of values = 4
Target value 1 (when counting up)
Interrupt task = 0
Target value 2 (when counting up)
Interrupt task = 1
Target value 3 (when counting up)
Interrupt task = 5
Target value 4 (when counting up)
Interrupt task = 8
Time
No.0
11
11-17

Advertisement

Table of Contents
loading

Table of Contents