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

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

Advertisement

CPM1/CPM1A Interrupt Functions
Target Value
Comparisons
Initial value
Range Comparisons
Programming
Controlling High-speed Counter Interrupts
1, 2, 3...
90
The current count is compared to the target values in the order that target values
are set in the comparison table and interrupts are generated as the count equals
each target value. Once the count has equaled all of the target values in the
table, the target value is set to the first target value in the table, which is again
compared to the current counted until the two values are equal.
Count
Interrupts
Target value
1
2
The current count is compared in cyclic fashion to all of the ranges at the same
time and interrupts are generated based on the results of the comparisons.
0
1
3
2
Note When performing target value comparisons, do not repeatedly use the INI in-
struction to change the current value of the count and start the comparison op-
eration. The interrupt operation may not work correctly if the comparison opera-
tion is started immediately after changing the current value from the program.
(The comparison operation will automatically return to the first target value once
an interrupt has been generated for the last target value. Repetitious operation
is thus possible merely by changing the current value.)
Use the following steps to program the high-speed counter.
The high-speed counter begins the counting operation when the proper PC Set-
up settings are made, but comparisons will not be made with the comparison
table and interrupts will not be generated unless the CTBL(63) instruction is
executed.
The high-speed counter is reset to "0" when power is turned ON and when op-
eration begins.
The present value of high-speed counter is maintained in SR 248 and SR 249.
1. Use the CTBL(63) instruction to save the comparison table in the
CPM1/CPM1A and begin comparisons.
(@)CTBL(63)
3
4
5
Count
4
C: (3 digits BCD)
P
000:
Target table set and comparison begun
C
001:
Range table set and comparison begun
002:
Target table set only
TB
003:
Range table set only
TB: Beginning word of comparison table
Section
Comparison Table
Target value 1
Target value 2
Target value 3
Target value 4
Target value 5
Comparison Table
Rage setting 1
Rage setting 2
Rage setting 3
Rage setting 4
2-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents