ST_WG_Weighing_Validation
Substructure for the configuration structure ST_WG_Weighing. Set parameters affect the function block outputs bValidMeasurement, bNewResult, tLastResult, fLastWeight and fLastStd.
(*This configure struct helps to find the actual weight during one measuring cycle.
A measuring cycle starts when FB_WG_Weighing.fWeight exceeds fThresholdWeight and ends when it falls below fRelativeWeightLimit*FB_WG_Weighing.fLastWeight or fThresholdWeight (if fRelativeWeightLimit is not set).
The actual weight will be displayed in FB_WG_Weighing.fLastWeight (FB_WG_Weighing.fWeight with smallest FB_WG_Weighing.fStd).
Optional parameters are ignored if they are zero. None of the parameters can be less than zero.*)
TYPE ST_WG_Weighing_Validation :
STRUCT
fThresholdWeight : LREAL := 50.0; (* Minimum value for the measured weight. This condition is fulfilled if FB_WG_Weighing.fWeight is greater than or equal to fThresholdWeight. *)
nValidationSamples : UDINT := 10; (* Number of input values for which the other ST_WG_Weighing_Validation parameter conditions (fThresholdWeight, fMaxStd, fMaxWeightDeviation) must be fulfilled so that FB_WG_Weighing.bValidMeasurement=TRUE (optional, recommended). *)
fMaxStd : LREAL := 5.0; (* Upper limit for the standard deviation. This condition is fulfilled if FB_WG_Weighing.fStd is less than or equal to fMaxStd (optional, recommended). *)
fMaxWeightDeviation : LREAL := 0.0; (* Upper limit for the maximum weight deviation. This condition is fulfilled if FB_WG_Weighing.fMax - FB_WG_Weighing.fMin is less than or equal to fMaxWeightDeviation (optional, recommended). *)
fRelativeWeightLimit : LREAL := 0.0; (* fRelativeWeightLimit (> 0 and < 1) specifies that FB_WG_Weighing.bNewResult and FB_WG_Weighing.tLastResult are updated if FB_WG_Weighing.fWeight falls below the fRelativeWeightLimit * FB_WG_Weighing.fLastWeight limit value (optional). *)
END_STRUCT
END_TYPE
fThresholdWeight
is the minimum value for the measured weight. This condition is met ifFB_WG_Weighing.fWeight
is greater than or equal tofThresholdWeight
.nValidationSamples
is the number of input values for which the otherST_WG_Weighing_Validation
parameter conditions (fThresholdWeight, fMaxStd, fMaxWeightDeviation)
must be fulfilled so thatFB_WG_Weighing.bValidMeasurement=TRUE
(optional, recommended).fMaxStd
is the upper limit for the standard deviation. This condition is met ifFB_WG_Weighing.fStd
is less than or equal tofMaxStd
(optional, recommended).fMaxWeightDeviation
is the upper limit for the maximum weight deviation. This condition is met ifFB_WG_Weighing.fMax - FB_WG_Weighing.fMin
is less than or equal tofMaxWeightDeviation
(optional, recommended).fRelativeWeightLimit
(> 0 and < 1)FB_WG_Weighing.bNewResult
andFB_WG_Weighing.tLastResult
are updated ifFB_WG_Weighing.fWeight
falls below the limit valuefRelativeWeightLimit
-FB_WG_Weighing.fLastWeight
(optional).
If FB_WG_Weighing.fWeight
rises above fThresholdWeight
, the weight with the lowest FB_WG_Weighing.fStd
is searched for until FB_WG_Weighing.fWeight
leaves the fThresholdWeight
limit again. If fRelativeWeightLimit
is set, the measurement ends when FB_WG_Weighing.fWeight
falls below fThresholdWeight
*fRelativeWeightLimit
. The weight determined is displayed for the first time on a rising edge of FB_WG_Weighing.bValidMeasurement
in FB_WG_Weighing.fLastWeight
and is updated until the measurement is complete. At the end of the measurement, the timestamp is set in FB_WG_Weighing.tLastResult
and FB_WG_Weighing.bNewResult
is set to TRUE for one cycle. If FB_WG_Weighing.fWeight
rises above fThresholdWeight
again, FB_WG_Weighing.fLastWeight
is set to zero and a new measurement begins.