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. RS-232 Serial port Communication?

RS-232 Serial port Communication?

Scheduled Pinned Locked Moved C / C++ / MFC
c++comhardwarequestion
2 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.
  • M Offline
    M Offline
    madhu_v
    wrote on last edited by
    #1

    Iam using VC++ as a fonrtend software to communicate with embedded system through Serial communication(RS-232). Iam using Readfile and Writefile functions to read and write through COM port. Can anyone Clarify me the following, * Is it necessary to Flush the Input and Output buffer for every command being transmitted/received ??? * If not, how often should i Flush the input and output buffer ??? Madhu

    K 1 Reply Last reply
    0
    • M madhu_v

      Iam using VC++ as a fonrtend software to communicate with embedded system through Serial communication(RS-232). Iam using Readfile and Writefile functions to read and write through COM port. Can anyone Clarify me the following, * Is it necessary to Flush the Input and Output buffer for every command being transmitted/received ??? * If not, how often should i Flush the input and output buffer ??? Madhu

      K Offline
      K Offline
      kakan
      wrote on last edited by
      #2

      Hello. I think you should flush the buffers after every Writefile. Else, chances are that the data will remain in the write buffer. When you do a flush, the data will be sent to the device. There is (generally) no need for flush before Readfile. You might considder to search for a serial class. There are several here at CP. I have found them very useful over the years. Kakan

      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