Variant subsystem throws error because it does not recognize parameter in mask

2 views (last 30 days)
Zeno Pavanello
Zeno Pavanello on 6 Jul 2021
Answered: Steve Miller on 29 Sep 2021
When I try to run a model in which a variant subsystem is present I get the following error: "Variant control 'maxdeg == 1' used by block 'model/Mechanical model/Chaser/Chaser Bus/Tanks/Sloshing Tank 1/Gravity EGM2008 ECI/Gravity EGM2008/Variant gravity model' should return a logical value".
The variable maxdeg is defined in the mask of the subsystem "Sloshing Tank 1" and is given as a parameter to the block "Gravity EGM2008 ECI", which is defined inside a custom library. Sometimes this error is accompanied by another error which states that the workspace of the masked subsystem is not initialized. I cannot debug the problem because when I try to run a simpler model with the single block "Sloshing Tank 1" or with the block "Gravity EGM2008 ECI" it runs smoothly.
If it may help, the model includes a Simscape Multibody system.
Thank you in advance for your help.

Answers (1)

Steve Miller
Steve Miller on 29 Sep 2021
Hi Zeno - take a look at this documentation page:
Make sure you have defined your variant control as shown on this page. I usually find it helpful to open the Variant Manager to check that it is set up properly.
--Steve

Community Treasure Hunt

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

Start Hunting!

Translated by