Using Stateflow     Search    Help Desk 

Event Inputs from Simulink

These tasks describe how to add and define the necessary fields for an event input from Simulink:

Add an Event Choosing a Chart as the Parent

These steps describe how to add an event:

   1.
Choose Explore from the graphics editor Tools menu to invoke the Explorer.
   2.
Select the chart object in the hierarchy that you want to be the event's parent.
You must explicitly choose a parent to create an event. Choosing the chart to be the parent of the event enables receive rights to Simulink, to the chart, and all its offspring.
   3.
Choose Event from the Explorer Add menu. The Event properties dialog box is displayed.
   4.
Enter a name in the Name field.

Choose Input from Simulink as the Scope

Once you have chosen the chart as the parent, the choice of valid scopes includes: Local, Input from Simulink, or Output to Simulink.

Choose Input from Simulink as the Scope to enable send rights to Simulink and any offspring of the chart and to enable receive rights to the chart and all of its offspring.

When you add an event input, a single Simulink trigger port is added to the top of the Stateflow block.

Select the Trigger

The trigger defines how the Stateflow block's input events are handled in the context of their Simulink model. The Trigger type indicates what kind of signal has meaning for the input event. The Trigger can have these values.

Keyword
Description
Either Edge
Either rising or falling edge trigger, where the control signal changes either from 0 to a nonzero value, from a negative value to a positive value, or from a positive value to a negative value.
Rising Edge
Rising edge trigger, where the control signal changes from either 0 to a positive value or from a negative value to a positive value.
Falling Edge
Falling edge trigger, where the control signal changes from either 0 to a negative value or from a positive value to a negative value.
Function Call
Function call triggered.

Each Stateflow block can only have one overall trigger type. See "Specifying Trigger Types" for more information.

Apply the Changes

Click on the Apply button to save the properties. Click on the OK button to save the properties and close the dialog box.



[ Previous | Help Desk | Next ]