LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Disable Keyboard Input- Allow USB Barcode Scanner Input

Hi All,

 

I've searched the discussion forums looking for an answer but I cannot. This has to be simple to do.....however I can't seem to find a simple answer.

 

Here is all I want to do:

 

Disable keyboard entry on a particular Text box on the fron panel.

Allow the user to scan a value into that textbox (USB scanner).

 

The reason for this is that I don't want people enter serial numbers manually.....only through scanner. No, i don't want to disconnect the keybaord from the computer.

 

Sounds simple but I can't find a good solution. There has to be a property node or sequence I can do to obtain this.

 

Thanks

 

0 Kudos
Message 1 of 11
(22,489 Views)
Unfortunately most barcode scanners use the same methods that every other HID device does - keyboards included.

We fight with the same thing here, really comes down to process control. If you really wanted to get crazy with it, you could look at the speed the characters were entered.
0 Kudos
Message 2 of 11
(22,484 Views)

See Matthew Kelton's reply at the end of this thread http://forums.ni.com/t5/LabVIEW/I-want-to-lock-out-the-PC-keyboard-while-allowing-barcode-reader/td-...

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


Message 3 of 11
(22,481 Views)

Thanks all.

 

Yes, I saw that thread already. I just thought that there had to be some sort of property node for it but I guess not. I will try the character speed option as that seems to be the only solution.

 

 

0 Kudos
Message 4 of 11
(22,455 Views)
Nope, no property node. As far as LabVIEW and the OS are concerned, input is from someone typing at the keyboard.
=====================
LabVIEW 2012


0 Kudos
Message 5 of 11
(22,446 Views)

I like the way Matthew Kelton did it. For me, adding a prefix and suffix to the scan is inconvenient because our barcode scanners are used for multiple things (other software). The way I did it is to use a key event and time the interval between keypresses.

 

Here is an example of what I mean.

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


0 Kudos
Message 6 of 11
(22,424 Views)

Hate to resurrect a dead thread but I think this solution is a little more simple.

 

Just an event structure with 2 cases. 

 

Case 1: A 20 millisecond timeout that jus reset the input String (I don't think anybody can type that fast, but in any case, the barcode scanner works even at 5 milliseconds)

 

Case 2:  Has the string input and is looking for value change. If the string length is greater than 2 than the For loop that contains the case stop. 

 

 

Please provide feedback

0 Kudos
Message 7 of 11
(17,528 Views)

@Jeannius wrote:

...

 

Just an event structure with 2 cases. 

 

Case 1: A 20 millisecond timeout that jus reset the input String (I don't think anybody can type that fast, but in any case, the barcode scanner works even at 5 milliseconds)

 

Case 2:  Has the string input and is looking for value change. If the string length is greater than 2 than the For loop that contains the case stop. 

 

 

Please provide feedback


I didn't look at the VI. I think this is similar to what SnowMule suggested.

Ctrl-C, Ctrl-V may defeat your timeout.

At a previous company, we explicitly went to Barcode scanners that had a serial interface over a COM port rather than barcode scanners that act as keyboards.

0 Kudos
Message 8 of 11
(17,525 Views)

I have modified and briefly checked that this new one cannot be defeated by CTR-V.

 

Basically it is looking for 2 cases to terminate the loop: length of string must be greater than 2 AND the "Line Feed" Character must be present in the string. I don't know of a way to copy and paste this character (again I may be naive or mistaken or both). But at any rate, I think this is a decent attempt.

0 Kudos
Message 9 of 11
(17,483 Views)

This looks pretty reasonable and will work in most cases.

 

The following questions are mostly devil's advocate, pathological type questions:

1) Will your scanned string always have a line feed? I've seen a wide variety of barcode strings when working for different companies.

2) Will your scanned string always be multiple characters? I've even seen companies that use barcode stickers for Rev letters where the only text on the barcode is "A"

 

LabVIEW type questions

Do you really need the field clearance to be done with a Value(Signaling) property node? This is slow and requires UI thread swaps. This is one case where I think a local variable may be better.

Any thoughts about putting this into an XControl?

In your final version, you can probably drop the hidden indicators.

0 Kudos
Message 10 of 11
(17,476 Views)