LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Device ID

Hi,

I have 2 USB Barcode Scanner. My problem is that when a barcode is scanned to barcode scanner, how can i find to use which barcode scanner ?

0 Kudos
Message 1 of 4
(2,559 Views)

Well, if they are both connected and your program can see both of them, then the one that Scans will have a "message", while the other one will not.  So try to read both, see which one returns anything.

 

Bob Schor

0 Kudos
Message 2 of 4
(2,529 Views)

I think the problem maybe that barcode scanners generally act as HID, or more specifically, a keyboard.  If you plugin a USB barcode scanner, Windows will usually see it as a keyboard, and when you scan something, that barcode scanner will just type the characters as if it were a keyboard.  There are typically other settings like telling the barcode scanner to add a return or tab at the end of a scan.

 

In these cases I don't think you'll get much luck out of knowing which scanner scanned what.  Even if you were able to read into the device ID from Device Manager (which I think you can do or using devcon) the problem is once a scan takes place you have no more information other than the text it scanned, not its origin.

 

So to help we will now need more information.  What is the make and model of the scanner?  Is there other drivers available?  A DLL?  Sample code?  There is likely a more low level API that can do thinks like invoke a scan in software, and with that you might be able to find which one was which.

 

In the past I specifically ordered RS-232 scanners, so that I would know which one I was reading from, because I knew which COM port was which.  This of course complicates the software because it no longer just types things like a keyboard but more control is possible for things like this.

0 Kudos
Message 3 of 4
(2,498 Views)

Depends on the scanner. Some Symbol scanners have an alternate mode where they will enumerate as separate COM devices instead of being aggregated into a single COM device.

 

If you are dealing with a scanner that only functions as a Keyboard wedge, then see if you can enable different Sentinel characters for each scanner. Then you can filter the contents of one from the other. I would try to avoid this setup as there may be confusion with a regular keyboard input.

 

Cheers!

0 Kudos
Message 4 of 4
(2,495 Views)