Scale.ReadLiveWeightWithTare Method (POS for .NET v1.14 SDK Documentation)
3/2/2014
Determines the value for displaying the net weight.
Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)
Syntax
'Declaration
Public MustOverride Function ReadLiveWeightWithTare ( _
weightData As Integer, _
tare As Integer, _
timeout As Integer _
) As WeightTareInfo
public abstract WeightTareInfo ReadLiveWeightWithTare (
int weightData,
int tare,
int timeout
)
public:
virtual WeightTareInfo ReadLiveWeightWithTare (
int weightData,
int tare,
int timeout
) abstract
public abstract WeightTareInfo ReadLiveWeightWithTare (
int weightData,
int tare,
int timeout
)
public abstract function ReadLiveWeightWithTare (
weightData : int,
tare : int,
timeout : int
) : WeightTareInfo
Parameters
- weightData
The net weight calculated by the scale. When AsyncMode is true, this value is set to zero in the return value.
- tare
The value used to calculate the net weight. When AsyncMode is true, this value is set to zero in the return value.
- timeout
In synchronous mode, the number of milliseconds to wait for a settled weight before returning an error. When AsyncMode is true, this value is ignored.
Return Value
Returns WeightTareInfo.
Remarks
In synchronous mode (AsyncMode is false), this method starts the read weight process, waits until a stable weight is obtained, and then calculates the net weight. Upon successful completion, the ScaleLiveWeight and TareWeight properties are updated, and the values for the WeightData and Tare are returned.
In asynchronous mode (AsyncMode is true), the weighing and subsequent net weight calculation is done asynchronously. The method returns immediately with the return values for the WeightData and Tare set. When the scale completes the price calculation, the ScaleLiveWeight and TareWeight properties are updated and a DataEvent is raised.
This method may cause a PosControlException to be thrown with the following error codes:
Value |
Meaning |
E_ILLEGAL |
An invalid timeout parameter was specified. |
E_BUSY |
An asynchronous ReadLiveWeightWithTare is in progress. |
E_TIMEOUT |
In synchronous mode, a valid stable weight could not be obtained before timeout milliseconds passed. |
E_EXTENDED |
Check the ErrorCodeExtended property to determine the extended error code:
ValueMeaning
ESCAL_OVERWEIGHTIn synchronous mode, the weight on the scale exceeded the MaximumWeight.
ESCAL_UNDERWEIGHTIn synchronous mode, the weight on the scale was less than the MinimumWeight.
ESCAL_UNDER_ZEROIn synchronous mode, the scale reported a weight less than zero. The scale must be recalibrated.
ESCAL_SAME_WEIGHTIn synchronous mode, the scale reported that the item and weight on the scale is identical to the previously report item and weight, indicating that the item has not been removed from the scale.
|
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread-safe. Any instance members are not guaranteed to be thread-safe.
See Also
Reference
Scale Class
Scale Members
Microsoft.PointOfService Namespace