Documentation Center

  • 評価版
  • 製品アップデート

sedb.gcev

Package: sedb

Identifier of current event

Syntax

evid = gcev

Description

evid = gcev returns the identifier of the event associated with the current operation. If the current operation does not change the event calendar, evid is an empty string. A change to the event calendar can be the scheduling, execution, or cancelation of an event.

Examples

View the event associated with the current operation:

  1. Begin a debugger session for a particular model. At the MATLAB® command prompt, enter:

    sedebug('sedemo_async_stateflow')
  2. Establish a breakpoint and proceed in the simulation. At the prompt, enter:

    tbreak 1
    cont

    The output ends with the current operation, which is the execution of the event with identifier ev9:

    Hit b1 : Breakpoint for first operation at or after time 1
    %==============================================================================%
    Executing ServiceCompletion Event (ev9)               Time = 1.000000000000000
    : Entity = en3                                        Priority = 500
    : Block  = Asynchronous Execution/Single Serverr
  3. View information about the event associated with the current operation:

    evid = gcev
    evdetails = evinfo(evid)

    The output shows the same identifier, ev9, in the workspace variable, evid, and the ID field of the structure, evdetails:

    evid =
    
    ev2
    
    
    evdetails =
    
               ID: 'ev2'
        EventType: 'EntityGeneration'
        EventTime: 2
         Priority: '300'
           Entity: ''
            Block: 'sedemo_async_stateflow/Asynchronous Execution/Time-Based Entity Generator'
    
  4. Proceed further in the simulation:

    step out

    The output is:

        %..........................................................................%
        Generating Entity (en2)
        : Block = Asynchronous Execution/Time-Based Entity Generator
        %..........................................................................%
        Entity Advancing (en2)
        : From = Asynchronous Execution/Time-Based Entity Generator
        : To   = Asynchronous Execution/Entity Departure Function-Call Generator
        %..........................................................................%
        Entity Advancing (en2)
        : From = Asynchronous Execution/Entity Departure Function-Call Generator
        : To   = Asynchronous Execution/Entity Sink
        %..........................................................................%
        Destroying Entity (en2)
        : Block = Asynchronous Execution/Entity Sink
        %..........................................................................%
        Executing Signal Block
        : Block = Chart
        %..........................................................................%
        Executing Signal Block
        : Block = Scope
        %..........................................................................%
        Scheduling EntityGeneration Event (ev3)
        : EventTime = 5.000000000000000
        : Priority  = 300
        : Entity    = <none>
        : Block     = Asynchronous Execution/Time-Based Entity Generator
    %==============================================================================%
    Executing EntityGeneration Event (ev3)                Time = 5.000000000000000
    : Entity = <none>                                     Priority = 300
    : Block  = Asynchronous Execution/Time-Based Entity Generator
  5. View information about the event associated with the current operation. This event is the entity request event the simulation is scheduling, not the service completion event whose execution causes the scheduling of the entity request event.

    evid_next = gcev
    evdetails_next = evinfo(evid_next)

    The output refers to the event identifier, ev10:

    evid_next =
    
    ev3
    
    
    evdetails_next =
    
               ID: 'ev3'
        EventType: 'EntityGeneration'
        EventTime: 5
         Priority: '300'
           Entity: ''
            Block: 'sedemo_async_stateflow/Asynchronous Execution/Time-Based Entity Generator'
    
  6. End the debugger session. At the prompt, enter:

    sedb.quit

See Also

|

Was this topic helpful?