Model Entry Points

The following functions represent entry points in the generated code for a Simulink® model.

FunctionDescription
model_initializeInitialization entry point in generated code for Simulink model
model_SetEventsForThisBaseStepSet event flags for multirate, multitasking operation before calling model_step for Simulink model
model_stepStep routine entry point in generated code for Simulink model
model_terminateTermination entry point in generated code for Simulink model

Note that the calling interface generated for each of these functions differs significantly depending on how you set the Generate reusable code option (see Configuring Model Interfaces).

By default, Generate reusable code is off, and the model entry point functions access model data with statically allocated global data structures.

When Generate reusable code is on, model data structures are passed in (by reference) as arguments to the model entry point functions. For efficiency, only those data structures that are actually used in the model are passed in. Therefore when Generate reusable code is on, the argument lists generated for the entry point functions vary according to the requirements of the model.

The entry points are exported with model.h. To call the entry-point functions from your hand-written code, add an #include model.h directive to your code. If Generate reusable code is on, you must examine the generated code to determine the calling interface required for these functions.

For more information, see the reference pages for the listed functions.

  


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