LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you configure vi to output the mean from instantaneous data?

Solved!
Go to solution

Hi,

 

I am trying to configure my vi to calculate the mean as the data is being read by the computer. I have tried storing the data in an array and then using the statistics option to calculate the arithmentic mean to no success. I have the vi set up to output the data as it reads it onto the screen. It seems like the array is not storing the data, instead I am getting the same value for the mean as for the data.

 

Any ideas?

 

Thanks,

Sumit.

0 Kudos
Message 1 of 5
(2,703 Views)
Why don't you show us how you are storing the data in an array. Posting the actual program is best.
0 Kudos
Message 2 of 5
(2,692 Views)

Hi,

 

Thanks for the response.

 

I am collecting and storing torque and rpm data. I am trying to find a way to output the mean rpm and mean torque in the front panel.

 

Please see attached vi and pic to for my attempt at solving this problem. So far nothing seems to be working.

 

Thanks,

Sumit

0 Kudos
Message 3 of 5
(2,686 Views)
Solution
Accepted by topic author sumit_clarkson
You are not saving data in an array. You are converting the scalar you get from the Pulse Measurement function into a 1D array with a single element. You are also doing it in a very confusing and convoluted way. All of those conversions to/from dynamic/1D/2D/dynamic/1d are just ridiculous. Each time the loop iterates, you get a brand new 1D array with a single element. In order to properly build an array, you would need a shift register with a Build Array function wired to it. You could also use the Mean PtByPt function wired directly to the scalar output of Pulse Measurements.
Message 4 of 5
(2,663 Views)

Thanks Dennis, the Mean PtByPt function worked for me.

 

This is the first time I am using labview and I appreciate your assistance.

 

Thanks,

Sumit.

0 Kudos
Message 5 of 5
(2,650 Views)