LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To find mean

I have a VI for HP 4155A that sets power source to a circuit.Now I have to find the mean voltage and current.after that i have to find the total power consumed after a certain time.

Using Labview 6.1
0 Kudos
Message 1 of 6
(2,404 Views)
My first task is to collect voltage samples and then to measure the mean. and finally the power consumed.
0 Kudos
Message 2 of 6
(2,394 Views)
I would post an example, but I'm using 7.1 and I'm not sure what would happen. Try obtaining your samples in the for loop (I couldn't run your vi, or really understand it, since I didn't have any of the sub vi's), and wiring the output of the sub vi that gets the output from the meter to the edge of the loop, and auto-index it. From there, use a math function to sum the array (Numeric-> Add Array Elements), and simply divide by the number of loop iterations.

To find the power consumed, I assume you either know the current drawn or are getting it the same way you did the voltage, and simply multiply the current by the voltage. To get power in watts anyways. Hope this helps.

Geoff
0 Kudos
Message 3 of 6
(2,387 Views)
But what i thought was first to multiply voltage and current everytime and form a array for power and then add the array elements and divide it by the number of samples.
0 Kudos
Message 4 of 6
(2,372 Views)
That also works. There's a number of ways to accomplish that task...whichever one is easiest for you to incorporate. The only thing to keep in mind is that if you need samples as fast as possible, it's best not to touch the data until after the loop is complete. Not that operations on it would cause a big performance hit, but it would have some effect, however small (chances are your equipment is nowhere near as fast as LabVIEW, but I'm not an expert in that area, so I don't know for sure).

Geoff
0 Kudos
Message 5 of 6
(2,367 Views)
That's not necessary. There is the function called Mean on the Mathematics>Probablility and Statistics palette.
0 Kudos
Message 6 of 6
(2,366 Views)