Diagnostics Pane: Sample Time

Sample Time Diagnostics Overview

Specify what diagnostic actions Simulink® software should take, if any, when it detects a compilation error related to model sample times.

Configuration

Set the parameters displayed.

Tips

  • To open the Sample Time pane, in the Simulink Editor, select Simulation > Model Configuration Parameters > Diagnostics > Sample Time.

  • The options are typically to do nothing or to display a warning or an error message.

  • A warning does not terminate a simulation, but an error does.

See Also

Source block specifies -1 sample time

Select the diagnostic action to take if a source block (such as a Sine Wave block) specifies a sample time of -1.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • The Random Source block does not obey this parameter. If its Sample time parameter is set to -1, the Random Source block inherits its sample time from its output port and never produces warnings or errors.

  • Some Communications System Toolbox™ blocks internally inherit sample times, which can be a useful and valid modeling technique. Set this parameter to none for these types of models.

Command-Line Information

Parameter: InheritedTsInSrcMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Discrete used as continuous

Select the diagnostic action to take if a discrete block (such as the Unit DelayUnit Delay block), inherits a continuous sample time from the block connected to its input.

Settings

Default: warning

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Command-Line Information

Parameter: DiscreteInheritContinuousMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Multitask rate transition

Select the diagnostic action to take if an invalid rate transition occurred between two blocks operating in multitasking mode.

Settings

Default: error

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • This parameter allows you to adjust error checking for sample rate transitions between blocks that operate at different sample rates.

  • Use this option for models of real-time multitasking systems to ensure detection of illegal rate transitions between tasks that can result in a task's output being unavailable when needed by another task. You can then use Rate Transition blocks to eliminate such illegal rate transitions from the model.

Command-Line Information

Parameter: MultiTaskRateTransMsg
Type: string
Value: 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Single task rate transition

Select the diagnostic action to take if a rate transition occurred between two blocks operating in single-tasking mode.

Settings

Default: none

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • This parameter allows you to adjust error checking for sample rate transitions between blocks that operate at different sample rates.

  • Use this parameter when you are modeling a single-tasking system. In such systems, task synchronization is not an issue.

Command-Line Information

Parameter: SingleTaskRateTransMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'none'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionnone or error

See Also

Multitask conditionally executed subsystem

Select the diagnostic action to take if Simulink software detects a subsystem that may cause data corruption or non-deterministic behavior.

Settings

Default: error

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • These types of subsystems can be caused by either of the following conditions:

    • Your model uses multitasking solver mode and it contains an enabled subsystem that operates at multiple rates.

    • Your model contains a conditionally executed subsystem that can reset its states and that contains an asynchronous subsystem.

    These types of subsystems can cause corrupted data or nondeterministic behavior in a real-time system that uses code generated from the model.

  • For models that use multitasking solver mode and contain an enabled subsystem that operates at multiple rates, consider using single-tasking solver mode or using a single-rate enabled subsystem instead.

  • For models that contain a conditionally executed subsystem that can reset its states and that contains an asynchronous subsystem, consider moving the asynchronous subsystem outside the conditionally executed subsystem.

Command-Line Information

Parameter: MultiTaskCondExecSysMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'error'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Tasks with equal priority

Select the diagnostic action to take if Simulink software detects two tasks with equal priority that can preempt each other in the target system.

Settings

Default: warning

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • This condition can occur when one asynchronous task of the target represented by this model has the same priority as one of the target's asynchronous tasks.

  • This option must be set to Error if the target allows tasks having the same priority to preempt each other.

Command-Line Information

Parameter: TasksWithSamePriorityMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionnone or error

See Also

Enforce sample times specified by Signal Specification blocks

Select the diagnostic action to take if the sample time of the source port of a signal specified by a Signal Specification block differs from the signal's destination port.

Settings

Default: warning

none

Simulink software takes no action.

warning

Simulink software displays a warning.

error

Simulink software terminates the simulation and displays an error message.

Tips

  • The Signal Specification block allows you to specify the attributes of the signal connected to its input and output ports. If the specified attributes conflict with the attributes specified by the blocks connected to its ports, Simulink software displays an error when it compiles the model, for example, at the beginning of a simulation. If no conflict exists, Simulink software eliminates the Signal Specification block from the compiled model.

  • You can use the Signal Specification block to ensure that the actual attributes of a signal meet desired attributes, or to ensure correct propagation of signal attributes throughout a model.

Command-Line Information

Parameter: SigSpecEnsureSampleTimeMsg
Type: string
Value: 'none' | 'warning' | 'error'
Default: 'warning'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionerror

See Also

Was this topic helpful?