using com-port in VB.net

  • Thread starter Thread starter Wim Linders
  • Start date Start date
W

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
 
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
 
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.
 
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.
 
Back
Top