FB_CTRL_ACTUAL_VALUE_FILTER
The function block allows a measured input variable to be checked for plausibility and filtered.
Behaviour of the output:
![FB_CTRL_ACTUAL_VALUE_FILTER 2:](Images/gif/11283491851__Web.gif)
This block allows a plausibility check to be carried out on a measured input variable. If the difference between two sampling values in sequence (measurements) is larger than the specified window, fDeltaMax, then the current input value is suppressed for a maximum of three cycles. During this time the output value is extrapolated from the previous input values. If the specified window is exceeded for more than three cycles, the output will again follow the input variable. The behaviour of the output is illustrated in the diagram above.
VAR_INPUT
VAR_INPUT
fIn : FLOAT;
fManValue : FLOAT;
eMode : E_CTRL_MODE;
END_VAR
fIn : Input value of the filter.
fManValue : Input variable whose value is output in manual mode.
eMode : Input that specifies the block's operating mode.
VAR_OUTPUT
VAR_OUTPUT
fOut : FLOAT;
eState : E_CTRL_STATE;
eErrorId : E_CTRL_ERRORCODES;
bError : BOOL;
END_VAR
fOut : Output of the function block.
eState : State of the function block.
eErrorId : Supplies the error number when the bError output is set.
bError : Becomes TRUE, as soon as an error occurs.
VAR_IN_OUT
VAR_IN_OUT
stParams : ST_CTRL_ACTUAL_VALUE_FILTER_PARAMS;
END_VAR
stParams : Parameter structure of the actual value filter element. This consists of the following elements:
TYPE
FB_CTRL_ACTUAL_VALUE_FILTER:
STRUCT
tCtrlCycleTime : TIME := T#0ms; (* controller cycle
time [TIME] *)
tTaskCycleTime : TIME := T#0ms; (* task cycle time
[TIME] *)
fDeltaMax :FLOAT;
END_STRUCT
END_TYPE
tCtrlCycleTime : Cycle time with which the control loop is processed. This must be greater than or equal to the TaskCycleTime. The function block uses this input value to calculate internally whether the state and the output values have to be updated in the current cycle.
tTaskCycleTime : Cycle time with which the function block is called. If the function block is called in every cycle this corresponds to the task cycle time of the calling task.
fDeltaMax : Maximum difference between two input values in sequence. See description above.