Re: Xon/Xoff char's - Urgent
Quote:
I use MSComm control and Xon/Xof Handshaking to communicate with Modem. But the Receive Event doesn't fire when Xon/Xoff characters arrive.
Why must the receive event fire?
That handshaking stuf is done for you behind the scene.
Re: Xon/Xoff char's - Urgent
I forgot to mention Xon=Char(17) and Xoff=Char(19). So with Xon/Xoff protocol you can't send binary data anymore or you have to "escape" them.
Re: Xon/Xoff char's - Urgent
hi,
Like RTC and CTS events and CTSHolding in RTC/CTS Handshaking , i always know when i can send the data to output buffer by questioning the CTSHolding.
How can i do the same in Xon/Xof handshaking ?
Re: Xon/Xoff char's - Urgent
Normally you don't need to know. You just place data in the OutBuffer and the comm object handles it. The same with the data enters the RS232 plug, the dat is stored for you in the InBuffer. Normally the buffersize is 1024 bytes and is adjustable with the InBufferSize and OutBufferZize property.
Also with RTS/CTS you don't have to do anything!
Except waiting for a buffer overflow? So size the buffers!
Re: Xon/Xoff char's - Urgent
It doesn't work :(
I can see that flow controls work with my comm port. In my Application i do:
do While ..... ' there is data to sent
Do While mdlDefinitions.MSComm.MSComm1.OutBufferCount > 0
Loop
mdlDefinitions.MSComm.MSComm1.Output = buff()
loop
But i can see that even if CTSHolding is false and there was data in outbuffer to send after some time outbuffercount = 0...(CTSHolding still false)...
and i got a data lost.. :(
Re: Xon/Xoff char's - Urgent
Its not clear to me how your code works.
Here some explanation from Bill:
http://support.microsoft.com/default...b;en-us;194922
Re: Xon/Xoff char's - Urgent
it's clear..
the question is can it be that there was some data in output buffer when CTS event arrive (false) and after some time where CTS still false the outputbuffercount = 0 ?!
Re: Xon/Xoff char's - Urgent
I have tried it some while ago. But it is not possible, as far as I know, to release byte by byte via RTS/CTS.
Re: Xon/Xoff char's - Urgent
Is it possible to see Xon/Xoff characters that modem sends to comm port ?
Re: Xon/Xoff char's - Urgent
Set handshaking to RTS/CTS and watch for Xon=Char(17) and Xoff=Char(19)
Re: Xon/Xoff char's - Urgent
Why should i set handshaking to RTS/CTS and not Xon/Xoff? I have only 3 pin cabel and no 9 pin so i can not use RTS/CTS handshaking physically..
when comm port cann't send the data from output baffer after some time it becomes empty, where i can set this time?
Really Thanks For all your answers.. :)
Re: Xon/Xoff char's - Urgent
Quote:
Why should i set handshaking to RTS/CTS and not Xon/Xoff? I have only 3 pin cabel and no 9 pin so i can not use RTS/CTS handshaking physically..
No you can't use RTS/CTS then. But also watch out with binary data. You can't see the Xon and Xoff chars then. What you can do is invoke the second comm port and connect the REC-pin as monitoring. Use a terminal program to listen.
Quote:
when comm port cann't send the data from output baffer after some time it becomes empty, where i can set this time?
I've never heard about this. Anyone else???
What kind of problems do you have now? Do you have contact with the modem? Is the modem switched to Xon/Xoff ?
Re: Xon/Xoff char's - Urgent
The modem switched to some flow control (say Xon/Xoff), i send data to output buffer (256 B), and i see that in this time modem tells comm port not to send data, the data stays in output buffer for some like 400 msec and then the buffer is empty. All this time the modem doesn't allow to comm port send data.
It look like some timeout for failure to send data or some..
My output buffer size is 512 B.
The problem is that i see that my OutBufferCount became 0 and i have no idia if my data was sent or deleted...