【关于CSerialPort串口类不能连续发送数据,大家有什么好的解决办法???】
大树学长 2015-03-23 04:32:28 如下:连续发送6次或者几次,都只能接受最前面和最后面的,如果没用延时就只能接收到最后面的疏浚。
我用串口监视工具查看的是直发送了最前面和最后面的数据,中间的数据都没用发送。
CString tempsend;
tempsend="(24106533)";
m_Commport.WriteToPort((char *)(LPCTSTR)tempsend);
Sleep(400);
tempsend="(150632454)";
m_Commport.WriteToPort((char *)(LPCTSTR)tempsend);
Sleep(400);
tempsend="(1062687)";
m_Commport.WriteToPort((char *)(LPCTSTR)tempsend);
Sleep(400);
tempsend="(10677582)";
m_Commport.WriteToPort((char *)(LPCTSTR)tempsend);
Sleep(400);
tempsend="(106457879)";
m_Commport.WriteToPort((char *)(LPCTSTR)tempsend);
Sleep(400);
tempsend="(10677127)";
m_Commport.WriteToPort((char *)(LPCTSTR)tempsend);