| SimEvents® | ![]() |
Convert entity departure event into one or two function calls
Event Translation
This block converts an entity departure event into one or two function calls that you can use to invoke function-call subsystems, Stateflow® blocks, or other blocks that accept function-call inputs. The block can suppress its output under certain conditions.
The primary criterion is the departure, or imminent departure, of an entity from the block. You can choose whether the block generates the function call before or after the departure.
To generate up to two function calls per event, select Generate optional function call f2 after function call f1. If you configure the block to generate the f1 function call before the entity departure, you can independently choose whether the block generates the f2 function call before or after that departure.
To make the f1 or f2 output function call contingent upon a secondary criterion, select Suppress function call f1 if enable signal e1 is not positive or Suppress function call f2 if enable signal e2 is not positive. The block acquires an additional signal input port, labeled e1 or e2, to which you connect a control signal. If the control signal is zero or negative when the block is about to generate the function call, the block suppresses the function call. The e1 and e2 ports operate independently of each other as secondary criteria for their respective function-call output ports.
Entity Input Ports
| Label | Description |
|---|---|
| IN | Port for arriving entities. |
Signal Input Ports
| Label | Description |
|---|---|
| e1 | When this signal is 0 or negative, the block does not generate a function call at the f1 output port. This input port appears only if you select Suppress function call f1 if enable signal e1 is not positive. |
| e2 | When this signal is 0 or negative, the block does not generate a function call at the f2 output port. This input port appears only if you select Suppress function call f2 if enable signal e2 is not positive. |
Entity Output Ports
| Label | Description |
|---|---|
| OUT | Port for departing entities. |
Signal Output Ports
| Label | Description | Time of Update When Port Is Present | Order of Update |
|---|---|---|---|
| f1 | Function-call signal, possibly contingent on e1 input signal. | Before or after entity departure, depending on Timing of function call f1 parameter | 1 |
| f2 | Function-call signal, possibly contingent on e2 input signal. | Before entity departure if both Timing of function call... parameters are set to Before entity departure; otherwise, after entity departure | 2 |
| #d | Number of entities that have departed from this block since the start of the simulation. | After entity departure | 4 |
| #f1 | Number of function calls the block has generated at the f1 port during the simulation. | After entity departure | 3 |
| #f2 | Number of function calls the block has generated at the f2 port during the simulation. | After entity departure | 3 |
Output signals having the same number in the Order of Update column in the table above are updated in an arbitrary sequence relative to each other; you should not rely on a specific sequence for your simulation results.
The initial output value for the numerical signals, which is in effect from the start of the simulation until the first update by the block, is 0.

Determines whether the f1 function call occurs before or after the entity departure event.
Selecting this option causes f1 function calls to be contingent upon a positive value at the e1 signal input port.
Selecting this option causes the block to generate a function call at the optional f2 output port when appropriate criteria are satisfied.
Determines whether the f2 function call occurs before or after the entity departure event. This field appears only if you set Timing of function call f1 to Before entity departure and select Generate optional function call f2 after function call f1.
Selecting this option causes f2 function calls to be contingent upon a positive value at the e2 signal input port. This field appears only if you select Generate optional function call f2 after function call f1.

Controls the presence and behavior of the signal output port labeled #d.
Controls the presence and behavior of the signal output port labeled #f1.
Controls the presence and behavior of the signal output port labeled #f2. This field is active only if you select Generate optional function call f2 after function call f1 on the Function Call tab of this dialog box.
Markov-Modulated Poisson Process demo, within On-Off Modulated Markov Source subsystems
Signal-Based Event to Function-Call Event
![]() | Entity Departure Counter | Entity Sink | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |