Create single custom simscape component which contains multiple subsystems?

1 visualización (últimos 30 días)
I have simscape subsystem, which contains physical signal inputs and simscape electrical outputs. I use the subsystem2ssc function to create a custom simscape component and then use ssc_protect to protect the subsystem. Currently there are no subsystems in the model and by using the two aforementioned function I am able to create a single file protected model.
I want to create a protected custom simscape component which contains nested subsystems. When I use the subsystem2ssc function it creates a .ssc file for each of the subsytems. Is there a way to create a single simscape component from a subsystem which contains other subsytems?

Respuestas (1)

Sumukh
Sumukh el 21 de Ag. de 2024
Hi Daniel.
There are two possible ways to create a single protected component for Simscape subsystem with nested subsystems:
  • A single protected component for the subsystem can be created using the “Simscape Component” block available in Simulink “Utilities” library. The protected subsystem code (“.sscp”) file must be provided to the block parameters, and it works with subsystems with nested subsystems as well. You can run the following command in the command window of MATLAB R2018b to the learn more about the block:
web(fullfile(docroot, 'physmod/simscape/ref/simscapecomponent.html'))
  • Alternatively, a single component library file for the subsystem can be created using the command “ssc_build”. The protected files must be first placed inside a package folder, with the name “+package_name”. The command “ssc_build package_name” can then be used to create a single protected component library file for the Simscape subsystem. You can run the following command in the command window to know more about “ssc_build”:
web(fullfile(docroot, 'physmod/simscape/ref/ssc_build.html'))
However, slight modifications must be done in the subsystem code file before protecting the code files. In the code, the paths of the nested subsystems in the “components” section must be edited to match the package folder structure. You can run the following command in the command window to understand the workflow to create components from Simscape subsystems and editing the subsystem code (“.ssc”) file:
web(fullfile(docroot, 'physmod/simscape/lang/converting-subsystems-into-composite-components.html'))
I hope this helps with your query.

Categorías

Más información sobre Composite Components en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by