Documentation

AVG

Function name

AVG

ST call

PROGRAM AVG_DEMO
VAR
REAL1,REAL2,REAL3,REAL4: REAL;
END_VAR
REAL4:= AVG(IN1:=REAL1, IN2:=REAL2, IN3:=REAL3);
END_PROGRAM

Description

Returns the arithmetic average of all input values. The number of inputs may be higher than 2.

Inputs

Input Type Description
IN1 ANY_NUM Input value
IN2 ANY_NUM Input value

Outputs

Output Type Description
=> ANY_NUM Output value

Application example