Search code examples
c#barcode-scannerpointofservice

Why isn't my scanner in the PosExplorer.GetDevices() list?


The LS2208 scanner is plugged in, I tried the scanner modes listed below by reading barcodes I found in the manual. In "USB HID Keyboard" and "OPOS (IBM Hand-held with Full Disable)" modes I can read barcodes into a text document with the scanner.

USB HID Keyboard

IMB Table Top USB

IBM Hand-Held USB

OPOS (IBM Hand-held with Full Disable)

Simple COM Port Emulation

explorer = new PosExplorer();
scannerList = new ArrayList(explorer.GetDevices("Scanner"));

All I'm seeing in the list is two scanners, which are always visible even when nothing is plugged in the computer:

{ Service Object Name: Microsoft Scanner Simulator, Description: Simulated service object for scanner, Manufacturer: Microsoft Corporation, Type: Scanner, Service Object Version: 1.14.1.0, UPOS Version: 1.14, Compatibility: CompatibilityLevel1, Hardware Description: , Hardware Id: , Hardware Path: , Default: False}

{Service Object Name: Example Scanner, Logical Names: , Description: Service object for Example scanner, Manufacturer: Microsoft Corporation, Type: Scanner, Service Object Version: 1.14.1.0, UPOS Version: 1.14, Compatibility: CompatibilityLevel1, Hardware Description: , Hardware Id: , Hardware Path: , Default: False}

Trying to connect to either of them throws an exception: "The value of the 'DevicePath' property must be defined by the service object before Open() can be called."

I assumed the "Simple COM Port Emulation" mode would simulate serial port input, but the scanner did not appear in the serial port list either.

System.IO.Ports.SerialPort.GetPortNames();

Solution

  • You are confused about different kinds of usage.

    For that, the following steps are required.

    For example, please refer this article for how to use.
    The question is not solved, but the usage of GetDevices() is okay.
    Why does Honeywell POS4NET fire the same event for two different scanners?
    pos explorer is not finding any device connected to the system in C#