| SimEvents® | ![]() |
Gates
This block permits the arrival of one pending entity when a signal-based event or function call occurs; at all other times, the block's entity input port is unavailable. By definition, the gate's opening permits one pending entity to arrive if able to advance immediately to the next block.
No simulation time passes between the opening and subsequent closing of the gate; that is, the gate opens and then closes in the same time instant. If no entity is already pending when the gate opens, then the gate closes without processing any entities.
The Open gate upon parameter determines the type of event that opens the gate. Possible types are
Edges in a trigger signal
Changes in the numerical value of a signal
Function calls
For more details, see Opening a Gate Instantaneously.
Entity Input Ports
| Label | Description |
|---|---|
| IN | Port for arriving entities. |
Signal Input Ports
| Label | Description |
|---|---|
| tr | Trigger signal that indicates when to open the gate. This port appears only if you set Open gate upon to Trigger from port tr. |
| vc | Control signal whose numerical changes indicate when to open the gate. This port appears only if you set Open gate upon to Change in signal from port vc. |
| fcn | Function-call signal that indicates when to open the gate. This port appears only if you set Open gate upon to Function call from port fcn. |
Entity Output Ports
| Label | Description |
|---|---|
| OUT | Port for departing entities. |
Signal Output Ports
| Label | Description | Time of Update When Statistic Is On |
|---|---|---|
| #d | Number of entities that have departed from this block since the start of the simulation. | After entity departure |
The initial output value, which is in effect from the start of the simulation until the first update by the block, is 0.

Determines the type of event that causes the gate to open instantaneously.
Determines whether rising, falling, or either type of trigger edge causes the gate to open. This field appears only if you set Open gate upon to Trigger from port tr.
Determines whether rising, falling, or either type of value change causes the gate to open. This field appears only if you set Open gate upon to Change in signal from port vc.
Select this option to explicitly prioritize the gate-opening event, relative to other simultaneous events in the simulation. If you do not select this option, the event has priority SYS1 on the event calendar. For details, see Choosing How to Resolve Simultaneous Signal Updates.
The priority of the gate-opening event, relative to other simultaneous events in the simulation. For details, see Specifying Event Priorities to Resolve Simultaneous Signal Updates. This field appears only if you select Resolve simultaneous signal updates according to event priority.
These parameters determine whether certain ports produce data throughout the simulation, produce data only when you stop or pause the simulation, or are omitted from the block. For descriptions of the affected ports, see the "Signal Output Ports" table above.

Controls the presence and behavior of the signal output port labeled #d.
Regulating Arrivals Using Gates
![]() | Read Timer | Replicate | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |