Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Barcode Scanner Communication

Barcode Scanner Communication

Barcode Scanner Communication

Sorry this might be terse, I didn't want to get overly verbose and wanted to get straight to the point.

I'm having trouble finding anything on how to read from a barcode scanner in HID mode.

No, I do not want to use: Windows.Devices.PointOfService.BarcodeScanner - I need to be able to target Win7 (and higher of course).

No, I do not want to use: POS for .NET - tried it and failed at it, most likely needs special drivers in serial mode.

I've seen in the USB POS specification usage page 0x8C targets barcode scanners. Theoretically something should work from here when the scanner is in HID mode, but when using RegisterRawInputDevices I haven't been seen WM_INPUT raised (I was successfully reading keyboard data, so the supporting code works).

I'm looking to find or build a library for getting data from barcode readers with the following requirements:
  1. Scanner must be in HID mode
  2. ANY scanner brand
  3. No special drivers should need to be installed
  4. Must work in WinForms
I've just about exhausted my searching powers and can't find anything. I've tested that BarcodeScanner class in the universal api, and it works great, but I need to target Win7 - not just 10. I've attempted to figure out how that class works, to no avail. I suspect it might use the USB HID specification - but I'm not sure how, and my tests in RegisterRawInputDevices haven't gotten any Usage ID in the 0x8C usage page to reveal any data.

Any thoughts on the direction I need to take, where to look, etc... would be greatly appreciated.

RE: Barcode Scanner Communication

HID means the scanner is acting as if there was an additional keyboard, that's all to it.
Put a textbox on your form and set the text cursor into it, then scan, it doesn't matter, that you see no WM_INPUT message, you'll likelier find WM_KEYDOWN and WM_KEYUP messages.

Bye, Olaf.

RE: Barcode Scanner Communication

That's what I originally thought too, but that's not exactly what HID means (though it can mean that - depending on the scanner).

I actually have used a textbox in the past, and it would actually be required for some barcode scanners - but I've found some users (and there seems to be a growing number of them) find it a difficult concept that they must focus a textbox first before scanning.

By using a method other than the textbox, it is simpler for user - plus there is the advantage of being able to get the type of barcode (UPC, EAN, ISBN, etc...).

Which is why I'm investigating the USB HID Point of Sale usage tables: http://www.usb.org/developers/hidpage/#Point of Sale.

I'll post back some details on the difference between keyboard and HID mode when I have some documentation in front of me.

RE: Barcode Scanner Communication

Got some docs. I've been testing on some Honeywell scanners (Granit 1981i, Voyager 1202g-bf, and Xenon 1902g), and the configuration seemed to work the same on all of them.

There is a few USB keyboard modes though I've tested only config code PAP124 (Keyboard [PC]) and this worked as expected, just like a second keyboard on the system.

There is however a USB HID mode called "USB HID Bar Code Scanner" (config code PAP131) and this is the mode I'm interested in. This worked with the BarcodeScanner class of Win 10 apps, and I would have assumed worked according to the USB specification linked above. I just don't know how to work with the device in that mode.

RE: Barcode Scanner Communication

So it's a hidden human interface device ;)

Well, I fear I can't help you with these modes. What I did was programming scanners to "preamble" everything with a function key F8. And in the application, that function key was configured to focus a textbox (or vice versa), so users wouldn't need to press F8 manually, but I see how this mode could help getting to the scanned barcode and even further info without such tricky configuration.

Bye, Olaf.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close