Share via


Scanner Class (POS for .NET v1.12 SDK Documentation)

2/27/2008

Defines the programmatic interface for a UPOS Scanner device.

Namespace: Microsoft.PointOfService
Assembly: Microsoft.PointOfService (in microsoft.pointofservice.dll)

Syntax

'Declaration
Public MustInherit Class Scanner
    Inherits PosCommon
public abstract class Scanner : PosCommon
public ref class Scanner abstract : public PosCommon
public abstract class Scanner extends PosCommon
public abstract class Scanner extends PosCommon

Remarks

The Scanner device reads encoded data from a label.

The Scanner class follows the general programming model for event-driven input:

  • When input is received by the Service Object, it queues a DataEvent.

  • If the AutoDisable property is true, the Service Object disables itself when a DataEvent is queued.

  • A queued DataEvent can be delivered to the application when the DataEventEnabled property is true. Just before delivering this event, the Service Object copies the data into properties and disables additional data events by setting the DataEventEnabled property to false. Later input data is queued by the Service Object while the application processes the current input and associated properties. When the application has finished the current input and is ready for more data, it should enable events by setting DataEventEnabled property to true.

  • One or more ErrorEvent events will be queued if the Service Object encounters an error while collecting or processing input. Those events are delivered to the application when the DataEventEnabled property is true.

  • The application can read the DataCount property to obtain the number of DataEvent events queued by the Service Object.

  • The application can delete all input queued by the Service Object by calling the ClearInput method.

The Service Object puts scanned data in the ScanData property. If the application sets the DecodeData property to true, the Service Object decodes the data and puts it in the ScanDataLabel and ScanDataType properties.

The Scanner is an exclusive-use device. Therefore:

  • The application must claim the device before it enables it.

  • The application must claim and enable the device before the device begins reading input.

Inheritance Hierarchy

System.Object
   Microsoft.PointOfService.PosDevice
     Microsoft.PointOfService.PosCommon
      Microsoft.PointOfService.Scanner
         Microsoft.PointOfService.BasicServiceObjects.ScannerBasic

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

Scanner Members
Microsoft.PointOfService Namespace