Discussion:
continuous DAQ
(too old to reply)
labmaster
2008-07-25 06:10:09 UTC
Permalink
I am a beginner in high speed buffering DAQ.
 
I want to make a routine for continuous DAQ of max 5 kHz (5kS/s samples) in only one channel of  USB-6229 or any other.
 
The total measuring time is around 1 min.
 
For data analysis, I need the same time interval of data.
 
Anyway, I found a good example file of "Acq&Graph Voltage-Int Clk.vi" in the example finder.
 
If I set the samples per channel to 5k and sample rate to 5k, the while loop should be executed for 60 times.
 
I am very wondering how to harmonize in the execution transition (for example, between 1s and 2s in the while loop) of loop?
(I believe there is a dely of at least 1 ms for each execution in the while loop.)
 
Otherwise, please recommend some best method to realize my purpose.
 
I have to consider to show the intermediate result (plotting) for 1 sec during the measurement and to save the result as a post-process.
(in producer/consumer routine.)???? 07-25-2008 01:02 AM? labmaster? ?? ?????
Corby_B
2008-07-28 17:10:12 UTC
Permalink
Hello labmaster! Thanks for your post!I see that you have some questions about multifunction DAQ. I would first like to ask are you actually using the example "Cont Acq&Graph Voltage - Int Clk.vi"? It sounds like you want to acquire continuously so I would use that example instead of "Acy&Graph Voltage - Int Clk.vi" So when you acquire all 5000 samples at the DAQmx read function I see what you are saying about the delay. If you lower the "samples to read" to say 500 or below then the loop will iterate faster and you will see your waveform develop faster than once a second. I would also use the producer consumer functions like you mentioned to better handle the data so that way you are not using the same loop to acquire and save your data. This is the best way to minimize any delay as every function you add to your loop will add process time. Let me know if this helps you and please post back if you have any other questions. Cheers!Corby_Bhttp://www.ni.com/support
labmaster
2008-07-29 00:10:08 UTC
Permalink
Thanks, Corby_B:
 
Acutally, I found "Cont Acq&Graph Voltage - Int Clk.vi" after my posting and developed the program.
I got to know the routine worked well as you mentioned the speed of updating.
 
But, I am still wondering how (continuous mode) DAQmx can get the data so fast continuously? 
As I mentioned, the delay of while loop between two iterations will be slow comparing to the speed of acquisition in DAQmx.
I mean the delay between A_time block data(1...499) and B_time block data(1...499) of continuous acquisitions.
In reality, there is no delay between two blocks (in my test of 2 kHz rate and 2 k sample size).
Was the DAQmx executed in background in continuous mode?
Corby_B
2008-07-29 14:10:12 UTC
Permalink
Hello labmaster! Thanks for your post back!So you are right to a point that the DAQmx driver is handling alot for you in the background. The information goes from the FIFO on the Daq card to the PC buffer on your PC. So the DAQmx Read only takes as long as it takes your computer to pull information off your PC buffer and then put that into LabVIEW. So for instance if you are reading 500 samples every loop iteration on the USB-6229, which is a 16 bit card, It will only take as long as it takes your computer to pull that from your PC buffer. So that is 16 bits or 2 bytes which equals 1000 bytes every loop iteration or 500 samples. So that is only 1kb of data from your PC buffer every loop iteration. That can take place extremely fast with any descent computer. The main limitation here is if you have other things running in the back ground such as an Anti Virus client, that can affect the processes your computer performs. Let me know if this helps you in understanding the way information is handled from your DAQ device to LabVIEW. Have a great day labmaster!Cheers!Corby_Bhttp://www.ni.com/support
Loading...