Hacker News new | ask | show | jobs
by mkopinsky 1397 days ago
Unrelated barcode question, to take advantage of a technical audience with knowledge in such things:

I have a use case where users are trying to scan 2d Pharmaceutical Product barcodes (https://www.gs1.org/docs/healthcare/GS1_Healthcare_Implement...) containing lot number, expiration date, and so on. We're mostly using Realinn 6200 scanners, some bluetooth some hardwired. In my testing, the FNC1 character gets sent to my Mac as '29', and to the warehouse PCs as '↔'. They also have chromebooks in the warehouse, and as far as I can tell the Chromebooks are just dropping the FNC1 character entirely from the barcodes.

I can not figure out how to program the RL6200 scanners to replace FNC1 with another character - only to add/remove a prefix/suffix.

Is this a known issue? Do I need a different scanner which can be programmed to substitute characters? Throw out the chromebooks in favor of Windows machines?

3 comments

Do you have the scanner set up as a keyboard wedge (USB-HID)? From your description, it sounds like it. Usually when dealing with control characters it's easier to put scanners in virtual COM mode. Although using them as a COM device does carry its own set of issues. I'm more familiar with honeywell and cognex scanners, but quickly browsing the realinn documentation I don't see a character replacement functionality.
Yes, the scanner is operating as a keyboard HID. I'll look into whether virtual COM could work. Will that still let it type into random webapp pages (how I use it now), or does that tie it rigidly to specific applications? (This question is based on this language from the Realinn manual - "9.2 USB virtual COM mode In USB virtual COM mode, the scanner needs to work with driver and serial software.Expected final behavior is that even if you open up another page, the scanned information will show up in the window of serial software. Please let us know if you need to set it to USB virtual COMmode,we will send you the driver."

I assume that Virtual COM works with both USB and bluetooth?

If you're entering into a webpage, your best bet may be a different scanner. Virtual COM generally ties it to native applications (website COM interfaces are possible, but I'm assuming the website isn't yours to modify).

Another possibility is writing a native app that works like a shim: reading from the COM port and using APIs (e.g. SendKeys on Windows) to re-transmit the characters as keystrokes. But the most robust solution is probably a different scanner.

The website is mine to modify. I wouldn't go to great lengths to change things to support virtual COM, but if it's just a question of adding a few lines of javascript to listen to virtual COM and map to keypress events that would be possible.
I'm not familiar with that scanner, however that sounds like a scanner issue. I haven't had that issue with GS-128 with the couple scanners I & colleagues have tried. I did a google search and in the Amazon reviews there is someone purporting to be from the manufacturer saying to email them to learn how to make it work, with regards to FNC1.
Are you using Chromebooks specifically?

If so, can I ask which barcode scanner(s) you're using which does work? The easiest solution may just be to buy a different scanner.

I did also email the manufacturer - let's see if they have a solution.

Can you determine what USB HID code(s) the scanner is sending for that? (Perhaps using wireshark, or usbmon on linux, …) Some years ago I worked on ChromeOS keyboard input, and I can probably tell you right away what it'd do with it. Basically, is the USB code in https://source.chromium.org/chromium/chromium/src/+/main:ui/...

Alternatively (but probably less usefully), try it on https://w3c.github.io/uievents/tools/key-event-viewer.html

We haven't used Chromebooks, sorry. For scanners a number of cheap to pricey ones were tried. On the cheap end I don't have the exact model number but I think it was about $30USD from Netum, as well as using apps in cheaper smart-phones using the built-in camera.

I'd guess it's the scanner though, I don't think those control characters are supposed to be sent.

I would recommend at least trying the big names - shouldn't be much to buy a few of them.
I've written applications for health care use, in my experience I'd recommend sticking to Honeywell and/or Zebra scanners. They are very popular in healthcare and easy to program, good documentation.

I'd check with your vendor to see if there is a barcode that you can scan to toggle the function code transmit, this is what I did with Honeywell anyway.