Table of Contents

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

InputType Description
IN1 ANY_NUMInput value
IN2 ANY_NUMInput value

Outputs

OutputType Description
ANY_NUMOutput value

Application example