Restart a USB connection

7 views (last 30 days)
Mathias Westlund
Mathias Westlund on 17 Jan 2013
Moved: Walter Roberson about 18 hours ago
Hi, I have a hardware intrument with a Matlab GUI that calls a few different USB devices. From time to time a USB connection fails. To resolve this I currently need to restart Matlab, the hardware or unplugg/replug the USB device. Is there a way to restart the USB communication from Matlab wihtout restarting any of the hardware or programs?
Thanks Mathias Westlund
  1 Comment
Mickael PIERRE
Mickael PIERRE on 12 Mar 2021
Hi there,
I have the same issue. Did you find a way around it?
Thank you,
Mickael

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 18 Jan 2013
Mathworks has said there is no current mechanism to do this.
A small number of people have reported success using instrreset, but that is part of the Instrument Control toolbox.
  1 Comment
Mathias Westlund
Mathias Westlund on 18 Jan 2013
Moved: Walter Roberson about 1 hour ago
Thanks Walter. I will investigate instrreset.

Sign in to comment.

More Answers (1)

Gavin
Gavin about 5 hours ago
See this same issue with a solution here
workaround exists: you can delete the existing serial port connection and then establish a new connection. For example:
myComPort = serial('COM5');
fopen(myComPort);
% Now disconnect the device
delete(myComPort);
clear myComPort;
% Reconnect the device; the following will now be successful:
myComPort = serial('COM5');
fopen(myComPort);

Categories

Find more on Instrument Control Toolbox Supported Hardware in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!