How can I monitor the cts pin of serial port using dcb
-
Can any one suggest me some ways to monitor the cts pin of the serial port using DCB. S.Yamini
-
Can any one suggest me some ways to monitor the cts pin of the serial port using DCB. S.Yamini
-
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.
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
-
Can any one suggest me some ways to monitor the cts pin of the serial port using DCB. S.Yamini
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..!!!"
-
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..!!!"
I have set fOutxCtsFlow to true but it is always true even if the voltage level in cts pin changes. S.Yamini
-
Can any one suggest me some ways to monitor the cts pin of the serial port using DCB. S.Yamini
Take a look at functions like GetCommModemStatus[^], WaitCommEvent[^] or GetCommMask[^]
Cédric Moonen Software developer
Charting control [v1.2] -
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
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.
-
Take a look at functions like GetCommModemStatus[^], WaitCommEvent[^] or GetCommMask[^]
Cédric Moonen Software developer
Charting control [v1.2]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
-
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
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]