Statistics_LREAL (FB)ΒΆ
FUNCTION_BLOCK Statistics_LREAL
This function block will update the values of minimum, maximum and average with respect to the integral input parameter \(x_{n}\),
which will be added to a set of integral data \(x_{n-1},\dots,n_{1}\) (stemming from previous calls).
The arithmetic mean \(\bar{x}\) of the values \(x_{n},\dots,x_{1}\) is calculated by:
\[\bar{x} = \frac{1}{n}\sum_{i=1}^{n}x_{i}\]
- InOut:
- Scope - Name - Type - Initial - Comment - Input - xEnable- BOOL- Reset - lrInput- LREAL- New data \(x_{n}\) - Output - lrMin- LREAL- LREAL#1E+80 - Minimum of set \(x_{n},\dots,x_{1}\) - lrMax- LREAL- LREAL#-1E+80 - Maximum of set \(x_{n},\dots,x_{1}\) - lrAverage- LREAL- Arithmetic mean of data \(x_{n},\dots,x_{1}\) - xOverrun- BOOL- TRUE: In case of overflowThe module will compensate this by a minor weighting of the old data leading to inaccuracy of the result
