01-25-2008 02:44 AM - edited 01-25-2008 02:45 AM
01-25-2008 10:18 AM
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.
01-25-2008 11:46 AM
01-28-2008 06:17 AM