Search code examples
c#serial-portbarcode-scannerhidusbserial

Read USB HID Barcode Scanner Data in Background C#


I am trying to read barcode data from Honeywell USB HID Barcode scanner to C# application running in background. I mean no need to focus the element to scan, it will read in background and process it.

I have searched and tried so many thread but still not success. Please help me with some working code.

  1. Is it possible to read data in background or service?
  2. If yes then can you share some code snipped for the same.

As far as I have tried with search are trying to read from Microsoft.PointOfService and Usb.Net Library but not able to read.


Solution

  • This isn't a complete answer because you haven't mentioned the model number. However, the information below should be helpful. In order to scan in the background, you'll want to set your barcode scanner to "USB Serial" device instead of "HID". See the user manual for your scanner which should have a barcode that you can scan which will change this setting.

    Go to the Honeywell Software Download site. If you haven't already created an account, you'll need to click "Register" to create one.

    After logging in, you'll need to download/install the "Honeywell Software Download Manager". See the note which provides a URL to download it.

    Download Honeywell Scanning (HSM) USB Serial Driver

    • Expand Software
    • Expand Barcode Scanners
    • Expand Software
    • Expand Drivers
    • Expand Honeywell Scanning (HSM) USB Serial Driver
    • Click Current
    • On the right side of HSM USB Serial Driver version 3.5.32.zip, click Download. (The Honeywell Software Download Manager needs to already be installed). If necessary, allow pop-ups from Honeywell. To see the location that the file is saved to, in the "Honeywell Software Download Manager", click "Settings". The default location is %UserProfile%\Documents\Download.
    • Unzip HSM USB Serial Driver version 3.5.32.zip
    • Read "HSM USB Serial Driver Release Notes" to ensure your device is supported.
    • Read "README.txt" for installation instructions.

    If one sets the barcode scanner to "USB Serial", one can use SerialPort to communicate with the barcode scanner. There is some code here which shows how to use SerialPort to communicate with a "USB Serial" device - the code was tested with a barcode scanner.


    Also see How to get the scanner to communicate via virtual COM port / USB serial driver