Hi,
What you are seeing is two-fold.
First, the USB driiver software (virtual serial port) UART probably
implements a 96-byte (or possible deeper) transmit FIFO. This FIFO is
emptied, even if CTS is lowered. There isn't anything that you can do in
your application code if this is, in fact, the case -- except to work around
it yourself (see below).
Second, the FIFO in your PC UART is only 16-bytes in depth, so it sounds
like the receiving hardware can handle 16-bytes, but not the larger number.
So, what's the work-around? The obvious. Leave CTS/RTS flow control in
place, then... Write a routine that breaks transmit data into small chunks,
of less than 16-bytes. Check the status of CTS in your transmit routine.
If CTSHolding = True, then send 16-bytes. Add a small delay between each
16-byte "chunk" to allow CTS to propogate from hardware to your software.
If CTSHolding = False, then stay in a delay loop until it goes back to True.
Continue until all data have been sent. I'd start with about a 1 mS or so
delay between each "chunk," but a much larger delay inside the loop (perhaps
50 mS). Keep decreasing the large delay until you encounter a problem, then
bump it back up some, until it is reliable.

Signature
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.
Peter - 19 Jun 2008 07:07 GMT
Thanks for your answer.
But I have problems to understand it.
I don't have any possibilities to modify the sending behaviour of my serial
device(a GPRS modem).
It is specified that after my VB6 app has lowered signal RTS it my still
send additional 256bytes until it stops sending data.
Inbetween I think that these additional 256bytes are not the main cause of
my problem because if I use the native COM-Port of my PC(instead of a
USB-Comm converter) everything works fine.
Instead, I think that either the USB driver or the USB hardware adds a
certain delay to signal RTS.
In case the PC's receive buffer gets full the "serial driver" instructs RTS
to go low but due to the additional delay(coming from the USB converter)
much more data can still access the receive buffer which gets overflown.
Now I try to play with the two parameters Xonlim and Xofflim of the DCB
structure because it seems that they also define the levels when RTS should
be lowered.
I hope I can adjust the flowcontrol mechanism(also by increasing the size of
the receive buffer) to accept the additional delay of signal RTS on the USB
converter.
Regards
Peter
> Hi,
>
[quoted text clipped - 21 lines]
> until you encounter a problem, then bump it back up some, until it is
> reliable.
Peter - 19 Jun 2008 14:23 GMT
Hi
Should XoffLim and XonLim of the DCB structure work in case I use RTS/CTS
flowcontrol(fRtsControl=RTS_CONTROL_HANDSHAKE and fOutxCtsFlow=true)?
Or does XoffLim and XonLim only work with Xon/Xoff Flowcontrol?
What ever value I set for XoffLim and XonLim, the app does not set/reset RTS
earlier or later in case the receive buffer gets full.
Could it be that these values are ignored for RTS/CTS flowcontrol?
Any other reason why it is not working?
In MSDN the following discriptuion con be found:
*****************************************************
XoffLim
Maximum number of bytes allowed in the input buffer before flow control is
activated to allow transmission by the sender. This assumes that either
XON/XOFF, RTS, or DTR input flow control is specified in fInX, fRtsControl,
or fDtrControl. The maximum number of bytes allowed is calculated by
subtracting this value from the size, in bytes, of the input buffer.
*****************************************************
Regards
Peter
> Hi,
>
[quoted text clipped - 21 lines]
> until you encounter a problem, then bump it back up some, until it is
> reliable.
Dick Grier - 20 Jun 2008 17:27 GMT
Hi,
These settings do not affect the operation of the FIFO. They only control
the standard Windows serial driver -- some drivers for USB devices may use
them, others may not.
Unfortunately, MSDN says only what the article author thinks "should be
true," and has no control over the reality of what really is true.
Experience (and experimentation) are the only real world guides.
Without "hands-on" the actuall hardware and drivers, I can only offer
advice.
Dick

Signature
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.
Peter - 23 Jun 2008 07:02 GMT
Thanks, Dick
But XoffLim and XonLim also do not work on my native serial Commports(no
USB)?
Do you have any experience whether these parameters should work with RTS/CTS
flowcontrol at all?
Regards
Peter
> Hi,
>
[quoted text clipped - 10 lines]
>
> Dick