Main Content

Default Parameter Behavior

Represent numeric block parameters in generated code

Model Configuration Pane: PLC Code Generation / Optimization

Description

The Default parameter behavior parameter specifies how to transform numeric block parameters into constant inlined values in the generated code.

Settings

Tunable (default) | Inlined

Default: Tunable for GRT targets | Inlined for ERT targets

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 class Auto, including numeric MATLAB® variables, as tunable fields of a global parameters structure.

Tips

  • Whether you set Default parameter behavior to Inlined or to Tunable, create parameter data objects to preserve tunability for block parameters. For more information, see Create Tunable Calibration Parameter in the Generated Code (Simulink Coder).

  • 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:

    • All referenced models must set Default parameter behavior to Inlined if the top model has Default parameter behavior set to Inlined.

    • The top model can specify Default parameter behavior as Tunable or Inlined.

  • 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

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOn
Safety precautionNo impact

Programmatic Use

Parameter:PLC_PLCEnableVarReuse
Type: string
Value: 'Inlined' | 'Tunable'
Default:Tunable for GRT targets | Inlined for ERT targets

Version History

Introduced in R2012b