Error message not connected
이전 댓글 표시
Hellow, im working with two motors for a project and they are connected via the Control instrument toolbox. Now i have used it in my gui, so the motor connect before the figure is shown. So in the function density_CreateFcn. But know, there must be a fault message when the gui starts and the motors arent connected properly. Anyone who has experience with this? Thx in advance
채택된 답변
추가 답변 (3개)
Sean de Wolski
2011년 5월 13일
0 개 추천
If the motor isn't connected it will error when it tries to connect to it because it won't be able to.
Post the full error message text for a more pinpointed response.
Walter Roberson
2011년 5월 13일
0 개 추천
I suspect that the answer you are looking for is that you should use a "try/catch" block around the fopen() for each of the motors. Though depending how you are finding the device information for the motors, you might be able to partly detect the condition earlier (e.g., if you only detect one COM port then you know that you don't have two motors connected.)
Fiboehh
2011년 5월 13일
댓글 수: 1
Walter Roberson
2011년 5월 13일
The specific error for serial() failing to create the internal java object is MATLAB:serial:serial:cannotCreate
The specific error for serial fopen failing to open the internal java object is MATLAB:serial:fopen:opfailed
You can create an error dialog with
ed = errordlg({'Serial connection not established.', 'Please check connections and try again'});
uiwait(ed);
카테고리
도움말 센터 및 File Exchange에서 Simulink Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!