LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NIDAQmx double-buffering?

I am converting a program that used the legacy NIDAQ drivers to NIDAQmx. I haven't found any discussion on double-buffering in the NIDAQmx documentation. I have looked at the Cont Acq-Int Clk example. Is that the way that continuous data acquisition should be handled in NIDAQmx? i.e. call DAQmxReadAnalogF64 (or similar func) from within a while loop? I assume that the func is blocking? It appears that this blocking call locks the user out of the interface though.
 
Can someone please summarize the mapping between the dubble-buffering legacy approach and what should be done in NIDAQmx?
 
 Thanks.
0 Kudos
Message 1 of 2
(3,060 Views)
Eric,

You are correct. The Cont Acq-Int Clk example is how continuous data acquisition should be handled in NI-DAQmx. The DAQmxReadAnalogF64 can be either blocking, or non-blocking, depending on the numSampsPerChan property. If numSampsPerChan is set to a positive value, the function will not return until that number of samples have been acquired. If, however, you set numSampsPerChan to -1, the function will immediately return all available samples in the buffer. In order to avoid locking the user interface, I would suggest the latter method.

Hope this helps,
Ryan Verret
Product Marketing Engineer
Signal Generators
National Instruments
0 Kudos
Message 2 of 2
(3,038 Views)