Using Stateflow     Search    Help Desk 

Outputting State Activity to Simulink

Stateflow allows a chart to output the activity of its states to Simulink via a data port on the state's chart block. To enable output of a particular state's activity, first name the state (see "Naming States" ), if unnamed, then check the Output State Activity checkbox on the state's property dialog (see "Using the State Properties Dialog"). Stateflow creates a data output port on the chart block containing the state. The port has the same name as the state. Stateflow also adds a corresponding data object of type State to the Stateflow data dictionary. During simulation of a model, the port outputs 1 at each time step in which the state is active; 0, otherwise. Attaching a scope to the port allows you to monitor a state's activity visually during the simulation. See "Defining Output Data" for more information.

Note
If a chart has multiple states with the same name, only one of those states can output activity data. If you check the Output State Activity property for more than one state with the same name, Stateflow outputs data only from the first state whose Output State Activity property you specified.



[ Previous | Help Desk | Next ]