02-15-2018 11:19 AM
Hi all. I have been searching the forum for examples of a boxcar average but can't find anything that suits.
Let's say I have a continuous stream of data coming in at the left and a wire to a waveform chart at the right. I haven't done a vi because it's that simple. I don't know how many data points there will be.
All I want is a black box to insert in the wire that will give me a running average of n points, probably around 5. I don't want the source or the indicator to be inside any loop.
Nearly all of the examples have either a number generator and display inside a loop, or a fixed length array of data points to work on. I just want the data stream coming in, averaged as it goes, and going out. I'm sure it can't be too difficult.
Thanks for any help.
Andy.
Solved! Go to Solution.
02-15-2018 11:26 AM
Use "mean ptbypt" with a value of 5.
02-15-2018 11:33 AM
@altenbach wrote:
Use "mean ptbypt" with a value of 5.
Ben
02-15-2018 11:45 AM
Actually, mean ptbypt seems to require at least LabVIEW full, but it would be trivial to create a subvi that does the same.
02-15-2018 12:05 PM
Thank you for that quick reply.
I'm afraid to say I fed you a bum steer, or I didn't explain it properly. The data is coming in packets in the form of a 1D array, of n length, (n is unknown) so I guess I would have to use "Array Size" and then step through it in a loop of n iterations?
Cheers
02-15-2018 12:10 PM
Just place mean ptbypt (and chart) inside an autoindexing for loop. No need to get the size.
02-15-2018 12:17 PM
I'm using Labview full and it works. Excellent.
02-15-2018 12:18 PM
Thanks altenbach. Much appreciated.
Cheers
Andy