Chapter 7
Counters
X Series User Manual
7-24
ni.com
•
X2 Encoding
—The same behavior holds for X2 encoding except the
co
u
nter increments or decrements on each edge of channel A,
depending on which channel leads the other. Each cycle res
u
lts in
two increments or decrements, as shown in Fig
u
re 7-19.
Figure 7-19.
X2 Encoding
•
X4 Encoding
—Similarly, the co
u
nter increments or decrements on
each edge of channels A and B for X4 encoding. Whether the co
u
nter
increments or decrements depends on which channel leads the other.
Each cycle res
u
lts in fo
u
r increments or decrements, as shown in
Fig
u
re 7-20.
Figure 7-20.
X4 Encoding
Channel Z Behavior
Some q
u
adrat
u
re encoders have a third channel, channel Z, which is also
referred to as the index channel. A high level on channel Z ca
u
ses the
co
u
nter to be reloaded with a specified val
u
e in a specified phase of the
q
u
adrat
u
re cycle. Yo
u
can program this reload to occ
u
r in any one of the
fo
u
r phases in a q
u
adrat
u
re cycle.
Channel Z behavior—when it goes high and how long it stays
high—differs with q
u
adrat
u
re encoder designs. Yo
u
m
u
st refer to the
doc
u
mentation for yo
u
r q
u
adrat
u
re encoder to obtain timing of channel Z
with respect to channels A and B. Yo
u
m
u
st then ens
u
re that channel Z is
high d
u
ring at least a portion of the phase yo
u
specify for reload. For
instance, in Fig
u
re 7-21, channel Z is never high when channel A is high
and channel B is low. Th
u
s, the reload m
u
st occ
u
r in some other phase.
In Fig
u
re 7-21, the reload phase is when both channel A and channel B are
low. The reload occ
u
rs when this phase is tr
u
e and channel Z is high.
Incrementing and decrementing takes priority over reloading. Th
u
s, when
Ch A
Ch B
Co
u
nter V
a
l
u
e 5 6
8 9
7
5
6
8
9
7
Ch A
Ch B
Co
u
nter V
a
l
u
e
5 6
8 9 10
10
11 11
12 12
1
3
1
3
7
5
6
8 7
9
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com