Read Comm port information from Control Panel 
Author Message
 Read Comm port information from Control Panel

Does anyone know how to read port information (such as Baudrate, Data bits,
parity, stop bits, flow control) from Control Panel?

The port information is under:
Control Panel -->System (properties) window -->   Hardware tab --> Device
Manager -->Ports (COM & LPT) property

Thanks,
Quynh



Sun, 30 Jan 2005 23:43:13 GMT  
 Read Comm port information from Control Panel
Hi,

Why do you want this information?  It is normal for an application to set
its own defaults, not to use the Windows defaults.

You can open the port (using the CreateFile API), and then use the
GetCommState API to read the DCB (Device Control Block).  The default
settings in the DCB are those that have been set via Control Panel.

--
Richard Grier  (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



Mon, 31 Jan 2005 01:38:45 GMT  
 Read Comm port information from Control Panel
Hi Richard,

I ordered and it took  8 weeks to get your book ("Serial Communications 3").
I got it 2 weeks ago.
Your books is informative and I enjoy reading it especially all the
"Problem" & "Solution"  sections.  Thank you :=)

I want this information because my app will set itself up to whatever the
user sets up in the Control Panel.
The purpose of my app is to read all binary data arrived at its port.  I am
using MSComm dll under .Net.
Dim Comm1 As New MSCommLib.MSCommClass()

I play/debug your program chapter6\ApiTerm32.  I call GetCommState() right
after CreateFile() API.
The GetCommState() gets back DCB from previously set-up in the hardware (
ex. Comm1.Setting = "38400,n,7,2"),  but not DCB in the Control Panel.

It seems to me that the information we set up in the Control Panel is not
necessary effective on the hardware yet.

Thank you for your help,
Quynh


Quote:
> Hi,

> Why do you want this information?  It is normal for an application to set
> its own defaults, not to use the Windows defaults.

> You can open the port (using the CreateFile API), and then use the
> GetCommState API to read the DCB (Device Control Block).  The default
> settings in the DCB are those that have been set via Control Panel.

> --
> Richard Grier  (Microsoft Visual Basic MVP)

> See www.hardandsoftware.net for contact information.

> Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
> Edition ISBN 1-890422-27-4 (391 pages) published February 2002.




Quote:
> Does anyone know how to read port information (such as Baudrate, Data

bits,

- Show quoted text -

Quote:
> parity, stop bits, flow control) from Control Panel?

> The port information is under:
> Control Panel -->System (properties) window --> Hardware tab --> Device
> Manager -->Ports (COM & LPT) property

> Thanks,
> Quynh



Mon, 31 Jan 2005 05:08:58 GMT  
 Read Comm port information from Control Panel
It is much quicker to get the book from Mabry. Got it in less than a week.


Quote:
> Hi Richard,

> I ordered and it took  8 weeks to get your book ("Serial Communications
3").
> I got it 2 weeks ago.
> Your books is informative and I enjoy reading it especially all the
> "Problem" & "Solution"  sections.  Thank you :=)

> I want this information because my app will set itself up to whatever the
> user sets up in the Control Panel.
> The purpose of my app is to read all binary data arrived at its port.  I
am
> using MSComm dll under .Net.
> Dim Comm1 As New MSCommLib.MSCommClass()

> I play/debug your program chapter6\ApiTerm32.  I call GetCommState() right
> after CreateFile() API.
> The GetCommState() gets back DCB from previously set-up in the hardware (
> ex. Comm1.Setting = "38400,n,7,2"),  but not DCB in the Control Panel.

> It seems to me that the information we set up in the Control Panel is not
> necessary effective on the hardware yet.

> Thank you for your help,
> Quynh



> > Hi,

> > Why do you want this information?  It is normal for an application to
set
> > its own defaults, not to use the Windows defaults.

> > You can open the port (using the CreateFile API), and then use the
> > GetCommState API to read the DCB (Device Control Block).  The default
> > settings in the DCB are those that have been set via Control Panel.

> > --
> > Richard Grier  (Microsoft Visual Basic MVP)

> > See www.hardandsoftware.net for contact information.

> > Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
> > Edition ISBN 1-890422-27-4 (391 pages) published February 2002.



> > Does anyone know how to read port information (such as Baudrate, Data
> bits,

> > parity, stop bits, flow control) from Control Panel?

> > The port information is under:

> > Control Panel -->System (properties) window --> Hardware tab --> Device

> > Manager -->Ports (COM & LPT) property

> > Thanks,

> > Quynh



Mon, 31 Jan 2005 07:15:08 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How to loop comm port control to read text files through serial port in VB3

2. Need help reading data from comm port

3. How do I read a comm port?

4. Reading Teletext from Comm Port

5. reading binary data from a comm port

6. Comm Overrun when playing sound while reading serial port (VB4.0)

7. Reading Comm Ports

8. How to read comm port state under VB?

9. Setting a COMM port and reading NMEA

10. How to get the support information that in control panel

11. Is it possible to read information from the parallel port using VB

 

 
Powered by phpBB® Forum Software