Main Content

Support: continuous time

Description

Specify whether to generate code for blocks that use continuous time.

Category: Code Generation > Interface

Settings

Default: off

On

Generates code for blocks that use continuous time.

Off

Does not generate code for blocks that use continuous time. If you do not select this option and the model includes blocks that use continuous time, an error occurs during code generation.

Dependencies

  • This parameter only appears for ERT-based targets.

  • This parameter requires an Embedded Coder® license to generate code.

  • This parameter must be on for models that include blocks that require absolute or elapsed time values.

  • This parameter is cleared if you select parameter Remove error status field in real-time model data structure.

  • If both the following conditions exist, output values read from ert_main for a continuous output port can differ from the corresponding output values in logged data for a model:

    • You customize ert_main.c or .cpp to read model outputs after each base-rate model step.

    • You select parameters Support: continuous time and Single output/update function.

    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. The following 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

Command-Line Information

Parameter: SupportContinuousTime
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff (execution, ROM), No impact (RAM)
Safety precaution

No recommendation

Related Topics