This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Sample time properties

Description

Specify and assign priorities to the sample times that this model implements.

Category: Solver

Settings

No Default

  • Enter an Nx3 matrix with rows that specify the model's discrete sample time properties in order from fastest rate to slowest rate.

  • Faster sample times must have higher priorities.

Format

[period, offset, priority]
periodThe time interval (sample rate) at which updates occur during the simulation.
offsetA time interval indicating an update delay. The block is updated later in the sample interval than other blocks operating at the same sample rate.
priorityExecution priority of the real-time task associated with the sample rate.

See Specify Sample Time for more details and options for specifying sample time.

Example

[[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 higher priority values indicate lower priorities — the Higher priority value indicates higher task priority option is not selected.

Tips

  • If the model's fundamental rate differs from the fastest rate specified by the model, specify the fundamental rate as the first entry in the matrix followed by the specified rates, in order from fastest to slowest. See Purely Discrete Systems.

  • If the model operates at one rate, enter the rate as a three-element vector in this field — for example, [0.1, 0, 10].

  • When you update a model, Simulink® software displays an error message if what you specify does not match the sample times defined by the model.

  • If Periodic sample time constraint is set to Unconstrained, Simulink software assigns priority 40 to the model base sample rate. If Higher priority value indicates higher task priority is selected, Simulink software assigns priorities 39, 38, 37, and so on, to subrates of the base rate. Otherwise, it assigns priorities 41, 42, 43, and so on, to the subrates.

  • Continuous rate is assigned a higher priority than is the discrete base rate regardless of whether Periodic sample time constraint is Specified or Unconstrained.

Dependencies

This parameter is enabled by selecting Specified from the Periodic sample time constraint list.

Command-Line Information

Parameter: SampleTimeProperty
Type: structure
Value: any valid matrix
Default: []

Note

If you specify SampleTimeProperty at the command line, you must enter the sample time properties as a structure with the following fields:

  • SampleTime

  • Offset

  • Priority

Related Topics