Matlab xPC target USB?

Hello folks,
If I am attempting to communicate with an external device such as a GPS (driver installed) and it shows up as a COM port on my computer even though it is hooked up via USB on the xPC target, can I still use the RS232 library from xPC target to read/write to the device?
Thank you, Rob

 Risposta accettata

Walter Roberson
Walter Roberson il 24 Mag 2012

1 voto

USB virtual serial ports require a device driver in order to communicated with as serial ports. If your xPC includes the appropriate device driver then you can use the RS232 library.
I know that some USB support is being offered on xPC now, but I have not examined the documentation to find out whether USB serial ports are one of them.

6 Commenti

Robert
Robert il 24 Mag 2012
Thank you Walter,
I have the device driver for Windows installed on my PC and it shows up as a COM port in device manager. Would that be sufficient or would I have to create my own driver for the xPC Target kernel?
Walter Roberson
Walter Roberson il 24 Mag 2012
My understanding is that drivers for xPC are not MS Windows drivers, that you would need a specific driver. I am not certain on this point.
I should also backtrack, in that I do not know how the xPC RS232 library is implemented, so my "can use" should be "might perhaps be able to use".
Robert
Robert il 24 Mag 2012
That is a question I have been asking myself also, whether or not MS Windows drivers are read by the xPC Target kernel. I assume they are, otherwise how can the xPC Target kernel detect devices on the motherboard such as Ethernet or USB.. Perhaps a xPC product employee can enlighten us?
Walter Roberson
Walter Roberson il 24 Mag 2012
xPC has kernel drivers for a small number of Ethernet models, I believe. I have seen a few postings from people whose ethernet board was not one of the few listed.
Robert
Robert il 25 Mag 2012
You are correct, I overlooked this fact. It looks like a virtual com port via USB is out of the question at the moment since I have little time to create a driver so I will resort to sending my GPS coordinates to an external micro-controller which will then be connected via RS232 to the target PC.
Walter Roberson
Walter Roberson il 25 Mag 2012
Sometimes you gotta do what ya gotta do.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by