LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i ensure my sampling rate is a constant and correct (@250Hz) when using AI Sample Channel vi

I am running a VI that samples 2 channels using the AI Sample Channel vi within a for loop (executing equal to the number of samples i require), i then calculate the difference between the channels. Within the for loop i use a chart to displays this difference in realtime.

On exiting the loop the data is converted to an array, which in turn i then convert to a waveform (using dT as 0.01 as an arbitary solution at the moment). The waveform is then compared to limits using the limit specs and limit testing vi's.

There is also other code displaying graphs from the previous iterations of the VI.

My question is how do i control the aquisition rat
e so that i know that the AI Sample Channel vi is sampling my data at a set rate (250Hz)?

I have tried to use some of the hardware timed exaples supplied by NI to no avail. They can't give me the single point output required within the initial for loop for the real-time display.

Any solutions welcome!!
0 Kudos
Message 1 of 2
(2,598 Views)
How about buffered acquisition? You can let your DAQCard acquire the number of samples you require instead of doing it with a FOR loop. Using a FOR loop means that you are software timed, which may as well be untimed since it's about as deterministic as the weather in Florida. 🙂

Look for the "Acquire N Scans.vi" example.

If you want to do this the RIGHT way, use continuous acquisition. Start your acquisition and keep doing AI Read in a loop. Also include your porcessing and display functions in the loop. Just make sure your loop runs fast enough to keep up with your acquisition. At 250 Hz, you should have no problem.

Dan Press
www.primetest.com
0 Kudos
Message 2 of 2
(2,597 Views)