Support: continuous time
Code generation for blocks that use continuous time
Model Configuration Pane: Code Generation / Interface
Description
The Support: continuous time parameter specifies whether to generate code for blocks that use continuous time.
This parameter is not relevant and, therefore, is not supported for component models configured with a service code interface.
Simulink® clears this parameter if you select the Remove error status field in real-time model data structure parameter.
Output values read from
ert_main
for a continuous output port can differ from the corresponding output values in logged data if these conditions exist:You select this parameter and the Single output/update function.
You customize
ert_main.c
orert_main.cpp
to read model output values after each base-rate model step.
The difference occurs because, while logged data captures output at major time steps, output read from
ert_main
after the base-rate model step can capture output at intervening minor time steps. This table lists workarounds that eliminate the discrepancy.Work Around Customized ert_main.c Customized ert_main.cpp Separate the generated output and update functions (clear parameter Single output/update function), and insert code in ert_main
to read model output values reflecting only the major time steps. For example, inert_main
, between the
call and themodel
_output
call, read the modelmodel
_updateExternal outputs
global data structure (defined in
).model
.hX Select parameter Single output/update function. Insert code in the generated
ormodel
.c.cpp
file that returns model output values reflecting only major time steps. For example, in the model step function, between the output code and the update code, save the value of the modelExternal outputs
global data structure (defined in
). Then, restore the value after the update code completes.model
.hX X Place a Zero-Order Hold block before the continuous output port. X X
Settings
Off
(default) | On
- On
Enables generation of code for blocks that use continuous time.
- Off
Disable generation of code for blocks that use continuous time. If you clear this parameter and the model includes blocks that use continuous time, the code generator returns an error.
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | Off (execution, ROM), No impact (RAM) |
Safety precaution | No recommendation |
Programmatic Use
Parameter: SupportContinuousTime |
Type: character vector |
Value: 'on' | 'off' |
Default: 'off' |
Version History
Introduced before R2006a