Variant Function-Call Signals on Variant Subsystem Outport
This example shows how the Variant Subsystem block allows function-call signals from its choice blocks to be merged on its outports.
NOTE: A Variant Subsystem block with more than one variant choice does not support function-call signals on its outports when the variant activation time is set to
Explore the Model
Open the model
The model contains a Variant Subsystem block with two Chart blocks,
Chart2, as variant choices. The variant control variable
A is defined in the
PreLoadFcn model callback. The variant conditions on
A==2 respectively. A Pulse Generator block is connected to the Variant Subsystem block and all its choices.
Chart2 are configured with port names that match the corresponding port names of the Variant Subsystem block.
The Output function call parameter is selected on the Signal Attributes tab of the Block Parameters dialog box of the Outport block named
activate(). This allows the Outport block of the variant subsystem to emit function-call signals. To enable this option programmatically, use this command:
Simulate the Model
To simulate the model, on the Simulation tab, click Run. Variant condition propagation determines the active and inactive variant choices.
activate() gets function-call signal from the choices
Chart2. When the Function-Call Subsystem block is triggered, there is a sine wave output at