CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: COMTIMEOUT

  1. #1
    Guest

    COMTIMEOUT

    When configuring a file I/O (in my case to serial COMx ports) COMMTIMEOUTS
    are set up.

    What happens when a COMTIMEOUT happens ? How can I see that/if it has
    happend ?


    Thanks in advance

    -- Eigil




  2. #2
    Join Date
    Apr 1999
    Location
    Tampa, FL
    Posts
    114

    Re: COMTIMEOUT

    COMMTIMEOUTS affects the behavior of the ReadFile() and WriteFile() calls in different ways depending on weather or not you are opening the COMM port in OVERLAPPED or NON-OVERLAPPED. Mode. In OVERLAPPED Mode for example, the ReadIntervalTimer is normally set to a minimal non-zero number (1) to force the Read operation to return an IO_PENDING status when there is no data to be read. You then usually wait for a read event to occur with a WaitForMultipleEvents() call, which has it's own preset timeout for the event associated with the Read operation's OVERLAPPED structure.

    It is somewhat complex to understand serial communications now that OVERLAPPED I/O and multithreading is the considered the correct approach. Fortunately, there is a great article that not only explains the whole matter in detail, but includes a fine terminal application project to pull it all together. IT's called " Serial Communications in Win32" and may be downloaded at:

    http://msdn.microsoft.com/library/te...sdn_serial.htm

    --Randy C
    * * * Second star to the Right!

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

Featured