Documentation

Specify Chart Properties

About Chart Properties

Chart properties allow you to specify how your chart interfaces with the Simulink® model. You can specify properties for a single chart or all charts in a model.

Set Properties for a Single Chart

To specify properties for a single chart, edit the properties in the Property Inspector or right-click in the chart and select Properties.

Field

Description

Name

Stateflow® chart name (read-only).

Machine

Simulink subsystem name (read-only).

Available only in the Chart properties dialog box. Not available in the Symbols window.

Action Language

Action language for programming the chart. Choices are C or MATLAB. For more information, see Modify the Action Language for a Chart.

In Advanced section of the Property Inspector.

State Machine Type

Type of state machine to create. Choices are:

  • Classic: Default state machine. Provides full set of semantics for MATLAB charts and C charts.

  • Mealy: State machine in which output is a function of inputs and state.

  • Moore: State machine in which output is a function only of state.

Mealy and Moore charts use a subset of Stateflow chart semantics.

In Advanced section of the Property Inspector.

Update method

Method by which a simulation updates (wakes up) a chart in a Simulink model (see Set the Stateflow Block Update Method). You can select Inherited, Discrete, or Continuous. For more information about continuous updating, see Model Hybrid Systems with Model Logic.

Sample Time

If Update method is Discrete, enter a sample time.

Enable zero-crossing detection

If Update method is Continuous, zero-crossing detection is enabled by default. See When to Enable Zero-Crossing Detection.

Enable C-bit operations

For C charts only. To interpret the following operators ( ~, &, |, and ^) as C bitwise operators, not logical operators, in action statements (default), select this check box.

If you clear this check box, the following occurs:

  • & , | and ~ are interpreted as logical operators.

  • ^ is interpreted as the power operator (for example, 2^3 = 8).

Other bit operations such as >> and << are interpreted as bit operations regardless of this setting.

In Advanced section of the Property Inspector.

User specified state/transition execution order

To use explicit ordering of parallel states and transitions (default), select this check box. In this mode, you have complete control of the order in which parallel states are executed and transitions originating from a source are tested for execution. For more information, see Execution Order for Parallel States and Transition Testing Order in Multilevel State Hierarchy.

In Advanced section of the Property Inspector.

Export Chart Level Functions

To export functions defined at the root level of the chart, select this check box. This allows Simulink Caller blocks to call Stateflow functions in the local hierarchy using qualified notation chartName.functionName. For more information, see Export Stateflow Functions for Reuse.

In Advanced section of the Property Inspector.

Treat Exported Functions as Globally Visible

To allow Stateflow and Simulink Caller blocks throughout the model to call the Stateflow functions, select this check box. Do not use qualified notation to call these functions.

In Advanced section of the Property Inspector.

Use Strong Data Typing with Simulink I/O

If selected, the chart accepts input signals of any data type supported by Simulink software, provided that the type of the input signal matches the type of the corresponding chart input data item. If the types do not match, an error occurs.

If cleared, the chart accepts and outputs only signals of type double. In this case, Stateflow software converts Simulink input signals to the data types of the corresponding chart input data items. Similarly, Stateflow software converts chart output data to type double.

For fixed-point data, the Use Strong Data Typing with Simulink I/O option is always on. If an input or output of fixed-point type in a chart does not match its counterpart in a model, an error occurs.

See Share Output Data with Simulink.

Execute (enter) Chart At Initialization

Select this check box if you want a chart's state configuration to be initialized at time 0 instead of at the first occurrence of an input event (see Execution of a Chart at Initialization).

Initialize Outputs Every Time Chart Wakes Up

Interprets the initial value of outputs every time a chart wakes up, not only at time 0. When you set an initial value for an output data object, the output will be reset to that value.

Outputs are reset whenever a chart is triggered, whether by function call, edge trigger, or clock tick.

Enable this option to:

  • Ensure all outputs are defined in every chart execution

  • Prevent latching of outputs (carrying over values of outputs computed in previous executions)

  • Give all chart outputs a meaningful initial value

In Advanced section of the Property Inspector.

Enable Super Step Semantics

Select to enable charts to take multiple transitions in each time step until it reaches a stable state. For more information, see Execution of a Chart with Super Step Semantics.

In Advanced section of the Property Inspector.

Maximum Iterations in Each Super Step

