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. How to check whether cts pin is on or off using vc++

How to check whether cts pin is on or off using vc++

Scheduled Pinned Locked Moved C / C++ / MFC
c++debugginghelptutorial
7 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.
  • Y Offline
    Y Offline
    yaminisridaran
    wrote on last edited by
    #1

    I have to check whether cts pin is on or off I tried the below code but no use if(GetCommModemStatus(m_hPort,&dwCommStatus)) { if(dwCommStatus & MS_CTS_ON) TRACE("cts on \n"); if(dwCommStatus & MS_DSR_ON) TRACE("dsr on \n"); if(dwCommStatus & MS_RING_ON) TRACE("ring on \n"); if(dwCommStatus & MS_RLSD_ON) TRACE("rlsd on \n"); else TRACE("pins no response\n"); } I am getting pins no response. Any help is welcome S.Yamini

    C D 2 Replies Last reply
    0
    • Y yaminisridaran

      I have to check whether cts pin is on or off I tried the below code but no use if(GetCommModemStatus(m_hPort,&dwCommStatus)) { if(dwCommStatus & MS_CTS_ON) TRACE("cts on \n"); if(dwCommStatus & MS_DSR_ON) TRACE("dsr on \n"); if(dwCommStatus & MS_RING_ON) TRACE("ring on \n"); if(dwCommStatus & MS_RLSD_ON) TRACE("rlsd on \n"); else TRACE("pins no response\n"); } I am getting pins no response. Any help is welcome S.Yamini

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      Did you check that your CTS signal is high ? (with a voltmeter or an oscilloscope)


      Cédric Moonen Software developer
      Charting control [v1.2]

      Y 1 Reply Last reply
      0
      • C Cedric Moonen

        Did you check that your CTS signal is high ? (with a voltmeter or an oscilloscope)


        Cédric Moonen Software developer
        Charting control [v1.2]

        Y Offline
        Y Offline
        yaminisridaran
        wrote on last edited by
        #3

        I checked before I connected the serial port cable to my computer.It showed +9v in the voltmeter and then i connected the serial cable but I am not getting any response or value. S.Yamini

        C K 2 Replies Last reply
        0
        • Y yaminisridaran

          I checked before I connected the serial port cable to my computer.It showed +9v in the voltmeter and then i connected the serial cable but I am not getting any response or value. S.Yamini

          C Offline
          C Offline
          Cedric Moonen
          wrote on last edited by
          #4

          Then I don't really see... Are you sure that you the port is opened correctly (with CreateFile) and that you open the same port ?


          Cédric Moonen Software developer
          Charting control [v1.2]

          Y 1 Reply Last reply
          0
          • C Cedric Moonen

            Then I don't really see... Are you sure that you the port is opened correctly (with CreateFile) and that you open the same port ?


            Cédric Moonen Software developer
            Charting control [v1.2]

            Y Offline
            Y Offline
            yaminisridaran
            wrote on last edited by
            #5

            Yes I am able to send Text and receive text but not able to monitor the cts pin S.Yamini

            1 Reply Last reply
            0
            • Y yaminisridaran

              I checked before I connected the serial port cable to my computer.It showed +9v in the voltmeter and then i connected the serial cable but I am not getting any response or value. S.Yamini

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

              If I remember right, RS232 uses a voltage feed of +-12V. And I know, from my own experience, that an open connector can give any state, it depends how the hardware is designed. The question is: Do you get antoher result when you have a negative voltage on the cts pin? Maybe you can try with a real modem, if you set DTR high/active, then RTS, the modem should respond with setting CTS high/active. Again, if I remember right, "high/active" really means a negative voltage on the pin in question. But I might be wrong here, so you'd better check that piece of information.

              Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson

              1 Reply Last reply
              0
              • Y yaminisridaran

                I have to check whether cts pin is on or off I tried the below code but no use if(GetCommModemStatus(m_hPort,&dwCommStatus)) { if(dwCommStatus & MS_CTS_ON) TRACE("cts on \n"); if(dwCommStatus & MS_DSR_ON) TRACE("dsr on \n"); if(dwCommStatus & MS_RING_ON) TRACE("ring on \n"); if(dwCommStatus & MS_RLSD_ON) TRACE("rlsd on \n"); else TRACE("pins no response\n"); } I am getting pins no response. Any help is welcome S.Yamini

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                What is the value of dwCommStatus?


                "A good athlete is the result of a good and worthy opponent." - David Crow

                "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

                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