LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding keystrokes to a to make a 7 digit string for a barcode input

Solved!
Go to solution

Hi, I am kind of new with this type of LabVIEW as I have mostly done DAC inputs instead of keyboard. I have a barcode reader that scans 7 digits. I have tried the keyboard aquire, but all this does is zip through the keys very fast and only shows one key at a time.

 

I don't know if this is possible, but I would like the barcode (acts like a usb keyboard) to output its string, and then have labview take those 7 characters and mash them into one string.

 

Any help on this would greatly be appreciated!

 

Thanks again

0 Kudos
Message 1 of 7
(3,533 Views)
Because it does act like a keyboard, you just need a string control. Set the key focus to the string, scan in the bar code, and that's it. You can get fancier if you want and make it a value change event or append a CR or LF and use the key navigation option to operate an 'Okay' button. etc but the basic operation is just the string control.
Message 2 of 7
(3,525 Views)
I have only really figured out how to bring in a keyboard input through "keyboard aquire", and through the "key down" event. I recieve an error when I try to add a control. I'm sorry if I am a little slow with all this.
0 Kudos
Message 3 of 7
(3,511 Views)

OK, maybe the easiest way to do this is with the "Prompt User For Input" vi.  It's in the function palette --> Programming --> Dialog and User Interface.  You do not need a keyboard acquire or event structure or anything like that.  If you want to get a bit more sophisticated or customized, you can make your own dialog box with a string control.

 

 

 

Message Edited by MattBradley on 02-13-2009 09:19 PM
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 4 of 7
(3,507 Views)
Solution
Accepted by topic author jtashman

You are making it much too complicated. You don't use the keyboard acquire at all. If you asked an operator to enter a string, you wouldn't use that, would you? No, you would just have a string control that is read.

 

Oops. the image has a mistake. There should be a True constant wired to the property node.

Message Edited by Dennis Knutson on 02-13-2009 08:21 PM
Message 5 of 7
(3,504 Views)
Thanks for all the help. I have sort of figured this out with the exception of making the keyfocus an input instead of and output. Right now the node is on the right side of the Property node.
0 Kudos
Message 6 of 7
(3,488 Views)
Right click on the property node and select "Change to Write".
Message 7 of 7
(3,486 Views)