本文介绍了通过USB串行适配器进行通讯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



你能帮我吗?我需要使用笔记本电脑与通过串行端口构建的嵌入式板进行通信.

当我使用PC与主板通信时,用C ++编写的程序效果很好.但是,当我将笔记本电脑与USB串行适配器一起使用时,程序出错,显示"FlameMonitoring.exe触发了断点".我发现问题发生在m_ctrlComm.get_Input().我的初始化代码如下.

Hi,

Could you please help me out? I need to use my laptop to communicate with embedded board I built through serial port.

The program written in C++ works very well when I use PC to communicate with board. But when I use laptop with USB-serial adapter, the program goes wrong, showing "FlameMonitoring.exe has triggered a breakpoint". I found that the problem occurs at m_ctrlComm.get_Input(). My initialization code as follows.

m_ctrlComm.put__CommPort(COM_PORT);
m_ctrlComm.put_InBufferSize(1024);
m_ctrlComm.put_PortOpen(TRUE);
m_ctrlComm.put_Settings("115200,n,8,1");
m_ctrlComm.put_InputMode(1);
m_ctrlComm.put_RThreshold(6);
m_ctrlComm.put_InputLen(0);
m_ctrlComm.get_Input();



我错过了什么?此外,程序可以输入OnComm(),表示它接收数据.而且我认为它也能够将数据发送到嵌入式板.有什么建议吗?非常感谢您的帮助.

Danny



Did I miss something? Besides, the program can enter OnComm(), which means it receives data. And I think it is also able to send data to embedded board. Any suggestion? Many thanks for your help.

Danny

推荐答案


这篇关于通过USB串行适配器进行通讯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-14 11:03