#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    New Zealand
    Posts
    28
    Rep Power
    0

    Win32 Serial IO?


    Hello

    Im having troubles with win32 serial IO in C.

    It appears extremely flakey... using hardware flow control, it often results in very slow thruput , and if not that, I get NULL characters and things... overall it just sucks, Im using examples straight out of MSDN.

    Has anyone else had extensive experience with win32's serial IO methods? Is it just me or is it very buggy?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    1. hardware flow control is your best choice.
    - if it is supported by your external device
    - if you did setup your external device to also use it
    - if your cable is not broken or has to few pins
    You canīt have slow thruput unless you have programmed some error correction. did you set the baud rate?
    2. did you setup the timeout values? i had big troubles with serial communication too until i manually set them.
    3. which way are you using anyway? event-driven? overlapping IO?
    Tell us a little more, maybe post some code?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    New Zealand
    Posts
    28
    Rep Power
    0
    Well the code I was using was essentially the code out of the MSDN writeup on serial IO.

    Ive got it working now... instead of overlapped IO, I instead used non-overlapped IO and set the timeouts with SetCommTimeouts.

    IT seems to work properly like that.

    /me slaps microsoft

    Thanks for the reply...

IMN logo majestic logo threadwatch logo seochat tools logo