Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Read.vi takes longer than predicted for data acquisition of a waveform

Hi Phil,

I am running a Dell Desktop with a Pentium 4, 3.2 GHz processor with 512 MB of RAM. Are you seeing 30 ms? I just looked at your attachment and it still shows around 70ms. If you are seeing 30 ms per run of DAQmx Read, this is what we would expect, correct? (1024 Samples / 34,133 Samples/sec = 30 ms) So now we just need to work back and see what the difference between this test1.vi and your original VI.

Where you store your VI should not affect its speed of execution. When you run a VI, it is loaded into local memory.

Regards,
Sean C.
Message 11 of 14
(845 Views)
Hi Sean,
Sorry for the confusion I though I had sent the Profiler for test1.vi. Yes, I did have 30ms for test1.vi. What do you think might be causing the difference between this test1.vi and my original VI?

Thanks again,

Have a great day,

Phil
0 Kudos
Message 12 of 14
(836 Views)
Hi Phil,

The main difference I see is that you are starting and stopping your task within the while loop. You should try replacing the first DAQmx Start Task.vi with a DAQmx Control Task.vi from the DAQmx Advanced Task Options subpalette. Create a constant off of the action terminal and set it to "commit". This forces DAQmx to commit the task outside the loop instead of every time the loop is called. Now you can remove the case structure around the Start Task.vi within the while loop. Does this make any difference in your read time? If not, you will have to start with the test1.vi and slowly build it up to the test3.vi, monitoring the timing statistics during this process to see what it is that is causing this increase in time.

Let me know if this works for you.

Sean C.
0 Kudos
Message 13 of 14
(825 Views)
Hi Sean,
I already tried to use a DAQmx Control Task.vi and setting to "commit" and it works fine. The only problem is that if your have more than one task in the sequence you will get a reserve resource error. Even if it takes a bit longer for data acquisition of the waveform it is not a problem anymore. I will work this around.

Thanks a lot for your help,

Regards,

Phil
0 Kudos
Message 14 of 14
(819 Views)