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

試著忘記壹切 提交于 2020-07-23 06:19:29

问题


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();

回答1:


You are confused about different kinds of usage.

  • USB HID Keyboard
    It emulates keyboard input and requires no additional drivers or software.
    In other words, it cannot be controlled by software.

  • PointOfService tag
    This mainly belongs to the API used in UWP, and it is necessary to set the hardware mode to use this method.
    The LS2208 may not support this mode.
    The DS2208 is supported.
    Windows.Devices.PointOfService Namespace
    Supported Point of Service Peripherals

  • scannerList = new ArrayList(explorer.GetDevices("Scanner"));
    The software you are trying to use is POS for .NET.
    The LS2208 supports OPOS/JPOS, but does not directly support POS for.NET.
    SYMBOL LS2208 GENERAL PURPOSE BARCODE SCANNER SUPPORT
    However, you can use OPOS from POS for .NET via Legacy Interop System.
    POS for .NET Architecture (POS for .NET v1.12 SDK Documentation)

For that, the following steps are required.

  • Install Zebra OPOS Driver (included in Scanner SDK for Windows).
    Support and Downloads > OPOS Driver Downloads & Support / SCANNER SDK FOR WINDOWS
  • Install CommonControlObjects.
    MCS: OPOS Common Control Objects - Current Version
  • Specify to search OPOS devices in the parameter of GetDevices().
    DeviceCompatibilities.Opos or DeviceCompatibilities.OposAndCompatibilityLevel1
    PosExplorer.GetDevices Method (String, DeviceCompatibilities) (POS for .NET v1.12 SDK Documentation)
    DeviceCompatibilities Enumeration (POS for .NET v1.12 SDK Documentation)

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#



来源:https://stackoverflow.com/questions/62994014/why-isnt-my-scanner-in-the-posexplorer-getdevices-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!