| Stateflow User's Guide | ![]() |
Setting Test Points for Stateflow States and Local Data with Model Explorer
You can explicitly set individual states or local data as test points through the Model Explorer. Use the example you create in the following procedure to learn how to set individual test points for Stateflow states and data.
tic. In the Stateflow diagram, the state A and its substate X are entered for the first tic event. State A and substate X stay active until 10 tic events have taken place and then state B is entered. On the following event, state A and substate X are entered and the cycle continues.
The data x is added to the state X. The entry and during actions for substate X increment x while X is active for 10 tic events. When state B is entered, x is reinitialized to zero, and the cycle repeats.
myModel.
Chart1, then select A.
A state.
Alternatively, you can access a test point through the middle pane. By default, the Model Explorer displays event and data child objects in the Contents pane for the selected object in the Model Hierarchy pane. You can set the test point for the A state through this pane by selecting the parent of A. If the states are not listed in the middle pane, select the States/Functions/Boxes/Etc. check box in the View -> List View Options for All Stateflow Objects.
X. Click Apply.
X again. Select the local data x in the Contents pane.
You can now log these test points. See Logging Data Values and State Activity.
| Monitoring Stateflow Test Points | Logging Data Values and State Activity | ![]() |
© 1994-2005 The MathWorks, Inc.