Thread Subject: RTW on a simulink model with a C S-sfunction

Subject: RTW on a simulink model with a C S-sfunction

From: Cyrock User

Date: 27 May, 2008 08:17:01

Message: 1 of 2

To create a .mex32 or a dll from a simulink model that
contains an S-function with C-code, should I:

-First create a mex32 file for the S-function though the
mex compiler?
-Use the legacy_code function somehow?
-Directly use the Build-Subsystem RTW command?

I am quite lost. It is not very clear in the documentation.

Right now if have a .c file obtained through the S-
function builder, which compiles and runs in the Simulink
model, but I cant manage to compile the Simulink model.

Thanks

Subject: RTW on a simulink model with a C S-sfunction

From: Omur Bas

Date: 27 May, 2008 12:35:03

Message: 2 of 2

"Cyrock User" <razor4045@gmail.com> wrote in message
<g1gg1t$fhk$1@fred.mathworks.com>...
> To create a .mex32 or a dll from a simulink model that
> contains an S-function with C-code, should I:
>
> -First create a mex32 file for the S-function though the
> mex compiler?
> -Use the legacy_code function somehow?
> -Directly use the Build-Subsystem RTW command?
>
> I am quite lost. It is not very clear in the documentation.
>
> Right now if have a .c file obtained through the S-
> function builder, which compiles and runs in the Simulink
> model, but I cant manage to compile the Simulink model.
>
> Thanks

Generally, what you have done should work. Put your code in
the S-function builder, see if it builds, then generate an
S-function from the whole system . The only other thing I
would do is to check the "Generate TLC Wrapper" option in
the S-Function Builder.

What I'd do to pinpoint the problem (and you've probably
tried these) are:
   *Build the rest of the model without the S-function
   *Build the model with only the S-function in it.

If none of these work, you should probably give us more
specifics about what it is that you are writing and what
error messages you are getting.

HTH,

Omur Bas
www.promodsoftware.com.tr

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
rtw Cyrock User 27 May, 2008 04:20:05
legacy code Cyrock User 27 May, 2008 04:20:05
sfunction Cyrock User 27 May, 2008 04:20:05
c Cyrock User 27 May, 2008 04:20:05
rssFeed for this Thread

Contact us at files@mathworks.com