Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Serial VS USB

10 views
Skip to first unread message

Bee

unread,
Dec 30, 2009, 6:41:01 PM12/30/09
to
My VB6 app looks at ports using the MSCOMM (MSCOMM32 ActiveX Control)component.
I try to open a port and set parameters.
Unfortunately, I do not know how to distinguish a serial port from a USB port.
What test can I use to determine if the port is USB or Serial?

Jim Mack

unread,
Dec 30, 2009, 9:18:53 PM12/30/09
to

If you can open it with MSCOMM, it's a serial port. It doesn't matter
if it's a physical port, a virtual port, or a USB-hosted port.

--
Jim Mack
Twisted tees at http://www.cafepress.com/2050inc
"We sew confusion"

CY

unread,
Dec 31, 2009, 7:01:45 AM12/31/09
to

Unfortnatly I don have any serial or serial USB devices but
Number of serial devices might be found at HKEY_LOCAL_MACHINE\SYSTEM
\CurrentControlSet\Services\Serial\Enum\Count
Do they differ in any way? I use them alike from VB with no problems
so far...
//CY

Bee

unread,
Dec 31, 2009, 11:57:01 AM12/31/09
to
I need to know if a port is Serial (RS232) or USB or whatever not just a
count although a count is useful. THere used to be two serial RS-232 ports
on a PC.
I need to see if my app will work on the PC or if I need to suggest a USB
Serial converter. There may not be any device hooked up so I cannot rely on
trying to communicate e.g. see if it respons as a modem (which I already do).
There are hardware interfaces that are only serial RS232 that I need to talk
to.
To me serial has always meant RS-232 as that is the technology I grew up with.

Also, does anyone recommend a good USB to Serial RS232 converter?

Nobody

unread,
Dec 31, 2009, 12:25:21 PM12/31/09
to
"Bee" <B...@discussions.microsoft.com> wrote in message
news:E0C57B85-8A3E-4889...@microsoft.com...

>I need to know if a port is Serial (RS232) or USB or whatever not just a
> count although a count is useful.

Why do you need to know that? I can't think of any reason to limit a
software from using USB-to-Serial converters. For you, they behave the same.


DickGrier

unread,
Dec 31, 2009, 1:07:29 PM12/31/09
to
Hi,

You can use WMI to obtain the port description for installed ports. I have
code examples for this in my book (below). I also provide a modified
version of MSComm32.ocx that allows you to open ports higher than 16, which
often happens these days. If you send me email, I will reply with that OCX
attached.

However... USB serial adapters are used just like any other serial adapter.
Do you really need to know whether or not is is USB (virtual serial port)
vs. hardware? You just set the CommPort number and Settings, (etc.), and
go.

In answer to your other question, I tend to prefer USB serial adapters that
are based on the FTDI chipset. These seem to be reliable across all OS

--
Richard Grier, Consultant, Hard & Software 12962 West Louisiana Avenue
Lakewood, CO 80228 303-986-2179 (voice) Homepage: www.hardandsoftware.net
Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004, Revised July
2006.

DanS

unread,
Dec 31, 2009, 1:12:56 PM12/31/09
to
> a good USB to Serial RS232 converter?

Isn't that an oxymoron ?!?!?!?!!?

Bee

unread,
Dec 31, 2009, 4:13:01 PM12/31/09
to
Huh?
I need to know if a PC has one usable real serial RS232 port or more.
If it does not, then I will suggest a USB to serial RS232 converter.
If it has a real serial RS232 port I will test it to see if the hardware I
expect is attached.
Does not the USB to Serial driver look like a serial RS232 port so I can
just try it as if it is an RS232 port?


"Nobody" wrote:

> .
>

CY

unread,
Dec 31, 2009, 4:22:16 PM12/31/09
to
On 31 Dec, 19:12, DanS <t.h.i.s.n.t.h....@r.o.a.d.r.u.n.n.e.r.c.o.m>
wrote:

> > a good USB to Serial RS232 converter?
>
> Isn't that an oxymoron ?!?!?!?!!?

Yep, USB is serial... as RS-485, RS-422 (Still handy, like the cable
length/multidrop and still async), and the new nice hard drives
connect with SATA.
Serial isnt all, can be parallel like IEEE-1284 (Centronics port if
anyone remember, If my memory dont fail me) and you still can talk to
them.

For the Q about nr of zerials , look at my earlier post. You have to
test it, I cant! (Or, I wont ;) Happy New Year) //CY

Bee

unread,
Dec 31, 2009, 4:21:01 PM12/31/09
to

I have used WMI but do not know how to interpret the data to determine if:
(1) true hardware serial RS232
(2) USB port
(3) USB port with USB to Serial dongle.
(4) other

In my case, I see my Sprint dongle showing up in that serial area.
But I do not see a generic descriptor.
Hope I do not have to sort through millions of different devices to
determine what is attached.

I need somthing distributable!
Suggestions please.

And thanks for the tip on the FTDI chipset! That really helps me.

For example: (this laptop has no Serial RS232 port)

