Chapter 8
Counters
©
National Instruments Corporation
8-15
Table 8-2 s
u
mmarizes some of the differences in methods of meas
u
ring
freq
u
ency.
For information abo
u
t connecting co
u
nter signals, refer to the
section.
Position Measurement
Yo
u
can
u
se the co
u
nters to perform position meas
u
rements with
q
u
adrat
u
re encoders or two-p
u
lse encoders. Yo
u
can meas
u
re ang
u
lar
position with X1, X2, and X4 ang
u
lar encoders. Linear position can be
meas
u
red with two-p
u
lse encoders. Yo
u
can choose either a single point
(on-demand) position meas
u
rement or a b
u
ffered (sample clock) position
meas
u
rement. Yo
u
m
u
st arm a co
u
nter to begin position meas
u
rements.
Measurements Using Quadrature Encoders
The co
u
nters can perform meas
u
rements of q
u
adrat
u
re encoders
that
u
se X1, X2, or X4 encoding. A q
u
adrat
u
re encoder can have
u
p
to three channels—channels A, B, and Z.
•
X1 Encoding
—When channel A leads channel B in a q
u
adrat
u
re
cycle, the co
u
nter increments. When channel B leads channel A in a
q
u
adrat
u
re cycle, the co
u
nter decrements. The amo
u
nt of increments
and decrements per cycle depends on the type of encoding—X1, X2,
or X4.
Fig
u
re 8-14 shows a q
u
adrat
u
re cycle and the res
u
lting increments and
decrements for X1 encoding. When channel A leads channel B, the
increment occ
u
rs on the rising edge of channel A. When channel B
leads channel A, the decrement occ
u
rs on the falling edge of
channel A.
Table 8-2.
Frequency Measurement Method Comparison
Method
Number of
Counters
Used
Number of
Measurements
Returned
Measures High
Frequency
Signals
Accurately
Measures Low
Frequency
Signals
Accurately
1
1
1
Poor
Good
1b
1
Many
Fair
Good
2
1 or 2
1
Good
Poor
3
2
1
Good
Good