Stateflow User's Guide Previous page   Next Page

Defining Input Events

An input event occurs outside a chart and is visible only in that chart. This type of event allows other Simulink blocks, including other Stateflow blocks, to notify a particular chart of events that occur outside it. To define an event as an input event, set its Scope property to Input from Simulink.

The following steps describe how to add an input event to a chart in the Model Explorer:

  1. Add an event to the Stateflow chart.
  1. You must add an input event to the chart and not to one of its objects. Adding events with the Stateflow diagram editor adds them to the chart open in the diagram editor. In the Model Explorer, you can add an event to any object. This means that you must select a chart object in the left Model Hierarchy pane before adding an input event. See Adding Events for a complete description of both ways to add an event.

  1. Set the Scope property for the event to Input (short for Input from Simulink).
  1. A single trigger port is added to the top of the Stateflow block.

  1. If you want a Simulink block to trigger the Stateflow block through this input event, do one of the following:

If you choose to add an event in the Model Explorer, you can change its Name, Scope, Trigger and Port properties directly in the Model Explorer. See Setting Properties for Stateflow Objects in the Model Explorer for a description.


Previous page  Sharing Events with Simulink Associating Input Events with Control Signals Next page

© 1994-2005 The MathWorks, Inc.