| Stateflow | ![]() |
Define Input Events
Before you can simulate the Stateflow diagram that you finished in Create a Stateflow Diagram, you must define the events on_switch and off_switch that trigger the transitions between On state and Off state. These event triggers are pointed out in the finished diagram:
Events control the execution of your Stateflow diagram. For example, if the state On is active and the on_switch event occurs, the transition from the On state to the Off state takes place and the Off state becomes active.
To define these input events for your Stateflow diagram, do the following:
on_switch in the Name field of the Event properties dialog box.
off_switch except enter Falling Edge as the Trigger type in step 4.
Now that you have defined the on_switch and off_switch events for your Stateflow diagram, take a look at the Stateflow block in the Simulink model.
The Stateflow block now has an input port for the events that you defined. Even though you have defined these events, you must now provide a source for these events in Simulink which you will do in Define the Stateflow Interface.
| Create a Stateflow Diagram | Define Input Data | ![]() |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |