Ring counter, Modifying count value – Rockwell Automation 1769-HSC Compact High Speed Counter Module User Manual
Page 29
![background image](/manuals/579645/29/background.png)
Rockwell Automation Publication 1769-UM006E-EN-P - July 2013
29
Module Operation
Chapter 2
Ring Counter
Figure 8 demonstrates ring counter operation. In ring counter operation, the
current count (Ctr[
n].CurrentCount) value changes between user-programmable
minimum count (Ctr
nMinCount) and maximum count (CtrnMaxCount)
values. If, when counting up, the counter reaches the Ctr
nMaxCount value, it
rolls over to the Ctr
nMinCount value upon receiving the next count and sets the
overflow bit. If, when counting down, the counter reaches the Ctr
nMinCount
value, it rolls under to the Ctr
nMaxCount value upon receiving the next count
and sets the underflow bit. These bits can be reset using the
Ctr
nResetCounterOverflow and CtrnResetCounterUnderflow bits.
Figure 8 - Ring Counter Diagram
Modifying Count Value
The count value (Ctr[
n].CurrentCount) can be stored, reset, or preset using the
Z-input, CtrReset bit in the configuration array, control bits in the output array,
or overwritten using a Direct Write command.
Rollover
Count Up
Count Down
Maximum Count Value
Minimum Count Value
Table 6 - Available Z Functions
Setting
For function
Store
(1)
(1) If both a store and preset function are configured, the stored count is captured before the preset operation
takes place.
On rising edge of Z, store count in the Stored Count input word
Hold
While Z = 1, hold counter at its current value
Preset/Reset
On rising edge of Z, preset the count value to the value in the preset word
IMPORTANT
Because only the Z-inputs are used for external gating and presetting,
these functions are not available for Counters 2 and 3, which do not have
Z-inputs. All options are always available for Counters 0 and 1,
regardless of input operational mode.