Products & Services Solutions Academia Support User Community Company

Learn more about Stateflow   

Using Data and Event Arguments in Actions

When you use data and event objects as arguments to functions that you call in action language, the chart assumes that these arguments appear at the same level in the hierarchy. If the data and event arguments are not at that level, Stateflow action language attempts to resolve the object name by searching up the hierarchy. Data or event object arguments parented anywhere else must have their path hierarchies defined explicitly.

In the following example, state A calls the graphical function addit to add the Stateflow data x and y and store the result in data z.

The call to function addit from state A can resolve z because that data object belongs to state A. However, the function call cannot resolve x and y by looking above state A in the chart hierarchy. Therefore, the function call must reference x and y explicitly to the parent state AA.

For information about functions you can call in Stateflow action language that use data as arguments, see these sections:

Only operators for event-based temporal logic take events as arguments. See Using Temporal Logic in State Actions and Transitions.

  


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