Quadrature encoders, or angular encoders, produce pulses on two signals, signal A, or channel A, and signal B, or channel B, while a shaft in the encoder rotates. Signal A and B are offset by 90°, which determines the direction the encoder moves. For instance, in a quadrature encoder, if signal A leads, the encoder rotates clockwise. If signal B leads, the encoder rotates counter clockwise.
Counters on M Series and NI-TIO devices support three types of decoding for quadrature encoders: X1, X2, and X4. With X1 decoding, when signal A leads signal B, the counter increments on the rising edge of signal A. When signal B leads signal A, the counter decrements on the falling edge of signal A.
With X2 decoding, the same behavior holds as with X1, except the counter increments and decrements on both rising and falling edges of signal A.
Similarly, with X4 decoding, the counter increments and decrements on both rising and falling edges of both signal A and signal B. X4 decoding is more sensitive to position, but is also more likely to provide an incorrect measurement if there is vibration in the encoder.
Many encoders also use z indexing for precise determination of a reference position.