Clear Filters
Clear Filters

Why do I receive an error when saving a Simscape model as a previous version and trying to compile it in that version?

15 views (last 30 days)
When I save my Simscape model in a previous version and try to compile it, I receive an error. How do I configure my models so that they are truly compatible?
The exact error I am receiving is:
Error due to multiple causes.
Caused by:
Error using slcontrollib.mdlcfg.ParameterManager/compile
Error in 'simscapeValidation33bar_old/PS-Simulink Converter': Initialization commands cannot be evaluated. - Show complete stack trace
Error using slcontrollib.mdlcfg.ParameterManager/compile
Unit name, 'inherit', is not recognized - Show complete stack trace
Error using slcontrollib.mdlcfg.ParameterManager/compile
Error in 'simscapeValidation33bar_old/PS-Simulink Converter1': Initialization commands cannot be evaluated. - Show complete stack trace
Error using slcontrollib.mdlcfg.ParameterManager/compile
Unit name, 'inherit', is not recognized - Show complete stack trace

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Oct 2022
Edited: MathWorks Support Team on 23 Nov 2022
Exporting a model to a format used by an earlier version (Simulation > Save > Previous Version) is not supported for models containing Simscape blocks. Refer to the documentation describing Simscape limitations.
This specific error is caused by the update in R2019b where the PS-Simulink Converter blocks added the option 'inherit' to the unit selection. This can be found in the release notes.https://www.mathworks.com/help/simscape/release-notes.html?rntext=&startrelease=R2019b&endrelease=R2019b&groupby=release&sortby=descending&searchHighlight=
Two recommended workarounds are:
  • Build and save Simscape models in the earliest release you are trying to export them to. In doing so, you eliminate the need to make the model backwards compatible, as forward compatibility is already supported.
  • Remove any functionality that was not yet introduced in the version you are trying to export to. MATLAB Release notes can be used to track the changes. For this example, replacing the 'inherit' units option in the PS-Simulink Converter blocks would resolve the issue. 

More Answers (0)

Categories

Find more on Variable Initialization in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!