| Stateflow User's Guide |
 |
Overflow Detection for Fixed-Point Types
Overflow occurs when the magnitude of a result assigned to a data exceeds the numeric capacity of that data. You enable Stateflow to detect overflow of integer and fixed-point operations during simulation with the following steps:
- In the Stateflow diagram editor, from the Tools menu, select Open Simulation Target.
- The Stateflow Target Builder dialog opens with
sfun entered in the Target Name field.
- Select Coder Options .
- The Stateflow sfun Coder Options dialog opens.
- Select both the Enable debugging/animation and Enable overflow detection (for debugging) options.
- For descriptions of these options, see Configuring a Simulation Target for Stateflow.
- Select OK to close the Stateflow sfun Coder Options dialog.
- In the Stateflow Target Builder dialog, select Build to build the simulation target.
- In the Stateflow diagram editor toolbar, select Debug
to open the Debugging window.
- In the Debugging window, select Data Range.
- See Setting Error Checking in the Debugging Window for a description of this option.
- In the Debugging window, select Start to begin simulating the model.
Simulation breaks execution when an overflow occurs.
| Tips for Using Fixed-Point Data in Stateflow | | Sharing Fixed-Point Data with Simulink |  |
© 1994-2005 The MathWorks, Inc.