Rate Transition block code
Format for rate transition block code and data
Model Configuration Pane: Code Generation / Code Placement
Description
Specify the format for Rate Transition block code and data. Inline the code with the model code or create separate functions that the model code calls with state data in a dedicated structure.
Dependencies
This parameter requires an Embedded Coder® license.
Appears only for ERT-based targets.
Settings
Inline
(default) | Function
Default: Inline
Inline
Inline Rate Transition block code with model code. Declare Rate Transition block state data in global block state structure.
Function
Separate Rate Transition block code and data from the model code and data. The generated code contains separate
get
andset
functions that themodel_step
functions call and a dedicated structure for state data. The generated code also contains separate start and initialize functions that themodel_initialize
function calls.
Recommended Settings
Application | Setting |
---|---|
Debugging | Function |
Traceability | Function |
Efficiency | Inline |
Safety precaution | No impact |
Note
The code generator does not separate code and data for Rate Transition blocks that have variable-size signals or are inside a For Each Subsystem block.
In the Rate Transition block parameters dialog box, you must select the Ensure data integrity during data transfer parameter. If you do not select this parameter, the model produces an error during code generation.
In Configuration Parameters dialog box, the Multitask data transfer parameter must be set to
error
. If this parameter is not set toerror
, Embedded Coder disables the Rate Transition block code parameter and the code generator inlines Rate Transition block code.
Programmatic Use
Parameter: RateTransitionBlockCode |
Value: 'Inline' | 'Function' | |
Default: 'Inline' |
Version History
Introduced in R2018a