Chapter 8
Counters
8-8
ni.com
condition is not met, the co
u
nter ret
u
rns a zero. Refer to the
For information abo
u
t connecting co
u
nter signals, refer to the
section.
Semi-Period Measurement
In semi-period meas
u
rements, the co
u
nter meas
u
res a semi-period on its
Gate inp
u
t signal after the co
u
nter is armed. A semi-period is the time
between any two consec
u
tive edges on the Gate inp
u
t.
Yo
u
can ro
u
te an internal or external periodic clock signal (with a known
period) to the So
u
rce inp
u
t of the co
u
nter. The co
u
nter co
u
nts the n
u
mber
of rising (or falling) edges occ
u
rring on the So
u
rce inp
u
t between two
edges of the Gate signal.
Yo
u
can calc
u
late the semi-period of the Gate inp
u
t by m
u
ltiplying the
period of the So
u
rce signal by the n
u
mber of edges ret
u
rned by the co
u
nter.
Single Semi-Period Measurement
Single semi-period meas
u
rement is eq
u
ivalent to single p
u
lse-width
meas
u
rement.
Buffered Semi-Period Measurement
In b
u
ffered semi-period meas
u
rement, on each edge of the Gate signal, the
co
u
nter stores the co
u
nt in a hardware save register. A USB Signal Stream
transfers the stored val
u
es to host memory.
The co
u
nter begins co
u
nting on the first active edge of the Gate after it is
armed. The arm
u
s
u
ally occ
u
rs between edges on the Gate inp
u
t. The
co
u
nter does not store a val
u
e for this incomplete semi-period.