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

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

Advertisement

CPM1/CPM1A Interrupt Functions
Stopping the Timer
Application Example
(One-shot Mode)
2. When C
is entered as a constant:
2
The settings are the same as for the one-shot mode, but interrupts will con-
tinue to be repeated at fixed intervals until the operation is stopped.
Reading the Timer's Elapsed Time
Use the STIM(69) instruction to read the timer's elapsed time.
(@)STIM(69)
C
: Number of times the decrementing counter has ben decremented (4 digits
2
BCD)
C
+ 1: Decrementing counter time interval (4 digits BCD; unit: 0.1 ms)
2
C
: Elapsed time from previous decrement (4 digits BCD; unit: 0.1 ms)
3
The time from when the interval timer is started until the execution of this instruc-
tion is calculated as follows:
{(Content of C2)
(Content of C2+1) + (Content of C3)}
If the specified interval timer is stopped, then "0000" will be stored.
Use the STIM(69) instruction to stop the interval timer. The interval timer will be
stopped.
(@)STIM(69)
In this example, an interrupt is generated 2.4 ms (0.6 ms
goes ON; the interrupt executes interrupt subroutine number 23.
25315 First Cycle Flag
ON for 1 cycle
MOV(21)
MOV(21)
00005
@STIM(69)
SBN(92)
RET(93)
C
: Read elapsed time (006)
1
C
1
C
: Leading word of parameter 1
2
C
2
C
: Parameter 2
3
C
3
C
1
C
: Stop interval timer (010)
1
000
000
#0004
Sets the decrementing counter's set value to 4.
(BCD: 0000 to 9999)
DM 0010
#0006
Sets the decrementing time interval to 0.6 ms.
(BCD: 0005 to 0320)
DM 0011
Starts the interval timer in one-shot mode.
000
Specifies the first word containing the set value.
DM 0010
#0023
Specifies the subroutine number (23).
023
Interrupt program
Section
2-3
0.1 ms
4) after input 00005
85

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents