Stateflow User's Guide Previous page   Next Page

Setting Breakpoints for Debugging

A breakpoint indicates a point at which the Stateflow Debugging window halts execution of a simulating Stateflow diagram. At this time you can inspect Stateflow and MATLAB workspace data and examine the status of a simulating Stateflow diagram.

The Stateflow Debugging window supports global and local breakpoints. Global breakpoints halt execution on any occurrence of the specific type of breakpoint. Local breakpoints halt execution on a specific object.

Setting Global Breakpoints

Use the Breakpoint controls in the Stateflow Debugging window to specify global breakpoints. When a global breakpoint is encountered during simulation, execution stops and the Debugger takes control. Select any or all of the following global breakpoints:

These breakpoints can be changed during run-time and are immediately enforced. When you save a Stateflow diagram, the breakpoint settings are saved with it.

Global breakpoints can be changed during run-time and are immediately enforced. When you save the Stateflow diagram, all the Stateflow Debugging window settings (including breakpoints) are saved, so that the next time you open the model, the breakpoints are as you left them.

Setting Local Breakpoints

You can set breakpoints for Stateflow objects that halt the execution of state actions, transitions, function calls, and event broadcasts.

  1. In the Model Explorer, right-click a particular state, transition, function, or event.
  2. From the resulting pop-up menu, select Properties.
  1. A dialog appears for setting the properties of the object.

    You can also access the properties dialog for states, transitions, and functions in the Stateflow diagram editor by right-clicking on them and selecting Properties from the resulting pop-up menu. You can only access the properties dialog for an existing event in the Model Explorer.

  1. Select from the following Debugger breakpoints options:
  1. For states, select one of the following breakpoints:

    For transitions, select one of the following breakpoints:

    For functions, select Function Call to stop execution before the function is called.

    For events, select one of the following breakpoints:


Previous page  Debugging with the Debugging Window Setting Error Checking in the Debugging Window Next page

© 1994-2005 The MathWorks, Inc.