LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to lock out the PC keyboard while allowing barcode reader input

I have an application that uses a barcode reader to enter part numbers.  I have been asked by manglement if I can lock-out the keyboard to prevent the users from typing in the part numbers (too prone to error in typing).  As the barcode reader is a separate USB port from the keyboard, is there a way to identify the keyboard port and disable it programmatically?

0 Kudos
Message 1 of 6
(10,475 Views)

If the intent is to prevent the user from manually entering the part number, why not just disable the control?

CLD | CTD
LabVIEW 2011 SP1 | TestStand 4.5
0 Kudos
Message 2 of 6
(10,473 Views)

Wouldn't that prevent the barcode reader from entering data also?

0 Kudos
Message 3 of 6
(10,469 Views)

Most bar code readers set them self up as a key board wedge at the operating system level. LabVIEW can not select between the key board or the bar code reader. To LabVIEW they seem to be the same input device.

 

Maybe your bar code reader software driver can be configured different (need to check with your bar code reader manufacture)

 

Tricks:

1Maybe you could use an event to trap on key down or key up and throw the key stroke out (I have not tried this) 

 

2Maybe you could time the key strokes. The bar code reader will be faster than what the operator could type.

Set Update Value while Typing to detect each key stroke as they happen.

 

3Program your bar code reader to add a special string to the end of the string that it reads and then test for this string in LabVIEW.

See you bar code reader setup on how to do this. I have programmed bar code readers to add stuff to what they read before passing it to the operating system. 

Omar
Message 4 of 6
(10,462 Views)

I was just about to respond and say that it is not possible and you could just unplug the keyboard. I really like Omar II's suggestion about timing the keystrokes!

=====================
LabVIEW 2012


0 Kudos
Message 5 of 6
(10,451 Views)

Since your barcode reader is USB, you may have the ability to set it up as a COM port.  Several USB readers will either behave as a keyboard or a COM port.  You would then have to modify your software to look at the COM Port.  You can change the control to an indicator and the user will not be able to do anything.

 

The other option, which is what I typically do, is to add prefix and suffix characters to the barcode scanner.  I pick a prefix that corresponds to a LabVIEW Key Navigation settign to set focus to the control.  This way, whenever the barcode scanner scans, the control is automatically highlighted and the barcode fills end.  I usually use a suffix of the ENTER key so the data is entered.

 

This way, you can hide your control off-screen so users cannot see it.  Use an indicator on-screen.  You can even set the off-screen control to be skipped while tabbing.  The other nice thing with the prefix is I can simulate the barcode with the keyboard by using the special key navigation sequence.  This is not 100% tamper-proof, but most operators aren't going to know what you are doing to skip the barcode reader unless you show them.

Message 6 of 6
(10,438 Views)