이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
Variant 구조
모델 내에서의 구조적 변동에 대응한 코드 생성 및 관리
Simulink®의 Variant 블록을 사용하면 단일 모델에서 컴포넌트의 모든 설계 변형을 표현할 수 있습니다. 각 설계의 선택은 단일 레이어 또는 개별 계층 구조의 Variant 선택지로 모델에 포함됩니다. 이러한 모델은 고정된 공통 구조와 유한한 세트의 Variant 선택지를 가지며, 선택지는 사용자가 선택한 Variant 제어에 따라 활성화되거나 비활성화됩니다. 자세한 내용은 What Are Variants and When to Use Them 항목을 참조하십시오. Variant 활성화 시점은 선택지를 활성화할 시점을 결정하고 생성 코드에 활성 선택지만 포함할지 아니면 활성 및 비활성 선택지를 모두 포함할지 여부를 결정합니다. 활성화 시점에 관한 자세한 내용은 Activate Variant During Different Stages of Simulation and Code Generation Workflow 항목을 참조하십시오.
도움말 항목
코드 생성하기
- Generate Code for Variant Subsystem Blocks
Generate code for specific implementation of component represented using Variant Subsystem block. - Generate Code for Variant Source and Variant Sink Blocks
Generate code for specific implementation of component represented using Variant Source and Variant Sink blocks. - Generate Code for Variant Start and Variant End Blocks
Generate code for specific implementation of component represented using Variant Start and Variant End blocks. - Generate Code for Model References Connected to Variant Blocks
Reuse and incrementally load, build, and generate code for multiple variations of a component. - Generate Code from Nested Variant Subsystem with Code Compile and Startup Activation
This example illustrates howcode compile
andstartup
variant activation time can be used together in two nested variant subsystems.
Variant 블록과의 인터페이싱
- Conditionalize Export Function Calls in Code using Variant Blocks
Generate code for export function calls conditionally using variant blocks.
최적화된 코드로 코드 신뢰성 및 안전성 극대화
- Compile Code Conditionally for Variations of Component Represented Using Variant Block
Conditionally compile code for different implementations of a component using variant blocks. - Run Executables for Variant Blocks Without Recompiling Code for Changing Active Choices Using Startup Activation Time
This example explains how to generate code for multiple implementations of a component represented using a Variant Subsystem block withstartup
activation time. - Generate Code from Nested Variant Subsystem with Code Compile and Startup Activation
This example illustrates howcode compile
andstartup
variant activation time can be used together in two nested variant subsystems. - Propagate Variant Conditions to Define Variant Regions Outside Variant Subsystems to Promote Consistency and Reduce Errors
Propagate variant conditions outside a Variant Subsystem block to adapt its interface according to the state of underlying blocks. - Remove Inactive Variant Components from Generated Code at Compile Time When No Active Choices Exist
Exclude inactive variant components from generated code at compile time. - Manage Variant Components to Pass Specified Values from Inactive Variant Subsystems with No Active Choice
Exclude inactive variant components from code generated for Variant Subsystem block at compile time.
Variant 제어 및 관리
- Organize Variant Control Macros in Same Header File
Aggregate variant control macros into a single header file using custom storage classes. - Represent Variant Conditions of Enumerated Type in Generated Code
Represent variant control variables meaningfully in the generated code by using enumerated types. - Generate Code for Variant Elements Within Buses
Generate code for buses with elements having different variant conditions. - Use Simulink.Parameter Type of Variant Control Variables for Code Generation in Variant Blocks
If you intend to generate code for a model containing variant blocks, specify variant control variables as
objects.Simulink.Parameter