Thread Subject: usb to serial port

Subject: usb to serial port

From: Neal

Date: 12 May, 2010 08:56:03

Message: 1 of 5

i've got matlab on a computer without any available serial ports (there is one, but it is connected to something else). I'd like to get a usb-to-serial port adapter, but i don't know if matlab will be able to control it the same way it does a normal serial port.

anyone know the answer?

Subject: usb to serial port

From: David Young

Date: 12 May, 2010 09:11:04

Message: 2 of 5

Some years ago I did exactly what you describe, and it wasn't a problem. As far as I remember, the driver for the USB->serial gadget just made it look as if there was a normal serial port, and I opened it from Matlab and communicated with it as for a standard hardware port.

Subject: usb to serial port

From: Ankit Desai

Date: 12 May, 2010 13:22:04

Message: 3 of 5

"David Young" <d.s.young.notthisbit@sussex.ac.uk> wrote in message <hsdrb7$9id$1@fred.mathworks.com>...
> Some years ago I did exactly what you describe, and it wasn't a problem. As far as I remember, the driver for the USB->serial gadget just made it look as if there was a normal serial port, and I opened it from Matlab and communicated with it as for a standard hardware port.

Like David said, you should be able to get a USB-to-Serial dongle (adaptor) to connect to your computer. Remember to restart MATLAB to see the new port show up.

A word of caution though that not all USB-to-Serial adaptors emulate a serial port exactly. The better the adaptor emulate the on board serial port the better performance (reliable and robust) you will get.

I have used IOGear USB-to-Serial adaptor without many issues in the past.

Hope this helps

-Ankit

Subject: usb to serial port

From: Walter Roberson

Date: 12 May, 2010 13:26:03

Message: 4 of 5

Neal wrote:
> i've got matlab on a computer without any available serial ports (there
> is one, but it is connected to something else). I'd like to get a
> usb-to-serial port adapter, but i don't know if matlab will be able to
> control it the same way it does a normal serial port.
> anyone know the answer?

It is known that USB to serial port adapters *cannot* work like normal
serial ports. USB is inherently synchronous, not asynchronous, so it is
not possible to emulate any behaviour that would require a rate greater
than the synchronous rate.

I am not awake yet, so my memory is acting up; the figure that comes to
mind at the moment is that you cannot poll more than once every 25
milliseconds. If you were to search the archives for the keywords USB
packet, then I think you would find the rates indicated a few weeks ago.

Subject: usb to serial port

From: Neal

Date: 13 May, 2010 03:56:05

Message: 5 of 5

"Ankit Desai" <adesai.nospam@mathworks.com> wrote in message <hsea1s$2u1$1@fred.mathworks.com>...
> "David Young" <d.s.young.notthisbit@sussex.ac.uk> wrote in message <hsdrb7$9id$1@fred.mathworks.com>...
> > Some years ago I did exactly what you describe, and it wasn't a problem. As far as I remember, the driver for the USB->serial gadget just made it look as if there was a normal serial port, and I opened it from Matlab and communicated with it as for a standard hardware port.
>
> Like David said, you should be able to get a USB-to-Serial dongle (adaptor) to connect to your computer. Remember to restart MATLAB to see the new port show up.
>
> A word of caution though that not all USB-to-Serial adaptors emulate a serial port exactly. The better the adaptor emulate the on board serial port the better performance (reliable and robust) you will get.
>
> I have used IOGear USB-to-Serial adaptor without many issues in the past.
>
> Hope this helps
>

thanks everyone for the info. I'll go ahead and get an adapter and see what happens. I simply need to send commands from matlab to a device through a serial cable, so i hope there aren't any issues. I'll be back on the forum if there are ...
> -Ankit

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
serial Ankit Desai 12 May, 2010 09:24:07
usb Ankit Desai 12 May, 2010 09:24:07
usb Neal 12 May, 2010 04:59:27
serial port Neal 12 May, 2010 04:59:27
rssFeed for this Thread

Contact us at files@mathworks.com