while(pComm->m_bGoOn)
{
//start=clock();
if(pComm->WaitForChar())// IsDataCome())
{
num=pComm->ReadBytesWait(CurReq,60); //读数据
if(pComm->m_bShowAble)
pComm->ShowString(CurReq,num,CString("Req:")); //显示数据
framenum=pComm->FindReqFrame(CurReq);
memset(CurReq,0,num);
if(framenum >0)
{
num=pComm->SendBytesWait(pComm->m_pAns+pComm->AnsRowLen*framenum,
(int)*(pComm->m_pAns+pComm->AnsRowLen*framenum+pComm->AnsLenPos)
-pComm->AnsPreLen);
//Sleep(num);
if(pComm->WaitForChar()>0){
num1=pComm->ReadBytesWait(CurReq,num);
str.Format("%03d:",framenum);
//pComm->ShowString(pComm->m_pAns+pComm->AnsRowLen*framenum,num,CString("Ans:"));
if(pComm->m_bShowAble)
pComm->ShowString(pComm->m_pAns+pComm->AnsRowLen*framenum,num1,str);
}
}
}
}
最后显示出来的原本的6个字节的数据被分开显示了 怎么办?怎么才能控制好读数据的时间哦? 帮帮小弟我哦 ~! 显示结果:
Address: 33
-->: 55 08 08
<--: f7
-->: cc
Req: 68
Req: 6a f1 01 00 c4 //这里原本是68 6a f1 01 00 c4的
Req:
Req: 68 6a
Req: f1 01 00
Req: c4
Req: 68 6a f1
Req: 01 00
Req: c4
Req: 68
Req: 6a f1
Req: 01 00 c4
Req: 68
Req: 6a f1 01
Req: 00 c4
Req:
Req: 00
{
//start=clock();
if(pComm->WaitForChar())// IsDataCome())
{
num=pComm->ReadBytesWait(CurReq,60); //读数据
if(pComm->m_bShowAble)
pComm->ShowString(CurReq,num,CString("Req:")); //显示数据
framenum=pComm->FindReqFrame(CurReq);
memset(CurReq,0,num);
if(framenum >0)
{
num=pComm->SendBytesWait(pComm->m_pAns+pComm->AnsRowLen*framenum,
(int)*(pComm->m_pAns+pComm->AnsRowLen*framenum+pComm->AnsLenPos)
-pComm->AnsPreLen);
//Sleep(num);
if(pComm->WaitForChar()>0){
num1=pComm->ReadBytesWait(CurReq,num);
str.Format("%03d:",framenum);
//pComm->ShowString(pComm->m_pAns+pComm->AnsRowLen*framenum,num,CString("Ans:"));
if(pComm->m_bShowAble)
pComm->ShowString(pComm->m_pAns+pComm->AnsRowLen*framenum,num1,str);
}
}
}
}
最后显示出来的原本的6个字节的数据被分开显示了 怎么办?怎么才能控制好读数据的时间哦? 帮帮小弟我哦 ~! 显示结果:
Address: 33
-->: 55 08 08
<--: f7
-->: cc
Req: 68
Req: 6a f1 01 00 c4 //这里原本是68 6a f1 01 00 c4的
Req:
Req: 68 6a
Req: f1 01 00
Req: c4
Req: 68 6a f1
Req: 01 00
Req: c4
Req: 68
Req: 6a f1
Req: 01 00 c4
Req: 68
Req: 6a f1 01
Req: 00 c4
Req:
Req: 00
Sleep(20));
num=pComm->ReadBytesWait(CurReq,60); //读数据