Comm Port will not Open 
Author Message
 Comm Port will not Open

Help!
I am attempting to write to and read from a serial port with limited
success.

The code sends 12 values over the port in a sequence that should repeat at
about 25 Hz. (at 19.2kBaud)

I am using a loopback cable with pins 2 and 3 jumpered to 'talk to myself'
initially.  All other pins are open.  It's the same cable I used with
success at work.

The code seems to be working on my PC at work but I run into problems at
home when I attempt to open the comm port (Port 2).  When I execute:

If MSComm1.PortOpen = False Then MSComm1.PortOpen = True

It returns error 8015 indicating one or more invalid parameters.
My home PC is an HP Pavilion and I use the offending comm port to dock my
Palm, so I imagine it works.
I've tried a variety of settings but none have worked yet.
Any suggestions would be gratefully received.

Thanks,
Ralph Page



Thu, 01 May 2003 03:00:00 GMT  
 Comm Port will not Open
I thought as first the palm may have some software{*filter*} about the port,
but that would give you a 8005 error 'port allready inuse' what is your
setup string, is there any palm software running.

Darren


Quote:
> Help!
> I am attempting to write to and read from a serial port with limited
> success.

> The code sends 12 values over the port in a sequence that should repeat at
> about 25 Hz. (at 19.2kBaud)

> I am using a loopback cable with pins 2 and 3 jumpered to 'talk to myself'
> initially.  All other pins are open.  It's the same cable I used with
> success at work.

> The code seems to be working on my PC at work but I run into problems at
> home when I attempt to open the comm port (Port 2).  When I execute:

> If MSComm1.PortOpen = False Then MSComm1.PortOpen = True

> It returns error 8015 indicating one or more invalid parameters.
> My home PC is an HP Pavilion and I use the offending comm port to dock my
> Palm, so I imagine it works.
> I've tried a variety of settings but none have worked yet.
> Any suggestions would be gratefully received.

> Thanks,
> Ralph Page



Fri, 02 May 2003 03:00:00 GMT  
 Comm Port will not Open

Hi,

Some other program has seized the port (perhaps the program used for
synchronizing your Palm).  Make sure that any other program that may be
using the port is closed.

--
Richard Grier (Microsoft Visual Basic MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition ISBN 1-890422-25-8 (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order.  For faster service contact the publisher at
http://www.mabry.com/vbpgser.



Fri, 02 May 2003 03:00:00 GMT  
 Comm Port will not Open
Darren and{*filter*},
Many thanks for the suggestions.  I discovered that my Palm software was in
fact running down there in the system tray and it had grabbed the port.
When I quit the Palm program in the background it worked fine.
As Darren suggested, I was expecting a different error if some other program
had grabbed the port, do you know why it reports the error it does?

Thanks again for the help,
-Ralph Page



Fri, 02 May 2003 03:00:00 GMT  
 Comm Port will not Open

Hi,

I was expecting a different error if some other program
had grabbed the port, do you know why it reports the error it does?
<<

Sure.  The port is already open.  The fact that it has been opened by
another program, not your own, is a Windows issue.  That is, Windows passes
that message to VB -- VB doesn't generate it.

--
Richard Grier (Microsoft Visual Basic MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition ISBN 1-890422-25-8 (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order.  For faster service contact the publisher at
http://www.mabry.com/vbpgser.



Sat, 03 May 2003 03:00:00 GMT  
 Comm Port will not Open

Quote:

> Hi,

> I was expecting a different error if some other program
> had grabbed the port, do you know why it reports the error it does?
> <<

> Sure.  The port is already open.  The fact that it has been opened by
> another program, not your own, is a Windows issue.  That is, Windows
passes
> that message to VB -- VB doesn't generate it.

Hi{*filter*}, since the port is already open as a result of another program I was
expecting error
8005 (Already Open)or 8010 (Not Available) rather than the 8015 (Can't set
comm state).

Are the other two errors only going to come along if MY software attemps to
open the port a second time etc. as opposed to a completely separate program
grabbing it?

Thanks again for the help, I bought the book, BTW, for future reference.

-Ralph

Quote:
> Richard Grier (Microsoft Visual Basic MVP)
> Hard & Software
> 12962 West Louisiana Avenue
> Lakewood, CO  80228
> 303-986-2179 (voice)
> 303-986-3143 (fax)
> Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
> Edition ISBN 1-890422-25-8 (355 pages).
> For information look on my homepage at http://www.*-*-*.com/ .
> Use the Books link to order.  For faster service contact the publisher at
> http://www.*-*-*.com/



Sun, 04 May 2003 03:00:00 GMT  
 Comm Port will not Open
Hi,

Hi{*filter*}, since the port is already open as a result of another program I was
expecting error
8005 (Already Open)or 8010 (Not Available) rather than the 8015 (Can't set
comm state).
<<

Yes, well.... What you get is what you get.  Expectations do not always
correspond.

Are the other two errors only going to come along if MY software attemps to
open the port a second time etc. as opposed to a completely separate program
grabbing it?
<<

I think that something like a mouse driver will result in one or the other
of these error returns.  The other I've never seen.  Windows is funny,
right?

--
Richard Grier (Microsoft Visual Basic MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition ISBN 1-890422-25-8 (355 pages).
For information look on my homepage at http://www.*-*-*.com/ .
Use the Books link to order.  For faster service contact the publisher at
http://www.*-*-*.com/



Mon, 05 May 2003 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Open comm port

2. API - Opening a Comm port -NT

3. How to detect an open comm port

4. opening and sending BINARY to a comm port.

5. Comm port freezes on open!

6. (Q) How to open a comm port.

7. How to open comm port in VB4.0?

8. Opening a comm port for input

9. Open Comm Port?

10. monitor an already open comm port or NIC?

11. Comm Port Open/Close question

12. check whether the comm port is using or not

 

 
Powered by phpBB® Forum Software