FB_BA_EnAvrg0X

FB_BA_EnAvrg0X 1:

The function block calculates the arithmetic average from the enabled input values. The function block is available for the variants of 2, 4 and 8 input values. The following documentation refers to the FB_BA_EnAvrg04.

FB_BA_EnAvrg0X 2: Inputs

VAR_INPUT
  bEn01…bEn04       : BOOL;
  fVal01…fVal04     : REAL;
END_VAR

Name

Type

Description

bEn01…bEn04

BOOL

General enable of an average calculation. If bEn0x = FALSE, the corresponding input value is not included for averaging.

fVal01…fVal04

REAL

The values from which the average value is to be calculated are applied to the variables fVal0 to fVal0x.

FB_BA_EnAvrg0X 3: Outputs

VAR_OUTPUT
  fAvgVal      : REAL;
  fMinVal      : REAL;
  fMaxVal      : REAL;
  nActvCnt     : UDINT;
END_VAR

Name

Type

Description

fAvgVal

REAL

Calculated arithmetic average.

fMinVal

REAL

Smallest input value.

fMaxVal

REAL

Largest input value.

nActvCnt

UDINT

Number of input values considered for averaging.

Requirements

Development environment

Required PLC library

TwinCAT from v3.1.4024.22

Tc3_BA2 from v5.2.5.0