5-2
Chapter 5: Programming Examples
NOTE
NOTE
Section 5.2
Ring Counter Sample
Section 5.3
Simple Ring Counter
with Flats (20 K Limit)
User's Manual Pub. 0300181-07 Rev. A
Configuration Word
O:e.2
Counter Limit 10,000 We have set the limit to 10,000.
If you change Configuration Bit 9 to 1, the counter will reach the limit and
then hold its value until the Limit Flag is cleared. Then it will roll to 0 and
continue counting to 10,000. Each time the limit is reached the flag must
be reset before proceeding.
If you toggle Configuration Bit 12 the counter counts in a downward
direction. It will start at 0 and count to -32,768. It will then Roll Under to
+32,767. If Configuration Bit 14 is set the counter will Roll Under to this
Preset Value.
The figure below demonstrates a ring counter operation. In a ring counter
operation, the count value changes between zero and maximum. If, when
counting up, the counter reaches the maximum value, it rolls over to zero.
If, when counting down, the counter reaches zero, it rolls under to the maximum
value.
This configuration for the counter module will allow you to count from a
minimum value of 0 to a limit value of 20,000 counts Each time a revolution has
occurred the counter limit flag will be set. Your ladder program may use this flag
to increment an accumulator, thus counting revolutions. The flag must be reset
before another complete revolution occurs otherwise the accumulator cannot be
incremented.
Need help?
Do you have a question about the SLC 500 and is the answer not in the manual?