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

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

Advertisement

CPM1/CPM1A Interrupt Functions
Reading the PV
Reading SR 248 and SR 249
Using the PRV(62) Instruction
If C is set to 000, then comparisons will be made by the target matching
method; if 001, then they will be made by the range comparison method.
The comparison table will be saved, and, when the save operation is com-
plete, then comparisons will begin. While comparisons are being executed,
high-speed interrupts will be executed according to the comparison table.
For details on the contents of the comparison tables that are saved, refer to
the explanation of the CTBL(63) instruction in Section 7 Instruction Set.
Note The comparison results are normally stored in AR 1100 through
AR 1107 while the range comparison is being executed.
If C is set to 002, then comparisons will be made by the target matching
method; if 003, then they will be made by the range comparison method. For
either of these settings, the comparison table will be saved, but compari-
sons will not begin, and the INI(61) instruction must be used to begin com-
parisons.
2. To stop comparisons, execute the INI(61) instruction as shown below.
To start comparisons again, set the second operand to "000" (execute com-
parison), and execute the INI(61) instruction.
Once a table has been saved, it will be retained in the CPM1/CPM1A during
operation (i.e., during program execution) as long as no other table is saved.
There are two ways to read the PV. The first is to read it from SR 248 and
SR 249, and the second to use the PRV(62) instruction.
The PV of high-speed counter is stored in SR 248 and SR 249 as shown below.
The leftmost bit will be F for negative values.
Leftmost 4 digits
Rightmost 4 digits
SR 249
Note
1. These words are refreshed only once every cycle, so there may be a differ-
ence from the actual PV.
2. When high-speed counter is not being used, the bits in these words can be
used as work bits.
Read the PV of the high-speed counter by using the PRV(62) instruction.
The PV of the high-speed counter is stored as shown below. The leftmost bit will
be F for negative values.
Leftmost 4 digits
P1+1
(@)INI(61)
Up/Down Mode
SR 248
F0032767 to 00032767
(–32767)
(@)PRV(62)
P1: Leading word of PV
000
000
P1
Rightmost 4 digits
Up/Down Mode
P1
F0032767 to 00032767
(–32767)
Section
000
001
000
Incrementing Mode
00000000 to 00065535
Incrementing Mode
00000000 to 00065535
2-3
91

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents