Stateflow User's Guide Previous page   Next Page

Avoiding Muxed Trigger Events with Binding

The simulated example in Simulating a Bound Function-Call Subsystem shows how binding events gives control of a function-call subsystem to a single state in a Stateflow diagram. This control can be undermined if you allow other events to trigger the function-call subsystem through a mux. For example, the following Simulink diagram defines two function-call events to trigger a function-call subsystem through a mux:

In the Stateflow diagram, E1 is bound to state A, but E2 is not. This means that state B is free to send the triggering event E2 in its entry action. When you simulate this model, you receive the following output:

Notice that broadcasting E2 in state B changes the output, which now rises to a height of 10 before the binding action in state A resets the data.


Previous page  Using Stateflow Logic with Binding Using Fixed-Point Data in Stateflow Next page

© 1994-2005 The MathWorks, Inc.