473,471 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Scanning barcodes (urgent)

tim
Hi all

I have made a application that scans barcode. The barcode scanner is connect
to the PC via one of the USB ports.

The technique that I use is hidden textbox that constantly has the focus to
process the input on the keydown event. This works fine.

It goes wrong when the user clicks for instance on one of the listboxes.
Before start scanning the user has to click on a button on the toolbar first
to set the focus back on the textbox. In some other cases I can do that in
code.

My customer has problems to click on the button first to start scanning
again. My question is if there is a other method that constantly receives
input from a barcode scanner and process it. If have tried to monitor the
USB port but I can't figure it out how this works. What also interest me is
how other programs do this.

Hopefully someone can help me with suggestions, sample or websites with
information about this topic.

Thanks in advance.

Tim

O yes, I posted this message in two newsgroups because I develop in VB6
and/or .Net so don't' shout at me please.
Mar 13 '08 #1
4 2312
Hi Tim

tim wrote:
I have made a application that scans barcode. The barcode scanner is connect
to the PC via one of the USB ports.
The technique that I use is hidden textbox that constantly has the focus to
process the input on the keydown event. This works fine.
you probably don't need to fiddle around with programming of the
USB-port. Just set the key preview event of the form to true and monitor
the keydown event of the form instead of using a hidden textbox. In this
case, you just need to make sure that the form has focus when scanning a
code.

If those barcodes have a checksum (like EAN8 or EAN13), I suggest you
keep the last xx chars/numbers in a variable and do a checksum
calculation on that. If its valid, you just received a full barcode.
Regards,

Mathias Wuehrmann
Mar 13 '08 #2
tim
Hi Mathias,

I will look in to that. Maybe that will solve the most of my problems.

Tim

"Mathias Wührmann" <us****@flexact.deschreef in bericht
news:ek*************@TK2MSFTNGP04.phx.gbl...
Hi Tim

tim wrote:
>I have made a application that scans barcode. The barcode scanner is
connect to the PC via one of the USB ports.
The technique that I use is hidden textbox that constantly has the focus
to process the input on the keydown event. This works fine.

you probably don't need to fiddle around with programming of the USB-port.
Just set the key preview event of the form to true and monitor the keydown
event of the form instead of using a hidden textbox. In this case, you
just need to make sure that the form has focus when scanning a code.

If those barcodes have a checksum (like EAN8 or EAN13), I suggest you keep
the last xx chars/numbers in a variable and do a checksum calculation on
that. If its valid, you just received a full barcode.
Regards,

Mathias Wuehrmann

Mar 13 '08 #3
Well, perhap you can get it to work. However, IMO, industrial-strength
applications should NOT use keyboad (HID) scanners. For a few dollars more,
one with a serial interface will work flawlessly, and won't require any
coding tricks (none of which I've been able to get to work reliably).

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.
Mar 13 '08 #4
Dick Grier is right that the serial communications approach is the
best way to go although you may not need to purchase a new scanner.
You should check with the manufacturer of your bar code scanner to see
if they have a "Virtual COM Port" driver for your scanner that you can
use instead of the "keyboard wedge" interface.
Most USB scanners come from the factory configured as a "keyboard" and
when you connect them to the USB port on a PC, Windows loads the built
in Windows USB keyboard driver and the scanner works as a second
keyboard connected to your PC. Metrologic, Handheld Products and most
other scanner manufacturers also have special "Virtual COM Port"
drivers that you can use although you may have to download the special
driver from the manufacturers web site. What you have to do is to
first install the Virtual COM port driver in your PC and then you have
to scan a special bar code in the users manual for the scanner that
will switch it from a keyboard wedge scanner to a "serial" scanner.
This basically reprograms the scanner so that when you connect it to
the USB port on your PC, the new Virtual COM port driver will load
instead of the original keyboard driver.
The driver will create a COM port that will show up in your Windows
Device Manager typically as COM4 or COM5.
You would then use serial communications code in your application to
read in the data from the scanner through the COM port.


On Thu, 13 Mar 2008 10:25:41 +0100, "tim" <tn****@hotmail.comwrote:
>Hi all

I have made a application that scans barcode. The barcode scanner is connect
to the PC via one of the USB ports.

The technique that I use is hidden textbox that constantly has the focus to
process the input on the keydown event. This works fine.

It goes wrong when the user clicks for instance on one of the listboxes.
Before start scanning the user has to click on a button on the toolbar first
to set the focus back on the textbox. In some other cases I can do that in
code.

My customer has problems to click on the button first to start scanning
again. My question is if there is a other method that constantly receives
input from a barcode scanner and process it. If have tried to monitor the
USB port but I can't figure it out how this works. What also interest me is
how other programs do this.

Hopefully someone can help me with suggestions, sample or websites with
information about this topic.

Thanks in advance.

Tim

O yes, I posted this message in two newsgroups because I develop in VB6
and/or .Net so don't' shout at me please.
Mar 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: CHANGE username to westes | last post by:
What are the most popular, and well supported, libraries of drivers for bar code scanners that include a Visual Basic and C/C++ API? My requirements are: - Must allow an application to be...
8
by: DS | last post by:
Does anyone know anything about barcodes in Access. I don't want to create them in Access. I merely want to scan whats already been created. I need to scan Liquor bottles. I have the scanner...
1
by: Curtis | last post by:
I am researching a project that involves controling a high speed document scanner. I am trying to find a .Net capable library to access the TWAIN drivers for the image scanners to automatate the...
1
by: miconib | last post by:
Hello everyone. I am not really a databse pro like most of you here, but i did make a small access database for our warehouse to scan serial numbers into the system. I have a few questions if anyone...
2
by: nmrpa91290 | last post by:
Hi, I am in the design phase of building a database that will track the productivity of my warehouse. I am thinking of using a barcode scanner to assist me with this. Employees will hopefully...
1
by: Fine | last post by:
When any person enters any shop and buy some items then goes to where he pays the prices of his items, the person there make scanning to each item to know what's the price? I am asking how this is...
7
by: jim | last post by:
I need to have 2 simple barcode reader applications finished by midnight tonight. I have never written any barcode reader software and need any help that you may be able to offer. I do not know...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.