How to use the results calculated by the previous module to control the variant modules in the system composer (software architecture)?
Show older comments
I am trying to use variant components to build my software architecture. The plan is to use the signal a calculated by the previous calculation module (Planning) to control the selection of variant components, such as selecting component_1 when v=1, and if v=2, select component_2. At present, after consulting the reference documents, it seems that the control variables for the variants can only be used in MATLAB ® Variables, Simulink Parameter object or Simulink The VariantControl object is used for control. And my quantity is the signal, how should this be achieved?
It should be noted that due to project requirements, I am unable to use programming methods likes M-function or S-function. I can only use the built-in module functions of SIMULINK.

Accepted Answer
More Answers (1)
Swastik Sarkar
on 28 Aug 2024
0 votes
Variant components are used to indicate alternate designs for a component within an architecture. They are not suited for conditional execution of components. More details can be found in the documentation below:
To achieve conditional execution of components, consider creating a wrapper around the components by including them as "Enabled Subsystems" in Simulink. This method allows for control over the execution of components based on specific conditions.
Further information about "Enabled Subsystems" and their implementation can be found in the documentation below:
Hope this information helps.
Categories
Find more on Component-Based Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