If you enable super step semantics, specify the maximum number of transitions the chart should take in each time step. The chart always takes one transition during a super step, so the value N that you specify represents the maximum number of additional transitions (for a total of N+1). For more information, see What Is Maximum Number of Iterations? Try to choose a number that allows the chart to reach a stable state within the time step, based on the mode logic of your chart.

In Advanced section of the Property Inspector.

Behavior after too many iterations

If you enable super step semantics, specify how the chart behaves after reaching the maximum number of transitions before taking all valid transitions. Options include:

  • Proceed — Chart execution continues to the next time step

  • Throw Error — Simulation stops and an error message appears

In Advanced section of Property Inspector.

    Note:   The Throw Error option is valid only for simulation. In generated code, chart execution always proceeds.

Support variable-size arrays

Select to support chart input and output data that vary in dimension during simulation. For more information, see Declare Variable-Size Inputs and Outputs.

Saturate on integer overflow

Select to specify that integer overflows saturate in the generated code. For more information, see Handle Integer Overflow for Chart Data.

In Advanced section of the Property Inspector.

Create output for monitoring:

Select to create output to monitor state activity. Choose:

  • Child activity

  • Leaf state activity

  • Self activity

See About Active State Data.

States When Enabling

If your chart uses function-call input events, specify how states behave when the event reenables the chart. Options include:

  • Held — Maintain most recent values of the states.

  • Reset — Revert to the initial conditions of the states.

  • Inherit — Inherit this setting from the parent subsystem.

For more information, see Control States When Function-Call Inputs Reenable Charts.

Treat these inherited Simulink signal types as fi objects

For MATLAB charts only. Determines whether to treat inherited fixed-point and integer signals as Fixed-Point Designer™ fi objects.

  • If set to Fixed-point (default), the MATLAB chart treats all fixed-point inputs as fi objects.

  • If set to Fixed-point & Integer, the MATLAB chart treats all fixed-point and integer inputs as fi objects.

In Advanced section of the Property Inspector.

MATLAB Chart fimath

For MATLAB charts only. Default fimath properties for the MATLAB chart. . Otherwise, specify the default fimath properties by constructing the fimath object in the MATLAB or model workspace and setting the property equal to the variable name.

  • If set to Same as MATLAB Default, the chart uses the same fimath properties as the current default fimath

  • If set to Specify Other, you can specify your own default fimath object. Either construct the fimath object inside the edit box, or create it in the MATLAB or model workspace, and enter its variable name in the edit box.

In Advanced section of the Property Inspector.

Description

Textual description/comment.

In Info tab of Property Inspector.

Document link

Enter a Web URL address or a general MATLAB® command. Examples are www.mathworks.com, mailto:email_address, and edit/spec/data/speed.txt.

In Info tab of the Property Inspector.

Set Properties for All Charts in the Model

You can set some properties for all charts in the model by setting properties for the Stateflow machine, which represents all of the Stateflow blocks in a model.

To set properties for the Stateflow machine:

  1. In the Chart properties dialog box for a particular chart, select the Machine link at the top of the dialog box.

    The Machine properties dialog box appears.

  2. Enter information in the fields that appear.

    Field

    Description

    Simulink Model

    Name of the Simulink model that defines this Stateflow machine (read-only). You change the model name in the Simulink window when you save the model under a chosen file name.

    Creation Date

    Date on which this machine was created, which is read-only.

    Creator

    Name of the person who created this Stateflow machine.

    Modified

    Time of the most recent modification of this Stateflow machine.

    Version

    Version number of this Stateflow machine.

    Use C-like bit operations in new charts

    For C charts only. Select this check box for all new C charts to interpret the following operators ( ~, &, |, and ^) as C bitwise operators, not logical operators, in action statements.

    You can enable or disable this option for individual C charts in the individual chart's property dialog box. See Set Properties for a Single Chart for a detailed explanation of this property.

    Description

    Brief description of this Stateflow machine, which is stored with the model that defines it.

    Document link

    MATLAB expression that, when evaluated, displays documentation for this Stateflow machine.

  3. Click one of these buttons:

    • Apply saves the changes.

    • Cancel closes the dialog box without making any changes.

    • OK saves the changes and closes the dialog box.

    • Help displays the online help in an HTML browser window.

Was this topic helpful?