Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Real duration of one measurement using 1-Sample or N-Samples

Hi

I tried to measure within LabView how long it takes to make an analog measurement with my 6036E PCMCIA card. So I tried two different method to measure: 1 Sample or N-Samples with a sample clock (see the two image attached).

For the vi with only 1 sample, it takes between 1 and 3 ms to make the measurement. I was however very astonished to see that with a 1000Hz sample clock it takes 512ms to measure 10 samples!!! I thought it would be 10ms (maybe a little bit more, since it is measured within a LabView VI). I tried to change the number of sample, and for this sampling rate, it always takes 512ms until 800 samples. Then, from this number of samples, it takes 1024ms to accomplish the measurement!

Can someone explain to me, why it takes so much time to measure 10 samples?

Thanks!

Guillaume

Message Edité par gbugnard le 01-25-2008 02:45 AM
Download All
0 Kudos
Message 1 of 4
(3,553 Views)

Well, I wouldn't want to draw any major conclusions based on that benchmarking code.  Because you call DAQmx Read without having first called DAQmx Start, the Read has to do a lot of extra work to finish configuring and starting the task before the actual reading happens.  You should be sure to start the task before you start your timing.

Also, it'd be a good idea to measure the timing more than 1 time.  Suggestion: configure the task for 1000 Hz and 10000 samples.  After starting the task, wait for 2.5 seconds.  Then run a For loop 25 times.  In the loop, capture a msec tick count before the Read, then Read 100 samples, then calc the delta time with another msec tick count.  Accumulate these delta times on the loop boundary using auto-indexing.  After the loop ends, graph the array of times.

My guess is you'll find that most of the 100 sample reads register a 0 or 1 msec delta time.  If so, you may need to change the strategy.  Take a msec tick count before the loop, then loop 25 times while reading 100 samples each time, then find your delta time after the loop ends.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 4
(3,540 Views)
Hi Guillaume,

It sounds like you're having the same issue described in yesterday's PCMCIA DAQCard thread:
http://forums.ni.com/ni/board/message?board.id=250&thread.id=36717

This KB explains the problem and the solution:
http://digital.ni.com/public.nsf/allkb/5C9D0AEFAE8EA81486256DCF00788B2F?OpenDocument

Brad
---
Brad Keryan
NI R&D
0 Kudos
Message 3 of 4
(3,533 Views)
Hi Brad
Thanks for the hint! It works perfectly now! Great!

Kevin, you were right, I forgot the start task VI... It didn't change a lot, but it is better with.

Regards

Guillaume
0 Kudos
Message 4 of 4
(3,492 Views)