Tare

The method can be used at runtime to tare the function block. The average is calculated via nDurationInSamples - output values. Finally, the result is passed to the method UpdateTareOffset().

Syntax

METHOD Tare : BOOL
VAR_INPUT
    nDurationInSamples : UDINT;
END_VAR

Tare 1: Inputs

Name

Type

Description

nDurationInSamples

UDINT

Number of samples to be averaged.

Sample

stParamsScale: ST_WG_Scaling := (fRawLow := 0, fRawHigh := 1, fReferenceHigh := 1, fReferenceLow := 0);
fbScaling :FB_WG_Scaling:=(stConfig:=stParamsScale);
IF bTare THEN
    fbScaling.Tare(nDurationInSamples := 10);
    bTare := FALSE;
END_IF

Tare 2: Return value

Name

Type

Description

Tare

BOOL

TRUE if the method was executed successfully.