Home All Groups Group Topic Archive Search About

SerialPort.GetPortNames() returns incorrect port names?

Author
4 Jul 2006 4:28 PM
Vile
SerialPort returns incorrect port names for virtual COM ports.
In my case it reports "COM5i" instead of "COM5" for Siemens MC35i terminal
Hyperterminal shows "COM5". SerialPort.Open() doesn't work with these names
- Incorrect port name error.
Who knows how to get the correct names ?

Author
4 Jul 2006 7:13 PM
Dick Grier
Hi,

GetPortNames returns the names that the device driver provides.  If you want
to filter that by some rules, you will have to do so yourself.
HyperTerminal uses TAPI (different methods than are used by
System.IO.Ports), so the results may not be exactly the same.

So, why do you care?  The name returned by GetPortNames may be used to open
that port, right?

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
5 Jul 2006 6:58 AM
Vile
Hi,

"Dick Grier" wrote:

> So, why do you care?  The name returned by GetPortNames may be used to open
> that port, right?

Unfortunately, no. This name causes System.IO.IOException with text "The
port 'COM5i' does not exist.".
Of course I can add filtering and fix broken COM port names, but probably
there are any better solutions?

Best regards
Author
5 Jul 2006 3:05 PM
Dick Grier
Hi,

>>
Of course I can add filtering and fix broken COM port names, but probably
there are any better solutions?
<<

No, I'm fairly sure there is not.  This is the first time that I've heard of
this issue.  I have dozens of different devices (many that use virtual
serial ports), and none of these display this problem -- so it isn't common.

The best thing to do would be to contact your manufacturer and to inquire
about it there.  You also can post it as an issue on
http://msdn.microsoft.com/vstudio/support/default.aspx.

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
5 Jul 2006 3:51 PM
Vile
Hi,

"Dick Grier" wrote:
> No, I'm fairly sure there is not.  This is the first time that I've heard of
> this issue.  I have dozens of different devices (many that use virtual
> serial ports), and none of these display this problem -- so it isn't common.

Yes, I already discovered that. I found just one more incident, but with
bluetooth device. Without any answer, unfortunately.

>
> The best thing to do would be to contact your manufacturer and to inquire
> about it there.  You also can post it as an issue on
> http://msdn.microsoft.com/vstudio/support/default.aspx.
Yes. I'm currently trying to get response from Siemens.
Already posted. :)

Thanks a lot. :)

AddThis Social Bookmark Button