How to check whether cts pin is on or off using vc++
-
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
-
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
Did you check that your CTS signal is high ? (with a voltmeter or an oscilloscope)
Cédric Moonen Software developer
Charting control [v1.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]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
-
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
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] -
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]Yes I am able to send Text and receive text but not able to monitor the cts pin S.Yamini
-
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
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
-
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
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