Using Stateflow     Search    Help Desk 

Data Properties

Items of data can have the following properties:

Data Name

A data name can consist of any alphanumeric and special character combination, with the exception of embedded spaces. The name cannot begin with a numeric character. The length of a name is not restricted.

Data Parent

The parent of a data item determines the objects that can access it. Specifically, only the item's parent and descendants of that parent can access the item. You specify the parent of a datum when you add it to the data dictionary.

Data Scope

A data object's scope specifies where it resides in memory relative to its parent. These are the options for the Scope property:

Local.    A local data object resides and is accessible only in a machine, chart, or state.

Input from Simulink.    This is a data item that is accessible in a Simulink chart block but resides in another Simulink block that may or may not be a chart block. The receiving chart block reads the value of the data item from an input port associated with the data item. See "Importing Data" for more information.

Output to Simulink.    This is a data item that resides in a chart block and is accessible in another block that may or may not be a chart block. The chart block outputs the value of the datum to an output port associated with the data item. See "Defining Output Data" for more information.

Temporary.    A temporary data item exists only while its parent is executing. See "Defining Temporary Data" for more information.

Workspace.    A Workspace data object is a value that typically does not change during a simulation. Workspace data objects are passed in from MATLAB
and/or Simulink. Workspace data objects can be defined at the MATLAB command line or through Simulink mask initialization. Stateflow will attempt to resolve a data name first locally, then in Simulink, and lastly in MATLAB. See the Using Simulink document for more information on mask initialization.

Constant.    A Constant data object is read-only and retains the initial value set in its data properties dialog box.

Exported.    An exported data item is state machine data that can be accessed by external code that embeds the state machine. See "Exporting Data" for more information.

Imported.    Imported data is data defined by external code that can be accessed by a state machine embedded in the external code. See "Importing Data" for more information.

Data Port

This property applies only to input and output data. It specifies the index of the port associated with the data item (see "Associating Ports with Data").

Data Type

This property specifies the type of the data, e.g., integer, double, etc.

Data Sizes

This property applies to arrays of data (see"Data Initial Value"). The value of this property may be a scalar or a MATLAB vector. If it is a scalar, it specifies the size of a one-dimensional array (i.e., a vector). If a MATLAB vector, it indicates the size of each dimension of a multidimensional array whose number of dimensions corresponds to the length of the vector.

Data First Index

This property applies only to arrays of data. It specifies the index of the first element of this array. For example, the first index of a zero-based array is 0.

Data Initial Value

This property specifies a data item's value at the start of a state machine's execution. If the item is an array, Simulink sets each element of the array to the specified initial value.

Data Minimum

The minimum value that a data item can have. A state machine uses this property to check that an item is in range.

Data Maximum

The maximum value that a data item can have. A state machine uses this property to check that an item is in range.

Data Description

The description can consist of any ASCII text you want to enter to describe the object.

Data Documentation

This property allows a model to incorporate links to online documentation for user-defined data. See "Documenting Data" for more information.



[ Previous | Help Desk | Next ]