Omron SYSMAC C20P Operation Manual page 74

Sysmac programmable controllers
Hide thumbs Also See for SYSMAC C20P:
Table of Contents

Advertisement

Timer and Counter Instructions
Example 2:
Extended Counter
Example 3:
Extended Timers
66
Counters that can count past 9,999 can be programmed by using one CNT to
count the number of times another CNT has reached zero from SV.
In the following example, 0000 is used to control when CNT 01 operates and
CNT 01, when 0000 is ON, counts down the number of OFF to ON changes
in 0001. CNT 01 is reset by its Completion Flag, i.e., it starts counting again
as soon as its PV reaches zero. CNT 02 counts the number of times the
Completion Flag for CNT 01 goes ON. Bit 0002 serves as a reset for the en-
tire extended counter, resetting both CNT 01 and CNT 02 when it is OFF.
The Completion Flag for CNT 02 is also used to reset CNT 01 to inhibit CNT
01 operation once PV for CNT 02 has been reached until the entire extended
counter is reset via 0002.
Because in this example the SV for CNT 01 is 100 and the SV for CNT 02 is
200, the Completion Flag for CNT 02 turns ON when 100 x 200 or 20,000
OFF to ON changes have been counted in 0001. This would result in 0203
being turned ON.
0000
0001
0002
CNT 01
CNT 02
CNT 01
0002
CNT 02
CNT can be used in sequence as many times as required to produce count-
ers capable of counting down even higher 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 02 counts the number of times TIM 01
reaches zero from its SV. The Completion Flag for TIM 01 is used to reset
TIM 01 so that is runs continuously and CNT 02 counts the number of times
the Completion Flag for TIM 01 goes ON (CNT 02 would be executed once
each time between when the Completion Flag for TIM 01 goes ON and TIM
01 is reset by its Completion Flag). TIM 01 is also reset by the Completion
Flag for CNT 02 so that the extended timer would not start again until CNT
02 was reset by 0001, which serves as the reset for the entire extended tim-
er.
As the SV for TIM 01 is 5.0 seconds and the SV for CNT 02 is 100, the Com-
pletion Flag for CNT 02 turns ON when 5 seconds x 100 times, or 8 minutes
and 20 seconds have expired. This would result in 0201 being turned ON.
Section 5–11
CP
CNT 01
#0100
R
CP
CNT 02
#0200
R
0203

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac c28pSysmac c40pSysmac c60p

Table of Contents