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. dodgy serial communication

dodgy serial communication

Scheduled Pinned Locked Moved C / C++ / MFC
helpcomdebuggingquestion
4 Posts 4 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.
  • G Offline
    G Offline
    godbert
    wrote on last edited by
    #1

    Hey, My prog is supposed to communicate with an external device with the serial port.I ve got some trouble trying to get it working...:confused: If I don t run the hyperterminal before using my software, the communication doesn t work.I ve tried to use overlapped and nonoverlapped communication.I ve tried to use a couple of activex controls and different classes.But it's still the same.Moreover, I am almost sure that my initializiation parameters are OK. Has somebody already had this kind of bug? What does the hyperterminal do that my prog doesn t? I tried to use a sniffer to find out what s going on in my communication, but everything looks find as well. If you have any ideas, please feel free to share ur thought.... I ve been trying to debug my softare for 2 weeks now... Thanks for ur precious help. sysy

    F T M 3 Replies Last reply
    0
    • G godbert

      Hey, My prog is supposed to communicate with an external device with the serial port.I ve got some trouble trying to get it working...:confused: If I don t run the hyperterminal before using my software, the communication doesn t work.I ve tried to use overlapped and nonoverlapped communication.I ve tried to use a couple of activex controls and different classes.But it's still the same.Moreover, I am almost sure that my initializiation parameters are OK. Has somebody already had this kind of bug? What does the hyperterminal do that my prog doesn t? I tried to use a sniffer to find out what s going on in my communication, but everything looks find as well. If you have any ideas, please feel free to share ur thought.... I ve been trying to debug my softare for 2 weeks now... Thanks for ur precious help. sysy

      F Offline
      F Offline
      Fredrik Skog
      wrote on last edited by
      #2

      You can use PortMon[^] to compare the settings of the terminal program with those of your application. Cheers, Fredrik
      "Felix qui potuit rerum cognoscere causas."

      1 Reply Last reply
      0
      • G godbert

        Hey, My prog is supposed to communicate with an external device with the serial port.I ve got some trouble trying to get it working...:confused: If I don t run the hyperterminal before using my software, the communication doesn t work.I ve tried to use overlapped and nonoverlapped communication.I ve tried to use a couple of activex controls and different classes.But it's still the same.Moreover, I am almost sure that my initializiation parameters are OK. Has somebody already had this kind of bug? What does the hyperterminal do that my prog doesn t? I tried to use a sniffer to find out what s going on in my communication, but everything looks find as well. If you have any ideas, please feel free to share ur thought.... I ve been trying to debug my softare for 2 weeks now... Thanks for ur precious help. sysy

        T Offline
        T Offline
        Ted Ferenc
        wrote on last edited by
        #3

        Cable If hyperteminal works then it should be OK Data You are using a sniffer, have you tried using 2 PCs with your prog on #1 and hypertermial on #2? Or use 1 PC with two serial ports? CreateFile CreateFile can be used to send serial data, search MSDN for "Configuring a Communications Resource" try this and send a test string to another PC that has hypertermial running, e.g. send "hello world". This should prove out your line settings baud rate, stop bits, parity etc. I assume this is where you problem is. With serial comms I always found is easiest to buy a comms library, the last one I used was COMM-DRV. Generally the problems are caused by the cable, handshaking, or not setting the DCB block in SetCommState A favourite problem is using XON/XOFF protocol and sending XOFF, also some devices/computers will conver a LF to CR/LF unless line characteristics are set to raw mode. So do a simple test to prove it works sending to hypertermial, that will elinate the receiving prog/device.


        It is amazing what you can accomplish if you do not care who gets the credit. - Harry S Truman

        1 Reply Last reply
        0
        • G godbert

          Hey, My prog is supposed to communicate with an external device with the serial port.I ve got some trouble trying to get it working...:confused: If I don t run the hyperterminal before using my software, the communication doesn t work.I ve tried to use overlapped and nonoverlapped communication.I ve tried to use a couple of activex controls and different classes.But it's still the same.Moreover, I am almost sure that my initializiation parameters are OK. Has somebody already had this kind of bug? What does the hyperterminal do that my prog doesn t? I tried to use a sniffer to find out what s going on in my communication, but everything looks find as well. If you have any ideas, please feel free to share ur thought.... I ve been trying to debug my softare for 2 weeks now... Thanks for ur precious help. sysy

          M Offline
          M Offline
          macmac38
          wrote on last edited by
          #4

          Hi, you can try to use the MSCOMM32.OCX for that. Otherwise you can find a serial class here: http://www.naughter.com Regards Mark

          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