06-17-2020 09:30 AM
I would like to be able to take 10 readings of my voltmeter and then take an average of those. I just don't know how you store those 10 readings and then parse them. I suppose I need to build an array but not sure what that would look like.
This is what I have so far.
Solved! Go to Solution.
06-17-2020 09:37 AM - edited 06-17-2020 09:42 AM
Of course.
The easiest way is to add the "Mean Pt by Pt" function.
I don't understand what you are doing with the blue dynamic datatype wire when you are building them into an array of dynamics, and feeding it to a shift register which doesn't seem to go anywhere from the left hand side of the loop.
06-17-2020 09:55 AM
Well I guess I don't understand the dynamic data data type. I really just want to build one of floats. The shift register is confusing sorry, it is actually the instrument handle for the voltmeter.
06-17-2020 10:26 AM
@crash_override wrote:
Well I guess I don't understand the dynamic data data type. I really just want to build one of floats. The shift register is confusing sorry, it is actually the instrument handle for the voltmeter.
Ahh yes. The wires that overlaid each other confused me as to what goes where.
As for the dynamic datatype, most people don't understand it. It was this magic wire NI created that allowed anything to connect to anything, and hid the details underneath. The problem is that it hid the details so you it is hard to figure out if it is doing what you truly want it to do.
Since you are feeding back and building them into an array, but then doing nothing with that, you might as well get rid of the feedback node and build array.
06-17-2020 10:28 AM
06-17-2020 12:14 PM
I really wished that work but any time I put my read function the values become way too low and ridiculous. I'm not sure why that is!
06-17-2020 12:35 PM
@ShockHouse wrote:
You don't need to store those 10 measurements. Just have a shift register, and keep adding the measurements until you get to 10. Then outside the loop divide by 10 and you have your Average. Like this
That's a Rube Goldberg "pseudo-FOR loop" (fixed number of iterations known before the loop starts).
Have you actually tested this? Shouldn't the shift register be initialized in some way?
06-17-2020 12:36 PM
06-17-2020 12:43 PM - edited 06-17-2020 12:46 PM
@altenbach wrote:
@ShockHouse wrote:
You don't need to store those 10 measurements. Just have a shift register, and keep adding the measurements until you get to 10. Then outside the loop divide by 10 and you have your Average. Like this
That's a Rube Goldberg "pseudo-FOR loop" (fixed number of iterations known before the loop starts).
Have you actually tested this? Shouldn't the shift register be initialized in some way?
You are correct, it was more of a mini example thrown together. If you wanted it to be proper you could just do it like this
06-17-2020 12:47 PM
The code sample shockhouse posted. It would work but for some reason when I try reading the instrument in that loop then the values that it reads go hay wire. Not sure if it's something I'm doing in labview wrong or the device itself and the way it's hooked up.