From: Arnaud Miege on

>> >
>> > Hi,
>> >
>> > the S-Functions are 'hand-coded' (due to historical reasons ;-) )
>> >
>> > Ansgar
>> >
>>
>> I didn't spot it at first, but there is a technical solution for
>> hand-written s-function that may help:
>> http://www.mathworks.com/support/solutions/en/data/1-3JK8LD/
>>
>> HTH,
>>
>> Arnaud
>>
>
> Hi,
>
> well, but I can not use the obj-files, because the S-Functions were build
> with different compilers (Borland and Microsoft) - as far as I know.
>
> So I need to use the *.mexw32 files.
>
> Greetings
> Ansgar
>

I don't think it's possible to do without the *.obj files, sorry.

Arnaud


From: Ralph Schleicher on
"Ansgar Hoffmann" <ansgar.hoffmann(a)continental-corporation.com> writes:

> I would like to generate an Exe-Application base on a Simulink
> model. This model contains several C/C++ coded S-Functions.
>
> These S-Functions are supported by different people and usually I do
> not have the original C-Code (black box).
>
> Is there a possibility to generate a stand alone application with the
> RTW or RSim target that runs with the &#8216;original&#8217;
> mexw32-files?

Hello Ansgar,

your setup sounds like a EU R&D project where each party provides
its proprietary component model and you are the poor guy who has
to compile the integrated system model. Here's the recipe:

(1) Each party has to implement its component model as reentrant
C/C++ functions and compile them into a static object library.
(2) Change the MEX-file S-function to call the C/C++ functions.
(3) Write a TLC wrapper calling the same C/C++ function.
(4) Generate the Rsim target and tell RTW that it has to link
against the static object libraries (see rtwmakecfg).

That way it works (done that), even if using different compilers.
Some details have to be considered (ssSetInputPortRequiredContiguous,
mdlRTW, ...) but its not too hard to do it right.

--
Ralph Schleicher <http://ralph-schleicher.de>

Development * Consulting * Training
Mathematical Modeling and Simulation
Software Tools
From: Ansgar Hoffmann on
nice idea. I will try this solution asap