Restart a USB connection
8 ビュー (過去 30 日間)
古いコメントを表示
Mathias Westlund
2013 年 1 月 17 日
移動済み: Walter Roberson
2025 年 10 月 23 日 2:53
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 件のコメント
その他の回答 (1 件)
Gavin
2025 年 10 月 22 日 23:08
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!