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 can I monitor the cts pin of serial port using dcb

How can I monitor the cts pin of serial port using dcb

Scheduled Pinned Locked Moved C / C++ / MFC
question
9 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

    Can any one suggest me some ways to monitor the cts pin of the serial port using DCB. S.Yamini

    C Q C 3 Replies Last reply
    0
    • Y yaminisridaran

      Can any one suggest me some ways to monitor the cts pin of the serial port using DCB. S.Yamini

      C Offline
      C Offline
      chandu004
      wrote on last edited by
      #2

      i have worked very enough with serial port(RS 232). but never heard of the cts pin and dcb. atleast for my information please educate me regarding those. then i will try to solve if it in my perview. thanku.

      Y 1 Reply Last reply
      0
      • C chandu004

        i have worked very enough with serial port(RS 232). but never heard of the cts pin and dcb. atleast for my information please educate me regarding those. then i will try to solve if it in my perview. thanku.

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

        I am using vc++ 6.0 for serial port communication. dcb is structure defines the control setting for a serial communications device. I have to monitor the cts (Clear to send)pin of the serial port. S.Yamini

        C 1 Reply Last reply
        0
        • Y yaminisridaran

          Can any one suggest me some ways to monitor the cts pin of the serial port using DCB. S.Yamini

          Q Offline
          Q Offline
          QuickDeveloper
          wrote on last edited by
          #4

          yaminisridaran wrote:

          Can any one suggest me some ways to monitor the cts pin of the serial port using DCB.

          i think u need to set fOutxCtsFlow flag of the DCB to TRUE to monitor the CTS signal.

          "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

          Y 1 Reply Last reply
          0
          • Q QuickDeveloper

            yaminisridaran wrote:

            Can any one suggest me some ways to monitor the cts pin of the serial port using DCB.

            i think u need to set fOutxCtsFlow flag of the DCB to TRUE to monitor the CTS signal.

            "Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"

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

            I have set fOutxCtsFlow to true but it is always true even if the voltage level in cts pin changes. S.Yamini

            1 Reply Last reply
            0
            • Y yaminisridaran

              Can any one suggest me some ways to monitor the cts pin of the serial port using DCB. S.Yamini

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

              Take a look at functions like GetCommModemStatus[^], WaitCommEvent[^] or GetCommMask[^]


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

              Y 1 Reply Last reply
              0
              • Y yaminisridaran

                I am using vc++ 6.0 for serial port communication. dcb is structure defines the control setting for a serial communications device. I have to monitor the cts (Clear to send)pin of the serial port. S.Yamini

                C Offline
                C Offline
                chandu004
                wrote on last edited by
                #7

                I use PCOMM library for sending and receiving data using serial port. functions are like sio_ioctl(); to define the port settings. sio_read(); sio_write(); soi_iqueue();to find weather any data is there in the port. may be i can help you if you are also using these libraries and functions.

                1 Reply Last reply
                0
                • C Cedric Moonen

                  Take a look at functions like GetCommModemStatus[^], WaitCommEvent[^] or GetCommMask[^]


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

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

                  I already using GetCommState. My Code CString strPort; strPort.Format("COM%d:",1); m_hPort=CreateFile(strPort,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); if(m_hPort==INVALID_HANDLE_VALUE) { return false; } GetCommState(m_hPort,&dcb); BOOL res; dcb.fOutxCtsFlow=true; res=SetCommState(m_hPort,&dcb); // Configure serial port GetCommState(m_hPort,&dcb); if(dcb.fOutxCtsFlow==TRUE) TRACE("TURNED OFF"); else if(dcb.fOutxCtsFlow==FALSE) { TRACE("TURNED ON"); } dcb.fOutxCtsFlow is always true even the voltage level changes S.Yamini

                  C 1 Reply Last reply
                  0
                  • Y yaminisridaran

                    I already using GetCommState. My Code CString strPort; strPort.Format("COM%d:",1); m_hPort=CreateFile(strPort,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL); if(m_hPort==INVALID_HANDLE_VALUE) { return false; } GetCommState(m_hPort,&dcb); BOOL res; dcb.fOutxCtsFlow=true; res=SetCommState(m_hPort,&dcb); // Configure serial port GetCommState(m_hPort,&dcb); if(dcb.fOutxCtsFlow==TRUE) TRACE("TURNED OFF"); else if(dcb.fOutxCtsFlow==FALSE) { TRACE("TURNED ON"); } dcb.fOutxCtsFlow is always true even the voltage level changes S.Yamini

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

                    Did you read my message ? Where do I speak about GetCommState ? I even gave you the link to the documentation, did you have a look at them ?


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

                    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