Products & Services Solutions Academia Support User Community Company

Learn more about Real-Time Workshop   

Writing S-Functions That Support Code Reuse

The Real-Time Workshop code reuse feature generates code for a subsystem in the form of a single function that is invoked wherever the subsystem occurs in the model (see Creating Subsystems). If a subsystem contains S-functions, the S-functions must be compatible with the code reuse feature. Otherwise, the code generator might not generate reusable code from the subsystem or might generate incorrect code.

If you want your S-function to support the subsystem code reuse feature, you must ensure that the S-function meets the following requirements:

In addition to meeting the preceding requirements, your S-function must set the SS_OPTION_WORKS_WITH_CODE_REUSE flag (see the description of ssSetOptions in the Simulink Writing S-Function documentation). This flag assures the code generator that your S-function meets the requirements for subsystem code reuse.

  


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