Propagate Variant Conditions to Enable or Disable Model or Subsystem References in Hierarchy
Simulink® compiles referenced models before propagating variant conditions. A variant condition can activate or deactivate a Model block, but the variant condition does not propagate into the referenced model. Instead, it stays on the boundary. However, the blocks inside the referenced model inherit the variant condition from the Model block.
Explore the Model
In the model, the
Variant Source1 block has a variant condition
V == 1 that propagates to the Model block
sub1 is a Model block, the variant condition stays on the boundary and applies to the referenced model within the Model block. If
sub1 is active, the blocks within
sub1 are also active. If
sub1 is inactive, the blocks within
sub1 are also inactive, thus making
A Model block can propagate variant conditions from its interface (input, output, or control port), if those variant conditions originate at ports inside the block. In this example, the Model block
sub2 propagates the variant conditions received from the referenced model
slexVariantMdlRefCondProp_sub2 at the outports.
The Model block does not propagate variant conditions from its interface if those variant conditions originate from the Initialize Function or Terminate Function blocks inside the Model block. For more information, see Conditionally Execute Custom Initialize, Reinitialize, Reset, and Terminate Routines.
Subsystem Reference blocks propagate the variant conditions in the same way as Model blocks.