Finding Available COM ports in a PC.
6 次查看(过去 30 天)
显示 更早的评论
Hi, I would like to write a program which can find the available serial ports in a PC and connect to the port to which an external instrument is connected. the instrhwinfo('serial') provides me the available serial ports(one of the port is connected to an instrument) in my PC.
Now i replug the instrument to different serial port and do an instrhwinfo('serial'). This time it doesn't update the change in port name. Why is this happening? Is there a script/additional commands which can recognize the port name when i replug again and again to different ports on my PC.
Need assistance, Thank you.
0 个评论
采纳的回答
Walter Roberson
2011-3-25
Postings from Mathworks staff in the past have indicated that you need to restart Matlab to get the port list updated. I do not know if that is still the case in the latest versions.
0 个评论
更多回答(2 个)
KarthiK Krishna Kumar
2011-3-25
1 个评论
Walter Roberson
2011-3-25
It appears that the answer is NO for real serial ports, and "not implemented" for USB ports. Please see http://www.mathworks.com/matlabcentral/newsreader/view_thread/300827
Phillip
2012-12-19
I had the same question, just found that the answer is the "instrreset" command.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!