Chapter 8
Counters
8-32
ni.com
Other Counter Features
Sample Clock
When taking co
u
nter meas
u
rements, yo
u
can enable a sample clock. When
yo
u
u
se a sample clock, meas
u
rements are saved after an active edge of the
sample clock. Fig
u
re 8-28 shows an example of
u
sing a sample clock with
a b
u
ffered period meas
u
rement. In this example, a period is defined by
two consec
u
tive rising edges of the Gate.
Figure 8-28.
Sample Clock Example
t
0
At t
0
, the counter is armed. No measurements are taken until the counter is armed.
t
1
The rising edge of Gate indicates the beginning of the first period to measure. The counter begins counting
rising edges of Source.
t
2
The rising edge of Sample Clock indicates that the USB-621
x
device should store the result of the measurement
of the current period when the period ends.
t
3
The rising edge of Gate indicates the end of the first period. The USB-621
x
device stores the counter value in
the buffer.
t
4
The rising edge of Gate indicates the end of the second period. Sample Clock did not assert during this period,
so the counter discards the measurement of the second period.
t
5
The rising edge of Gate indicates the end of the third period. Sample Clock asserts during this period, so the
USB-621
x
device stores the measurement in the buffer.
S
OURCE
GATE
B
u
ffer
4
Co
u
nter Armed
Sa
mple Clock
4
4
3
Time N
Co
u
nter V
a
l
u
e
t
0
t
1
t
2
t
3
t
4
t
5
1
2
3
4
1
2
1
2
3
1