我刚刚写了一个串口通信程序,初始设置如下:
 m_ctrlComm.SetCommPort(6);//选择COM,
    m_ctrlComm.SetInputMode(1);//二进制模式
    m_ctrlComm.SetInBufferSize(1024);             // 
    m_ctrlComm.SetOutBufferSize(512); 
m_ctrlComm.SetSettings("9600,n,8,1");
                       
if(!m_ctrlComm.GetPortOpen())
m_ctrlComm.SetPortOpen(true);    m_ctrlComm.SetRThreshold(1);
//m_ctrlComm.SetSThreshold(1);
m_ctrlComm.SetInputLen(0);
    m_ctrlComm.GetInput();
但是在接收数据时不能触发oncomm()消息,我确认oncomm添加无误!
我串口调试助手,用16进制调试时,能接收到数据,初始要发送50,才能接收到。
我用setoutput()函数发送50(16进制),可是根本等不到接收数据触发的oncomm
消息啊!有没有人遇到过我这样的情况啊?
我的这个程序以前是用来调试其他串口的,现在用来调试新的串口,没有影响吧?急啊``~