Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Asynch Serial Comms

Asynch Serial Comms

Scheduled Pinned Locked Moved C / C++ / MFC
c++help
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    louis 0
    wrote on last edited by
    #1

    Hi there, Is there any other way of implementing asynchronous serial communication in Visual C++ than the MFC way. The MFC way is too time consuming. I so far have seen that _inp and _outp are only for WIN95 platform. Any suggestions will help. Thanks.

    P 1 Reply Last reply
    0
    • L louis 0

      Hi there, Is there any other way of implementing asynchronous serial communication in Visual C++ than the MFC way. The MFC way is too time consuming. I so far have seen that _inp and _outp are only for WIN95 platform. Any suggestions will help. Thanks.

      P Offline
      P Offline
      palbano
      wrote on last edited by
      #2

      You can use CreateFile and the Win32 Communications API which contains functions like BuildCommDCB(...) etc.

      L 1 Reply Last reply
      0
      • P palbano

        You can use CreateFile and the Win32 Communications API which contains functions like BuildCommDCB(...) etc.

        L Offline
        L Offline
        louis 0
        wrote on last edited by
        #3

        Thanks for the reply. Yes, you're right CreateFile() and the WIN32 Comms API can be used. My problem is that I receive data that is between 40 and 45 bytes in length far too late. The instrument on the other side sends the data at 9600 baud every 100ms. My program must receive it by 65ms. At the moment the data is received it at approximately 80ms, which is way too late. I have used the CreateFile() and ReadFile() with the necessary time-out, threads and event operations to read the data. I also wrote a utility in Delphi which seem to work fine (54ms). Unfortunately the code must be in C++ as it fits into a bigger Visual C++ program. Any ideas. Thank again.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups