Results 1 to 14 of 14

Thread: Xon/Xoff char's - Urgent

  1. #1

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    59

    Xon/Xoff char's - Urgent

    Hello.

    I use MSComm control and Xon/Xof Handshaking to communicate with Modem. But the Receive Event doesn't fire when Xon/Xoff characters arrive.

    With MSComm1
    Handshaking = comXOnXoff
    .RThreshold = 1
    .RTSEnable = True
    .settings = "9600,n,8,1"
    .SThreshold = 1
    .CommPort = 2
    .portOpen = True
    End With

    The Send and Receive Events do fire when some regular data is transmitted. But this unprintable chars cann't be seen

    Is some property is missing? Or something else...

    Please answer as soon as possible ..

    Thanks,
    anstasia

  2. #2
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Xon/Xoff char's - Urgent

    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.

  3. #3
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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.

  4. #4

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    59

    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 ?

  5. #5
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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!

  6. #6

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    59

    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..

  7. #7
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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

  8. #8

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    59

    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 ?!

  9. #9
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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.

  10. #10

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    59

    Re: Xon/Xoff char's - Urgent

    Is it possible to see Xon/Xoff characters that modem sends to comm port ?

  11. #11
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    Re: Xon/Xoff char's - Urgent

    Set handshaking to RTS/CTS and watch for Xon=Char(17) and Xoff=Char(19)

  12. #12

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    59

    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..
    Last edited by nastya; Nov 10th, 2005 at 03:59 AM.

  13. #13
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    639

    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..
    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.

    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 ?

  14. #14

    Thread Starter
    Member
    Join Date
    May 2005
    Posts
    59

    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...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width