LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems acquiring 3 analog channels at fast sampling rates

I am using a NI 6120 multifunction DAQ with LabView 7.0 to acquire 3 analog signals. Specifically, I'm using the AI C-Scan VI. My understanding is that I must sample all three channels at the same rate, and I would like for this rate to be the maximum of 800 kS/s for the purpose of computing a PSD plot. Also, I want to acquire a decent size chunk of data at a time so that the frequency resolution on the PSD plot is relatively high across the 400 kHz span. Finally, the three acquisitions need to be synchronized so that they can be compared in the time domain. The problem I'm having is that, for all three channels, I can't read the data fast enough to keep the buffer from overflowing. Even if I get the acqui
sition to last for a little while by using a huge buffer, scans appear to be dropped, as seen in the concatenated waveforms which are discontinuous. What is the best way to handle this problem? Should I be using something other than the AI C-Scan? If it helps, the PSD's can be calculated after the acquisition process rather than real time.
0 Kudos
Message 1 of 3
(2,617 Views)
My advice would be to definetly do all the calculations outside of the loop.Also you will want to use double buffering if you can. I'm not sure if that card will do that or not.what the AI C scan uses is a circular buffer which means if you do not read the data fast enough then you will get buffer overuns and lose data.Try taking out the calc. and run it and see if that helps if not you will have to use the AI config AI start AI read and AI Stop VI's and set this up.If you can use DAQmx then try using the I/O assistant(labview 7.0 only) Sorry I cannot be of more assistance.

Joe



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 3
(2,617 Views)
I would definetely agree with Joe that your best bet is to do your processing outside of the while loop and use the "Intermediate" DAQ VIs (AI Config, AI Start, AI Read, and AI Clear) with ONLY AI Read.vi inside of the while loop. For a good example of using these VIs, please refer to the LabVIEW shipping example entitled "Cont Acq & Graph (buffered).vi." In general, set your buffer size to 10x the number of samples to read at one time. For example if you acquire data at a scan rate of 100 KHz and read in data 10,000 pts at a time then you want a buffer size of 100,000 and your while loop will take about 100 ms to run (10x per second)... You can not use DAQmx (DAQ Assistant) with the 6120 board as it is not yet supported (coming soon) 😉

Good Luck!


Sincerely,

Brooks B
Applications Engineering
National Instruments
0 Kudos
Message 3 of 3
(2,617 Views)