| SimEvents® | ![]() |
| On this page… |
|---|
Overview of Entity-Departure Subsystems |
You can create a subsystem that executes only when an entity departs from a particular block in your model. The figure below shows a prototype, although most ports are not yet connected. The prototype uses the Entity-Based Function-Call Event Generator block to generate a function call when an entity departs. The function call executes the subsystem.
Prototype of Entity-Departure Subsystems

To create discrete event subsystems that respond to entity departures, use some or all of the blocks listed below.
| Block | Library Location | Purpose |
|---|---|---|
| Entity-Based Function-Call Event Generator | Event Generators library in the SimEvents® library set | Issues a function call corresponding to each entity departure |
| Entity Departure Event to Function-Call Event | Event Translation library in the SimEvents library set | |
| Mux | Signal Routing library in the Simulink® library set | Combines multiple function-call signals into a single function-call signal, if needed |
| Function-Call Subsystem | Ports & Subsystems library in the Simulink library set | Contains blocks to execute upon each function call. You must configure the subsystem to propagate its execution context, as described in Creating Entity-Departure Subsystems. |
| Inport | Ports & Subsystems library in the Simulink library set | Links a subsystem to its parent system |
| Outport |
To create subsystems that respond to entity departures, follow the procedure below.
Insert and configure the Function-Call Subsystem block as described in Setting Up Function-Call Subsystems in SimEvents® Models.
Insert one or more of these blocks into your model. The first is easier to use but less flexible.
Entity-Based Function-Call Event Generator
Entity Departure Event to Function-Call Event
Note You can configure these blocks to issue a function call either before or after the entity departs. In most situations, the After entity departure option is more appropriate. The Before entity departure option can be problematic if a subsystem is executed too soon, but is an appropriate choice in some situations. |
Connect the newly inserted blocks to indicate which entity departures should call the subsystem. If entity departures from multiple blocks should call the subsystem, then combine multiple function-call signals using a Mux block.
![]() | Examples Using Discrete Event Subsystem Blocks | Examples Using Entity-Departure Subsystems | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |