Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simulink RTW, real time problems

7 views
Skip to first unread message

Sean

unread,
Nov 23, 2009, 8:09:20 PM11/23/09
to
Hello,

I'm probably a relative rookie when it comes to simulink and real time workshop. I've been trying to get a simple program to run on real time and I think I must be missing something.

Here's what I'm trying to do, I'm trying to simply send a signal through a usb port at real time. I've set up RTW with a discrete time step of .01, a total time of 20 units and generated the model. But both the simulation and the resulting program seem to run at a speed of higher than 20 sec. Its actually running at about 23 seconds. Am I missing something. I should probably venture into the optimization of the simulation but I was curious if you guys would have any insights or helpful remarks.

Thank you in advance,
Sean

Arnaud Miege

unread,
Nov 24, 2009, 3:47:22 AM11/24/09
to

"Sean " <sa...@email.arizona.edu> wrote in message
news:hefbo0$a3u$1...@fred.mathworks.com...

Hi Sean,

USB is generally incompatible with real-time applications. Which block are
you using for USB communications? Which RTW target are you using? On which
platform are you running the generated code? Is it a real-time environment
(i.e. not Windows)?

Arnaud


Sean

unread,
Nov 24, 2009, 2:40:23 PM11/24/09
to
I'm trying to interface with a PCTx connector to control an aerial remote controller in real time. I've created a block for simulink using legacy code. the System builds, its just not in real time. I'm doing this all from a windows computer.

And i'm not quite sure what you mean by: Which RTW target are you using?

Thank you for your patiance,
Sean

"Arnaud Miege" <arnaud...@nospam.mathworks.co.uk> wrote in message <heg6iq$f7m$1...@fred.mathworks.com>...

Arnaud Miege

unread,
Nov 25, 2009, 7:45:47 AM11/25/09
to

"Sean " <sa...@email.arizona.edu> wrote in message
news:hehcr7$i87$1...@fred.mathworks.com...

> I'm trying to interface with a PCTx connector to control an aerial remote
> controller in real time. I've created a block for simulink using legacy
> code. the System builds, its just not in real time. I'm doing this all
> from a windows computer.
>
> And i'm not quite sure what you mean by: Which RTW target are you using?
>
> Thank you for your patiance,
> Sean
>
You mean you are running a Simulink model interpretatively on a Windows
platform, not C code generated from Simulink? Anything running on Windows
will not be in real-time because Windows is not a real-time operating
system. For real-time performance, you need to generate C code with
Real-Time Workshop from your Simulink model and run the generated C code on
a real-time platform, hence my comment and question:
- Generally speaking, USB is not supported on real-time platforms
- You can generate C code from Simulink with Real-Time Workshop for
different (real-time) targets. The fact that you didn't understand my
question suggest that you are not doing that, otherwise, you'd know which
target you are generating C code for. You might want to have a look at the
Real-Time Workshop documentation.

Arnaud


0 new messages