Target Language Compiler    

Sample Time Information

The sample time information written to model.rtw file describes the rates at which the model executes. The FundamentalStepSize corresponds to the base rate for the fastest task in a model.

The InvariantConstants field is set as a result of the Inline parameters check box in the Real-Time Workshop page of the Simulation Parameters dialog box. This allows you to globally select whether or not parameter inlining is to be used in generated code. An inlined parameter results in a parameter value being hard-coded in the generated code. Consequently, this value cannot be altered by any parameter tuning method. You can override invariant constants on one or more selected signals by selecting Tunable parameters and specifying the variable name.

The SampleTime list contains all periodic rates found within your model. This list excludes constant and triggered sample times.

Table A-6: Model.rtw Sample Times 
Variable/Record Name
Description
AllSampleTimesInherited

yes if all blocks in the model have inherited sample times, no otherwise.

InvariantConstants

yes if invariant constants (i.e., Inline parameters check box) is on, no if invariant constants is off.

FundamentalStepSize

Fundamental step size or 0.0 if one cannot be determined. Fixed step solvers will always have a nonzero step size. Variable step solvers may have a fundamental step size of 0.0 if one can not be computed from the sample times in the model.

SingleRate

yes if the model is single rate, no otherwise. A model is considered single-rate if either:

  • The number of system sample times is one (excluding triggered and constant).
  • The number of system sample times is two, the tids are 0 and 1, TID01EQ is true, and the system has no continuous states.
NumSampleTimes

Number of sample times in the model followed by SampleTime info records, giving the TID (task ID), an index into the sample time table, and the period and offset for the sample time.

SampleTime {

One record for each sample time.

  TID

Task ID for this sample time.

  PeriodAndOffset

Period and offset for this sample time.

}

NumVariableSampleTimes

The number of variable sample times in the model.


  Data Structure Sizes Data Type Information (DataTypes record)