AutoTare
Die Methode kann zur Laufzeit verwendet werden, um eine FB_WG_Scaling -Instanz automatisch zu tarieren.
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
Eingänge
Name | Typ | Beschreibung |
---|---|---|
IScaling | I_WG_Scaling | Funktionsblock mit dem Interface I_WG_Scaling |
eAutoTareType | Verhalten zum automatischen Tarieren |
Beispiel
// 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)
Rückgabewert
Name | Typ | Beschreibung |
---|---|---|
AutoTare | BOOL | TRUE, wenn der Methodenaufruf erfolgreich durchgeführt wurde. |