qq_25206829 2015-06-09 07:19 采纳率: 0%
浏览 4881

C++如何接受串口返回的数据

void CNewTestDlg::OnStart()
{
// 55 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 03 FD D4 14 01 17 00
CByteArray SendTemp,hexdata;
COleSafeArray safearray_inp;
CString strtemp;
SendTemp.SetSize(24);
SendTemp.SetAt(0,0x55);
SendTemp.SetAt(1,0x55);
SendTemp.SetAt(2,0x00);
SendTemp.SetAt(3,0x00);
SendTemp.SetAt(4,0x00);
SendTemp.SetAt(5,0x00);
SendTemp.SetAt(6,0x00);
SendTemp.SetAt(7,0x00);
SendTemp.SetAt(8,0x00);
SendTemp.SetAt(9,0x00);
SendTemp.SetAt(10,0x00);
SendTemp.SetAt(11,0x00);
SendTemp.SetAt(12,0x00);
SendTemp.SetAt(13,0x00);
SendTemp.SetAt(14,0x00);
SendTemp.SetAt(15,0x00);
SendTemp.SetAt(16,0xFF);
SendTemp.SetAt(17,0x03);
SendTemp.SetAt(18,0xFD);
SendTemp.SetAt(19,0xD4);
SendTemp.SetAt(20,0x14);
SendTemp.SetAt(21,0x01);
SendTemp.SetAt(22,0x17);
SendTemp.SetAt(23,0x00);
m_ctrlComm.SetOutput(COleVariant(SendTemp));
}

然后怎么写才能接收串口返回的数据?本人小白,谢谢各位大神了
  • 写回答

2条回答

报告相同问题?

悬赏问题

  • ¥15 为什么eprime输出的数据会有缺失?
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题