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
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
PostLoadFcn in File > ModelProperties > Callbacks. 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 in the Signal Attributes tab of the Block Parameters dialog box of the
activate() outport block is selected. This allows the outport block of the Variant Subsystem to emit function-call signals. To enable this option programmatically, use this command:
To simulate the model, on the Simulation tab, click Run. Variant condition propagation determines the active and inactive variant choices.
Chart1 is active.
Chart2 is active.
activate() gets function-call signal from the choices
Chart2. When the Function-Call Subsystem block is triggered, there is a sine wave output at