AutoTare

The method can be used at runtime to automatically tare a FB_WG_Scaling instance.

Syntax

//This method tares the function block with the interface I_WG_Scaling with the current fAutoTareOffset-value automaticly if fAutoTareOffset is not zero.
//It calls I_WG_Scaling.UpdateTareOffset(fOffset := fAutoTareOffset) and FB_WG_Weighing.Reset().
//A new FB_WG_Weighing.fAutoTareOffset value will be updated after ST_WG_Weighing.nWindowLength + ST_WG_Weighing_AutoTare.nValidationSamples at the earliest.
METHOD AutoTare := BOOL
VAR_INPUT
    IScaling         : I_WG_Scaling;      //function block with the interface I_WG_Scaling
    eAutoTareType    : E_WG_AutoTareType; // AutoTare behaviour (end or continously)
END_VAR

AutoTare 1: Inputs

Name

Type

Description

IScaling

I_WG_Scaling

Function block with the interface I_WG_Scaling

eAutoTareType

E_WG_AutoTareType

Behavior for automatic taring

Sample

// Scaling
stParamsScaling : ST_WG_Scaling :=    (
        fRawLow:=0.0,
        fReferenceLow:=0.0,
        fRawHigh:=1000.0,
        fReferenceHigh:=100.0);

fbScaling : FB_WG_Scaling:=(stConfig:=stParamsScale);

// Weighing
stParamsWeighing : ST_WG_Weighing :=    (
        nWindowLength:=100,
        Validation:=(nValidationSamples:=100, fThresholdWeight:=20.0, fMaxStd:=5.0, fMaxWeightDeviation:=0.0),
        AutoTare:=(nValidationSamples:=100, fThresholdWeight:=10.0, fMaxStd:=1.0, fMaxWeightDeviation:=0.0)
    );
fbWeighing : FB_WG_Weighing:=(stConfig:=stParamsWeighing);
eAutoTareType : E_WG_AutoTareType : E_WG_AutoTareType.eContinously;

fbWeighing.AutoTare(fbScaling, eAutoTareType)

AutoTare 2: Return value

Name

Type

Description

AutoTare

BOOL

TRUE if the method call was executed successfully.