[AVERAGE] 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 blocks.

Functioning

AVERAGE calculates the weighted average [Out] from max. 8 inputs [In1]...[In8] by considering their weighting [Wght1]...[Wght8] and release 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.

Pins

Input

Description

Data type

Default value
Value range

In1In8

Input 1Input 8

Input 1 for calculating the average.
Enable input 2.
Input 3…8 first display the input.

Real

1.0

Wght1Wght8

Weighting 1Weighting 8

Parameter to weigh input 1 in proportion to the other inputs.

Real

0.0

0.0: This input is ineffective (default value).
< 0: Negative weighting is replaced by the absolute value for calculation purposes. The absolute value is reread to the input.

EnIn1EnIn8

Enable input 1Enable 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.
1 - Input is used.

 

Output

Description

Data type

Default value
Value range

Out

Output

Real

0.0

WghtTot

Weighting total

Sum of the weighted values for all unlocked input values.

Real

0.0

Application

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.

Troubleshooting

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.