Stateflow User's Guide Previous page   Next Page

Using a Floating Scope to Monitor Data Values and State Activity

In the steps of this topic, you configure a Floating Scope block to monitor a data value and the activity of a state in the following example model:

The model consists of a Floating Scope block and a Stateflow block. The Stateflow diagram for the Stateflow block starts by adding an increment of .02 for 10 samples to the data x1. For the next 10 samples, an increment of .2 is added, and the cycle repeats.

  1. Double-click the Floating Scope block.
  1. A Floating Scope window appears, already scaled for this example.

  1. In the Floating Scope window, select the Signal Selection tool .
  1. The Signal Selector dialog appears with a hierarchy of Simulink blocks for the model.

  1. In the Model hierarchy pane, select the Stateflow block whose signals you want to monitor and, in the List contents pane, select the data you want to monitor.

  1. In the preceding example, the block named Chart is selected in the Model hierarchy pane, and the data x1 and the activity of state A are selected in the Contents pane.

  1. Simulate the model.
  1. When the example model is simulated, you receive a signal trace for x1 and for the activity of state A, as shown.

    Notice that when state A is active, its activity signal value is 1, and when it is inactive, its signal value is 0. Because this value is very low or very high compared to some data, you might want to put it in a second Floating Scope block to compare it with other data.


Previous page  Logging Data Values and State Activity Understanding Model Coverage for Stateflow Charts Next page

© 1994-2005 The MathWorks, Inc.