| Contents | Index |
| On this page… |
|---|
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.
| Event | Description |
|---|---|
| Counter reset | Reinitialization of the counter in the Entity Departure Counter block. |
| Delayed restart | Causes a pending entity in the Time-Based Entity Generator block to attempt to depart. The block uses delayed restart events only when you set Response when unblocked to Delayed restart. |
| Entity advancement | Departure of an entity from one block and arrival at another block. |
| Entity destruction | Arrival of an entity at a block that has no entity output port. |
| Entity generation | Creation of an entity, except in the case of an Event-Based Entity Generator block that has suspended the generation of entities. |
| Entity request | Notification 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 call | Discrete invocation request carried from block to block by a special signal called a function-call signal. For more information, see Function Calls. |
| Gate (opening or closing) | Opening or closing of the gate represented by the Enabled Gate block. |
| Memory read | Reading of memory in the Signal Latch block. |
| Memory write | Writing of memory in the Signal Latch block. |
| New head of queue | Scheduled when there is a new entity at the head of a queue. Upon execution, it causes the entity at the head of a queue to attempt to depart. |
| Port selection | Selection 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. |
| Preemption | Replacement of an entity in a server by a higher priority entity. |
| Release | Opening of the gate represented by the Release Gate block. |
| Sample time hit | Update in the value of a signal that is connected to a block configured to react to signal updates. |
| Service completion | Completion of service on an entity in a server. |
| Storage completion | Change in the state of the Output Switch block, making it attempt to advance the stored entity. |
| Subsystem | Execution of Atomic Subsystem block caused by an appropriate signal-based event in the input signal of a Event Filter block that connects to the Atomic Subsystem block. |
| Timeout | Departure of an entity that has exceeded a previously established time limit. |
| Trigger | Rising 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 change | Change 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. If a model has multiple discrete-event systems (in which signals change when events occur), each discrete-event system maintains its own event calendar. The application executes the event calendar of each discrete-event system independently of the other discrete-event systems.
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
The updated value that results in a sample time hit could be the same as or different from the previous value of the signal.
It is unreliable to induce signal-based events based on sample time hits from a time-based signal connected to the discrete-event system via a gateway block. For more information see Invalid Connections of Gateway Blocks.
Event-based signals do not necessarily undergo an update at the beginning of the simulation.
Every change in a signal value is also an update in that signal's value. However, the opposite is not true because an update that merely reconfirms the same value is not a change in the value.
Every rising or falling edge is also a change in the value of the signal. However, the opposite is not true because a change from one positive value to another (or from one negative value to another) is not a rising or falling edge.
Triggers and value changes can be rising or falling. You configure a block to determine whether the block considers rising, falling, or either type to be a relevant occurrence.
Blocks in the Simulink® libraries are more restrictive than blocks in the SimEvents libraries regarding trigger edges that rise or fall from zero. Simulink blocks in discrete-time systems do not consider a change from zero to be a trigger edge unless the signal remained at zero for more than one time step; see Triggered Subsystems in the Simulink documentation. SimEvents blocks configured with tr ports consider any change from zero to a nonzero number to be a trigger edge.
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 best way to make Stateflow blocks and blocks in the Simulink libraries respond to asynchronous state changes.
Within a discrete-event system, function-calls can generate from these kinds of blocks:
Entity Departure Function-Call Generator
Signal-Based Function-Call Generator
Time-Based Function-Call Generator
Stateflow blocks
MATLAB Function blocks
Atomic Subsystem block containing a Function-Call Gererator block
Note The software does not support asynchronous function-calls in discrete-event systems. It also does not support asynchronous function-calls at discrete-event system boundaries (as identified by gateway blocks). |
You can combine or manipulate function-call signals. To learn more, see Manipulating Events.
![]() | Working with Events | Example: Event Calendar Usage for a Queue-Server Model | ![]() |

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |