Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

DAQmx takes longer than predicted for data acquisition of a waveform

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 ( 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...

Thank you very much,

0 Kudos
Message 1 of 14
Hello Phil,

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...

Let me know if this does not help.

Sean C.
Message 2 of 14
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 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.

Thanks a lot for help,

I appreciated it,

0 Kudos
Message 3 of 14
Hi Phil,

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 only took 30 ms to complete. Try running my attached VI and see if it still takes 70 ms.

Sean C.
Message 4 of 14
Hi Sean,
I tried and it is a bit faster than 70 ms but still not precise enough. I am getting 46.9 ms with the Profiler and I tried it a couple of times to make sure.

Thank a lot for your help,

Have a great day,

0 Kudos
Message 5 of 14
Hi Phil,

Try profiling with this modified Again, I am getting 30 ms as the average time for the DAQmx 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?

Let me know your results...

Sean C.
Message 6 of 14
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?

Sean C.
Message 7 of 14
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 ?
0 Kudos
Message 8 of 14
Hi Sean,
I have a PCMCIA DAQCard 1200 and a PCMCIA to PCI card in my computer but it is not working properly.

Thanks for your help,

0 Kudos
Message 9 of 14
Also I was wondering if the place were you store the *.vi file influence the speed of the software for all the polymorphics functions.

Thanks again,

0 Kudos
Message 10 of 14