LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow operation of 'N Samples' AI DAQ?

I have an application that uses a SCXI chassis, with two analog inputs (voltage and thermocouples), both multiplexed 32 channels.

I've used LV express tasks to set up a DAQ sampling system that uses N Samples (target is 10 samples/channel per VI read, but sampling at 1000Hz at the hardward side), and set this up in a timed loop at 100ms timing and high priority.  However, I found the loop was running slow and found that it was across the VI task that this was happening, which took anywhere from 500 to 1000ms to complete despite the read timing being 10ms.

I reverted this Express VI to it's component VI and played with some of the parameters in there but couldn't get the speed up save by cutting down the number of samples per read, which is not what I want to do. 

I did find that if I used continuous sampling from an Express VI setup, the read speed in the loop was excellent, but I would get 0 values too frequently to be useful for the main application (as there's heating loops to consider)

I did see that there's an Example that continuously reads a single thermocouple channel using the N-sample type approach, but  that the biggest difference between this and the  expanded Express VI is that the  example does NOT include the Sample Clock timing - it just uses the DAQ read to pull values in.  

This is with LabView 7.1.1f.  I believe I had used the sample approach with the N-sample reads in a previous version (7.0?) with a similar SCXI chassis without a problem of this slow read, so I'm wondering if there's something int he software or drivers that changed between these two.

Would the best way to proceed is to ignore the Express VI (save for the task setup stuff) and use the example approach?


0 Kudos
Message 1 of 3
(2,788 Views)
Hi,
 
One of the issues may be that with the Express VI, the task is started and stopped everytime the VI runs.  This adds some overhead that is unnecessary if you are reading the inputs in a loop.
 
I think a "better" way to do this would be to configure the task/channels, timing and start the task outside of the loop, and then in the loop do the read.  After the loop is finished, you can stop and clear the task.
 
I hope you find this useful.
 
Jon
0 Kudos
Message 2 of 3
(2,779 Views)
Hi M_N,
 
I'm assuming you are using the DAQ Assistant to set up your analog acquisition.  Actually, there is some logic "underneath the hood" of this VI that only allows the configuration, start, and stop calls to be made once, even if the DAQ Assistant is placed in a WHILE loop. 
 
I'm not sure exactly what is going on in your code, but I suggest taking a look at the examples that come with the DAQmx driver.  In LabVIEW, go to Help >> Find Examples... to launch the NI Example Finder.  Browse to Hardware Input and Output >> DAQmx >> Analog Measurements to find lots of ready to run examples.  These examples can be used as great building blocks for your own code.
 
Thanks,
 
Justin M
National Instruments
0 Kudos
Message 3 of 3
(2,761 Views)