How can I specify the directory where my S-function is generated using Real-Time Workshop's S-Function target?

14 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
To set the output directory of your S-function target, modify the appropriate template makefile (TMF).
1. Find the appropriate TMF file in $MATLAB\rtw\c\rtwsfcn\
where $MATLAB is the MATLAB root directory on your machine, as returned by typing
matlabroot
at the MATLAB Command Prompt.
The filename will be rtwsfcn_(compiler).tmf. If you are using Visual Studio it will be rtwsfcn_vc.tmf, or if you are using the MATLAB default LCC, it will be rtwsfcn_lcc.tmf.
2. Copy or rename the TMF file to rtwfscn_(compiler)2.tmf.
3. Open rtwfscn_(compiler)2.tmf in the editor, and search for "-outdir".
4. There will be a line in the Rules section where it sets the MEX_FLAGS, and on one line will be:
-outdir ..
5. Replace the .. with the directory where you want the mexw32 file to be generated.
6. In the Real-Time Workshop options section of the Configuration Parameters dialog, set the TMF file to rtwfscn_(compiler)2.tmf instead of rtwsfcn_default_tmf.
7. When you build, the temporary directories will be generated in the working directory, but the S-function file will go to the location you specified for -outdir.

More Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Tags

No tags entered yet.

Products

Community Treasure Hunt

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

Start Hunting!