필터 지우기
필터 지우기

Finding Available COM ports in a PC.

조회 수: 2 (최근 30일)
KarthiK Krishna Kumar
KarthiK Krishna Kumar 2011년 3월 25일
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.

채택된 답변

Walter Roberson
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.

추가 답변 (2개)

KarthiK Krishna Kumar
KarthiK Krishna Kumar 2011년 3월 25일
Hi Walter,
Thanks for your reply. Yes as you indicated i need to restart matlab in order to update the port list. Is there any other way to update the list from a script ??
Thank you !!!
  댓글 수: 1
Walter Roberson
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
Phillip 2012년 12월 19일
I had the same question, just found that the answer is the "instrreset" command.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by