Chapter 7
Counters
©
National Instruments
7-23
X Series User Manual
Yo
u
can calc
u
late the 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.
Period meas
u
rements ret
u
rn the inverse res
u
lts of freq
u
ency meas
u
rements.
Refer to the
Frequency Measurement
section for more information.
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 to do 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.
Refer to the following sections for more information abo
u
t the X Series
position meas
u
rement options:
•
Measurements Using Quadrature Encoders
•
Measurements Using Two Pulse Encoders
•
Buffered (Sample Clock) Position Measurement
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 7-18 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.
Figure 7-18.
X1 Encoding
Ch A
Ch B
Co
u
nter V
a
l
u
e
7
7
6
5
5
6
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com