A counter is a digital timing device. You typically use counters
for event counting, frequency measurement, period measurement,
position measurement, and pulse generation.
A counter contains the following four main components:
- Count Register -
Stores the current count of the counter. You can query the
count register with software.
- Source -
An input signal that can change the current count stored in
the count register. The counter looks for rising or falling
edges on the source signal. Whether a rising or falling edge
changes the count is software selectable. The type of edge
selected is referred to as the active edge of the
signal. When an active edge is received on the source
signal, the count changes. Whether an active edge increments
or decrements the current count is also software selectable.
- Gate -
An input signal that determines if an active edge on the
source will change the count. Counting can occur when the
gate is high, low, or between various combinations of rising
and falling edges. Gate settings are made in software.
- Output -
An output signal that generates pulses or a series of
pulses, otherwise known as a pulse train.
When you configure a counter for simple event counting, the
counter increments when an active edge is received on the
source. In order for the counter to increment on an active edge,
the counter must be armed or started. A counter has a fixed
number it can count to as determined by the resolution of the
counter. For example, a 24-bit counter can count to:
2Counter Resolution-1=242-1=16,777,215
2
Counter Resolution
1
2
42
1
16,777,215
When a 24-bit counter reaches the value of
16,777,21516,777,215, it has reached the
terminal count. The next active edge will force the counter to
roll over and start at 0.
"A full introductory course on programming with LabVIEW."