Hi, I am trying to acquire data on a digital audio broadcasting (DAB) transmission frame which is 96 ms of duration. I am using a DAQPad 6016 with Labview 7.1. I want to acquire or send I/O :
1 - AI- Analog 1D Wfm N Chan N Samp (finite sample Rate: 33000 Hz Nb of samples: 1024) 2 - AI - Analog 1 Chan 1 Samp 3 - DO - Digital U8 1 Chan 1 Samp 4 – DO - Digital U8 1 Chan 1 Samp
My problem is the following: it takes longer than the transmission to acquire the data. When I run the Labview Profiler I see that my DAQmx Read fonction for the Analog 1D wfm N Chan N Samp takes around 75.3 ms and should take around 1024 / 33000 Hz = 31 ms. I guest I would need to use a buffer to improve it but I don't exactly know how to use it with a finite sampling. Also, I want to create all my channels outside the while loop, what is the best to synchronize my four Start Task.vi ( in way that I won’t get a reserved resource error) ?
What I need to do: I need to load to all the channels once outside the loop then I want to start each one after another and stop them when they are done for a total duration of 96 ms.
Maybe there is a better to solve this, please let me know...
I recommend looking at the shipping examples under Help >> Find Examples... Then Browse to Hardware Input & Output, DAQmx. Look at examples for Analog Measurements and Digital Generation. I also recommend using the 1D Wfm 1 Chan N Samp instance of DAQmx Read if you are only reading from one channel...
To start and stop each task one after another, try using a sequence structure. Just make sure that one AI Task is closed before you try to start a new one...
Hi Sean, Thanks for you prompt response. You are right it makes more sense to use the 1D Wfm 1 Chan N Samp instance of DAQmx Read.
By closing the Task do you mean to use DAQmx Clear Task.vi because if I do use it, I will need to create the Virtual Channels once again and then lose some efficiency and timing which is really critical for my application since I am trying to make all my acquisition in 96 ms.
What I found strange is that is takes an average of 70 ms (in the Labview profiler) to execute the 1D Wfm 1 Chan N Samp instance of DAQmx Read and it should take around 1024 samples / 34133 Hz = 30 ms.
I mean to call a Stop Task VI. The Stop Task does not require you to recreate the task before restarting it.
I just wrote up a test VI to see if I could replicate your problem, but each time I ran my VI, the DAQmx Read.vi only took 30 ms to complete. Try running my attached VI and see if it still takes 70 ms.
Try profiling with this modified test.vi. Again, I am getting 30 ms as the average time for the DAQmx Read.vi. Some of these timing differences we are seeing could be system dependent. If you are running a slow computer, then the amount of time it takes to actually call the Read VI could be different. What kind of computer are you using? Can you achieve different results on a different PC?
Also keep in mind that the DAQPad-6016 uses Interrupt Based Data Transfers. If you have other applications ruinning at the same time as your DAQ VI, you might be slowing it down that way. Do you have a PCI DAQ card that you could try this with?
Hi Sean, I tried the new example and I am also getting around 30 ms average. My computer is a : Intel (R) Pentium 4 CPU 1.90 GHZ, AT/AT Compatible, 1024 MB RAM and with Windows 2000. I already tried it with a new PC Intel (R )Pentium 4, 2.4 GHz CPU, and I was getting similar results. What type of PC are you using ?