FB_FTR_Gaussian

FB_FTR_Gaussian 1:

The function block FB_FTR_Gaussian implements a Gaussian filter. The filter calculates the weighted average of M input values. The weights are calculated using a Gaussian function, where the standard deviation σ determines the cut-off frequency of the filter.

The cut-off frequency fc is defined by the standard deviation σ and the sampling rate fs such that the normalized amplitude response takes the value 1/sqrt(2) ≈ -3dB at the cut-off frequency.

FB_FTR_Gaussian 2:

The filter specification is transferred with the structure ST_FTR_Gaussian.

Syntax

Declaration:

fbFilter : FB_FTR_Gaussian(stConfig := ...)

Definition:

FUNCTION_BLOCK FB_FTR_Gaussian
VAR_INPUT
    stConfig        : ST_FTR_Gaussian;
END_VAR
VAR_OUTPUT
    bError          : BOOL;
    bConfigured     : BOOL;
    ipResultMessage : I_TCMessage;
END_VAR

FB_FTR_Gaussian 3: Inputs

Name

Type

Description

stConfig

ST_FTR_Gaussian

Structure for configuring the filter behavior

FB_FTR_Gaussian 4: Outputs

Name

Type

Description

bError

BOOL

TRUE, if an error occurs.

bConfigured

BOOL

TRUE if the configuration was successful.

ipResultMessage

I_TCMessage

Interface that provides properties and methods for message handling

FB_FTR_Gaussian 5: 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.

FB_FTR_Gaussian 6: Properties

Name

Type

Access

Definition location

Initial value

Description

bTraceLevelDefault

BOOL

Get, Set

Local

TRUE

TRUE if eTraceLevel = Critical

eTraceLevel

TcEventSeverity

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