Main Content

Stateflow.Event

Event in chart, state, or box

    Description

    Use Stateflow.Event objects to trigger actions in one of these objects:

    • A parallel state in a Stateflow® chart

    • Another Stateflow chart

    • A Simulink® triggered or function-call subsystem

    For more information, see Synchronize Model Components by Broadcasting Events.

    Creation

    Description

    example

    event = Stateflow.Event(parent) creates a Stateflow.Event object in a parent chart, state, or box.

    Input Arguments

    expand all

    Parent for the new event, specified as a Stateflow API object of one of these types:

    Properties

    expand all

    Interface

    Name of the event, specified as a character vector.

    Scope of the event, specified as 'Local', 'Input', or 'Output'. For more information, see Scope.

    Type of trigger associated with the event, specified as a character vector that depends on the scope of the data:

    • For input events, use 'Function call', 'Rising', 'Falling', or 'Either'.

    • For output events, use 'Function call' or 'Either'.

    This property does not apply to local events. For more information, see Trigger.

    Port index for the event, specified as an integer scalar. This property applies only to input and output events. For more information, see Port.

    Debugging

    Whether to set the Start of Broadcast breakpoint for the event, specified as a numeric or logical 1 (true) or 0 (false). For more information, see Debugger Breakpoints.

    Example: event.Debug.Breakpoints.StartBroadcast = true;

    Whether to set the End of Broadcast breakpoint for the event, specified as a numeric or logical 1 (true) or 0 (false). For more information, see Debugger Breakpoints.

    Example: event.Debug.Breakpoints.EndBroadcast = true;

    Hierarchy

    This property is read-only.

    Machine that contains the event, specified as a Stateflow.Machine object.

    This property is read-only.

    Location of the parent of the event in the model hierarchy, specified as a character vector.

    Identification

    Description for the event, specified as a character vector.

    Document link for the event, specified as a character vector.

    User-defined tag for the event, specified as data of any type.

    This property is read-only.

    Unique identifier, specified as an integer scalar. Use this property to distinguish the event from other objects in the model. The value of this property is reassigned every time you start a new MATLAB® session and may be recycled after an object is deleted.

    Object Functions

    classhandleProvide class handle for object
    dialogOpen properties dialog box
    getReturn MATLAB structure containing property settings of object or array of objects
    setSet properties with specified values
    upReturn parent of object
    viewDisplay object in editing environment

    Examples

    collapse all

    Add a event to the chart ch. Specify its name and scope.

    event = Stateflow.Event(ch);
    event.Name = 'E';
    event.Scope = 'Input';
    Introduced before R2006a