To download NI software, including the products shown below, visit ni.com/downloads.
Synchronize a Counter (Angular Encoder) task with an Analog Input task.
This VI will take data at the same rate from both a counter input task, set up here to be an angular encoder, and an analog input task. The Analog Input sample clock is used as the sample clock for both tasks, such that they will both acquire data at the same rate. This VI will also take the counter output and place it into a waveform with the same timing information as the analog data. This allows all the data to be plotted on the same graph.
*Note: The "Get Terminal Name With Device Prefix.vi" subVI automatically selects generates the full terminal name (such as Dev1/ai/sampleclock) and routes it to the sample clock source for the counter. If this subVI does not load, you can easily create a control for the counter's sample clock source and select DevX/ai/sampleclock where DevX is the device name of your DAQ card. The "Get Terminal Name With Device Prefix" VI simply does that behind the scenes rather than needing a user to select it
Requirements to Run
Steps to Implement or Execute Code
Additional Information or References
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.