Sample time properties
Discrete sample time periods, offsets, and priorities
Model Configuration Pane: Solver
Description
Specify priority for each sample time in the model.
Dependencies
To enable this parameter, set the Periodic sample time constraint parameter to Specified
.
Settings
3
matrixSpecify the sample time properties as an n-by-3
matrix
where n is equal to the number of discrete sample times in the model.
Each row of the matrix has this form:
[period, offset, priority]
period
— Sample time periodoffset
— Sample time offset relative to other blocks with the same periodpriority
— Execution priority of the real-time task associated with the sample time
Specify the sample time properties in order from highest priority to lowest priority. During simulation, higher priority tasks run first and can interrupt lower priority tasks as needed. Faster rates must have higher priorities. Continuous sample time always has the highest priority.
For example, specifying the value as [[0.1, 0, 10]; [0.2, 0, 11]; [0.3, 0,
12]]
:
Declares that the model should specify three sample times
Sets the fundamental sample time period to 0.1 second
Assigns priorities of 10, 11, and 12 to the sample times
Assumes that higher priority values indicate lower priorities
Recommended Settings
The table summarizes recommended values for this parameter based on considerations related to code generation.
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | Period, offset, and priority of each sample time in the model |
Programmatic Use
Parameter: SampleTimeProperty |
Type: structure |
Value: n-by-3 matrix |
Default: [] |
Version History
Introduced in R2007a