Documentation Center

  • Trial Software
  • Product Updates

Diagnostics Pane: Stateflow

Stateflow Diagnostics Overview

Specify the diagnostic actions to take for detection of undesirable chart designs.

Configuration

Set the parameters displayed.

Tips

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

  • 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

Unused data and events

Select the diagnostic action to take for detection of unused data and events in a chart. Removing unused data and events can minimize the size of your model.

Settings

Default: warning

none

No warning or error appears.

warning

A warning appears, with a link to delete the unused data or event in your chart.

error

An error appears and stops the simulation.

Tip

This diagnostic does not detect the following types of data and events:

  • Machine-parented data

  • Inputs and outputs of MATLAB® functions

  • Input events

Command-Line Information

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

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
EfficiencyNo impact (for simulation)
none (for production code generation)
Safety precautionwarning

See Also

Unexpected backtracking

Select the diagnostic action to take when a chart junction has both of the following conditions. The junction:

  • Does not have an unconditional transition path to a state or a terminal junction

  • Has multiple transition paths leading to it

This chart configuration can lead to undesired backtracking during simulation.

Settings

Default: warning

none

No warning or error appears.

warning

A warning appears, with a link to examples of undesired backtracking.

error

An error appears and stops the simulation.

Tip

To avoid undesired backtracking, consider adding an unconditional transition from the chart junction to a terminal junction.

Command-Line Information

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

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
EfficiencyNo impact (for simulation)
No impact (for production code generation)
Safety precautionerror

See Also

Invalid input data access in chart initialization

Select the diagnostic action to take when a chart:

  • Has the ExecuteAtInitialization property set to true

  • Accesses input data on a default transition or associated state entry actions, which execute at chart initialization

In this chart configuration, blocks that connect to chart input ports might not initialize their outputs during initialization. Use this diagnostic to locate this configuration in your model and correct it.

Settings

Default: warning

none

No warning or error appears.

warning

A warning appears.

error

An error appears and stops the simulation.

Tip

In charts that do not contain states, the ExecuteAtInitialization property has no effect.

Command-Line Information

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

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
EfficiencyNo impact (for simulation)
No impact (for production code generation)
Safety precautionerror

See Also

No unconditional default transitions

Select the diagnostic action to take when a chart does not have an unconditional default transition to a state or a junction.

This chart configuration can cause inconsistency errors. Use this diagnostic to locate this configuration in your model and correct it. If a chart contains local event broadcasts or implicit events, detection of a state inconsistency might not be possible until run time.

Settings

Default: warning

none

No warning or error appears.

warning

A warning appears.

error

An error appears and stops the simulation.

Command-Line Information

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

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
EfficiencyNo impact (for simulation)
none (for production code generation)
Safety precautionerror

See Also

Transition outside natural parent

Select the diagnostic action to take when a chart contains a transition that loops outside the parent state or junction.

Settings

Default: warning

none

No warning or error appears.

warning

A warning appears.

error

An error appears and stops the simulation.

Command-Line Information

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

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
EfficiencyNo impact (for simulation)
none (for production code generation)
Safety precautionerror

See Also

Transition shadowing

Select the diagnostic action to take when a chart contains multiple unconditional transitions that originate from the same state or junction.

Settings

Default: warning

none

No warning or error appears.

warning

A warning appears.

error

An error appears and stops the simulation.

Command-Line Information

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

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
EfficiencyNo impact (for simulation)
none (for production code generation)
Safety precautionerror

See Also

Undirected event broadcasts

Select the diagnostic action to take when a chart contains undirected local event broadcasts.

Undirected local event broadcasts can cause unwanted recursive behavior in a chart and inefficient code generation. Use this diagnostic to flag these types of event broadcasts and fix them.

Settings

Default: warning

none

No warning or error appears.

warning

A warning appears.

error

An error appears and stops the simulation.

Command-Line Information

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

Recommended Settings

ApplicationSetting
Debuggingwarning
TraceabilityNo impact
Efficiencywarning
Safety precautionerror

See Also

Transition action specified before condition action

Select the diagnostic action to take when a transition action executes before a condition action in a transition path with multiple transition segments.

When a transition with a specified transition action precedes a transition with a specified condition action in the same transition path, out-of-order execution can occur. Use this diagnostic to flag such behavior in your chart and fix it.

Settings

Default: warning

none

No warning or error appears.

warning

A warning appears.

error

An error appears and stops the simulation.

Command-Line Information

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

Recommended Settings

ApplicationSetting
Debuggingwarning
Traceabilitywarning
Efficiencywarning
Safety precautionwarning

See Also

Was this topic helpful?