Connecting an Encoder to a Counter

Updated Nov 22, 2022



Counter/Timers (TIO)

I want to measure frequency, period, pulse width, semi period, two edge separation, position, velocity, duty cycle, or count edges with my NI hardware. How do I wire up or connect my encoder to a counter?

The encoder has five outputs: Channel A Out, Channel B Out, Channel A Inverse Out, Channel B Inverse Out and Z-Index.

Connecting the encoder to a single counter:
  1. Choose Channel A and Channel B or Channel A Inverse and Channel B Inverse. Do not connect a non-inversed and an inversed channel to the same counter. For example, Channel A Out and Channel A Inverse Out should not be connected to the same counter.
  2. After selecting a valid pair of inversed or non-inversed channels, make one of the following connections configurations depending on the channel pair selected:
    • Configuration 1
      • Channel A to Source
      • Channel B to AUX
      • Z-Index to Gate
    • Configuration 2
      • Channel A Inverse to Source
      • Channel B Inverse to AUX
      • Z-Index to Gate

An easy way to find the pin connections to these counters is to right click the device in Measurement & Automation Explorer (MAX) and select Device Pinout.

Connecting the encoder to two counters:
In some critical applications, a single encoder is connected to two counters to keep track of precise counting. To do this, make the following connections:
  1. Connect the non-inversed pair of channels and the Z-Index to Counter 1 in Configuration 1 above.
  2. Connect the inversed pair of channels and the Z-Index to Counter 2 in Configuration 2 above. The Z-Index is connected to both counters.

Additional Information

Some encoders require a pull-up resistor to work properly with a DAQ device. Review the specification sheet for the cDAQ and the encoder to confirm if the resistor is needed and the value of it.