| SimEvents® | ![]() |
Count departures and write result to signal port and/or attribute
Probes
This block computes the number of entities that have departed from this block since the start of the simulation or since the last reset, whichever occurred later. The block writes this number to a signal output port and/or an attribute of each departing entity. The departing entity is included in the count.
Entity Input Ports
| Label | Description |
|---|---|
| IN | Port for arriving entities. |
Signal Input Ports
| Label | Description |
|---|---|
| tr | When the signal at this port satisfies the specified trigger criteria, the block resets its internal counter and the #d output signal to zero. This port appears only if you set Reset counter upon to Trigger from port tr. |
| vc | When the signal at this port satisfies the specified value-change criteria, the block resets its internal counter and the #d output signal to zero. This port appears only if you set Reset counter upon to Change in signal from port vc. |
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 or since the last reset. | 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.

Controls the presence and behavior of the signal output port labeled #d. This parameter determines whether the block outputs the entity count through a signal output port throughout the simulation, only when you stop or pause the simulation, or not at all.
If you set this to On, the block assigns the entity count to the attribute specified in the Attribute name parameter.
The name of the attribute the block uses to record the entity count. This field appears only if you set Write count to attribute to On.
Selecting this option enables the block to define a new attribute for the entity count. Otherwise, the block issues an error if the attribute named above does not already exist. This field appears only if you set Write count to attribute to On.
Determines whether the block resets its internal counter to zero based on trigger edges, based on changes in signal values, or not at all.
Determines whether rising, falling, or either type of trigger edge causes the counter to reset. This field appears only if you set Reset counter upon to Trigger from port tr.
Determines whether rising, falling, or either type of value change causes the counter to reset. This field appears only if you set Reset counter upon to Change in signal from port vc.
Select this option to explicitly prioritize the counter's reset 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. This field appears only if you set Reset counter upon to Trigger from port tr or Change in signal from port vc.
The priority of the counter's reset 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 set Reset counter upon to either Trigger from port tr or Change in signal from port vc, and then select Resolve simultaneous signal updates according to event priority.
Instantaneous Entity Counting Scope
![]() | Entity Combiner | Entity Departure Event to Function-Call Event | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |