AVG
PROGRAM AVG_DEMO
VAR
REAL1,REAL2,REAL3,REAL4: REAL;
END_VAR
REAL4:= AVG(IN1:=REAL1, IN2:=REAL2, IN3:=REAL3);
END_PROGRAM
Returns the arithmetic average of all input values. The number of inputs may be higher than 2.
Input | Type | Description |
---|---|---|
IN1 | ANY_NUM | Input value |
IN2 | ANY_NUM | Input value |
Output | Type | Description |
---|---|---|
=> | ANY_NUM | Output value |