LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating Average Values using "Mean" vi

Hello. I'm trying to write a simple program that will take values of a device 100 times, and average them. I found out that the "Mean" funciton would be the most useful for this, but I'm not sure on how to get it done. Any help would be appreciated.
0 Kudos
Message 1 of 5
(3,806 Views)
Can you explain your problem in detail?
You have to connect a 1D-array of DBL to the input and you will get the mean at the output.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
0 Kudos
Message 2 of 5
(3,806 Views)
Take a look at Temperature Analysis vi in LabVIEW help.
0 Kudos
Message 3 of 5
(3,806 Views)
Certainly. What I'm specfically trying to do is to take 100 outputs of an A-to-D converter, feed it through the "Mean.vi" and obtain an average value for the values outputted. I have been successful in getting the A-to-D to operate correctly. I just need to know how to send 100 values to a 1-D array and then from that array determine the mean of those 100 values. Hope this helps.
0 Kudos
Message 4 of 5
(3,806 Views)
There are numerous ways to create an array. I'm assuming that you're using one of the DAQ functions that returns a single point measurment since if you were using a waveform measurement, you'd already have a 1D array. The attachment shows some of the possible methods. A single point measurement inside of a for loop is the best in terms of memory allocation since LabVIEW knows how big the array bounds should be ahead of time. There is a shipping example called Building Arrays that you can refer to as well. It's under Help>Find Examples>Fundamentals>Arrays and Clusters.
0 Kudos
Message 5 of 5
(3,806 Views)