Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

how to double buffer inputs using daqmx

Hi,
 
I'm using DAQmx 8.3 and am programming in C++ (Microsoft Visual Studio).
 
I'm intersed in writing Counter values to disk, and am trying to set-up a double buffer operation.
 
What functions are best suited to reading alternating halves of a read buffer using NI DAQmx?
 
thanks
0 Kudos
Message 1 of 2
(3,493 Views)
 
Hello IUBwork. 
 
In our legacy driver, Traditional DAQ, double buffering was typically left up to the user's programming skills.  However, in DAQmx, double buffering is automatically done for you.  The following is from a webpage about general functionality of NI-DAQ (Answers to Frequently Asked Questions about NI-DAQmx and Traditional NI-DAQ (Legacy): https://www.ni.com/en/support/documentation/supplemental/06/answers-to-frequently-asked-questions-ab...)
 
"If you are doing double-buffered I/O, you would most likely be polling the buffers to continuously acquire data. In NI-DAQmx, you can achieve this simply by using the NI-DAQmx timing function and setting the Sample Mode parameter to Continuous.

NI-DAQmx uses circular buffers. For input operations, portions of data are read from the buffer while the buffer is filled. Likewise for output operations, portions of the buffer can be written to while the buffer is emptied. Using a circular buffer, you can set up your device to continuously acquire data in the background while NI-DAQmx retrieves the acquired data.

Figure 12. NI-DAQmx simplifies double-buffered data acquisition."
 
 
If you have any other questions, please let us know.  We would be glad to help!
 
Brian F
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,474 Views)