Home All Groups Group Topic Archive Search About

using com-port in VB.net

Author
31 Aug 2006 2:08 PM
Wim Linders
Hi,

I have to capture data from the com-port that comes from a barcode-scanner
with rs232-cable.
What is the best way to do it in .net?

In my first attempt i used the msComm-ocx (the one that came with vb6). This
worked on my computer, but after deploy on the computer the programm is
supposed to run on, i encountered errors...

In a second attempt i wanted to use the rs232-class that is provided in a
microsoft-code sample:
(http://www.microsoft.com/downloads/details.aspx?FamilyID=075318ca-e4f1-4846
-912c-b4ed37a1578b&DisplayLang=en)
But i can't get this to work

Does somebody has experience on this matter ?
Thanks already for a reply...

regards
Wim

Author
31 Aug 2006 3:16 PM
redeagle
Dick Grier has a dll available for download on his website
www.hardandsoftware.com

Download the DesktopSerialIO dll and use it to communicate with RS232.  I
have downloaded it and it works great in VB2003.

John

Show quoteHide quote
"Wim Linders" wrote:

> Hi,
>
> I have to capture data from the com-port that comes from a barcode-scanner
> with rs232-cable.
> What is the best way to do it in .net?
>
> In my first attempt i used the msComm-ocx (the one that came with vb6). This
> worked on my computer, but after deploy on the computer the programm is
> supposed to run on, i encountered errors...
>
> In a second attempt i wanted to use the rs232-class that is provided in a
> microsoft-code sample:
> (http://www.microsoft.com/downloads/details.aspx?FamilyID=075318ca-e4f1-4846
> -912c-b4ed37a1578b&DisplayLang=en)
> But i can't get this to work
>
> Does somebody has experience on this matter ?
> Thanks already for a reply...
>
> regards
> Wim
>
>
>
Author
31 Aug 2006 4:51 PM
Dick Grier
Hi,

What version of .NET?  You can download DesktopSerialIO and an accompanying
example from my homepage for VS2003, or you can download the VS2005 example
that uses the built-in System.IO.Ports serial class.

BTW, I have some barcode reader examples in my book (see below).

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.
Author
31 Aug 2006 8:59 PM
Spam Catcher
"Wim Linders" <w*@merko.be> wrote in
news:O37WfbQzGHA.4796@TK2MSFTNGP06.phx.gbl:

> I have to capture data from the com-port that comes from a
> barcode-scanner with rs232-cable.
> What is the best way to do it in .net?

..NET 2.0 has a COM port class you can use.

Or you could go with a 3rd party class that maybe easier to use.