Omron CPM1 Programming Manual page 240

Hide thumbs Also See for CPM1:
Table of Contents

Advertisement

Timer and Counter Instructions
Note
Starting Interrupts
Reading Timer PVs
Stopping Timers
Refer to 1-5-4 , 1-6-4 , and 1-7-2 for more detailed descriptions of using inter-
val timer interrupts. STIM(69) is also described in more detail after the table.
Function
Starting timers
Starting scheduled interrupts
Reading timer PV
Stopping timers
1. In CQM1 PCs, interval timer 0 cannot be used when a pulse output is being
output by the SPED(64) instruction.
2. In CQM1 PCs, interval timer 2 cannot be used when high-speed counter 0
operation has been enabled in DM 6642 of the PC Setup.
Set C1=000 to 002 to start timers 0 to 2 to activate a one-shot interrupt. Set
C1=003 to 005 to start scheduled interrupts using timers 0 to 2.
C2, which specifies the timer's SV, can be a constant or the first of two words
containing the SV. The settings are slightly different depending on the method
used.
If C2 is a constant, it specifies the initial value of the decrementing counter
(BCD, 0000 to 9999). The decrementing time interval is 1 ms.
If C2 is a word address, C2 specifies the initial value of the decrementing
counter (BCD, 0000 to 9999), and C2+1 specifies the decrementing time
interval (BCD, 0005 to 0320) in units of 0.1 ms. The decrementing time inter-
val can thus be 0.5 to 32 ms.
C3 specifies subroutine number 0000 to 0255 (0000 to 0127 in the CQM1-
CPU11/21-E, 0000 to 0049 in the CPM1/CPM1A/SRM1 PCs).
Note The time required from interval timer start-up to time-up is:
(the content of C2)
Set C1=006 to 008 to read the PVs of timers 0 to 2.
C2 specifies the first of two destination words that will receive the timer's PV.
C2 will receive the number of times the decrementing counter has been dec-
remented (BCD, 0000 to 9999) and C2+1 will receive the decrementing time
interval (BCD in 0.1 ms units).
C3 specifies the destination word that will receive the time which has elapsed
since the last time the timer was decremented (BCD in 0.1 ms units).
(Must be equal to or less than the decrementing time interval set in C2+1.)
Note The time that has elapsed since the timer was started is computed as follows:
(Content of C2
(Content of C2 + 1) + Content of C3)
Set C1=010 to 012 to stop timers 0 to 2.
Timer
C1 value
0
000
1
001
2
002
0
003
1
004
2
005
0
006
1
007
2
008
0
010
1
011
2
012
(the content of C2+1)
0.1 ms
Section 5-15
Applicable PCs
CQM1/CPM1/
CPM1A/SRM1
CQM1 only
CQM1/CPM1/
CPM1A/SRM1
CQM1 only
CQM1/CPM1/
CPM1A/SRM1
CQM1 only
CQM1/CPM1/
CPM1A/SRM1
CQM1 only
0.1 ms
219

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CPM1 and is the answer not in the manual?

Questions and answers

Table of Contents

Save PDF