Documentation Center

  • 評価版
  • 製品アップデート

Entity Departure Function-Call Generator

Convert entity departure event into one or two function calls

Library

Generators/Function-Call Generators

Description

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.

Criteria for Generating Function Calls

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.

Ports

Entity Input Ports

LabelDescription
INPort for arriving entities.

Signal Input Ports

LabelDescription
e1When this signal is 0 or negative, the block does not generate a function call at the f1 output port. This signal must be an event-based signal. You see this input port only if you select Suppress function call f1 if enable signal e1 is not positive.
e2When this signal is 0 or negative, the block does not generate a function call at the f2 output port. This signal must be an event-based signal. You see this input port only if you select Suppress function call f2 if enable signal e2 is not positive.

Entity Output Ports

LabelDescription
OUTPort for departing entities.

Signal Output Ports

LabelDescriptionTime of Update When Port Is PresentOrder of Update
f1Function-call signal, possibly contingent on e1 input signal.Before or after entity departure, depending on Timing of function call f1 parameter1
f2Function-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 departure2
#dNumber of entities that have departed from this block since the start of the simulation.After entity departure4
#f1Number of function calls the block has generated at the f1 port during the simulation.After entity departure3
#f2Number of function calls the block has generated at the f2 port during the simulation.After entity departure3

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.

Dialog Box

Function Call Tab

Timing of function call f1

Determines whether the f1 function call occurs before or after the entity departure event.

Use of signals awaiting update during function call

You see this parameter only if you set Timing of function call f1 to Before entity departure.


When you configure the block to generate a function-call before an entity departs the block, the function-call event might use signal values that are still awaiting update. If this situation arises, Use of signals awaiting update during function call: specifies the action that you want the software to take. If you do not also select the configuration parameter Prevent duplicate events on multiport blocks and branched signals in your model, the parameter does not function.

Suppress function call f1 if enable signal e1 is not positive

Selecting this option causes f1 function calls to be contingent upon a positive value at the e1 signal input port.

Generate optional function call f2 after function call f1

Selecting this option causes the block to generate a function call at the optional f2 output port when appropriate criteria are satisfied.

Timing of function call f2

Determines whether the f2 function call occurs before or after the entity departure event. You see this field only if you set Timing of function call f1 to Before entity departure and select Generate optional function call f2 after function call f1.

Suppress function call f2 if enable signal e2 is not positive

Selecting this option causes f2 function calls to be contingent upon a positive value at the e2 signal input port. You see this field only if you select Generate optional function call f2 after function call f1.

Statistics Tab

Number of entities departed

Allows you to use the signal output port labeled #d.

Number of f1 function calls

Allows you to use the signal output port labeled #f1.

Number of f2 function calls

Allows you to use 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.

Was this topic helpful?