Main Content

Use Discrete and Continuous Time

Support for Discrete and Continuous Time Blocks

The ERT system target file supports code generation for discrete and continuous time blocks. If you select model configuration parameter Support: continuous time, you can use these blocks in your models, without restriction.

Note that use of certain blocks is not recommended for production code generation for embedded systems. The Simulink® Block Data Type Support table summarizes characteristics of blocks in the Simulink and Fixed-Point Designer™ block libraries, including whether or not they are recommended for use in production code generation. To view this table, execute the following command and see the “Code Generation Support” column of the table that appears:


Support for Continuous Solvers

The ERT target supports continuous solvers. In the Solver options dialog, you can select an available solver in the Solver menu. (Note that the solver Type must be fixed-step for use with the ERT target.)


Custom targets must be modified to support continuous time. The required modifications are described in Customize System Target Files.

Support for Stop Time

The ERT target supports the stop time for a model. When generating host-based executables, the stop time value is honored if one of these model configuration parameters is selected:

  • External mode

  • MAT-file logging

  • Classic call interface

Otherwise, the executable runs indefinitely.

The ERT system target file provides generated and static examples of the ert_main.c file. The ert_main.c file controls the overall model code execution by calling the model_step function and optionally checking the ErrorStatus/StopRequested flags to terminate execution. For a custom target, if you provide your own custom static main.c, consider including support for checking these flags.

Related Topics