Variant Systems
In Simulink®, you can create models that are based on a modular design platform that comprises a fixed common structure with a finite set of variable components. The variability helps you develop a single, fixed master design with variable components.
The approach helps you meet diverse customer requirements that are governed by application, cost, or operational considerations.
Variants are the variable components of modular design platforms. They help you specify multiple implementations of a model in a single, unified block diagram. For more information, seeWhat Are Variants and When to Use Them.
有两种类型的变体,分层和inline. Hierarchical variants are throughVariant Subsystemblocks, whereas Inline Variants are throughVariant SourceandVariant Sinkblocks. Use of aVariant Subsystem块提供了这些优势:
Allows you to mixModelandSubsystemblocks as variant systems
Supports flexible I/O, so that all variants do not need to have the same number of input and output ports
Blocks
Variant Subsystem, Variant Model | Template subsystem containing Subsystem, Model, or Subsystem Reference blocks as variant choices |
Variant Source | Route among multiple inputs using variants |
Variant Sink | Route amongst multiple outputs using variants |
Manual Variant Source | Switch between multiple variant choices at input |
Manual Variant Sink | Switch between multiple variant choices at output |
Classes
Simulink.Variant |
Specify conditions that control variant selection |
Simulink.VariantConfigurationData |
Class representing a variant configurations data object |
Simulink.VariantControl |
创造e a variant control variable object |
Simulink.VariantVariable |
创造e a variant parameter object |
Simulink.VariantManager |
Access Variant Manager functionality programmatically |
Simulink.VariantConfigurationAnalysis |
Analyze variant configurations programmatically |
Topics
Introduction to Variants
- What Are Variants and When to Use Them
Single system that caters to multiple variant requirements. - Variant Terminology
Learn terminology and parameters related to Simulink variants. - 创造e a Simple Variant Model
Learn how to create a model using Variant blocks. - Introduction to Variant Controls
Learn how to control variant blocks and variant parameters. - Working with Variant Choices
Activate, inactivate, or create default variant choices. - 创造e Variant Controls Programmatically
Use MATLAB®code to define variant controls. - Activate Variant During Different Stages of Simulation and Code Generation Workflow
Use variant activation time to set active choices during different stages of simulation and code generation workflows. - Approaches to Control Active Variant Choice of a Variant Block Using Mask or Model Workspace
This example shows different approaches to control the active choice of inline variant and Variant Subsystem blocks from a mask or a model workspace. - Variant Condition Propagation Overview
Understand variant condition propagation in Simulink.
Variant Subsystem
- Variant Subsystems
Learn basic functionality of variant subsystems. - Define, Configure, and Activate Variant Choices in a Variant Subsystem Block
Represent variant choices in Variant Subsystems. - Propagate Variant Conditions Outside Variant Subsystems
Propagate variant conditions outside aVariant Subsystemblock to adapt its interface according to the state of underlying blocks. - Use Variant Subsystem Blocks with Conditionally Executed Subsystems
Understand how to use Variant Subsystem blocks with conditionally executed systems as variant choices. - Convert Configurable Subsystem to Variant Subsystem
Learn how to convert configurable subsystems to variant subsystems and their behavior on loading. - Control Active Choice of Locked Custom Library Variant Subsystem Using Mask Parameter
Control active choice ofVariant Subsystemthat belongs to a locked custom library. - Automatic Mask Icon Promotion in Variant Subsystems
This example demonstrates how Simulink® automatically displays the mask icon of the active variant block on the parent Variant Subsystem block. - 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. - Model Reference Variants
This example shows how to use model reference variants.
Inline Variants
- Define and Configure Variant Sources and Sinks
代表变体选择使用内联变体。 - Visualize Variant Implementations in a Single Layer
View the variant choices in a model containing Inline Variants. - Variant Source and Variant Sink Blocks
Define variant choice in Variant Source and Sink blocks. - Variant Condition Propagation with Variant Sources and Sinks
Propagate variant conditions from the Variant Source and Variant Sink blocks. - Propagate Variant Conditions from Variant Source Blocks to Subsystem Blocks
Understand variant condition propagation to virtual and non-virtual subsystems. - Propagate Variant Conditions from Variant Source Blocks to Conditionally Executed Subsystems
Learn about variant condition propagation from Variant Source blocks to conditional subsystems . - Control Variant Condition Propagation
Control propagation of variant conditions upstream and downstream. - Variant Elements within Buses
Understand how to create variant bus, generate code, and variant condition propagation with bus. - Use Variant Source Block to Receive or Output Function-Call Signals for Simulation and Code Generation
This example shows how a Variant Source block receives function-call signals at its input ports and conditionally merges the signals at its output port.
Code Generation
- Prepare Variant-Containing Model for Code Generation
Configure and generate code for a variant model.
Variant Manager
- Variant Manager Overview
Use a central tool to manage variation points of a variants model. - 创造e and Validate Variant Configurations
创造e variant configuration for a model and validate their accuracy. - Import Control Variables to Variant Configuration
Import control variables associated with a model. - Define Constraints
Define constraints across models. - Export, Save, Refresh, and Load a Variant Configuration Data Object
This example shows how to export, save, and load a variant configuration data object for a Simulink® model using Variant Manager. - Reduce Models Containing Variant Blocks
Generate models with a subset of variant configurations. - Analyze Variant Configurations in Models Containing Variant Blocks
Analyze model references and libraries for each variant configuration in a model containing variant blocks.
Variant Parameters
- Use Variant Parameters to Reuse Block Parameters with Different Values
Design one model for many systems that differ in block parameter values. - 创造e a Simple Variant Parameter Model
This example shows you how to create a simple model with variant parameters. - Change Active Values and Activation Time of Variant Parameters
This example shows how to change the active values and activation time of variant parameters in a Simulink® model. - Options to Represent Variant Parameters in Generated Code(Embedded Coder)
You can generate the code only for active values or for both active and inactive values of variant parameters in Simulink.
Example Models
- V-Model for System Development with Simulink Variants
A set of examples that illustrate some of the Simulink variants capabilities in V-model representation of system development life cycle.