Stateflow    

Specifying Trigger Types

A trigger type defines how control signals trigger input and output events associated with a chart. Trigger types fall into two categories: function call and edge. The basic difference between these two types is when receiving blocks are notified of their occurrence. Receiving blocks are notified of edge-triggered events only at the beginning of the next simulation time step, regardless of when the events occurred during the previous time step. By contrast, receiving blocks are notified of function-call-triggered events the moment the events occur, even if they occur in mid step.

You set a chart's trigger type by setting the Trigger property of any of the input or output events defined for the chart. If you want a chart to notify other blocks the moment an output event occurs, set the Trigger property of the output event to Function Call. The output event's trigger type must be Either Edge. If a chart is connected to a block that outputs function-call events, you must specify the Trigger property of the receiving chart's input events as Function Call. Stateflow changes all the chart's other input events to Function Call.

If it is not critical that blocks be notified of events the moment they occur, you can define the events as edge-triggered. You can specify any of the falling types of edge triggers.

In all cases, the signal must cross 0 to constitute a valid trigger. For example, a change from -1 to 1 constitutes a valid rising edge, but not a change from 1 to 2.

If you specify an edge trigger type that differs from the edge type previously defined for a chart, Stateflow changes the Trigger type of the chart's input events to Either Edge.


  Importing Events Implicit Events