Entity Departure Counter

Count departures and write result to signal port or attribute

Library

Entity Management

Description

This block computes the number of entities that have departed 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 count includes the departing entity.

Ports

Entity Input Ports

LabelDescription
INPort for arriving entities.

Signal Input Ports

LabelDescription
tsWhen this signal has an update, the block resets its internal counter and the #d output signal to zero. This signal must be an event-based signal. You see this port only if you set Reset counter upon to Sample time hit from port ts.
trWhen this signal satisfies the specified trigger criteria, the block resets its internal counter and the #d output signal to zero. This signal must be an event-based signal. You see this port only if you set Reset counter upon to Trigger from port tr.
vcWhen this signal satisfies the specified value-change criteria, the block resets its internal counter and the #d output signal to zero. This signal must be an event-based signal. You see this port only if you set Reset counter upon to Change in signal from port vc.
fcnWhen this signal carries a function call, the block resets its internal counter and the #d output signal to zero. This signal must be an event-based function call. You see this port only if you set Reset counter upon to Function call from port fcn.

Entity Output Ports

LabelDescription
OUTPort for departing entities.

Signal Output Ports

LabelDescriptionTime of Update When Statistic Is On
#dNumber 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 is 0. This value is in effect from the start of the simulation until the first update by the block.

Dialog Box

Write count to signal port #d

Allows you to use the signal output port labeled #d. This parameter determines whether the block outputs the entity count through a signal output port under these circumstances:

  • Throughout the simulation

  • Only when you stop or pause the simulation

  • Not at all

Write count to attribute

If you select this check box, the block assigns the entity count to the attribute specified in the Attribute name parameter.

Attribute name

The name of the attribute the block uses to record the entity count. You see this field only if you select the Write count to attribute check box.

Create attribute if not present

Selecting this option enables the block to define a new attribute for the entity count. Otherwise, the block issues an error if the attribute you name in the Attribute name parameter does not exist. You see this field only if select the Write count to attribute check box..

Reset counter upon

Determines whether, and under which circumstances, the block resets its internal counter and the #d output signal to zero:

Trigger type determines whether rising, falling, or either type of trigger edge causes the counter to reset. You see this field only if you set Reset counter upon to Trigger from port tr.

Type of change in signal value determines whether rising, falling, or either type of value change causes the counter to reset. You see this field only if you set Reset counter upon to Change in signal from port vc.

Resolve simultaneous signal updates according to event priority

Select this option to prioritize the reset event explicitly, 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 Resolve Simultaneous Signal Updates. You see this field only if you set Reset counter upon to a value other than Off.

Event priority

The priority of the reset event, relative to other simultaneous events in the simulation. For details, see Specify Event Priorities to Resolve Simultaneous Signal Updates. You see this field only if you set these parameters:

  • Reset counter upon = A value other than Off

  • Select Resolve simultaneous signal updates according to event priority

Was this topic helpful?