Clear Filters
Clear Filters

Compilation of variant subsystem

6 views (last 30 days)
Lukas Polacek
Lukas Polacek on 24 Aug 2021
Commented: Dinesh on 2 Jul 2024 at 6:03
Hi.
I have two big systems that works nice as separate models. My question is following will it change performance at any point of runnig the model if I put them into variant subsystem? Fast running is crucial for my project. Will it affect the length of compilation? Now I am on half an hour so longer compilation is also problem.
Thank you for answer:

Accepted Answer

Jonas
Jonas on 24 Aug 2021
In a Variant Subsystem, only the active subsystem will be compiled. Any other variants inside the Variant Subsystem will be ignored. So the compilation time of a regular subsystem compared to the same subsystem as an active subsystem in a Variant Subsystem will be the same.
  2 Comments
Lukas Polacek
Lukas Polacek on 24 Aug 2021
Thank you that is what I need.
Dinesh
Dinesh on 2 Jul 2024 at 6:03
@Lukas Polacek, as of release R2024a, there are a couple of changes to Variant Subsystem. Compilation of inactive choices/subsystems depends on the "Variant Activation Time" chosen. By default when you create a Variant Subsystem, "update diagram" is the value of "Variant Activation Time" which means only the active subsytem will be compiled. However, you can change this value in the block parameters dialog of the block. To access this, right-click on the Variant Subsystem block and choose "Block Parameters". In the dialog, if the "Variant Control Mode" is chosen to be "expression", then you can modify the "Variant Activation Time" as well. The value "update diagram analyze all choices" means all the choices will be analyzed, which means that the inactive choices/subsystems will also be compiled (Since you don't want to encounter performance issues, you may not choose this value). There are other values such as "code compile" or "startup" which also anaylze all choices, but the difference is in how they generate code for the model. You can learn more about this in the following documentation: https://www.mathworks.com/help/simulink/slref/variantsubsystemvariantmodelvariantassemblysubsystem.html#:~:text=sim%20codegen%20switching-,Variant%20activation%20time,-%E2%80%94%20Time%20when

Sign in to comment.

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!