Effacer les filtres
Effacer les filtres

How to create a component reference in the system composer from a simscape component

18 vues (au cours des 30 derniers jours)
Flávio Luiz
Flávio Luiz le 16 Août 2024 à 17:02
Modifié(e) : Josh Kahn le 20 Août 2024 à 12:55
Hello,
I have a Simscape Isothermal Fluid component that is an isolated component (it have its own test harness, test cases and requirements. You can see it is composed with simscape signals and simulink signals.
I would like to build a system composer, were this component is part of. But when I add a "reference component" on the system composer ad link to the compoenent, the physical lines does not come.
The only way I made it works is creating the sismcape compoenent inside the system composer, but this way I need to manage changes and so on inside the composer.
Any solution to create a simscape component that can be referenced inside the system composer and have the physical connections available?

Réponses (2)

Akshat Dalal
Akshat Dalal le 19 Août 2024 à 13:02
Hello Flavio,
It is possible to create a simscape component that can be referencedn inside a System Composer application and have the physical connections available. One way to achieve this is to use the Simulink Subsystem Reference approach. This allows you to author Simulink or Simscape behaviors with physical ports and connections.
You can refer the following documentation for a more detailed explanation and other approaches: https://www.mathworks.com/help/releases/R2024a/systemcomposer/ug/implement-components-in-simulink.html

Josh Kahn
Josh Kahn le 20 Août 2024 à 12:55
Modifié(e) : Josh Kahn le 20 Août 2024 à 12:55
When you right-click to create your Simulink behavior from System Composer, make sure you choose "Subsystem Reference". Simscape models do not support physical ports crossing the model reference boundaries but they can cross subsystem reference boundaries.
Alternatively, if you right-click your HydraulicPumpSubsystems subsystem in your existing Simulink model and convert it to a subsystem reference, you can link your System Composer component directly to it using the "Link to Model" option in the context menu.
Josh

Catégories

En savoir plus sur System Composer dans Help Center et File Exchange

Produits


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by