Overview Sliding average

This block calculates the average of the last N values (sliding window). In addition the minimum and the maximum within the same window are put out. This smooths fluctuating measured values without having to specify a fixed time. The window is stored persistently and is available again after a restart of the controller.

Distinction: the block Average calculates the average over several inputs, the block Average per time over a period of time. This block averages over the last N recorded values.


Inputs

WT Value Value that is taken into the window.
TA Clock A rising edge takes the current value into the window. Only effective with update mode “Via clock input”.
RS Reset A rising edge clears the window. Until the first new value all outputs are set to 0.



Outputs

DS Average Average of the values in the window.
MI Minimum Smallest value in the window.
MA Maximum Largest value in the window.



Parameters

Window length Number of values to average over, 1 to 64. As long as fewer values have been recorded, the average is calculated over the existing ones.
Update
  • On change: every change at input WT is recorded.
  • Via clock input: a value is only recorded on a rising edge at input TA.
  • Cyclic: a value is recorded at the interval of the cycle time, regardless of whether it has changed.
Cycle time (s) Recording interval in seconds. Only with update mode “Cyclic”.
Store persistently Stores the window so that the average continues after a restart of the controller. It is saved cyclically at most once per hour and when shutting down. If the window length is changed afterwards, averaging starts over.

See also: Average, Average per time, Trend

See also common parameters of all function blocks.