串口调试显示为什么不全
西安康智强 2011-09-01 09:57:02 大家好,请高手指教一下,我用串口调试助手,
void CSCOMMDlg::OnButtonManualsend()
{
// TODO: Add your control notification handler code here
CString str;
if(m_Port.m_hComm==NULL)
{
m_ctrlAutoSend.SetCheck(0);
AfxMessageBox("串口没有打开,请打开串口");
return;
}
else
{
UpdateData(TRUE);
for (int i=0;i<8;i++)
{
if (i==0){ str = "3a0100000001";m_Port.WriteToPort((LPCTSTR)str); }
if (i==1){str = "3a0100000002";m_Port.WriteToPort((LPCTSTR)str);}
if (i==2){str = "3a0100000003";m_Port.WriteToPort((LPCTSTR)str);}
if (i==3){str = "3a0100000004";m_Port.WriteToPort((LPCTSTR)str);}
if (i==4){str = "3a0100000005";m_Port.WriteToPort((LPCTSTR)str);}
if (i==5){str = "3a0100000006";m_Port.WriteToPort((LPCTSTR)str);}
if (i==6){str = "3a0100000007";m_Port.WriteToPort((LPCTSTR)str);}
if (i==7){str = "3a0100000008";m_Port.WriteToPort((LPCTSTR)str);}
}
// if(m_ctrlHexSend.GetCheck())
// {
// char data[512];
// int len=Str2Hex(m_strSendData,data);
// m_Port.WriteToPort(data,len);
// TX_count+=(long)((m_strSendData.GetLength()+1)/3);
// //m_Port.WriteToPort(hexdata);
// }
// else
// {
// m_Port.WriteToPort((LPCTSTR)m_strSendData); //发送数据
// TX_count+=m_strSendData.GetLength();
// }
// CString strTemp;
// strTemp.Format("TX:%d",TX_count);
// m_ctrlTXCount.SetWindowText(strTemp);
}
}
为什么接收结果只能看到数据3a0100000001和3a0100000008,中间的数据为什么没有发出来?