FB_FTR_ActualValue

FB_FTR_ActualValue 1:

The function block allows a measured input value to be checked for plausibility and filtered.

If the difference between two sampling values in sequence 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 linearly extrapolated from the previous input values. If the specified window is exceeded for more than three cycles, the output will again follow the input value.

FB_FTR_ActualValue 2:

Variable n is incremented if |xk - xk-1| > fDeltaMax.

The filter specification is transferred with the structure ST_FTR_ ActualValue.

Syntax

Declaration:

fbFilter : FB_FTR_ActualValue(stConfig := ...)

Definition:

FUNCTION_BLOCK FB_FTR_ActualValue
VAR_INPUT
    stConfig        : ST_FTR_
ActualValue;
END_VAR
VAR_OUTPUT
    bError          : BOOL;
    bConfigured     : BOOL;
    ipResultMessage : I_TCMessage;
END_VAR

FB_FTR_ActualValue 3: Inputs

Name

Type

Description

stConfig

ST_FTR_ActualValue

Structure for configuring the filter behavior

FB_FTR_ActualValue 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_ActualValue 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.

GetFilterActive()

Local

Indicates which elements of the input signal have been changed.

GetFilterActiveTimestamps()

Local

Shows when the filter was last active.

FB_FTR_ActualValue 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.

nTimestamp

UINT

Set

Local

0

Timestamp of the oldest input value of the next Call().

tSamplePeriod

LTIME

Set

Local

0

Time difference between two input values.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4022.25

PC or CX (x64, x86)

Tc3_Filter