Serial Port Class & Component

J

JerryWEC

I'm being tasked with the job of creating a serial ports class component or
dll for use in other applications. This ports component/dll will replace an
existing COM dll (VB6 using old comm32.dll).

I want to know if it is better to start with the new VS2005 ports class or
the new serial ports component?

I also need to know if one has more functionality then the other (ports
class vs serial ports component)?

I will need to create a collection of serial ports based on the client
application's needs. I will need to be able to communicate with all of the
ports required for the using client application.

I am new to serial ports communications programming. Any and all insight
would be greatly appreciated!!!

I also need to know if USB/USB2 ports can be used with either of these items
(ports class vs serial ports component).

Thanks JerryM
 
D

Dick Grier

Hi,
I want to know if it is better to start with the new VS2005 ports class or
the new serial ports component?
<<

They are the same thing. You can instantiate the SerialPort oject by drag
and drop from the toolbox, or by a couple lines of code.
I also need to know if one has more functionality then the other (ports
class vs serial ports component)?
<<

There is no difference.
I will need to create a collection of serial ports based on the client
application's needs. I will need to be able to communicate with all of the
ports required for the using client application.

I am new to serial ports communications programming. Any and all insight
would be greatly appreciated!!!
<<

If you really mean a collection, then I suggest that you create a class that
wraps or inherits from SerialPort, then use it in a collection or other
similar management class. This may or may not be a "good way" to implement
the design -- it just depends on your needs.

I have example code in my book (VB, of course), but details will vary
with... Details.
I also need to know if USB/USB2 ports can be used with either of these items
(ports class vs serial ports component).
<<

Sure, if the USB device is a serial port adapter, GPS device or modem. No,
if the USB device is something that isn't a serial device. USB is a serial
bus (like PCI is a parallel bus). The internal workings of the bus, which
is serial, has nothing to do with serial communications in general.

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.
 
J

JerryWEC

Dick, thanks so much for you feedback!

I did figure out that the SerialPorts Component and the
system.io.serialport.serialports class are the same... Just installed
VS2005 today. :)

I have been tasked with redoing a VB6 dll that wraps the old comm32 control.
I'm hoping that the same functionality is still availbable in the new ports
class.

Does your revised book cover all aspects of .net and specifically VS2005?
And does it cover the .net threading issues?

I'll look for your book this weekend or sooner.

What is the namespace for the USB communications? system.io.?

Again D.G. thanks for your help! It is greatly appreciated!

JerryM
 
L

Luke Zhang [MSFT]

Hello Jerry,

Here is also a good article on serial port operation witin .NET:

http://msdn2.microsoft.com/en-us/library/ms172760.aspx

Hope this help,

Luke Zhang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
J

JerryWEC

Thanks Luke for the Article!

I'm also looking for some examples of how to do pre-amble and post-amble
code.

Pre-amble is also called Prefix and Post-amble is also called Suffix.

Any other sources of .net code for Serial Ports using the new VS2005 /FW2.0
is greatly appreciated.

Thanks in Advance and Chow. JerryM
 
D

Dick Grier

Hi,
Does your revised book cover all aspects of .net and specifically VS2005?
And does it cover the .net threading issues?
<<

Yes, to both questions (of course "all" covers a lot of ground, but feel
free to ask questions). Your best avenue to purchase it is directly from
me. See my homepage for details.

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.
 
D

Dick Grier

Hi,

This is just the implementation of some sort of serial protocol (while not
infinite in variety, there are lots of variations). I show examples of this
sort of thing in my book. However, if you already have VB6 code that does
it, porting to .NET would be straight-forward.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top