Solved! Go to Solution.
Hi, the example in the help file is showing that it is a rolling average.
(72.3+72.5)/2 = 72.4
(72.3+72.5+72.9)/3 = 72.6
(72.3+72.5+72.9+73.4)/4 = 72.8
And so on.
Hi, the example in the help file is showing that it is a rolling average.
(72.3+72.5)/2 = 72.4
(72.3+72.5+72.9)/3 = 72.6
(72.3+72.5+72.9+73.4)/4 = 72.8
And so on.
Actually it is a running total. When the run tag transitions to a non zero value the input starts being sampled. The sample rate is based on the scan rate of the input tag.after the first 2 samples the samples are summed and divided by 2. The next sample value is added to the current average and that sum is divided by 2.
This continues untile the run tag transitions back to a zero value,
The average is done this way to save on memory resources. it would be impossible to maintain potentially hundreds of thousands of values in memory. The application memory usage would quickly reach the limits for a 32bit application.
Thanks, understood now! I thought it's the average only latest two values, that's why I confused.