MSComm handshaking trouble 
Author Message
 MSComm handshaking trouble

Hi everybody. I am having a strage problem with the MSComm control. If I set
the handshaking to either Xon/Xoff or CTS/RTS (mixed mode is no option for
my application) and cause the receiving side to block, the MSComm control
does apparently stop sending data, but will move on with a timeout value of
about 5 seconds.

So far, I have not been able to find any way to determine if the Output=
method returned properly or if it just came out of this timeout. It also
seems like every time the timeout strikes, characters are lost.

Any hints?

Thanks, Marc.



Sun, 27 Oct 2002 03:00:00 GMT  
 MSComm handshaking trouble

Quote:
> Hi everybody. I am having a strage problem with the MSComm control. If I
set
> the handshaking to either Xon/Xoff or CTS/RTS (mixed mode is no option for
> my application) and cause the receiving side to block, the MSComm control
> does apparently stop sending data, but will move on with a timeout value
of
> about 5 seconds.

> So far, I have not been able to find any way to determine if the Output=
> method returned properly or if it just came out of this timeout. It also
> seems like every time the timeout strikes, characters are lost.

Well, I have tried using the SetCommTimeouts API function and setting
WriteTotalTimeoutConstant to 0 will effectively cause MSComm to honor
handshaking, but also lock up the whole application when handshaking signals
"wait mode". How can I circumvent this effect?

Marc.



Sun, 27 Oct 2002 03:00:00 GMT  
 MSComm handshaking trouble
Hi,

Yes, the timeout is EXACTLY five seconds.  If Xon or CTS is not
re-established within that timeout, any unsent data are discarded.  You can
use the Windows API to extend this timeout to a more reasonable number
(thousands of seconds, if you want).  I have examples of the code required
for this in my book.  See below.  The required API function is
SetCommTimeouts.  You can use the API Text viewer to find the declaration
for this function.  The code example in my book illustrates how to calculate
a good timeout interval.

--
Richard Grier
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Leave voice mail or fax that I can receive as email at 303-593-9315
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.



Sun, 27 Oct 2002 03:00:00 GMT  
 MSComm handshaking trouble

Quote:
> Yes, the timeout is EXACTLY five seconds.  If Xon or CTS is not
> re-established within that timeout, any unsent data are discarded.  You
can
> use the Windows API to extend this timeout to a more reasonable number
> (thousands of seconds, if you want).  I have examples of the code required
> for this in my book.  See below.  The required API function is
> SetCommTimeouts.  You can use the API Text viewer to find the declaration
> for this function.  The code example in my book illustrates how to
calculate
> a good timeout interval.

Thanks, Richard. If I use the SetCommTimeouts API function to set
WriteTotalTimeoutConstant to 0 will effectively cause MSComm to honor
handshaking, but also lock up the whole application when handshaking signals
"wait mode". Can I circumvent this effect?

Setting a specific timeout is no option since my app will run unattended and
deliver programs to a CNC machine. I can't justify corrupted data at all.

Thanks.



Mon, 28 Oct 2002 03:00:00 GMT  
 MSComm handshaking trouble
Hi,

I am not sure.  However, a timeout of 24 days (which you can set) should be
long enough.  If the machine stops taking data for that period of time,
there is some other issue that needs to be addressed.

--
Richard Grier
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO  80228
303-986-2179 (voice)
303-986-3143 (fax)
Leave voice mail or fax that I can receive as email at 303-593-9315
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.



Mon, 28 Oct 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. help - how do I implement XonXoff Handshaking with MSComm

2. MSComm handshaking?

3. Handshaking and MSCOMM.VBX

4. MSCOMM handshaking problem!

5. MsComm Control for Using Xon/Xoff HandShaking

6. Trouble with MSComm

7. Mscomm trouble...

8. MScomm trouble!!!!!

9. mscomm trouble

10. MSComm trouble

11. MSComm Trouble

12. MSComm troubles

 

 
Powered by phpBB® Forum Software