accessing a barcode scanner

  • Thread starter Thread starter Heath P. Dillon
  • Start date Start date
H

Heath P. Dillon

Hi,

I have POS machine with windows XP thats been dumped on me to figure out
what it can do.

Its got a USB barcode scanner built in, drivers installed, and it works but
how can I use this in a vb.net application ?

Do I have to get some sort of custom control for it or can I do some sort of
USB interface coding to get it to put the bar code data into my app?
 
Does the scanner work when you scan a barcode in notepad (this would
work if the hardware is keyboard-wedge type)? If it does, then you
don't have a problem. Just put a textbox control in your form, scan
the barcode, and get the textbox.text.

If nothing is displayed when you scan from notepad, then you probably
have to obtain some kind of a keyboard emulator that will send the
scanner's scanned data as a keyboard input. You can also create your
own emulator, just watch the scanner's serial port# from your
application and process whatever data is coming in from that port.

hth,

diego
 
Does the scanner work when you scan a barcode in notepad (this would
work if the hardware is keyboard-wedge type)? If it does, then you
don't have a problem. Just put a textbox control in your form, scan
the barcode, and get the textbox.text.

If nothing is displayed when you scan from notepad, then you probably
have to obtain some kind of a keyboard emulator that will send the
scanner's scanned data as a keyboard input. You can also create your
own emulator, just watch the scanner's serial port# from your
application and process whatever data is coming in from that port.

hth,

diego
 
This depends on the barcode scanner details. If the driver provides an API,
or if it interfaces via a virtal serial port (by far the best two methods),
then it will be rather simple. The details would vary, of course.

If, however, the scanner is a HMI device that emulates a keyboard device,
then you have to provide a texbox that has focus to receive the scanned
data. You then can parse the data in the KeyPress event, or use some
mechanism (a timer, perhaps) to determine when all data have been received
and are ready to process -- or simply use the data directly by having the
user scan, then proceed to the next step manually. The "issue" with this
kind of scanner is that the user may, accidentally, move focus from the
textbox that you've designed to receive the input data -- and somewhat
random things may happen.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
This depends on the barcode scanner details. If the driver provides an API,
or if it interfaces via a virtal serial port (by far the best two methods),
then it will be rather simple. The details would vary, of course.

If, however, the scanner is a HMI device that emulates a keyboard device,
then you have to provide a texbox that has focus to receive the scanned
data. You then can parse the data in the KeyPress event, or use some
mechanism (a timer, perhaps) to determine when all data have been received
and are ready to process -- or simply use the data directly by having the
user scan, then proceed to the next step manually. The "issue" with this
kind of scanner is that the user may, accidentally, move focus from the
textbox that you've designed to receive the input data -- and somewhat
random things may happen.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.
 
Back
Top