Why do I get an error when specifying a Simscape component parameter with same name as built-in Simulink parameter?
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 26 Sep 2018
Réponse apportée : MathWorks Support Team
le 26 Sep 2018
I have defined a custom Simscape component with a parameter named "position" declared only once in my component file. When I generate the library for this component, I get the following error:
>> ssc_build
Failed to generate 'tsTest_lib'
Caused by:
Error using simscape.engine.sli.internal.setupmask
Invalid inputs specified for method 'addParameter'
Error using simscape.engine.sli.internal.setupmask
Block 'tsTest_lib/Variable Area Ram' already has a built-in parameter 'position'. Hence a mask
parameter of the same name cannot be added
With same *.ssc file if we add this in Simscape component block, the error dialog reports
"PMDialogs.DynDlgBuilder.realizeChildren" (for failures in setupmask)
or
"Unable to create block dialog. If the block belongs to a custom Simscape library, please run ssc_build to rebuild the library. Please contact technical support if the error persists." (for failures in pmdlg)
Réponse acceptée
MathWorks Support Team
le 26 Sep 2018
The "position" parameter is already a built-in Simulink mask parameter. As a result, this causes a conflict when a Simscape parameter is defined with the same name in the component file.
As a workaround, changing the parameter name from "position" to something like "myposition" resolves the conflict. After making this change, running "ssc_build" in the package directory will successfully build the library.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating Custom Components and Libraries dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!