Description
Original instructions
Function description
The function block creates a moving average value (with frozen correction factor) with up to 10,000 input values.
The function block has both a manual and automatic mode.
NOTE: This function block performs an internal initialization in the first program cycle after a warm start or cold start (e.g. application download or power cycle) of the PLC program.
Due to this, you have to make sure that the function block is invoked in the first program cycle. In case of invoking the function block in a later program cycle, the internal initialization will not be performed, the value Y(old) will not be sure and the output Y(new) may deliver a wrong value.
WARNING
UNEXPECTED OUTPUT BEHAVIOUR
Make sure that the function block is always invoked in the first program cycle.
Failure to follow these instructions can result in death, serious injury, or equipment damage.
EN and ENO can be configured as additional parameters.
Formula
Block formula:
Explanation of the variables
Variable
Description
Y (new)
Y Value in current program cycle
Y (old)
Y Value from the last program cycle
K
Correction factor
X
X Value in current program cycle
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
CAL AVGMV_K_Instance (MAN:=Mode, X:=InputValue, 
    K:=CorrectionFactor, YMAN:=ManualValue, Y=>Average)
Representation in ST
Representation:
AVGMV_K_Instance (MAN:=Mode, X:=InputValue, 
    K:=CorrectionFactor, YMAN:=ManualValue, Y=>Average) ;
Parameter description
Description of input parameters:
Parameter
Data type
Description
MAN
"0" = Automatic operating mode; "1" = Manual operating mode
X
Input
K
Correction factor (max. 10,000)
YMAN
REAL
Manual value
Description of output parameters:
Parameter
Data type
Description
Y
REAL
Average value
Runtime error
For a list of all block error codes and values, see Measurement.