Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

Encoder Correlated DIO

Overview
This example demonstrates how to count digital events on a digital port of an M-Series card using correlated DIO. 
 
Description
This program correlates a digital input task to the analog input sample clock, creating a buffered hardware timed acquisition on a digital port.  The program then compares samples from each port to the previous sample, and a change in a digital line increments a count value in software.
 
Steps to implement or execute code
To implement this example:
  1. Set the physical channel
  2. Define the encoder setting
  3. Define the timing parameter
  4. Run the VI
  5. (Optional) Turn on the Highlight Execution to see the flow of the VI

To execute this example:

  1. Install the required software.
  2. Connect the DAQ hardware
  3. Confirm the connection with the MAX with TestPanel
  4. Open the VI and refer the Implement Steps


Requirements
Software
LabVIEW 2012 or compatible
NI-DAQmx 16.0 or compatible

Hardware
cDAQ with C series or compatible

 

2017-10-29_12-40-44.jpgBD.png

**This document has been updated to meet the current required format for the NI Code Exchange.**

Thank You
Eric Reid
National Instruments
Motion R&D
Comments
Todd S.
NI Employee

thanks for posting!  could you please rename your attachment to include the LabVIEW version? "_lvXX.zip" would be fine.

Todd S.
LabVIEW Community Manager
National Instruments
Joji
NI Employee

Does this handle the Z channel?

Joji
Eric_R
NI Employee

Hi Buddy, great question! This VI currently does not support a Z axis that you may see on quadrature encoders for indexing. My recommendation would be to change the Encoder Split VI and add the logic for edge detection to quadrature-split.

-Eric


Thank You
Eric Reid
National Instruments
Motion R&D