FB_FTR_Median

The function block FB_FTR_Median implements a median filter. The median is the middle value in a list of values sorted by size. This means that at least half of the values are less than or equal to the median, and at least half are greater than or equal to the median. If the list contains an even number of values, the median is equal to the arithmetic mean of the two middle values.
The filter specification is transferred with the structure ST_FTR_Median.
Syntax
Declaration:
fbFilter : FB_FTR_Median(stConfig := ...)Definition:
FUNCTION_BLOCK FB_FTR_Median
VAR_INPUT
stConfig : ST_FTR_Median;
END_VAR
VAR_OUTPUT
bError : BOOL;
bConfigured : BOOL;
ipResultMessage : I_TCMessage;
END_VAR
Outputs
Name | Type | Description |
|---|---|---|
bError | BOOL | TRUE, if an error occurs. |
bConfigured | BOOL | TRUE if the configuration was successful. |
ipResultMessage | Interface that provides properties and methods for message handling |
Methods
Name | Definition location | Description |
|---|---|---|
Configure() | Local | Loads a new (or initial) configuration structure. |
Call() | Local | Calculates the output signal for a given input signal and filter configuration. |
Reset() | Local | Resets internal states. |
Properties
Name | Type | Access | Definition location | Initial value | Description |
|---|---|---|---|---|---|
bTraceLevelDefault | BOOL | Get, Set | Local | TRUE | TRUE if eTraceLevel = Critical |
eTraceLevel | Get, Set | Local | Critical | Severity of an event |
Requirements
Development environment | Target platform | PLC libraries to include |
|---|---|---|
TwinCAT v3.1.4022.25 | PC or CX (x64, x86) | Tc3_Filter |
Inputs