[AVRG] Average of 8 real values
Function block AVERAGE calculates the average value from 8 real values.
AVERAGE calculates the average value from 8 real values. The calculation only includes valid input signals and their respective weighting.
More than 8 input signals are processed by cascading multiple AVERAGE function blocks.
AVERAGE calculates the weighted average [Out] from max. 8 inputs [In1]...[In8] by considering their weighting [Wght1]...[Wght8] and enable inputs 1...8 [EnIn1]...[EnIn8].
To calculate the average value, all unlocked values are considered, e.g. [EnIn1] = 1. As a result, the average value [Out] is derived from all unlocked input values multiplied by their weighting.

The output [WghtTot] supplies the sum of all weightings for all unlocked inputs.

Input | Description | Data type | Default value |
|---|---|---|---|
In1…In8 | Input 1…Input 8 Input 1 for calculating the average. | Real | 0.0 |
Wght1…Wght8 | Weighting 1…Weighting 8 Parameter to weigh input 1 in proportion to the other inputs. | Real | 1.0 |
0.0: This input is ineffective. | |||
EnIn1…EnIn8 | Enable input 1…Enable input 8 Excludes the input from averaging (e.g. faulty input signal). If the input is used as a parameter (not wired), [EnIn] = 1 must be set (e.g. no error supervision). | Boolean | 0 |
0 - Input not used. | |||
Output | Description | Data type | Default value |
|---|---|---|---|
Out | Output | Real | 0.0 |
WghtTot | Weighting total Sum of the weighted values for all unlocked input values. | Real | 0.0 |
AVERAGE normally is used for averaging measured values.
As not all input values are weighted in proportion, weighting factors can be selected:
- Averaging several room temperatures including room size.
- Averaging parallel sensors to increase measuring accuracy in large air ducts.
- Averaging parallel sensors to increase availability.
Cascading several AVERAGE function blocks to calculate average values from more than 8 input values is possible.

For calculation, negative weightings of [Wght1]...[Wght8] (by parameterization) are replaced by their absolute value. The replacement values are rewritten to the inputs.
If the sum of all weightings [Wght1]...[Wght8] of valid inputs is 0, then [Out] = 0.
If all inputs [In1]...[In8] are invalid, i.e., all inputs [EnIn1]...[EnIn8] = 0, then [Out] = 0.