Overview:
This example uses DAQmx to synchronize finite generation and acquisition of Correlated Digital Output with an Analog Input Task respectively.
Descriptions:
Correlated I/O enables synchronization of on board digital I/O lines to a clock reference. Digital and Analog samples can be synchronized in time by sharing the AI clock as the source of your digital I/O clock. You may also use the Counter Output pulse as the Source of Digital Timing. Hence, set the Source for Digital Timing as ai/SampleClock.This example will work on any device that uses DAQmx and supports Correlated Digital I/O. To perform Correlated Digital I/O on 9172 Chassis, you need a Correlated Module in slot 1-4 of the chassis.
Requirements:
- LabVIEW 2012 or compatible.
- NI-DAQmx 15.5.1 or compatible.
Steps to Implement or Execute Code:
- Set all the control values on the front panel corresponding to the physical channel to be used on the DAQ device.
- Run this VI.
- Monitor the analog input voltage measured and ramp signal generated from specified channels.
Block Diagram Steps:
- Creates channels to measure voltage and to generate digital signals
- Sets the source of the Sample Clock, the rate of the Sample Clock, and the number of samples to acquire or generate.
- Generates an array containing a ramp pattern and write to digital output lines.
- Transitions the tasks to running state to begin measuring and generating data.
- Reads the waveform from the analog input channel and waits for the digital output generation to complete.
- Clears the tasks.
- Displays any error occurs.


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