Name Sprint Connection Manager NMEA Port (COM7)
Status OK
PNP Device ID NMEA\PORTB\1&5&NMEAAPP0
Maximum Input Buffer Size 0
Maximum Output Buffer Size No
Settable Baud Rate Yes
Settable Data Bits Yes
Settable Flow Control Yes
Settable Parity Yes
Settable Parity Check Yes
Settable Stop Bits Yes
Settable RLSD Yes
Supports RLSD Yes
Supports 16 Bit Mode No
Supports Special Characters No
Baud Rate 9600
Bits/Byte 8
Stop Bits 1
Parity None
Busy No
Abort Read/Write on Error No
Binary Mode Enabled Yes
Continue XMit on XOff No
CTS Outflow Control No
Discard NULL Bytes No
DSR Outflow Control 0
DSR Sensitivity 0
DTR Flow Control Type Enable
EOF Character 26
Error Replace Character 0
Error Replacement Enabled No
Event Character 0
Parity Check Enabled No
RTS Flow Control Type Disable
XOff Character 19
XOffXMit Threshold 512
XOn Character 17
XOnXMit Threshold 2048
XOnXOff InFlow Control 0
XOnXOff OutFlow Control 0
Driver c:\windows\system32\drivers\pctnullport.sys (2.0.2.0, 37.77 KB
(38,680 bytes), 12/2/2009 12:12 PM)

CY

unread,
Dec 31, 2009, 6:11:44 PM12/31/09
to
On 31 Dec 2009, 22:21, Bee <B...@discussions.microsoft.com> wrote:
> I have used WMI but do not know how to interpret the data to determine if:
> (1) true hardware serial RS232
> (2) USB port
> (3) USB port with USB to Serial dongle.
> (4) other

Yes, but true RS-232 is not all serial comm, but normally all thing
that hook up to th before mentioned reg entry (not tested, but thats
what I think right now), the electrical interface is not interesting
but all noted there should be a serial communication device as you now
know them.
Nown 00:10 so I can report: its not been so bad this year soo far ;)
ohh, here comes some more fireworks gottago...

James Hahn

unread,
Dec 31, 2009, 9:27:12 PM12/31/09
to
I would have thought that you needed to know that the PC has one usable
serial port, and if it doesn't then you can suggest a USB to serial
converter. If it has one usable serial port you don't care whether it is a
USB device or an RS232 device or some other port emulator.

If you find _any_ serial port then there's no need to suggest that the user
install one.

"Bee" <B...@discussions.microsoft.com> wrote in message

news:0C6A54FE-59B5-4DF1...@microsoft.com...

Nobody

unread,
Jan 1, 2010, 9:14:33 AM1/1/10
to
"Bee" <B...@discussions.microsoft.com> wrote in message
news:0C6A54FE-59B5-4DF1...@microsoft.com...

> Huh?
> I need to know if a PC has one usable real serial RS232 port or more.
> If it does not, then I will suggest a USB to serial RS232 converter.
> If it has a real serial RS232 port I will test it to see if the hardware I
> expect is attached.
> Does not the USB to Serial driver look like a serial RS232 port so I can
> just try it as if it is an RS232 port?

As far as your software is concerned, they are both equally real. Perhaps
what you were looking for is finding which COM port exists. Start with port
1, then try to open it and trap any error. You get different errors if the
port is in use or if it doesn't exist. Then increment the port number and
try again, or simply let the user specify the port to use from a long
drop-down list.


CY

unread,
Jan 2, 2010, 12:48:12 AM1/2/10
to
As thinking about this a bit, if a modem (internal) acting like a com
port(addr &H358/258 INT 3/4) would be seen as a serial device (with it
is) then is it a serial port? *g*
//CY

CY

unread,
Jan 2, 2010, 3:06:14 AM1/2/10
to

oops 378/278 sorry---

David Kerber

unread,
Jan 5, 2010, 9:15:19 AM1/5/10
to
In article <E0C57B85-8A3E-4889...@microsoft.com>,
B...@discussions.microsoft.com says...

>
> I need to know if a port is Serial (RS232) or USB or whatever not just a
> count although a count is useful. THere used to be two serial RS-232 ports
> on a PC.
> I need to see if my app will work on the PC or if I need to suggest a USB
> Serial converter. There may not be any device hooked up so I cannot rely on
> trying to communicate e.g. see if it respons as a modem (which I already do).
> There are hardware interfaces that are only serial RS232 that I need to talk
> to.
> To me serial has always meant RS-232 as that is the technology I grew up with.
>
> Also, does anyone recommend a good USB to Serial RS232 converter?

We use ones from B&B electronics (www.bb-elec.com). They have several
different kinds.

D

Dee Earley

unread,
Jan 27, 2010, 6:41:38 AM1/27/10
to
On 31/12/2009 16:57, Bee wrote:
> I need to know if a port is Serial (RS232) or USB or whatever not just a
> count although a count is useful. THere used to be two serial RS-232 ports
> on a PC.
> I need to see if my app will work on the PC or if I need to suggest a USB
> Serial converter. There may not be any device hooked up so I cannot rely on
> trying to communicate e.g. see if it respons as a modem (which I already do).
> There are hardware interfaces that are only serial RS232 that I need to talk
> to.
> To me serial has always meant RS-232 as that is the technology I grew up with.
>
> Also, does anyone recommend a good USB to Serial RS232 converter?

There is pretty much only one chipset available.
Every USB to serial device I've seen uses the Prolific PL2303 chipset
which is then put in an adapter with very little electrical difference
between all the manufacturers.

--
Dee Earley (dee.e...@icode.co.uk)
i-Catcher Development Team

iCode Systems

Dee Earley

unread,
Jan 27, 2010, 9:29:47 AM1/27/10
to

Having said that, I came across an Intel based one this afternoon... :)

Jim Mack

unread,
Jan 27, 2010, 10:21:19 AM1/27/10
to
Dee Earley wrote:
>
> There is pretty much only one chipset available.
> Every USB to serial device I've seen uses the Prolific PL2303
> chipset which is then put in an adapter with very little electrical
> difference between all the manufacturers.

I'd say the FTDI-based converters are at least as common.

0 new messages