GUI problem while doing serial communication
이전 댓글 표시
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.
답변 (1개)
Walter Roberson
2016년 4월 13일
0 개 추천
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
Nachiket Patki
2016년 4월 13일
Nachiket Patki
2016년 4월 14일
편집: Walter Roberson
2016년 4월 14일
Walter Roberson
2016년 4월 14일
The *OutputFcn is not called until you are exiting the GUI, by which time you are probably destroying the graphics.
Nachiket Patki
2016년 5월 9일
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()
카테고리
도움말 센터 및 File Exchange에서 Data Type Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!