port number changing (virtual com port)

2 views (last 30 days)
lasith
lasith on 11 May 2011
Commented: raym on 17 Jan 2021
i need to write a program to get data from eeprom through virtual com port. but the problem is it assign different port number time to time(not a fixed one).therefore how can I make a serial object identifying the correct com port

Answers (1)

Walter Roberson
Walter Roberson on 11 May 2011
Does the port number have to change while the program is running? If so that can be a problem.
If it does not have to change while the program is running, then if it will be the only port above a certain number, then you can use instrhwinfo ('serial') to determine which ports exist (as of the time MATLAB was started) and eliminate from that the ones you know are fixed ports.
  1 Comment
raym
raym on 17 Jan 2021
Sometimes there are multiple serial usb port connected, and the port number is volatile, causing a lot of trouble when start working on these ports.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!