Chapter 7 Counters
NI 6124/6154 User Manual 7-8 ni.com
You can route an internal or external periodic clock signal (with a known
period) to the Source input of the counter. The counter counts the number
of rising (or falling) edges occurring on the Source input between
twoedges of th e Gate signal.
You can calculate the semi-period of the Gate input by multiplying the
period of the Source signal by the number of edges returned by the counter.
Single Semi-Period MeasurementSingle semi-period measurement is equivalent to single pulse-width
measurement.
Buffered Semi-Period MeasurementIn buffered semi-period measurement, on each edge of the Gate signal, the
counter stores the count in a hardware save register. A DMA controller
transfers the stored values to host memory.
The counter begins counting when it is armed. The arm usually occurs
between edges on the Gate input. So the first value stored in the hardware
save register does not reflect a full semi-period of the Gate input. In most
applications, this first point should be discarded.
Figure7 -9 shows an example of a buffered semi-period measurement.
Figure 7-9. Buffered Semi-Period Measurement
Note that if you are using an external signal as the Source, at least one
Source pulse should occur between each active edge of the Gate signal.
This condition ensures that correct values are returned by the counter. If this
condition is not met, consider using duplicate count prevention, described
in the Duplicate Count Prevention section.
3
1
2
2
3
1
2
2
3
2
SOURCE
GATE
Counter Value
Buffer
1 3
2
2
1 1
1
3
2
1 2 1
0 2
C
ounter Armed