LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Any serial input read vi for barcode scanner?

Hello,

 

I need read the barcode scanned by the scanner plug into the USB port from the VISA port, instead of read the string input of a LabView popup.

There is a good example for single key and mouse input, but I have not found an example to do the same for the barcode scanner which is what I need.

Any example of idea is highly appreciated!

 

C:\Program Files (x86)\National Instruments\LabVIEW 2015\examples\Connectivity\Input Device Control\Monitoring Keyboard and Mouse Activity.vi

BigDrum_0-1736404232544.png

 

0 Kudos
Message 1 of 7
(133 Views)

Hi Drum,

 


@BigDrum wrote:

I need read the barcode scanned by the scanner plug into the USB port from the VISA port, instead of read the string input of a LabView popup.


Do you really use a barcode scanner with a serial interface?

(A virtual COM port over USB also counts as "serial interface".)

 

Then all you need is to use the VISA functions, especially for the serial port. Open the port, send commands as needed, read the messages of the scanner, close the port…

(Using those mouse/keyboard/joystick functions will not help you with serial ports!)

 

All you need to know about communication over serial ports is here!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(125 Views)

When I connect my barcode scanner to my laptop USB port, in Device Manager, it shows up as the 3rd "USB Composite Device" (no COM number). So I do not know the VISA resource name to use VISA functions.

BigDrum_0-1736407058729.png

I tried renaming "USB Composite Device" to "barcode scanner" according to this but it errors out. Maybe the question is how to get the resource name when plug the barcode scanner.

How to rename Hardware in Device Manager of Windows 11/10

 

0 Kudos
Message 3 of 7
(111 Views)

Hi Drum,

 

when the scanner doesn't provide a (virtual) serial port then it doesn't make sense to ask for "serial input VI" or VISA functions!

 

Which kind of scanner do you use?

What does its manual say about its communication protocol(s)?

The manual is your only source of information on this topic...

 

Trying to "rename" a device in the device manager will NOT help you with device communication!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(95 Views)

Currently I am using a Honeywell Xenon Ultra scanner.  But I am trying to write vi that works for the common plug and play scanner which can scan right after plug in USB port.

 

I do not understand why plug it in, but in Device manager not show in Ports, maybe the protocol is different?

 

 

0 Kudos
Message 5 of 7
(85 Views)

Hi Drum,

 


@BigDrum wrote:

I do not understand why plug it in, but in Device manager not show in Ports, maybe the protocol is different?


Most probably yes.

Again: the only source of information is the manual for your specific scanner!

 


@BigDrum wrote:

But I am trying to write vi that works for the common plug and play scanner which can scan right after plug in USB port.


I worked with scanner, that are configured as "keyboard".

And I worked with scanners, that provided a communication port so you can send commands and receive answers. That could be a serial port, but also a LAN port…

 

What is your "common plug and play scanner" exactly?

Why do you need to write a VI for such a scanner???

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(79 Views)

@BigDrum wrote:

Currently I am using a Honeywell Xenon Ultra scanner.  But I am trying to write vi that works for the common plug and play scanner which can scan right after plug in USB port.

 

I do not understand why plug it in, but in Device manager not show in Ports, maybe the protocol is different?

 


Usually Bar Code Scanner may support different modes. One is simple "Keyboard emulation", then RS 232 emulation, and some special advanced cases - using provided API. 

I have no experience with this particular scanner, but see in the manual the configuration codes for Honeywell (sorry for screenshots in German):

 

Screenshot 2025-01-09 09.14.27.png

Try to scan first code and download and install driver as stated in the manual.

 

Message 7 of 7
(77 Views)