Real-Time Workshop Embedded Coder | ![]() ![]() |
Generating the Main Program
The Generate an example main program option controls whether or not ert_main.c
is generated. This option is located in the ERT code generation options (3)
category of the Real-Time Workshop pane of the Simulation Parameters dialog box, as shown in this figure.
Figure 2-1: 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:
BareBoardExample
: Generate a bare-board main program designed to run under control of a real-time clock, without a real-time operating system.
VxWorksExample
: Generate a fully commented example showing how to deploy the code under the VxWorks real-time operating system.
Regardless of which Target operating system you select, ert_main.c
includes
main()
function for the generated program
The operation of the main program and the scheduling algorithm employed depend primarily upon whether your model is single-rate or multi-rate, and also upon your model's solver mode (SingleTasking
vs. MultiTasking
). These are described in detail in Program Execution.
If you turn the Generate an example main program option off, the Real-Time Workshop Embedded Coder provides the module ert_main.c
as a basis for your custom modifications (see The Static Main Program Module).
![]() | Code Modules | Program Execution | ![]() |