Stateflow.Machine - Container for Stateflow blocks in a Simulink model - MATLAB (original) (raw)
Container for Stateflow blocks in a Simulink model
Description
Creation
You automatically create a Stateflow.Machine
object when you load a model that contains a Stateflow block or call the function sfnew. To access the Stateflow.Machine
object, call thefind function for theSimulink.Root
object. For example, if your Simulink model is named myModel
, enter:
machine = find(sfroot,"-isa","Stateflow.Machine",Name="myModel");
Properties
Stateflow API objects have properties that correspond to the values you set in the Stateflow Editor. To access or modify a property, use dot notation. To access or modify multiple properties for multiple API objects, use the get
andset
functions, respectively. For more information, see Modify Properties and Call Functions of Stateflow Objects.
Content
This property is read-only.
Name of the Simulink model for the machine, specified as a character vector.
This property is read-only.
Full file path of the Simulink model for the machine, specified as a character vector.
This property is read-only.
Whether the Simulink model for the machine builds a library and not an application, specified as a numeric or logical 1 (true
) or 0 (false
).
Debugging
Debugger properties for charts in the machine, specified as a Stateflow.MachineDebug object with these properties:
Animation.Enabled
— Whether to animate the charts in the machine during simulation, specified as a numeric or logical 1 (true
) or 0 (false
). Disabling this property is equivalent to selectingNone
in theAnimation Speed drop-down list in theDebug tab.Animation.Delay
— Delay that the chart animation uses for highlighting each transition segment in the machine, specified as a scalar. These values correspond to the settings of the Animation Speed drop-down list in the Debug tab:Delay Value Animation Speed 0.5 Slow 0.2 Medium 0 Fast -1 Lightning Fast Animation.MaintainHighlighting
— Whether to maintain the highlighting of active states in the machine after the simulation ends, specified as a numeric or logical 1 (true
) or 0 (false
).
Example: machine.Debug.Animation.Enabled = true;
Example: machine.Debug.Animation.Delay = -1;
Hierarchy
This property is read-only.
Location of the machine in the model hierarchy, specified as a character vector.
Whether the Simulink model for the machine has changed after being opened or saved, specified as a numeric or logical 1 (true
) or 0 (false
).
Whether the machine is locked, specified as a numeric or logical 1 (true
) or 0 (false
). Enable this property to prevent changes in the Stateflow charts, state transition tables, and truth table blocks in this machine.
This property is read-only.
Whether the machine is locked, specified as a numeric or logical 1 (true
) or 0 (false
). This property is equivalent to the property Locked
, but is used internally to prevent changes in the machine during simulation.
Identification
This property is read-only.
Date of the creation of the machine, specified as a character vector.
Creator of the machine, specified as a string scalar or character vector.
Record of modifications to the machine, specified as a string scalar or character vector.
Version of the machine, specified as a string scalar or character vector.
Description for the machine, specified as a string scalar or character vector.
Document link for the machine, specified as a string scalar or character vector.
User-defined tag for the machine, specified as data of any type.
This property is read-only.
Unique identifier, specified as an integer scalar. Use this property to distinguish the machine from other objects in the model. The value of this property is reassigned every time you start a new MATLAB® session and may be recycled after an object is deleted.
Object Functions
find | Identify specified objects in hierarchy |
---|---|
dialog | Open properties dialog box |
Examples
Update the Modified
and Version
properties of machine machine
.
machine.Modified = string(datetime); oldVersion = str2double(machine.Version); if isnan(oldVersion) machine.Version = "1"; else machine.Version = string(oldVersion+1); end
Version History
Introduced before R2006a