SerialPort.GetPortNames() returns incorrect port names?

G

Guest

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

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

Guest

Hi,

Dick Grier said:
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
 
D

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

Guest

Hi,

Dick Grier said:
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. :)
 

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