| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Real-Time Workshop |
| Contents | Index |
| Learn more about Real-Time Workshop |
| On this page… |
|---|
For details about solver options, see Solver Pane in the Simulink reference documentation.
The stop time must be greater than or equal to the start time. If the stop time is zero, or if the total simulation time (Stop minus Start) is less than zero, the generated program runs for one step. If the stop time is set to inf, the generated program runs indefinitely.
When using the GRT or Wind River Systems Tornado targets, you can override the stop time when running a generated program from the Microsoft Windows command prompt or UNIX[1] command line. To override the stop time that was set during code generation, use the -tf switch.
model -tf n
The program runs for n seconds. If n = inf, the program runs indefinitely. See Getting Started in the Real-Time Workshop documentation for an example of the use of this option.
Certain blocks have a dependency on absolute time. If you are designing a program that is intended to run indefinitely (Stop time = inf), and your generated code does not use the rtModel data structure (that is, it uses simstructs instead), you must not use these blocks. See Limitations on the Use of Absolute Time for a list of blocks that can potentially overflow timers.
If you know how long an application that depends on absolute time needs to run, you can ensure that timers do not overflow and that they use optimal word sizes by specifying the Application lifespan (days) parameter on the Optimization pane. See Controlling Memory Allocation for Time Counters for details.
For code generation, you must configure a model to use a fixed-step solver for all targets except the S-function and RSim targets. You can configure the S-function and RSim targets with a fixed-step or variable-step solver.
The Real-Time Workshop product supports both single-tasking and multitasking modes for periodic sample times. See Scheduling Considerations for details.
[1] UNIX is a registered trademark of The Open Group in the United States and other countries.
![]() | Using Timers | Simulation Considerations That Affect Code Generation | ![]() |

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