Scale.ReadWeight Method
2/27/2008
Reads a weight from the scale.
Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)
Syntax
'Declaration
Public MustOverride Function ReadWeight ( _
timeout As Integer _
) As Decimal
public abstract decimal ReadWeight (
int timeout
)
public:
virtual Decimal ReadWeight (
int timeout
) abstract
public abstract Decimal ReadWeight (
int timeout
)
public abstract function ReadWeight (
timeout : int
) : decimal
Parameters
- timeout
The number of milliseconds to wait for a settled weight before ReadWeight fails. If zero, ReadWeight attempts to read the scale weight, then returns the status immediately. If WaitForever, ReadWeight waits as long as needed until a weight is successfully read or an error occurs.
Remarks
The weighing process is performed synchronously and ReadWeight returns after finishing the weighing process.
If AsyncMode is false, ReadWeight operates synchronously.
If AsyncMode is true, weighing is performed asynchronously. ReadWeight initiates a read, then returns immediately. If ReadWeight returns a success status, weighing is started and a DataEvent containing the weight in its status parameter indicates its completion.
Note
POS for .NET does not use an assumed decimal place when reading the scale weight. The returned value is the actual value and should not be shifted before use.
ReadWeight may cause a PosControlException to be thrown with the following ErrorCode:
Value |
Meaning |
Illegal |
An invalid timeout parameter was specified. |
Timeout |
A stable non-zero weight was not available before timeout milliseconds elapsed (can only be returned if AsyncMode is false). |
ExtendedOverWeight |
The weight was over MaximumWeight (can only be returned if AsyncMode is false). |
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
UnitPrice
WeightUnit
CapPriceCalculating
SalesPrice
TareWeight