![background image](http://html1.mh-extra.com/html/omron/sysmac-c1000h/sysmac-c1000h_operation-manual_743079130.webp)
124
In the following example, 00000 is used to control when CNT 001 operates.
CNT 001, when 00000 is ON, counts down the number of OFF to ON
changes in 00001. CNT 001 is reset by its Completion Flag, i.e., it starts
counting again as soon as its PV reaches zero. CNT 002 counts the number
of times the Completion Flag for CNT 001 goes ON. Bit 00002 serves as a
reset for the entire extended counter, resetting both CNT 001 and CNT 002
when it is OFF. The Completion Flag for CNT 002 is also used to reset CNT
001 to inhibit CNT 001 operation, once SV for CNT 002 has been reached,
until the entire extended counter is reset via 00002.
Because in this example the SV for CNT 001 is 100 and the SV for CNT 002
is 200, the Completion Flag for CNT 002 turns ON when 100 x 200 or 20,000
OFF to ON changes have been counted in 00001. This would result in 00203
being turned ON.
00203
CP
R
CNT 001
#0100
CP
R
CNT 002
#0200
CNT 001
00002
CNT 002
00000 00001
00002
CNT 001
CNT 002
Address
Instruction
Operands
00000
LD
00000
00001
AND
00001
00002
LD NOT
00002
00003
OR
CNT
001
00004
OR
CNT
002
00005
CNT
001
#
0100
00006
LD
CNT
001
00007
LD NOT
00002
00008
CNT
002
#
0200
00009
LD
CNT
002
00010
OUT
00203
CNT can be used in sequence as many times as required to produce count-
ers capable of counting any desired values.
CNT can be used to create extended timers in two ways: by combining TIM
with CNT and by counting SR area clock pulse bits.
In the following example, CNT 002 counts the number of times TIM 001
reaches zero from its SV. The Completion Flag for TIM 001 is used to reset
TIM 001 so that is runs continuously and CNT 002 counts the number of
times the Completion Flag for TIM 001 goes ON (CNT 002 would be exe-
cuted once each time between when the Completion Flag for TIM 001 goes
ON and TIM 001 is reset by its Completion Flag). TIM 001 is also reset by
the Completion Flag for CNT 002 so that the extended timer would not start
again until CNT 002 was reset by 00001, which serves as the reset for the
entire extended timer.
Because in this example the SV for TIM 001 is 5.0 seconds and the SV for
CNT 002 is 100, the Completion Flag for CNT 002 turns ON when 5 seconds
Example 3:
Extended Timers
Timer and Counter Instructions
Section 5-12