To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This NI-DAQmx example VI allows the user to acquire data on multiple analog input channels and generate this same data back out through analog output channels.
Description
The VI uses a producer/consumer architecture with queues to enable the input and output tasks to run independently.This architecture is most useful when acquiring data, performing processing, and then outputting the processed data back out. In this example, no processing is done, but if needed, it could be placed in its own loop as an intermediate step between the acquisition and generation loops. Of course, this would increase the delay between when the signal is acquired and generated back out, but it will be a constant delay and the generation data should not be underwritten.
Note that the delay between when the acquisition and generation starts will be dependant on the number of samples read by the first DAQmx Read (plus some small overhead for the software to queue/dequeue the data). For a simpler approach of reading and generating the data out with a programmable delay, please see the community example found here.
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
The following image shows the VI with a sine wave on ai1, which is then output to ao0 and read back in on ai2 to compare the delay.
**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.