How to read Barcode Scanner?? 
Author Message
 How to read Barcode Scanner??

Hi everyone,

I installed a barcode scanner to my PC's serial port. I
want my TextBox to read the barcode once I scanned. But it
doesn't work. Do I need to do some extra programming to
read the serial port? It's said that the Barcode Scanner
is just like the keyboard, you don't need to any coding
for it, it that right?

The scanner is ok because the test program (under DOS) can
read the barcode correctly.

Thanks,
mh



Sun, 24 Jul 2005 05:45:48 GMT  
 How to read Barcode Scanner??
Hi MH,

The scanner should not be connected to your serial port.  It should be
connected via a y connection to you keyboard.  Then, when a control has
focus, the scan will be dumped into the control (textbox) just as if it were
being placed there by the clipboard.

To test this even more easily, simply open a blank document in Word and
begin scanning - if the scanner is working properly, it will scan text right
into the Word doc.

HTH,

Bernie Yaeger

Quote:
> Hi everyone,

> I installed a barcode scanner to my PC's serial port. I
> want my TextBox to read the barcode once I scanned. But it
> doesn't work. Do I need to do some extra programming to
> read the serial port? It's said that the Barcode Scanner
> is just like the keyboard, you don't need to any coding
> for it, it that right?

> The scanner is ok because the test program (under DOS) can
> read the barcode correctly.

> Thanks,
> mh



Sun, 24 Jul 2005 08:27:41 GMT  
 How to read Barcode Scanner??

Quote:

> Hi everyone,

> I installed a barcode scanner to my PC's serial port. I
> want my TextBox to read the barcode once I scanned. But it
> doesn't work. Do I need to do some extra programming to
> read the serial port? It's said that the Barcode Scanner
> is just like the keyboard, you don't need to any coding
> for it, it that right?

> The scanner is ok because the test program (under DOS) can
> read the barcode correctly.

> Thanks,
> mh

There are two common types of barcode readers. One type sits between the
keyboard and the PC and emulates a keyboard by 'typing' characters as
though it were a user, but the other type uses the serial port and returns
a stream of serial characters instead.

To read the serial port take a look at this:
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/default....

This provides a wrapper for serial communications that is very easy to use.

Source code is here:
http://download.microsoft.com/download/f/9/e/f9e23137-875f-4ec0-b391-...

Cheers,
  Jason



Sun, 24 Jul 2005 18:43:15 GMT  
 How to read Barcode Scanner??
Quote:
> The scanner should not be connected to your serial port.

Why not, I wrote a library management system for my school, and the scanner
was connected to the serial port. That was in the days of VB6, where I used
the MSCOMM control to read the serial port ;)

==============================================
Happy To Help,
Tom Spink

http://dotnetx.betasafe.com >> VB, VB.NET, C#, C++ Code

One day

Quote:
> Hi MH,

> The scanner should not be connected to your serial port.  It should be
> connected via a y connection to you keyboard.  Then, when a control has
> focus, the scan will be dumped into the control (textbox) just as if it
were
> being placed there by the clipboard.

> To test this even more easily, simply open a blank document in Word and
> begin scanning - if the scanner is working properly, it will scan text
right
> into the Word doc.

> HTH,

> Bernie Yaeger


> > Hi everyone,

> > I installed a barcode scanner to my PC's serial port. I
> > want my TextBox to read the barcode once I scanned. But it
> > doesn't work. Do I need to do some extra programming to
> > read the serial port? It's said that the Barcode Scanner
> > is just like the keyboard, you don't need to any coding
> > for it, it that right?

> > The scanner is ok because the test program (under DOS) can
> > read the barcode correctly.

> > Thanks,
> > mh



Mon, 25 Jul 2005 00:27:24 GMT  
 How to read Barcode Scanner??
Hi,

BTW, the code that I posted was VB6.  You can do the same thing in .NET
(using either MSComm, or download something like NETComm.ocx from my
homepage -- this is free).  Also, I have .NET code examples in my book.

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



Mon, 25 Jul 2005 02:30:47 GMT  
 How to read Barcode Scanner??
Hi,

Use MSComm32.ocx.

Set the Settings and CommPort properties appropriately.  Set RThreshold = 1.

Private Sub Form_Load ()
    MSComm1.PortOpen = True
End Sub

Private Sub MSComm1_OnComm
Static Buffer As String
    Buffer = Buffer & MSComm1.Input
    If InStr(Buffer, vbCr) Then
        Text1.SelText = Buffer
        Buffer = ""
    End If
End Sub

I have several examples of this sort of thing in my book, which may help
with other questions.  See below.

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



Mon, 25 Jul 2005 02:29:01 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Help Reading Barcode Scanner

2. Reading information from a barcode scanner

3. Using barcode scanner with Access

4. barcode scanner in USB port

5. vb.net and barcode scanners

6. Barcode Scanner and VB .NET

7. RF Barcode Scanner /w Visual Studio?

8. ASP with barcode scanner

9. Barcode scanners

10. Norand Barcode scanners???

11. Newbie Q: Using a barcode scanner with VB

12. Barcodes-Scanners cabled to the ethernet

 

 
Powered by phpBB® Forum Software