By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,836 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,836 IT Pros & Developers. It's quick & easy.

usb connection as com port using 2.0 SerialPort component

P: n/a
Forgive me for stupid questions for I am new to serial IO programming.

I am developing an app that will need to communicate with a device via
RS232 protocol using a standard 9 pin serial cable. From what I
understand this can be accomplished relativly easy using .net 2.0
SerialPort component over a COM port.

My question: because most newer computers don't have 9 pin serial
ports (COM), can the SerialPort component use a USB connection just
the same as it would a serial port? If so, how would I accomplish
this using the SerialPort component? What other alternatives might
there be?

Thanks in advance for any info.

Oct 2 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
egress wrote:
Forgive me for stupid questions for I am new to serial IO programming.

I am developing an app that will need to communicate with a device via
RS232 protocol using a standard 9 pin serial cable. From what I
understand this can be accomplished relativly easy using .net 2.0
SerialPort component over a COM port.

My question: because most newer computers don't have 9 pin serial
ports (COM), can the SerialPort component use a USB connection just
the same as it would a serial port? If so, how would I accomplish
this using the SerialPort component? What other alternatives might
there be?

Thanks in advance for any info.
I have done something similar.
There is an adapter you can get that is a "serial" to USB adapter, and
this comes with an install disk.

Once that is installed, then when you plug in the unit ( in my case it
was a rf / barcode scanner ) then by going into control panel / system
settings, you would notice that it actually has assigned a com port to it.

This might help you out as well, it gets all the ports that are in use.

Dim CurrentAvailPorts As Array = SerialPort.GetPortNames()

Run it, plug in your usb, and run it again, and the difference is your
new com port.

I have found some strange things with the serialport component.
Some of its events dont fire when I would expect them to, but for the
most part my simple program did the trick. A few exceptions i cant seem
to catch every once in a while, but its a workin progress.

Miro
Oct 2 '07 #2

P: n/a
Hi,

You would use a USB serial adapter. These range in price from $15 (up).
The device driver that is installed for the adapter creates a "virtual
serial port" that Windows applications use just like any physical
hardware -- all of the APIs are the same.

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.
Oct 2 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.