2-3
Section
CPM1/CPM1A Interrupt Functions
85
2. When C
2
is entered as a constant:
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
1
C
2
C
3
C
1
: Read elapsed time (006)
C
2
: Leading word of parameter 1
C
3
: Parameter 2
C
2
: Number of times the decrementing counter has ben decremented (4 digits
BCD)
C
2
+ 1: Decrementing counter time interval (4 digits BCD; unit: 0.1 ms)
C
3
: Elapsed time from previous decrement (4 digits BCD; unit: 0.1 ms)
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)}
×
0.1 ms
If the specified interval timer is stopped, then “0000” will be stored.
Stopping the Timer
Use the STIM(69) instruction to stop the interval timer. The interval timer will be
stopped.
(@)STIM(69)
C
1
000
000
C
1
: Stop interval timer (010)
In this example, an interrupt is generated 2.4 ms (0.6 ms
×
4) after input 00005
goes ON; the interrupt executes interrupt subroutine number 23.
MOV(21)
#0004
DM 0010
MOV(21)
#0006
DM 0011
SBN(92)
023
RET(93)
@STIM(69)
000
DM 0010
#0023
00005
Interrupt program
Sets the decrementing counter‘s set value to 4.
(BCD: 0000 to 9999)
Sets the decrementing time interval to 0.6 ms.
(BCD: 0005 to 0320)
Starts the interval timer in one-shot mode.
Specifies the first word containing the set value.
Specifies the subroutine number (23).
25315 First Cycle Flag
ON for 1 cycle
Application Example
(One-shot Mode)
Содержание SRM1 - PROGRAMING 02-2001
Страница 1: ...Programmable Controllers Cat No W353 E1 06 SYSMAC CPM1 CPM1A CPM2A CPM2C SRM1 V2 PROGRAMMING MANUAL ...
Страница 2: ...CPM1 CPM1A CPM2A CPM2C SRM1 V2 Programmable Controllers Programming Manual Revised February 2008 ...
Страница 3: ...iv ...
Страница 5: ...vi ...
Страница 9: ...x ...
Страница 15: ...xvi ...