LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AI Read is executing only once in a while loop instead of continuously scanning the channels

The ultimate goal is to sample 15 channels (1 at 20kHz, 9 at 1000Hz, and 5 at 100Hz). Since only one scan rate is possible, I would like to reduce the data (for both displaying and saving purposes). The decimate function does not seem to work correctly.

Attached is the current subroutine used to 'decimate' the data. It seems to work on the first loop iteration, as seen by the data block with correct time stamps and data values, but with each additional iteration, all values are zero. Why is only one scan being used in the displaying of data?
0 Kudos
Message 1 of 2
(2,586 Views)
When you call AI Clear, the DAQ session is over. You will not get any new data by calling AI Read after an AI Clear. Move your AI Clear to the right of your while loop such that it runs after the while loop completes. Don't forget to wire an error cluster or DAQ session ID to AI Clear from inside the while loop to create the data dependency. Also, consider adding a shift register for the error cluster and some way to exit the loop on an error.

Remember that Alliance Members are here to help. We do this stuff every day.

Daniel L. Press
PrimeTest Corp.
www.primetest.com
0 Kudos
Message 2 of 2
(2,586 Views)