Generating the Main Program Module

The Generate an example main program option controls whether or not ert_main.c or ert_main.cpp is generated for your Simulink® model. This option is located in the Templates pane of the Configuration Parameters dialog box, as shown in this figure.

Options for Generating a Main Program

By default, Generate an example main program is on. When Generate an example main program is selected, the Target operating system pop-up menu is enabled. This menu lets you choose the following options:

Regardless of which Target operating system you select, ert_main.c or .cpp includes

The operation of the main program and the scheduling algorithm employed depend primarily upon whether your model is single-rate or multirate, and also upon your model's solver mode (SingleTasking vs. MultiTasking). These are described in detail in Program Execution Overview.

If you turn the Generate an example main program option off, the Real-Time Workshop® Embedded Coder™ software provides a static version of the file ert_main.c as a basis for your custom modifications (see Static Main Program Module).

You can use a custom file processing (CFP) template file to override the normal main program generation, and generate a main program module customized for your target environment. To learn how to do this, see Customizing Main Program Module Generation.

  


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