Generate an example main program
Control generation of example main program
Model Configuration Pane: Code Generation / Templates
Description
Control whether to generate an example main program for model. This parameter is not relevant and is disabled for component models configured with a service interface.
Dependencies
This parameter enables Target operating system.
Settings
Default: on
- On
Generates an example main program,
ert_main.c
(or.cpp
) for a model. The file includes:The
main()
function for the generated programTask scheduling code that determines how and when block computations execute on each time step of the model
The operation of the main program and the scheduling algorithm employed depend primarily on whether the model:
Is single-rate or multirate
Solver mode is set to
SingleTasking
orMultiTasking
- Off
Does not generate an example main program.
Note
The software provides static versions of the main file,
andmatlabroot
/rtw/c/src/common/rt_main.c
, as a basis for custom modifications. You can use the static main file as a template for developing embedded applications.matlabroot
/rtw/c/src/common/rt_cppclass_main.cpp
Tips
After you generate and customize the main program, clear this parameter to prevent regenerating the main module and overwriting your customized version.
You can use a custom file processing (CFP) template file to override normal main program generation, and generate a main program module customized for your target environment.
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | No impact |
Programmatic Use
Parameter: GenerateSampleERTMain |
Type: character vector |
Value: 'on' | 'off' |
Default: 'on' |
Version History
Introduced before R2006a