Azzera filtri
Azzera filtri

Matlab blocks arduino comport

3 visualizzazioni (ultimi 30 giorni)
Dennis Weber
Dennis Weber il 11 Dic 2017
Commentato: Dennis Weber il 11 Dic 2017
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?

Risposta accettata

Madhu Govindarajan
Madhu Govindarajan il 11 Dic 2017
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

Più risposte (0)

Categorie

Scopri di più su MATLAB Support Package for Arduino Hardware in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by