필터 지우기
필터 지우기

Matlab blocks arduino comport

조회 수: 3 (최근 30일)
Dennis Weber
Dennis Weber 2017년 12월 11일
댓글: Dennis Weber 2017년 12월 11일
Hi all,
I am using matlab (Matlab App Designer to be precise) to communicate with my arduino via serial communication. My code works fine the first time I start the app. If I restart the app, Matlab gives me the following error code:
if true
Error using serial/fopen (line 72)
Open failed: Port: COM4 is not available. No ports are available.
Use INSTRFIND to determine if other instrument objects are connected to the requested
device.
end
If have already tried 'clear all' afterwards, but my COMPORT still seems to be busy. I have to restart matlab to get the app running again.
Do you have any idea how this can be solved?

채택된 답변

Madhu Govindarajan
Madhu Govindarajan 2017년 12월 11일
I would recommend something along the lines of cleanup that happens when someone closes the App where you can use this - https://www.mathworks.com/help/matlab/ref/serial.delete.html
The other thing I think might help is this function here - https://www.mathworks.com/help/instrument/instrreset.html
which should delete all open instrument objects as per the doc.
HTH
  댓글 수: 1
Dennis Weber
Dennis Weber 2017년 12월 11일
Thanks, the first part worked!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by