Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Empty Data Buffer

Good morning all,
 
I am trying to empty my DAQ buffer (while my VI is in 'pause mode' etc). My buffer size is set to 100,000 (I think) and the number of samples easily exceeds this (90kS/s). The problem is that once the 100kS is exceeded, the number of data in the buffer goes to 0, and so any read VIs with -1 as the number of samples doesnt read out any data, but when i resume my VI it has to trawl through millions of pieces of data before it gets to the most recent ones, and back to Real Time operation.
 
Any ideas?
 
- Capuchin
0 Kudos
Message 1 of 3
(2,791 Views)

If you might be paused long enough for the DAQ hardware to overrun the buffer size, you won't be able to use the (-1) option to read "all available samples" anymore.  Your Read call should be returning an error when you make an attempt to do this -- are you handling it?

It sounds like what you really care about is more like "most recent samples" and there's a way to get those directly.  Under LV, there's a DAQmx Read property node where you can set "RelativeTo" = "Most Recent Sample" and "Offset" = -N, and then request N samples.

-Kevin P.

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
Message 2 of 3
(2,785 Views)
Hmm, I solved the problem programatically by altering the buffer size to 30,000,000, giving me 5 minutes of save dialog before it will break. I realise this is a fairly crude solution. If it proves to be too crude, i will keep your idea in mind Kevin, Although it will need slight alteration of the timings, thanks.
 
0 Kudos
Message 3 of 3
(2,764 Views)