Stateflow User's Guide Previous page   Next Page

Exporting Events to Stateflow External Code

Stateflow allows a Stateflow machine to export events. Exporting events enables external code to trigger events in the Stateflow machine.

Exported events can be parented only by a Stateflow machine. To export an event, add the event to the Stateflow machine and set its Scope property to Exported.

The Stateflow code generator generates a function for each exported event. The C prototype for the exported event function has the form

where EVENT is the name of the exported event. External code built into a target can trigger the event by invoking the event function. For example, suppose you define an exported event named switch_on. External code can trigger this event by invoking the generated function external_broadcast_trigger_on. See Exported Events for an example of how to trigger an exported event.

See Exported Events for an example of a Stateflow event exported to Stateflow external code.


Previous page  Sharing Events with Stateflow External Code Importing Events from Stateflow External Code Next page

© 1994-2005 The MathWorks, Inc.