Programming dilemma, involves barcode scanners

NuclearNed

Raconteur
May 18, 2001
7,873
364
126
I have been given a task to force our users to use barcode scanners to input certain types of data instead of allowing them to type in the same data. Managment rightfully thinks that this will cut down on the number of data-entry errors caused by the users.

The barcode scanners we have are Symbol LS4071's. These units are connected to the pc through the PS2 port, in conjunction with the keyboard (i.e. the scanner connects to the pc's PS2 keyboard port, and the keyboard connects to a PS2 port on the scanner hardware, daisy-chained kind of like SCSI devices). In other words, the pc thinks that any data received from that PS2 port is coming from the keyboard, but in reality it may be coming from either the keyboard or the scanner.

I can't come up with any way to force the user to scan instead of type, because the pc can't distinguish where the data is coming from. Scanning works fine as it is, but the user could just as easily type in some data and "emulate" the scanner.

Does anyone have any good suggestions???
 

mugs

Lifer
Apr 29, 2003
48,920
46
91
Hmmm... good luck on that one. Not sure how you could do it since the computer can't differentiate between one and the other. The only thing I can think of is to measure the amount of time between "keystrokes," because the scanner would enter the data much faster than a person could type. If there's too much time between keystrokes, just clear the input. That's a sort of ghetto way to do it though.
 

NuclearNed

Raconteur
May 18, 2001
7,873
364
126
Originally posted by: mugs
Hmmm... good luck on that one. Not sure how you could do it since the computer can't differentiate between one and the other. The only thing I can think of is to measure the amount of time between "keystrokes," because the scanner would enter the data much faster than a person could type. If there's too much time between keystrokes, just clear the input. That's a sort of ghetto way to do it though.

Thanks, I've thought of some really kludgy ways that might work, but nothing that is real slick that I would be happy with. I've already told my manager that I don't think what they want can be done if we use this scanner hardware.
 

Cheetah8799

Diamond Member
Apr 12, 2001
4,508
0
76
Can you plug the barcode scanner in via a PS/2 to USB adapter into a USB port, then write your app to only accept data from the USB device?? Long shot, but might work...

In the end, it sounds like you are basically trying to do what the hardware wasn't designed for. It sounds like it is SUPPOSED to allow the user to use the keyboard and scanner at the same time. Maybe contacting the scanner manufacturer will get some results, but other than that, you may have to tell your boss that they bought the wrong scanner...
 

NuclearNed

Raconteur
May 18, 2001
7,873
364
126
Originally posted by: Cheetah8799
Can you plug the barcode scanner in via a PS/2 to USB adapter into a USB port, then write your app to only accept data from the USB device?? Long shot, but might work...

In the end, it sounds like you are basically trying to do what the hardware wasn't designed for. It sounds like it is SUPPOSED to allow the user to use the keyboard and scanner at the same time. Maybe contacting the scanner manufacturer will get some results, but other than that, you may have to tell your boss that they bought the wrong scanner...

No - the scanner connects to the PS2 port only. I think my manager agrees with me that we can't force the user to use just the scanner. We will come up with an alternate solution.
 

stevewm

Senior member
Dec 6, 2001
742
1
0
Why not change the app so it will only accept input when a certain trigger is sent?

I work with Symbol scanners and know that they can all be programmed to send any sequence of keys before and after the actual barcode data.

For example: Program the scanner to send CTRL+Page Down before each barcode. And have the application ONLY respond to input if it receives a CTRL+Page Down keystoke followed by the barcode.

This is how our POS application works. The scanner sends CTRL + /, Barcode data, ENTER

If the application does not receive CTRL+/ it assumes the data was keyed manually and searches by SKU number instead of by barcode. If it does receive the right trigger, but the cursor is not in the UPC field (the only place a barcode should ever be in our app) it traps the keystokes and pops up a error msg. This prevents barcodes from being input into the wrong fields.
 

bunker

Lifer
Apr 23, 2001
10,572
0
71
Well, I just went to Symbol's web site and read a bit about the scanner. It sounds to me like you can program the internal software on the scanner itself to modify what was scanned before sending off to the PC.

Add some funky, impossible to guess string in front of whatever is sent and make sure it contains that before allowing entry into the field.

EDIT: Heh, had this all typed up, then got called away to the server room, come back, post and lo and behold, stevewm beat me to it!
 

KLin

Lifer
Feb 29, 2000
30,246
578
126
Can you modfiy the barcode or is it coming from a 3rd party? You can add a letter to the beginning of the barcode, and if they try and type it in, and the first character is not that letter, then have it error out. Of course all it takes is for them to find out what that letter is to get around it.

I would say it comes down to training them to use the scanners, and if they still want to type in the numbers, then make them accountable for keying errors.