Borrar filtros
Borrar filtros

Matlab blocks arduino comport

3 visualizaciones (últimos 30 días)
Dennis Weber
Dennis Weber el 11 de Dic. de 2017
Comentada: Dennis Weber el 11 de Dic. de 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?

Respuesta aceptada

Madhu Govindarajan
Madhu Govindarajan el 11 de Dic. de 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
  1 comentario
Dennis Weber
Dennis Weber el 11 de Dic. de 2017
Thanks, the first part worked!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB Support Package for Arduino Hardware en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by