Create Simscape protected or pre-compiled model for users who don't have Simscape licenses
10 ビュー (過去 30 日間)
古いコメントを表示
I created a Simulink model (Model.slx) containing Simscape blocs. I need to share with some people for compilation purposes who does not have Simscape licenses.
I could create a script to protect the Simulink model:
Simulink.ModelReference.protect('Model.slx', ...
'Path', 'C:\MyFolder', ...
'Report', true, ...
'Mode', 'CodeGeneration', ...
'CodeInterface', 'Top model', ...
'OutputFormat', 'CompiledBinaries');
On my laptop with Simscape licenses, I am able to compile the Simulink (CodeToCompile.slx) that contains the protected model, and the code works as expected. But people who does not have Simscape licenses are not able to compile the code. I tried to compile the Simulink model into C code, but that created mainy .c files, so I am not confident in how to import the compiled model into CodeToCompile.slx.
Am I missing an option into the Simulink.ModelReference.protect function ? Should I go with the generated C code, and add each .c and .h to the Custom Codes of CodeToCompile.slx ? Are there any other way to create a model from Model.slx that people who don't have Simscape licences can compile ?
Many thanks for your help !
0 件のコメント
回答 (2 件)
Ayush
2025 年 9 月 1 日
編集済み: Stefanie Schwarz
2025 年 10 月 20 日 12:29
Hi, Valentin,
I understand you want to share a Simulink model containing Simscape blocks with colleagues who do not have a Simscape license.
You can refer this answer posted by MathWorks staff on similar issue:
Hope this helps.
Yifeng Tang
2025 年 9 月 3 日
I don't think Model reference, protected or not, will allow the user to run without Simscape.
Do you have the licenses needed to create a standalone FMU? You can bring that into a Simulink for a non-Simscape user, and that won't require Simscape license.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Configure and View Diagnostics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
