10-25-2010 08:12 AM
Hi, i got problems with the mean value function, to begin with i have a very limited knowledge of labview so this could be a very stupid question.
The problem is that i want to have the total mean value of a run displayed "online", so that it displays the mean of all readings from a instrument from the moment i start the program and till i turn it off. The things ive tried just seems to take the mean of for example the 10 last values, and as i said, i want it too include all the readings during the whole run that can last for a couple of hours so its alot of measurements.
Would appreciate all the help and tips i can get! Hope i managed to describe the problem, im finding it hard to find the words to use in english.
Solved! Go to Solution.
10-25-2010 08:29 AM
It would probably be easier to keep a running total and divide by the number of samples. This would use much less memory than an array.
10-25-2010 08:30 AM - edited 10-25-2010 08:31 AM
Hi robnys,
the Mean function from math->probability palette calculates the mean from the given array.
So I would like to ask: what does the array contain you use for data collection?
The same applies, when you calculate the average "manually" by summing up the data and dividing by the number of elements...
For all other possibilities you should attach a (simplified) VI, that shows your problem!
10-27-2010 05:28 AM
If you have the full or professional edition of LabVIEW, you can use Mean PtByPt to calculate a continuous average.
10-27-2010 07:06 AM
As Philip proposed, the Mean PtByPt is the appropriate VI for you. It is located in the Functions Palette, under Signal Processing > PtByPt > Statistics & Probability
Attached is an Action Engine that does something similar. I hesitate to post it because it does it for a single data at a time. You can change the code to select a single value or to input an array (just get the size of the array and increment the count by the size of the array). You can do that by adding another case and adding another selection to the enum Ctrl.