Control whether to generate an example main program for a model.
Category: Code Generation > Templates
Default: on
Generates an example main program, ert_main.c
(or .cpp
).
The file includes:
The main()
function for the generated
program
Task 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 your model is single-rate or
multirate, and also on your model's solver mode (SingleTasking
or MultiTasking
).
Does not generate an example main program.
Note
The software provides static versions of the main file,
and matlabroot
/rtw/c/src/common/rt_main.c
,
as a basis for custom modifications. You can use either static main
file as a template for developing embedded applications.matlabroot
/rtw/c/src/common/rt_cppclass_main.cpp
After you generate and customize the main program, disable this option 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.
If you disable this option, the code generator produces slightly different rate grouping code to maintain compatibility with an older static main module.
This parameter enables Target operating system.
You must enable this parameter and select VxWorksExample
for Target
operating system if you use VxWorks®[1]
library blocks.
Parameter: GenerateSampleERTMain |
Type: character vector |
Value: 'on' | 'off' |
Default: 'on' |
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | No impact |
[1] VxWorks is a registered trademark of Wind River® Systems, Inc.