Supported Events in SimEvents® Models

Types of Supported Events

An event is an instantaneous discrete incident that changes a state variable, an output, and/or the occurrence of other events. SimEvents® software supports the events listed below.

EventDescription
Counter resetReinitialization of the counter in the Entity Departure Counter block.
Discrete event subsystem executionExecution of Discrete Event Subsystem block contents caused by an appropriate signal-based event at one of the subsystem's inports.
Entity advancementDeparture of an entity from one block and arrival at another block.
Entity destructionArrival of an entity at a block that has no entity output port.
Entity generationCreation of an entity.
Entity requestNotification that an entity input port has become available. A preceding block's response to the notification might result in an entity advancement. After each entity advancement, an Enabled Gate block or a switch block reissues the notification until no further entity advancement can occur.
Function callDiscrete invocation request carried from block to block by a special signal called a function-call signal. For more information, see Function Calls.
Gate eventOpening or closing of the gate represented by the Enabled Gate block.
Memory readReading of memory in the Signal Latch block.
Memory writeWriting of memory in the Signal Latch block.
Port selectionSelection of a particular entity port in the Input Switch, Output Switch, or Path Combiner block. In the case of the Path Combiner block, the selected entity input port is the port that the block notifies first, whenever its entity output port changes from blocked to unblocked.
PreemptionReplacement of an entity in a server by a higher priority entity.
ReleaseOpening of the gate represented by the Release Gate block.
Sample time hitUpdate in the value of a signal that is connected to a block configured to react to signal updates.
Service completionCompletion of service on an entity in a server.
Storage completionChange in the state of the Output Switch block, making it attempt to advance the stored entity.
TimeoutDeparture of an entity that has exceeded a previously established time limit.
TriggerRising or falling edge of a signal connected to a block that is configured to react to relevant trigger edges.

A rising edge is an increase from a negative or zero value to a positive value (or zero if the initial value is negative). A falling edge is a decrease from a positive or a zero value to a negative value (or zero if the initial value is positive).

Value changeChange in the value of a signal connected to a block that is configured to react to relevant value changes.

During a simulation, the application maintains a list, called the event calendar, of selected upcoming events that are scheduled for the current simulation time or future times. By referring to the event calendar, the application executes events at the correct simulation time and in an appropriate sequence.

Signal-Based Events

Sample time hits, value changes, and triggers are collectively called signal-based events. Signal-based events can occur with respect to time-based or event-based signals. Signal-based events provide a mechanism for a block to respond to selected state changes in a signal connected to the block. The kind of state change to which the block responds determines the specific type of signal-based event.

When comparing the types of signal-based events, note that

Example: Comparing Types of Signal-Based Events

Consider the signal representing the number of entities stored in a FIFO queue. This is the #n output signal from the FIFO Queue block in the model below. The #n signal is connected to the Event-Based Entity Generator block, which reacts to different types of signal-based events. Parameters in its dialog box determine whether the block has a ts, vc, or tr input port, as well as the types of events to which the block reacts.

In the following figures, a staircase plot shows the values of the #n signal, starting from the first entity's arrival at T=0. Based on those values of #n, the stem plots indicate when signal-based events occur at the Event-Based Entity Generator block if it is configured with a ts, vc, or tr signal input port.

Sample Time Hits of #n Signal Connected to ts Port

Value Changes of #n Signal Connected to vc Port

Trigger Edges of #n Signal Connected to tr Port

Function Calls

Function calls are discrete invocation requests carried from block to block by a special signal called a function-call signal. A function-call signal appears as a dashed line, not a solid line. A function-call signal carries a function call at discrete times during the simulation and does not have a defined value at other times. A function-call signal is capable of carrying multiple function calls at the same value of the simulation clock, representing multiple simultaneous events.

In SimEvents models, function calls are the recommended way to make Stateflow® blocks and blocks in the Simulink libraries respond to asynchronous state changes.

Function calls and signal-based events are often interchangeable in their ability to elicit reactions from various SimEvents blocks, such as the Event-Based Entity Generator block and the Signal-Based Event to Function-Call Event block.

Function-call signals can be combined, as described in Creating a Union of Multiple Events.

  


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