To download NI software, including the products shown below, visit ni.com/downloads.
Overview
This VI returns the current average of all values in a fixed-size FIFO buffer using array functions.
Description
This VI returns the current average of all values in a fixed-size FIFO buffer using array functions.
Requirements
LabVIEW 2012 (or compatible)
Steps to Implement or Execute
Run this VI and watch as the 10 most recent values from a random number generator are shifted through a fixed-size FIFO, and an average of all values in the buffer is returned during each iteration.
Additional Information or References:
**This document has been updated to mee the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Works great as moving average. I'm new to LV and this made more sense than what I found looking for "moving average".
This is a good start for a moving average.
There's no need to keep checking the array size as it doesn't change.
The first 9 values will calculate average using zeros for some of the elements.