Restart a USB connection
7 次查看(过去 30 天)
显示 更早的评论
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 个评论
Mickael PIERRE
2021-3-12
Hi there,
I have the same issue. Did you find a way around it?
Thank you,
Mickael
采纳的回答
Walter Roberson
2013-1-18
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 个)
Gavin
2025-10-22
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);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Instrument Control Toolbox Supported Hardware 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!