09-13-2011 11:29 AM - edited 09-13-2011 11:30 AM
I would like to measure voltage continuously, and collect that data in a small array, e.g. 10 elements (consecutively collected voltage values) and then do some calculations on the array values. Then, I want to throw away those array values and collect the next 10 voltage values in a new array and repeat the calculation etc.
However, I am not understanding how to get the array formed. I think an array should be created by a FOR LOOP, but, is the BUILD ARRAY the correct function to capture the values? Does the BUILD ARRAY know to accept the values consecutively by the wiring I show in the attached vi??
Will the attached vi collect 10 values, allow a calculation, discard those 10 values, and then repeat?
09-13-2011 11:55 AM
09-13-2011 12:17 PM - edited 09-13-2011 12:18 PM
Don't create your DAQmx task in every iteration of the While Loop, you will eventually run out of resources.
As Gerd said, read 10 samples at once rather than 1 sample 10 times. Then you can get rid of the inner For loop. You'd use DAQmx Read 1 channel N samples.
09-13-2011 12:50 PM
Yes, I am using DAQmx to read the voltages. Thanks for the suggestion. I will try to make it work.
Dave