| Real-Time Workshop® Embedded Coder™ | ![]() |
The following functions represent entry points in the generated code for a Simulink® model.
| Function | Description |
|---|---|
| model_initialize | Initialization entry point in generated code for Simulink model |
| model_SetEventsForThisBaseStep | Set event flags for multirate, multitasking operation before calling model_step for Simulink model |
| model_step | Step routine entry point in generated code for Simulink model |
| model_terminate | Termination 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.
Note The function reference pages document the default (Generate reusable code off) calling interface generated for these functions. |
![]() | Wind River Systems VxWorks® Example Main Program Execution | Static Main Program Module | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |