Chart properties enable you to specify how your Stateflow® chart interfaces with a Simulink® model. You can specify chart properties in the Property Inspector, the Model Explorer, or the Chart properties dialog box.
Property Inspector
To open the Property Inspector, in the Modeling tab, select Property Inspector.
Click in the chart.
In the Property Inspector, edit the chart properties.
Model Explorer
To open the Model Explorer, in the Modeling tab, select Model Explorer.
In the Model Hierarchy pane, select the chart.
In the Chart pane, edit the chart properties.
Chart properties dialog box
Right-click in the chart.
Select Properties.
Edit the chart properties.
You can set the following chart properties in:
The main and Advanced sections of the Property Inspector.
The General tab of the Model Explorer or the Chart properties dialog box.
Name of the chart (read-only). When you click the chart name hyperlink, the chart opens in the Stateflow Editor.
Name of the Simulink subsystem (read-only). When you click the machine name hyperlink, the Machine properties dialog box opens. This property is not available in the Property Inspector.
Action language that defines the syntax for state and transition actions in the chart. Options include:
MATLAB
C
The default value is MATLAB
. For more
information, see Differences Between MATLAB and C as Action Language Syntax.
Type of state machine semantics to implement. Options include:
Classic
Mealy
Moore
Classic charts provide the full set of Stateflow semantics. Mealy and Moore charts use a subset of these semantics.
The default value is Classic
. For more information,
see Overview of Mealy and Moore Machines.
Method by which a simulation updates or wakes up a chart in a Simulink model.
Setting | Description |
---|---|
Inherited | Input from the Simulink model determines when the chart wakes up during a simulation (default). If you define
input events for the chart, the Stateflow chart is explicitly triggered by a signal
on its trigger port originating from a connected
Simulink block. You can set this trigger input
event to occur in response to a Simulink signal. The Simulink signal can be If you do not define input events, the Stateflow chart implicitly inherits triggers from the Stateflow model. These implicit events are the discrete or continuous sample times of the Stateflow signals providing inputs to the chart. If you define data inputs, the chart awakens at the rate of the fastest data input. If you do not define any data input for the chart, the chart wakes up as defined by the execution behavior of its parent subsystem. |
Discrete | The Simulink model generates an implicit event at regular time intervals to awaken the Stateflow chart at the rate that you specify in the Sample Time chart property. Other blocks in the Simulink model can have different sample times. |
Continuous | The Stateflow chart updates its state during major time steps only, although it computes outputs and local continuous variables during major and minor time steps. The chart can register zero crossings, which allows Simulink models to sample Stateflow charts whenever state changes occur. The Stateflow chart computes derivatives for local continuous variables. For more information, see Continuous-Time Modeling in Stateflow. |
The time interval at which the Stateflow chart wakes up during simulation. The sample time can be any
nonzero number. The sample time is in the same units as the Simulink simulation time. Other blocks in the Simulink model can have different sample times. This option is available
only when you set the chart property Update
method to Discrete
.
Specifies that zero-crossing detection is enabled (default). This option is
available only when you set the chart property Update
method to Continuous
. See Disable Zero-Crossing Detection.
Specifies that the operators &
, ^
,
|
, and ~
perform bitwise operations in
action statements (default). If you clear this check box:
&
, |
, and
~
perform logical operations.
^
performs the power operation.
This option is available only in charts that use C as the action language. For more information, see Supported Operations for Chart Data.
Specifies that the chart uses explicit ordering of parallel states and transitions (default). You determine the order in which the chart executes parallel states and tests transitions originating from a source. This option is available only in charts that use C as the action language. For more information, see Execution Order for Parallel States and Evaluate Transitions.
Extends the scope of functions defined at the root level of the chart to other parts of the model. This option enables Simulink Caller blocks to call Stateflow functions in the local hierarchy by using qualified notation chartName.functionName. For more information, see Export Stateflow Functions for Reuse.
Enables Stateflow and Simulink Caller blocks throughout the model to call functions exported from Stateflow without using qualified notation. This option is available only when you select the chart property Export chart level functions. For more information, see Export Stateflow Functions for Reuse.
Enables charts to interface directly with signals from Simulink models (default). The chart accepts only input signals whose data type matches the type of the corresponding Stateflow data object. Otherwise, a type mismatch error occurs. This option is available only in charts that use C as the action language. For more information, see Strong Data Typing with Simulink Inputs and Outputs.
Note
The Use strong data typing with Simulink I/O chart property is provided for backward compatibility. Clearing this check box can produce unpredictable results and is not recommended.
Specifies that the chart initializes its state configuration at time 0 instead of at the first occurrence of an input event. For more information, see Execution of a Chart at Initialization.
Specifies that the chart resets its output values every time that the chart wakes up, not only at time 0. Output values are reset whenever a chart is triggered by function call, edge trigger, or clock tick. If you set an initial value for an output data object, the output resets to that value. Otherwise, the output resets to zero. Select this option to:
Ensure that all outputs are defined in every chart execution.
Prevent latching of outputs (carrying over values of outputs computed in previous executions).
Provide all chart outputs with a meaningful initial value.
For more information, see Initial Value.
Specifies that the chart can take multiple transitions in each time step until
it reaches a stable state. This option is not available when you set the chart
property Update method to
Continuous
. For more information, see Super Step Semantics.
Specifies the maximum number of transitions that the chart can 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). This option is available only when you select the chart property Enable super step semantics. For more information, see Maximum Number of Iterations.
Specifies how the chart behaves after it reaches the maximum number of transitions in a time step.
Setting | Description |
---|---|
Proceed | Chart execution continues to the next time step. |
Throw Error | Simulation stops and an error message appears. This setting is valid only for simulation. In generated code, chart execution always proceeds. |
This option is available only when you select the chart property Enable super step semantics.
Specifies that chart supports input and output data that varies in dimension during simulation. See Declare Variable-Size Inputs and Outputs.
Specifies that integer overflows saturate in the generated code. See Handle Integer Overflow for Chart Data.
Generates a preprocessor conditional in the generated code. See Code Generation Using Variant Transitions.
Specifies how states behave when function-call input events reenable the chart. Options include:
Held
Reset
See Control States in Charts Enabled by Function-Call Input Events.
Specifies that the chart produces active state output. When you enable this option, you can select one of these activity types to output:
Child activity
Leaf state activity
You can set fixed-point properties for the chart in:
The Fixed Point Properties section of the Property Inspector.
The Fixed Point Properties tab of the Model Explorer or the Chart properties dialog box.
Fixed-point properties are available only in charts that use MATLAB® as the action language.
fi
ObjectsSpecifies whether the chart treats inherited fixed-point and integer signals
as Fixed-Point Designer™
fi
objects.
Setting | Description |
---|---|
Fixed-point | The chart treats all fixed-point inputs as
fi objects (default). |
Fixed-point &
Integer | The chart treats all fixed-point and integer inputs as
fi objects. |
fimath
Specifies default properties for the chart.
Setting | Description |
---|---|
Same as MATLAB
| Use the same fimath properties as the
current default fimath object in
MATLAB. |
Specify Other | Use your own default
|
For more information, see fimath Properties Usage for Fixed-Point Arithmetic (Fixed-Point Designer).
You can set additional properties for the chart in:
The Info tab of the Property Inspector.
The Documentation tab of the Model Explorer or the Chart properties dialog box.
Description of the chart. You can enter a brief description and comments.
Link to online documentation for the chart. You can enter a web URL address or a MATLAB command that displays documentation in a suitable online format, such as an HTML file or text in the MATLAB Command Window. When you click the Document link hyperlink, Stateflow evaluates the link and displays the documentation.
The Stateflow machine represents all of the Stateflow blocks in a model (including all charts, state transition tables, and truth tables). You can specify machine properties in the Machine properties dialog box.
Open the Model Explorer or the Chart properties dialog box for any chart in the model.
In the Machine chart property field, click the machine name link.
In the Machine properties dialog box, edit the properties for the Stateflow machine.
Name of the Simulink model that defines this Stateflow machine (read-only). You change the model name when you save the model.
Date on which this Stateflow machine was created (read-only).
Name of the person who created this Stateflow machine.
Comment text for recording modifications to the Simulink model that defines this Stateflow machine.
Comment text for recording the version of the Simulink model that defines this Stateflow machine.
Description of the Stateflow machine. You can enter a brief description and comments.
Link to online documentation for the Stateflow machine. You can enter a web URL address or a MATLAB command that displays documentation in a suitable online format, such as an HTML file or text in the MATLAB Command Window. When you click the Document link hyperlink, Stateflow evaluates the link and displays the documentation.