PLC API VAR_IN_OUT stParams : ST_CTRL_ARITHMETIC_MEAN_PARAMS; END_VAR Inputs/ outputs stParams consists of the following elements: TYPE ST_CTRL_ARITHMETIC_MEAN_PARAMS: STRUCT tCtrlCycleTime : TIME := T#0ms; tTaskCycleTime : TIME := T#0ms; END_STRUCT END_TYPE 4.2.1.4.3 FB_CTRL_MEDIAN_FILTER The function block specifies the median. The median is the mean value of a list of values ordered by size. This means that one half of the collected data values is smaller than the median value, the other half is larger. The programmer must create an array "ARRAY [1..2(n+2)] OF LREAL", in which the function block can store the internal required data. VAR_INPUT fIn : FLOAT; fManSyncValue : FLOAT; eMode :
E_CTRL_MODE; bSync : FLOAT; bHold : BOOL; END_VAR Inputs TF4100 88 Version: 2.2.4 Name Type Description fOut FLOAT Output of the mean value filter eState E CTRL STATE _ _ State of the function block eErrorId E CTRL ERROR _ _ CODES Supplies the error number [} 173] when the output bError is set. bError BOOL Becomes TRUE, as soon as an error occurs. Name Type Description stParams ST CTRL _ _ ARITHMETIC _ MEAN PARAMS _ Parameter structure of the mean value filter Name Type Description tCtrlCycleTime TIME 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 TIME 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.