GUI problem while doing serial communication
1 次查看(过去 30 天)
显示 更早的评论
I am doing serial communication between matlab and controller. I have created a GUI. The problem is whenever I am starting serial communication the GUI doesn't appears but when I terminate the program GUI appears. I want GUI to appear in real time.I am not getting the problem.
0 个评论
回答(1 个)
Walter Roberson
2016-4-13
Create serial object BytesAvailableFcn callbacks to handle the serial data, instead of looping around checking for data.
There is a sample GUI for serial communications in the File Exchange
5 个评论
Walter Roberson
2016-5-9
It would seem to make the most sense to put the display code in pushbutton1_Callback, or at least have pushbutton1_Callback call the display code.
Note: fgets() returns the line terminator as part of the string, but you are using == to do comparisons. You should use fgetl() and you should use strcmp()
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!