Entity Output Switch

Output entities

  • Library:
  • SimEvents

Description

Note

This page is the block reference page for the Output Switch block introduced in R2016a. To see the documentation for the previous Output Switch block, see Output Switch (Obsolete).

The Entity Output Switch block allows you to select an output port for the departure of an entity. You can choose the criterion for switching between output ports.

Ports

Input

expand all

Input entity port for entities entering the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | enumerated | bus

Input control port for the incoming control entity that determines the output port for the entities departing from the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Output

expand all

Output entity port for entities exiting the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | enumerated | bus

Output entity port for entities exiting the block.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | Boolean | enumerated | bus

Parameters

expand all

Number of output ports for entity departure.

Programmatic Use

Block Parameter: NumberOutputPorts
Type: character vector
Values: '2' | scalar
Default: '2'

Choose the criterion for switching between output ports.

  • To output the entity to the first unblocked port, select First port that is not blocked.

  • To output entities in a round robin fashion among the output ports, select Round robin. For more information, see Select Arrival Path Using Entity Input Switch.

  • Select From control port to let the control port determine the selected port for entity departure. A control port will appear to input an anonymous entity carrying data with a value greater than 0 and smaller than or equal to the number of output ports to determine the active port.

  • To specify an attribute that determines the output port, select From attribute. The attribute value is greater than 0 and smaller than or equal to the number of output ports to determine the active port.

  • To randomly select an output port for entity departure, select Equiprobable. Set the Seed to generate a random number and to determine the active output port.

Note

The block rounds a double precision value to the nearest integer less than or equal to its value as port selection. For instance, the value 0.3 is rounded of to 0 which is not a valid value for port selection.

Programmatic Use

Block Parameter: SwitchingCriterion
Type: character vector
Values: 'First port that is not blocked' | 'Round robin' | 'From control port' | 'From attribute' | 'Equiprobable'
Default: 'First port that is not blocked'

Select the initial port for the entity departure.

Dependencies

This parameter is visible when Switching criterion is set to Round robin or From control port.

Programmatic Use

Block Parameter: InitialPortSelection
Type: character vector
Values: '1' | scalar
Default: '1'

Specify the attribute name used to switch the output port.

Dependencies

This parameter is visible when Switching criterion is set to From attribute.

Programmatic Use

Block Parameter: SwitchAttributeName
Type: character vector
Values: 'Attribute1' | character vector
Default: 'Attribute1'

Specify the seed for the random number generator to determine the output port.

Dependencies

This parameter is visible when Switching criterion is set to Equiprobable.

Programmatic Use

Block Parameter: Seed
Type: character vector
Values: '34567' | scalar
Default: '34567'

Model Examples

Introduced in R2016a