Main Content

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 or ert_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 AroundCustomized ert_main.cCustomized 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, in ert_main, between the model_output call and the model_update call, read the model External outputs global data structure (defined in model.h). X 
    Select parameter Single output/update function. Insert code in the generated model.c or .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 model External outputs global data structure (defined in model.h). Then, restore the value after the update code completes.XX
    Place a Zero-Order Hold block before the continuous output port.XX

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

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff (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