Products & Services Solutions Academia Support User Community Company

Learn more about Stateflow   

Error Messages When Parsing Charts and Generating Code

How Error Messages Appear

Error messages appear in a dialog box and in the MATLAB Command Window. Double-clicking a message in the error dialog box zooms the source Stateflow chart to the object that caused the error.

Parser Error Messages

The Stateflow parser flags syntax errors in a chart. For example, using a backward slash (\) instead of a forward slash (/) to separate the transition action from the condition action generates a general parse error message.

Typical parse error messages include:

Code Generation Error Messages

Typical code generation error messages include:

Compilation Error Messages

If compilation errors indicate undeclared identifiers, verify that variable expressions in state, condition, and transition actions are defined.

Consider, for example, an action language expression such as a=b+c. In addition to entering this expression in the Stateflow chart, you must create data objects for a, b, and c using the Model Explorer. If you do not define the data objects, the parser assumes that these unknown variables appear in the Custom code portion of the target, at the beginning of the generated code. Because of this assumption, error messages appear at compile time and not at code generation time.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS