| Contents | Index |
| On this page… |
|---|
Generate Code for Discrete and Continuous Time Blocks |
The ERT target supports code generation for discrete and continuous time blocks. If the Support continuous time option is selected, you can use any such 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 Simulink Fixed Point 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:
showblockdatatypetable
The ERT target supports continuous solvers. In the Solver options dialog, you can select any available solver in the Solver menu. (Note that the solver Type must be fixed-step for use with the ERT target.)
Note Custom targets must be modified to support continuous time. The required modifications are described in Custom Targets in the Simulink Coder documentation. |
The ERT target supports the stop time for a model. When generating host-based executables, the stop time value is honored when any one of the following is true:
Classic call interface is selected on the Interface pane
External mode is selected in the Data exchange subpane of the Interface pane
MAT-file logging is selected on the Interface pane
Otherwise, the executable runs indefinitely.
Note The ERT target provides both 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, you should consider including support for checking these flags. |
![]() | Scheduling Considerations | Optimize Task Scheduling for Multirate Multitasking Models on RTOS Targets | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |