CSerialport串口程序与PLC通信问题

利用CSerialport类编写的串口程序,可正常接收龚建伟老师的串口调试助手发出的十六制信息,但收不到S7200发出的信息。
以下是接收函数:
LONG CMy22Dlg::OnComm(WPARAM ch,LPARAM port)
{

CString strtemp1,strtemp2;
LONG len;
int n=0;

BYTE m_byte=0;
CByteArray ReceiveData;
//ReceiveData.SetSize(8);
strtemp1.Format("%d",ch);
n=atoi(strtemp1);
m_byte=n;
ReceiveData.Add(m_byte);
//count++;
len=ReceiveData.GetSize();

for(int k=0;k<len;k++)
{   
    BYTE bt=ReceiveData.GetAt(k);
    rcv[k]=bt;
    strtemp2.Format("%d",bt);
    m_ReceiveMsg+=strtemp2+" "; 
}
UpdateData(FALSE);
if(n==97)
    {
       //count=0;
       ReceiveData.RemoveAll();
       m_ReceiveMsg.Empty();
    }



return 0;

}

用串口调试助手看下

先用串口丹东助手 看看 能不能收到S7200发出的信息?
如果能,则检查一下 CSerialport 的参数设置,如:波特率、起始/停止位,流控等.

用工具先抓一下你的这个串口设备发送的数据格式,各种参数是什么,然后跟你代码中的配置来对比