Click here to Skip to main content
15,898,371 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
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();


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
Posted
Updated 15-May-10 12:47pm
v3

1 solution

1.a) you need to verify if the Serial port of the USB-serial adapter you are using is valid.
1.b) check it using %SystemRoot%\system32\mmc.exe "%SystemRoot%\system32\compmgmt.msc" /s
2. try to use a try {} catch {} block to trap the exception (if any)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900