Products & Services Solutions Academia Support User Community Company

Learn more about SimEvents   

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_ent')
  2. Proceed in the simulation. At the sedebug>> prompt, enter:

    tbreak 1
    cont

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

    %==============================================================================%
    Executing ServiceCompletion Event (ev6)               Time = 1.000000000000000
    : Entity = en2                                        Priority = 500
    : Block  = Asynchronous Execution/Single Server
  3. View information about the event associated with the current operation:

    evid = gcev
    evdetails = evinfo(evid)

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

    evid =
    
    ev6
    
    
    evdetails = 
    
               ID: 'ev6'
        EventType: 'ServiceCompletion'
        EventTime: 1
         Priority: '500'
           Entity: 'en2'
            Block: 'sedemo_async_stateflow_ent/Asynchronous Execution/Single Server'
  4. Proceed further in the simulation:

    step

    The output is:

        %..........................................................................%
        Scheduling EntityRequest Event (ev7)
        : EventTime = 1.000000000000000 (Now)
        : Priority  = SYS2
        : Block     = Asynchronous Execution/Single Server
  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, ev7:

    evid_next =
    
    ev7
    
    
    evdetails_next = 
    
               ID: 'ev7'
        EventType: 'EntityRequest'
        EventTime: 1
         Priority: 'SYS2'
           Entity: ''
            Block: 'sedemo_async_stateflow_ent/Asynchronous Execution/Single Server'
  6. End the debugger session. At the sedebug>> prompt, enter:

    sedb.quit

See Also

sedb.evcal | sedb.evinfo

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS