| Real-Time Workshop® | ![]() |
The Application lifespan (days) parameter lets you control the allocation of memory for absolute and elapsed time counters. Such counters exist in the code for blocks that use absolute or elapsed time. For a list of such blocks, see Blocks That Depend on Absolute Time.
The size of the time counters in generated code is 8, 16, 32, or 64 bits. The size is set automatically to the minimum that can accommodate the duration value specified by Application lifespan (days) given the step size specified in the Configuration Parameters Solver pane. To minimize the amount of RAM used by time counters, specify a lifespan no longer than necessary, and a step size no smaller than necessary.
An application is guaranteed to be able to run to its specified lifespan. It may be able to run longer, but is not guaranteed to do so. For example, running a model with a step size of one millisecond (0.001 seconds) for one day requires a 32-bit timer, which could continue running without overflow for 49 days more.
To maximize application lifespan, specify Application lifespan (days) as inf. This value allocates 64 bits (two uint32 words) for each timer. Using 64 bits to store timing data would allow a model with a step size of 0.001 microsecond (10E-09 seconds) to run for more than 500 years, which would rarely be required. 64-bit counters do not violate the usual Real-Time Workshop® length limitation of 32 bits because the value of a time counter never provides the value of a signal, state, or parameter.
For information about the allocation and operation of absolute and elapsed time counters, see Timing Services. For information about asynchronous timing, see Using Timers in Asynchronous Tasks. For information about the effect of the Application lifespan (days) parameter on simulation, see Application lifespan (days) in the Simulink® documentation.
![]() | Configuring a Loop Unrolling Threshold | Optimizing Code Resulting from Floating-Point to Integer Conversions | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |