MATLAB Answers


Error refreshing com ports

Asked by Stiphu
on 5 Mar 2013
Latest activity Edited by Bergercookie
on 16 Sep 2015

My computer is connected to a LED light source over a virtual com port. The LED light source crashes from time to time. If this is the case, I have to restart it, which I can do over this com port (the crash is a power failure. The light source is not working properly anymore, but I still can communicate with it). The problem is, that after the restart, I'm not anymore able to connect to it. I'm trying to establish a new connection with

    connection = serial('COM14','BaudRate',9600);

If I execute the fopen command, I get the following error message:

    Error using serial/fopen (line 72)
    Open failed: Port: COM14 is not available. Available ports: COM12,
    COM14, COM15.
    Use INSTRFIND to determine if other instrument objects are connected to    
    the requested device.

If I restart Matlab, I am able to reconnect. Do you know if there is any workaround?


on 6 Mar 2013

Yes, I do close the com port. And there is no error in the code, or do you see one in this two lines of code? The strange thing is that it says that Port 14 is not available and then says that Port 14 is available.

on 30 May 2013

I'm experiencing the same problem and would be very interested in a solution (port unavailable, yet available). The port is closed and deleted, yet I get the following message:

Open failed: Port: COM3 is not available. Available ports:

It can be solved by restarting the system. Until it fails again after some hours of com port use.

on 16 Sep 2015

I had the same problem. There is a similar post ( ) in which a working solution is presented.

Essentially you can resolve the problem by issuing the following command


0 Answers

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!