l
CRBasic instruction:
PulseCount()
.
See also
14.5.4 Quadrature measurements
The
Quadrature()
instruction is used to measure shaft or rotary encoders. A shaft encoder
outputs a signal to represent the angular position or motion of the shaft. Each encoder will have
two output signals, an A line and a B line. As the shaft rotates the A and B lines will generate
digital pulses that can be read, or counted, by the data logger.
In the following example, channel A leads channel B, therefore the encoder is determined to be
moving in a clockwise direction. If channel B led channel A, it would be determined that the
encoder was moving in a counterclockwise direction.
Terminals SE1 and SE2 or C1 and C2 can be configured as digital pairs to monitor the two
channels of an encoder. The
Quadrature()
instruction can return:
l
The accumulated number of counts from channel A and channel B. Count will increase if
channel A leads channel B. Count will decrease if channel B leads channel A.
l
The net direction.
l
Number of counts in the A-leading-B direction.
l
Number of counts in the B-leading-A direction.
Counting modes:
l
Counting the increase on rising edge of channel A when channel A leads channel B.
Counting the decrease on falling edge of channel A when channel B leads channel A.
l
Counting the increase at each rising and falling edge of channel A when channel A leads
channel B. Counting the decrease at each rising and falling edge of channel A when
channel A leads channel B.
14. Measurements
82