Mathworks responded to my question. Here is the response.
________________
Answer to question 1:
Don't use the configurable subsystem. Mathworks would like to deprecate it. Variant Subsystems is an improvement. Mathworks is improving and refining the Variant Subsystem. It is not actively developing the Configurable Subsystem. Translation, you will get better support and response to questions related Variant Subsystem.
________________
Answer to Question 2:
To use nested Variant Subsystems, use set_param to set a parameter at the level 2 from level 1. Level 1 has a mask and is the top level of a Simulink library. When the level 1 mask is configured and the user clicks "Apply" or "Okay," the initialization for level 1 is executed. Use set_param in the level 1 initialization to set the value of a parameter at level 2. This causes Simulink to run the level 2 initialization script once the level 1 initialization script finishes. Thus, at the time the level 1 mask is configured, the level 2 Variant Subsystem is configured. Level 2 uses "OverrideUsingVariant" (as I said in option 3 of my question above) to configure itself.
If you try to set a variable in the level 1 initialization that is then referenced at level 2, this is not resolved until Simulink tries to run the model. Simulink does not allow configuring of the Variant Subsystem once the Simulink model is executed in the current version,2018a, or in previous versions. The Variant Subsystem must be configured before you execute the model. The tricky part is that you will only get a failure/error when you try to set an active variant at level 2 that is DIFFERENT than current active variant at level 2. For example, if option A is active at level 2, then if you try to run the model and option A is what you want (configured on the level 1 mask), then the model will run. If you try to switch to option B by configuring the level 1 mask and passing a variable, you will get an error when you try to run the model.
Mathworks provided me an example model. I will post here once they reply if it is okay to share it here.
1 Comment
Direct link to this comment
https://nl.mathworks.com/matlabcentral/answers/391515-managing-high-levels-of-variation-in-a-simulink-library#comment_551337
Direct link to this comment
https://nl.mathworks.com/matlabcentral/answers/391515-managing-high-levels-of-variation-in-a-simulink-library#comment_551337
Sign in to comment.