Default parameter behavior
Represent numeric block parameters in generated code
Model Configuration Pane: Code Generation / Optimization
Description
The Default parameter behavior parameter specifies how to represent
numeric block parameters in the generated code. When using Embedded Coder® for a component model that is configured with a service interface, this
parameter must be set to Inlined
.
Dependencies
When you set Default parameter behavior to Inlined
, you enable Inline invariant signals configuration parameter.
Settings
Tunable
for GRT targets,
Inlined
for ERT targets (default)Inlined
Set Default parameter behavior to
Inlined
to reduce global RAM usage and increase efficiency of the generated code. The code does not allocate memory to represent numeric block parameters such as the Gain parameter of a Gain block. Instead, the code inlines the literal numeric values of these block parameters.Tunable
Set Default parameter behavior to
Tunable
to enable tunability of numeric block parameters in the generated code. The code represents numeric block parameters and variables that use the storage classAuto
, including numeric MATLAB® variables, as tunable fields of a global parameters structure.
Tips
Whether you set Default parameter behavior to
Inlined
or toTunable
, create parameter data objects to preserve tunability for block parameters. For more information, see Create Tunable Calibration Parameter in the Generated Code.If you configure a block parameter to use the storage class
Define
, the generated code uses variables with#define
macros to represent the parameter, and the storage class setting overrides Default parameter behavior.When you switch from a system target file that is not ERT-based to one that is ERT-based, Default parameter behavior sets to
Inlined
by default. However, you can change the setting of Default parameter behavior later.When a top model uses referenced models or if a model is referenced by another model:
Referenced models must set Default parameter behavior to
Inlined
if the top model has Default parameter behavior set toInlined
.The top model can specify Default parameter behavior as
Tunable
orInlined
.
If your model contains an Environment Controller block, you can suppress code generation for the branch connected to the Sim port if you set Default parameter behavior to
Inlined
and the branch does not contain external signals.
Recommended Settings
Application | Setting |
---|---|
Debugging | Tunable during developmentInlined for production code generation |
Traceability | Tunable |
Efficiency | Inlined |
Safety precaution | No impact |
Programmatic Use
Parameter: DefaultParameterBehavior |
Type: character vector |
Value: 'Inlined' | 'Tunable' |
Default: 'Tunable' for GRT targets | 'Inlined' for ERT targets |
Version History
Introduced in R2015b