バリアントのインライン コンポーネント
R2026b単一のレイヤーで構造のバリエーションを実装
インライン バリアント ブロックを使用して、システムのすべての代替設計を単一のモデルで表現できます。設計の選択肢は、それぞれバリアントの選択として単一のレイヤーでモデルに組み込まれます。このようなモデルには、共通の固定構造と、バリアント制御に応じてアクティブまたは非アクティブになる可変コンポーネントの有限セットがあります。コンポーネントは自動または手動でアクティブにできます。
たとえば、自動車のワイパーの速度を制御するモデルをさまざまなレイン センサーを使用してシミュレートするとします。レイン センサー モデルを Variant Source ブロックに入力として提供し、それらのセンサーをバリアント制御の選択に基づいて切り替えることができます。詳細については、バリアント制御の紹介を参照してください。
インライン バリアント ブロックの生成コードには、システムのすべてのバリアントの選択を含めることができます。Activate Variant During Different Stages of Simulation and Code Generation Workflowで説明されているように、コードのコンパイル前やモデルの起動時に選択を切り替えることができます。インライン バリアント ブロックのコード生成の詳細については、バリアントの構造 (Simulink Coder)を参照してください。
ブロック
| Variant Source | バリアントを使用した複数の入力間での経路指定 | |
| Variant Sink | バリアントを使用した複数の出力間での経路指定 | |
| Variant Start | Define start of bounded region (R2024a 以降) | |
| Variant End | Define end of bounded region (R2024a 以降) | |
| Manual Variant Source | 入力での複数バリアント選択肢の切り替え | |
| Manual Variant Sink | 出力での複数バリアント選択肢の切り替え |
クラス
Simulink.VariantUtils | Utility methods to work with variant elements (R2023b 以降) |
関数
enumeration | クラスの列挙型メンバーと名前 |
オブジェクト
struct | 構造体配列 |
Simulink.VariantControl | Create variant control variable object |
Simulink.Parameter | パラメーター値の保存、共有、構成 |
Simulink.VariantExpression | Specify conditions that control variant selection |
トピック
バリアント制御の構成
- Variant Control Modes in Variant Blocks
Learn how to control variant blocks. - 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. - Use Variant Control Variables in Variant Blocks
This topic explains how to use different types of variant control variables in variant blocks. - バリアント ソースとバリアント シンクの定義と構成
インライン バリアントを使用してバリアントの選択を表現します。 - 単一レイヤーでのバリアント実装の可視化
インライン バリアントを含むモデル内でバリアントの選択を表示します。 - Manual Variant Source ブロックと Manual Variant Sink ブロックを使用した信号のソースと接続先での変化の提供
この例では、インライン バリアント ブロックManual Variant SourceとManual Variant Sinkの使用方法を示します。
バリアント条件の伝播
- Propagate Variant Conditions to Define Variant Regions with Variant Blocks
Determine active model components by propagating variant conditions using variant blocks. - Variant Source ブロックと Variant Sink ブロックを使用した、バリアント領域を定義するためのバリアント条件の伝播
Variant Source ブロックと Variant Sink ブロックからバリアント条件を伝播する。 - バーチャル サブシステムおよび非バーチャル サブシステムのバリアント領域を定義するためのバリアント条件の伝播
バーチャル サブシステムおよび非バーチャル サブシステムへのバリアント条件の伝播について理解します。 - バス内のバリアント要素
この例では、異なるバリアント条件をもつ要素のあるバスの作成方法を示します。 - Propagate Variant Conditions to Control Execution of Conditional Subsystems
Understand how to use Variant Subsystem blocks with conditionally executed systems as variant choices. - Control Variant Condition Propagation Using Bounded Regions and Signal-Level Isolation
Limit the scope of variant condition propagation by confining variant conditions to bounded regions or terminating them at specific signal paths.
ワークスペースでのバリアント制御変数の定義
- Choose and Configure a Workspace for Variant Control Variables of Variant Blocks
Choose the workspace that matches your scoping, activation time, and hierarchy requirements for variant control variables in variant blocks. - Use Base Workspace to Define Globally Accessible Variant Control Variables for Variant Blocks
Control variant choices across models in a MATLAB session by defining variant control variables in the base workspace. - Use Data Dictionary to Define Shared Variant Control Variables for Variant Blocks
Control variant choices across multiple models by defining variant control variables in a data dictionary for version control, team sharing, and traceability. - Use Model Workspace to Define Variant Control Variables Scoped to the Model for Variant Blocks
Control variant choices by defining variant control variables in the model workspace to scope them to a single model so they persist with the model file. - Override Variant Control Variables of Variant Blocks in Simulation Runs
Override variant control variable values for individual simulation runs using a SimulationInput object without modifying persistent workspace or data dictionary values.
インスタンスごとのバリアント制御の構成
- Use Model Arguments with Fast Restart to Switch Variant Choices Per Instance Without Recompiling for Variant Blocks
Control variant choices per model instance by defining variant control variables as model arguments in a referenced model. - Use Mask Parameters for Per-Instance Variant Control in Variant Blocks
Control variant choices per block instance by defining a mask parameter as the variant control variable and setting its value from the mask dialog box. - Use Mask Parameters with Fast Restart to Switch Variant Choices Without Recompiling for Variant Blocks
Control the active variant choice per block instance without recompiling by using mask parameters as variant control variables with the startup activation time and fast restart. - Use Mask Initialization Code for Per-Instance Variant Control in Variant Blocks
Control active variant choices in a variant block by defining variant control values or mapping mask parameter selections to label names in a mask initialization script. - Use Mask Parameters with Enumeration Classes for Per-Instance Variant Control of a Variant Block in a Locked Library
Control variant choices per block instance in a locked custom library by using mask parameters as variant control variables with enumeration classes in condition expressions. - Use Mask Parameter Object to Control Variant Choices in Masked Variant Assembly Subsystem Block
Control variant choices in a masked Variant Assembly Subsystem block by instantiating subclasses of a shared superclass as the mask parameter object value. - Control Active Choice of Variant Subsystem During Simulation or Execution of Generated Code
Switch the active variant of a Variant Subsystem block during simulation or execution of generated code by using a Parameter Writer block.
トラブルシューティング
モデルをバリアント システムに変換 (Simulink Check)
モデル トランスフォーマー ツールを使用した、モデルのバリアント システムへの変換。
