LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bar code scanner

I have three HID devices on my computer:  keyboard, mouse, and bar code scanner.  I want to be able to enter data into a control on my front panel using either the keyboard or the scanner.  I want to be able to set the focus to that control by tabbing on the keyboard, clicking mouse down in the control, or programmatically.  Setting the focus seems to be my problem.  I have written a VI that handles the various methods of scanner operation using an action engine (AE) but the control that I want to fill is on the front panel of my user interface VI.  To make the connection, I have registered the reference to the front panel control into a shift register in my AE during initialization.  When it is time to collect data via the scanner, I turn on the backlight, place the part on the scanner window, and set the key focus to the reference of the front panel control using a property node.  Still, no data is placed into the control.

 

Does anyone have any ideas to remedy this problem?

0 Kudos
Message 1 of 5
(2,669 Views)

It is kind of hard to help without seeing your code.  Smiley Wink  Please post your VI's including the action engine that handles the scanning.

0 Kudos
Message 2 of 5
(2,662 Views)

I have made some progress just making the front panel wrapper demo attached.  There seems to be some limitations that I don't understand on this approach.

 

Here's what works:

1.  Execute front panel.vi from the front panel window.

2.  Type something.

3.  Hit Enter.

 

Here's what I thought would work and didn't.

1.  Execute the Link to Self method of scanner.vi.

2.  Execute the Initialize method of scanner.vi.

3.  Execute the Read Code method of scanner.vi.

4.  Type something.

5.  Hit Enter.

 

After further investigation, I realized that the Test Indicator is truly and indicator which you can't type into.  Doh!

 

Changing it to a control fixes the problem.

Download All
0 Kudos
Message 3 of 5
(2,656 Views)

Hey kc64,

 

I needed to add a scanner to my test stations to read in serial numbers. I started as you have by manipulating the focus. But that became cumbersome and ultimately not usable. What worked best was to use the usb scanner in serial port emulation mode, then have a small loop that picks up the data up at the port. I also added the feature of being able to enter a serial number manually, by pressing a button and utilizing a pop up dialog screen.Turned out very nice and stable.

 

See attached jpeg.If you want more info let me know.

~~~~~~~~~~~~~~~~~~~~
Paul Johnson
Renco Encoders, Inc
Goleta, CA
~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 5
(2,644 Views)

Paul--

 

Thanks for your advice.  I took it and the new solution is working out nicely.

 

Thanks,

kc64

Message Edited by kc64 on 12-08-2008 02:50 PM
0 Kudos
Message 5 of 5
(2,596 Views)