StructuralSwitch

This virtual block implements a structural switch. The output is connected to one of the inputs that is designated by the block parameter. Unlike in non-virtual switch blocks, the output signal does not inherit from all the input signals, but only from the connected input. Therefore, changing the connected input, under simulation pause, forces a simulation restart.

    StructuralSwitch

Library

Routing

Description

The StructuralSwitch block changes the diagram topology when its parameter is changed. When the connected input parameter is set to n, the block becomes equivalent to a link connection from nth input to the output. Other inputs remain unconnected. Compared to the block Manual Switch, which depending on the value of its parameters copies one of its inputs to the output, any block connected to the output of the Structural Switch that inherits its activation, it inherits it only through the connected input (in the case of Manual Switch it inherits through all inputs of the block). The other important difference is that the inputs of the Structural Switch block need not have equal sizes.

The Structural Switch block is a programmable Super Block containing Set and Get Signal blocks with parameterized names.

Due to the structural change produced in the diagram when the block parameter is changed, a recompilation is needed following such a change. This implies in particular that a simulation cannot be continued following a parameter change.

Parameters

StructuralSwitch_0

NameLabelDescriptionData TypeValid Values

n

Number of inputs

Number of block inputs.

Number

k

Connected input

Input from where the output signal inherits the input signals.

Scalar

Ports

NameTypeDescriptionIO TypeNumber

Port 1

explicit

input

n

Port 2

explicit

output

1