Why do I get sublibs in simulink browser for my custom lib
4 次查看(过去 30 天)
显示 更早的评论
I have created a customized Simulink library. I followed the instructions outlined in the following link: https://se.mathworks.com/help/simulink/ug/adding-libraries-to-the-library-browser.html to ensure that the library appears correctly in the Simulink browser. However, I am encountering an issue where certain "sub-libraries" are appearing in the library browser that are not intended to be part of the library. These sub-libraries seem to correspond to the names of certain blocks within the actual library.
I have attached a screenshot below to illustrate how the library browser looks. The section highlighted in red actually represents blocks with the same names as those in the main library. Strangely, they are displayed as sub-libraries.
If I expand one of the "sublibs" it displays all parts that the actulal block consists but separatly:
I have tried restarting matlab and refreshing the lib but the problem still exist. Does any one have soution for this?
MATLAB Version: 9.13.0.2126072 (R2022b) Update 3
MATLAB License Number: 41069452
Operating System: Microsoft Windows 10 Enterprise Version 10.0 (Build 19044)
Java Version: Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.13 (R2022b)
Simulink Version 10.6 (R2022b)
Simscape Version 5.4 (R2022b)
Simscape Fluids Version 3.5 (R2022b)
>>
Below follows the code for the code that shall make the lib to show in the browser
function blkStruct = slblocks
Browser.Name = 'SSG Library';
Browser.Library = 'ssg_simscape_lib';
blkStruct.Browser = Browser;
0 个评论
回答(1 个)
Brahmadev
2023-9-4
Hi Magnus,
I understand that you are trying to create a Custom Library with your "Subsystem" blocks. However, as mentioned in the tutorial you have referred, simply using a "Subsystem" block in your Library will create a "Sublibrary" with all the blocks used inside the "Subsystem".
One way to ensure that your Custom blocks created using "Subsystem" block stay intact is using a "Variant Subsystem" block. You can either add your current block model inside a new "Variant Subsystem" or right-click on the subsystem block, click on "Subsystem & Model Reference", click on “Convert to” and choose “Variant Subsystem”. This should help you use your custom blocks in your custom library instead of creating Sublibraries.
Hope this helps!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subsystems 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!