Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

mdlRTW - Generate code generation data

Required

No

C Syntax

#define MDL_RTW
void mdlRTW(SimStruct *S)

C Arguments

S

SimStruct representing an S-Function block.

M Syntax

WriteRTW(s)

M Arguments

s

Instance of Simulink.MSFcnRunTimeBlock class representing the Level-2 M-File S-Function block.

Description

This function is called when the Real-Time Workshop product is generating the model.rtw file. In C MEX S-functions, you can call the following functions that add fields to the model.rtw file:

In C MEX S-functions, this function must be enclosed in a #if defined(MATLAB_MEX_FILE) statement.

In Level-2 M-file S-functions, use the run-time object's WriteRTWParam method to write custom parameters to the model.rtw file.

Languages

C, C++, M

C Example

See the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/src/sfun_multiport.c in the Simulink model sldemo_msfcn_lms.mdl for an example.

M Example

See the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/adapt_lms.m in the Simulink model sfcndemo_sfun_multiport.mdl for an example.

See Also

ssSetInputPortFrameData, ssSetOutputPortFrameData, ssSetErrorStatus

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS