Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
updating instrhwinfro('serial') help

Subject: updating instrhwinfro('serial') help

From: Jay Mac

Date: 13 Jan, 2011 10:00:21

Message: 1 of 3

hello everyone.

i want to put a pop-up menu in my GUI for the user to choose which COMPORT he will connect.

a = instrhwinfo('serial');
a.SerialPorts

then i see the available COMPORTS in my laptop.
now next, when i plug my circuit in a USB port in my laptop using a USB-Serial converter, it apperas in the device manager as COM5.
but when i try to
a = instrhwinfo('serial');
a.SerialPorts
the 'COM5' doesn't appear even though i can access it using serial('COM5') and fopen.
if i restart MATLAB, 'COM5' will apear.
but i want to update "a.SerialPorts" whenever i plug my circuit without restarting MATLAB.

need help please. thanks.

Subject: updating instrhwinfro('serial') help

From: Trent Jarvi

Date: 13 Jan, 2011 19:47:15

Message: 2 of 3


"Jay Mac" <davemac_314@yahoo.com> wrote in message
news:igmifl$4pm$1@fred.mathworks.com...
> hello everyone.
> i want to put a pop-up menu in my GUI for the user to choose which COMPORT
> he will connect.
>
> a = instrhwinfo('serial');
> a.SerialPorts
>
> then i see the available COMPORTS in my laptop.
> now next, when i plug my circuit in a USB port in my laptop using a
> USB-Serial converter, it apperas in the device manager as COM5.
> but when i try to a = instrhwinfo('serial');
> a.SerialPorts
> the 'COM5' doesn't appear even though i can access it using serial('COM5')
> and fopen.
> if i restart MATLAB, 'COM5' will apear. but i want to update
> "a.SerialPorts" whenever i plug my circuit without restarting MATLAB.
>
> need help please. thanks.

Hi Jay,

The events required to know when a new port is created are not in the RS232
serial APIs underneath. We are considering adding support for USB hotplug
events with the serial object. Voicing interest through customer support
will increase the priority.

Subject: updating instrhwinfro('serial') help

From: Jay Mac

Date: 14 Jan, 2011 01:17:04

Message: 3 of 3

"Trent Jarvi" wrote in message <ignks3$nt8$1@fred.mathworks.com>...
>
> "Jay Mac" <davemac_314@yahoo.com> wrote in message
> news:igmifl$4pm$1@fred.mathworks.com...
> > hello everyone.
> > i want to put a pop-up menu in my GUI for the user to choose which COMPORT
> > he will connect.
> >
> > a = instrhwinfo('serial');
> > a.SerialPorts
> >
> > then i see the available COMPORTS in my laptop.
> > now next, when i plug my circuit in a USB port in my laptop using a
> > USB-Serial converter, it apperas in the device manager as COM5.
> > but when i try to a = instrhwinfo('serial');
> > a.SerialPorts
> > the 'COM5' doesn't appear even though i can access it using serial('COM5')
> > and fopen.
> > if i restart MATLAB, 'COM5' will apear. but i want to update
> > "a.SerialPorts" whenever i plug my circuit without restarting MATLAB.
> >
> > need help please. thanks.
>
> Hi Jay,
>
> The events required to know when a new port is created are not in the RS232
> serial APIs underneath. We are considering adding support for USB hotplug
> events with the serial object. Voicing interest through customer support
> will increase the priority.
>

oh i see.

is it possible to put a pop-up menu which shows the list of the available ports? and list updates when i remove or plug any device. thanks for the info.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us