Unable to enable a claimed device using POS for .Net
I am using a Motorola DS4208 hand held barcode reader. In the past I was able to successfully setup and use this device, however recently it has stopped working. This may be the result of installing other devices that also use OPOS and POS for .Net interfaces.
This is a USB device so I created a Control Configuration file named *Moto_Scanner.xml* and placed it in the correct location.
<PointOfServiceConfig Version="1.0">
<Servi开发者_开发知识库ceObject Type="Scanner" Name="Example Scanner">
<HardwareId
From="HID\VID_05E0&PID_1300&REV_0100"
To="HID\VID_05E0&PID_1300&REV_0100" />
<HardwareId
From="HID\VID_05E0&PID_1300"
To="HID\VID_05E0&PID_1300" />
</ServiceObject>
</PointOfServiceConfig>
Using SOMgr.exe I can see the device in POSDevices with the proper path. I then created a LogicalName of MotoScan. It then appears in the Logical Names list as expected.
Using Microsoft Point Of Service\SDK\Samples\Sample Application\TestApp.exe I am able to open and claim the device. However, after attempting click the enable checkbox I get the following error message.
POSControlException ErrorCode(Failure) ExtendedErrorCode(0) occurred: Unable to enable the device. See inner exception for details.
System.ComponentModel.Win32Exception: The process cannot access the file because it is being used by another process
at Microsoft.PointOfService.ExampleServiceObjects.HidReader.HidThread.StartReading()
at Microsoft.PointOfService.ExampleServiceObjects.HidReader.OpenDevice()
at Microsoft.PointOfService.ExampleServiceObjects.ExampleScanner.set_DeviceEnabled(Boolean value)
Opened device: Example Scanner
Created instance of device: Example Scanner
Motorola provides an app called 123Scan to assist with configuration and testing. Using this app I can confirm the device works. This app was eventually uninstalled as part of troubleshooting.
Any suggestions will be appreciated.
Have you tried installing the OPOS driver?
EDIT:
Instead of re-linking this every time it expires, you should proactively search for "OPOS Driver" at http://support.symbol.com so that you can download the driver for the appropriate platform.
Through the learning process it became clear that opening and claiming a device does not mean it is actually connected. POS Explorer will allow you to open a connection and claim a device for exclusive use even if it not physically connected. This is partially because POS Explorer is using a Service Object to communicate with the hardware.
It is not until you enable a device, that you will have positive confirmation the device is available. In fact, if enable fails you have confirmation the device is not connected.
The Motorola DS4208 hand held scanner does not require a custom made configuration mapping file. After installing the Motorola ADK the correct Service Objects are installed and they have the Hardware Ids internally stored. In my previous code I attempted to use the "Example Scanner" Service Object available in the POS Explorer SDK to communicate with that hardware, that was my primary mistake.
After the OPOS Driver for Symbol Scanners v3.31 were installed I had not trouble testing the hardware.
精彩评论