This content is not available in your preferred language.
The content is shown in another available language. Your browser may include features that can help translate the text.
For this section, consider an example using the NI cDAQ-9178 chassis and the NI 9401 C Series digital I/O module. The procedure is similar when using a different measurement instrument or device.
Figure 8. NI cDAQ-9178 Chassis and NI 9401 Digital I/O Module
The NI 9401 has a DSUB connector that provides connections for the eight digital channels. Each channel has a digital I/O pin to which you can connect a digital input or output device. Access to the four counters of the CompactDAQ chassis is available in any of the slots of the chassis; if you are using the cDAQ-9172, access to its two counters is only available through slots 5 and 6, therefore insert the 9401 in slot 5. Figure 9 shows the pinout for this configuration, and Table 1 shows the default counter terminals.To use your quadrature encoder with your DAQ card, connect channels A, B, and Z to the counter's SOURCE, AUX, and GATE pins, respectively. To find the pinout specific to your DAQ card, right-click the card in NI MAX and select Device Pinout. Refer to the guide Connecting Quadrature Encoders to a DAQ Device for step-by-step instructions for wiring and configuring your NI DAQ device for quadrature encoder measurements.
Figure 9. NI 9401 Pinout (Slot 5)Table 1. Default Counter Terminals
According to these specifications, Wire A is connected to Pin 14, Wire B is connected to Pin 17, “5 VDC Power” is connected to any unused digital line set to “high,” and “Ground” is connected to any COM terminal.
Now that you have your encoder connected to the measurement device, you can use NI LabVIEW and the DAQmx driver to transfer the data into the computer for visualization and analysis.Table 1 shows an example of displaying the edge count and the corresponding position increments inside the LabVIEW programming environment.An example of this can be found in the DAQmx Counter Input shipped examples found in <National Instruments>\LabVIEW xxxx\examples\DAQmx\Counter Input. Specifically, the Counter-Read Encoder (Continuous Clock).vi
Figure 10. LabVIEW Front Panel Showing Measurements
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.