LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

barcode reader using RS-232

How am i going to read barcodes via RS-232 using LV 7.1?
 
I have searched for a sample code, please refer to the attachment, but it's only keyboard-compatible barcode reader.
 
Thanks alot for the your future answers.
 
 
Maharlika
0 Kudos
Message 1 of 7
(3,853 Views)

It's not clear precisely what you are asking for.

Reading data from an RS-232 bar code scanner should be much trhe same as reading from any other serial device - check for examples of using serial IO in the LabVIEW examples.

You'll need to specify which serial port the scanner is plugged into, the baud rate, number of bits per character, number of stop bits, parity bits on or off.

You can read characters as they become available in a while loop, terminating the while loop when the scanner sends an end character.

You may want to flush the serial IO buffer before reading a new bar code scan, in order to avoid reading any backlog of old scans.

If you have more specific questions, do ask - but please try to be more specific.

   

0 Kudos
Message 2 of 7
(3,843 Views)

Hi Maharlika,

As Mark mentionned, the barcode reader is basically treated as a regular serial device.  From my past experience with many barcode readers, you will need to go through the User Manual and follow the steps to "setup & calibrate" the scanner, before you can use it.  This sets up the serial port configuration, the type of characters (ASCII), bar-code types, etc.  Simply follow the instructions and you should be fine.

JLV

Message 3 of 7
(3,840 Views)

Hi,

If it's a keyboard (AT/PS2) type of barcode scanner, then you don't have to do anything.  You basically would bring a String control on your panel into focus and then scan the barcode.  The barcode scanner should input the characters read right into the String control -- as if someone actually typed those characters in there. 

I suggest you test this first in another program, like Notepad, to rule out any issues with the scanner itself.

Regards,

-Khalid

 

0 Kudos
Message 4 of 7
(3,827 Views)


@Khalid wrote:

I suggest you test this first in another program, like Notepad, to rule out any issues with the scanner itself.




Yes, testing it is a very good idea.

You can use Notepad if it is a wedge-type (keyboard emulator) or USB scanner.  Use Hyperterminal for serial port (RS-232) types of scanners.

JLV

Message 5 of 7
(3,824 Views)
Thanks alot to you all for generously sharing your ideas. I'll try all of these info. Thanks again.
0 Kudos
Message 6 of 7
(3,804 Views)

You are welcomed.

Also let us know if it worked..  🙂

Message 7 of 7
(3,792 Views)