5-4
|
ni.com
Chapter 5
Counters
You also can use a pause trigger to pause (or gate) the counter. When the pause trigger is active,
the counter ignores edges on its Source input. When the pause trigger is inactive, the counter
counts edges normally.
You can route the pause trigger to the Gate input of the counter. You can configure the counter
to pause counting when the pause trigger is high or when it is low. Figure 5-3 shows an example
of on-demand edge counting with a pause trigger.
Figure 5-3.
Single Point (On-Demand) Edge Counting with Pause Trigger
Buffered (Sample Clock) Edge Counting
With buffered edge counting (edge counting using a sample clock), the counter counts the
number of edges on the Source input after the counter is armed. The value of the counter is
sampled on each active edge of a sample clock and stored in the FIFO. The STC3 transfers the
sampled values to host memory using a high-speed data stream.
The count values returned are the cumulative counts since the counter armed event. That is, the
sample clock does not reset the counter. You can configure the counter to sample on the rising
or falling edge of the sample clock.
Figure 5-4 shows an example of buffered edge counting. Notice that counting begins when the
counter is armed, which occurs before the first active edge on Sample Clock.
Figure 5-4.
Buffered (Sample Clock) Edge Counting
Controlling the Direction of Counting
In edge counting applications, the counter can count up or down. You can configure the counter
to do the following:
•
Always count up
•
Always count down
Co
u
nter Armed
S
OURCE
P
aus
e Trigger
(P
aus
e When Low)
Co
u
nter V
a
l
u
e
1
0
0
5
4
3
2
3
6
3
Co
u
nter Armed
S
OURCE
Sa
mple Clock
(
Sa
mple on Ri
s
ing Edge)
Co
u
nter V
a
l
u
e
B
u
ffer
1
0
7
6
3
4
5
2