为什么我的扫描仪不在PosExplorer.GetDevices()列表中? [英] Why isn't my scanner in the PosExplorer.GetDevices() list?

查看:205
本文介绍了为什么我的扫描仪不在PosExplorer.GetDevices()列表中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已插入LS2208扫描仪,我通过阅读在手册中找到的条形码尝试了以下列出的扫描仪模式.在"USB HID键盘"中,和"OPOS(具有完全禁用功能的IBM手持设备)";模式下,我可以使用扫描仪将条形码读取到文本文档中.

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键盘

IMB台式USB

IBM手持USB

OPOS(具有完全禁用功能的IBM手持设备)

OPOS (IBM Hand-held with Full Disable)

简单的COM端口仿真

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:

{ 服务对象名称:Microsoft扫描仪模拟器, 说明:扫描仪的模拟服务对象, 制造商:Microsoft Corporation, 类型:扫描仪 服务对象版本:1.14.1.0, UPOS版本:1.14, 兼容性:CompatibilityLevel1, 硬件描述: 硬件ID :、 硬件路径: 默认值:False}

{ 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}

{服务对象名称:示例扫描仪, 逻辑名称: 说明:示例扫描器的服务对象, 制造商:Microsoft Corporation, 类型:扫描仪 服务对象版本:1.14.1.0, UPOS版本:1.14, 兼容性:CompatibilityLevel1, 硬件描述: 硬件ID :、 硬件路径: 默认值: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}

尝试连接到其中任何一个都会引发异常:必须在调用Open()之前由服务对象定义'DevicePath'属性的值."

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."

我假设简单COM端口仿真"模式将模拟串行端口输入,但扫描仪也未出现在串行端口列表中.

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

推荐答案

您对各种用法感到困惑.

You are confused about different kinds of usage.

  • USB HID键盘
    它模拟键盘输入,不需要其他驱动程序或软件.
    换句话说,它不能由软件控制.

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

PointOfService标签
这主要属于UWP中使用的API,必须设置硬件模式才能使用此方法.
LS2208可能不支持此模式.
支持DS2208.
Windows.Devices.PointOfService命名空间
支持的服务点外围设备

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"));
您尝试使用的软件是POS for .NET.
LS2208支持OPOS/JPOS,但不直接支持POS for.NET.
SYMBOL LS2208通用条码扫描仪支持
但是,您可以通过旧版互操作系统从POS for .NET使用OPOS.
用于.NET体系结构(POS的POS适用于.NET v1.12 SDK文档)

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)

例如,请参考本文以了解如何使用.
问题尚未解决,但可以使用GetDevices().
为什么霍尼韦尔POS4NET为两个不同的扫描仪触发相同的事件?
pos资源管理器在C#中找不到连接到系统的任何设备

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#

这篇关于为什么我的扫描仪不在PosExplorer.GetDevices()列表中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