フィルターのクリア

How to display blocks of a custom library in the Simulink library browser?

5 ビュー (過去 30 日間)
xycinate
xycinate 2012 年 3 月 8 日
回答済み: Michael Walker 2018 年 9 月 26 日
I have started working on a Simulink library. I followed the instructions provided in MATLAB help and managed to create the library that I wanted. Everything works as it is supposed to, i.e. the library name is displayed in the library browser, I can open it (by right clicking on it), drag the blocks to my models and use them. However, the blocks that are in the library are not displayed in the right hand side of the library browser. Does anyone know how can I possibly display them?
  1 件のコメント
Titus Edelhofer
Titus Edelhofer 2012 年 3 月 8 日
Hi Mihail,
hmm, never heard this: whenever I had a user being able to write the slblocks function, the content of the library also appeared. Perhaps this would be a question to ask the technical support ...
Titus

サインインしてコメントする。

採用された回答

xycinate
xycinate 2012 年 3 月 9 日
Thank you for your replies. The answer to Ms. Govind's questions are 1). Yes. All of the blocks are subsystems. 2). Yes. They all have masks and all have parameters.
Also, my slblocks function looks like (I tried both 1 and 0 for Browser.IsFlat and also tried deleting the line completely):
function blkStruct = slblocks
% Specify that the product should appear in the library browser
% and be cached in its repository
Browser.Library = 'DrivetrainLibrary.mdl';
Browser.Name = 'Drivetrain Library';
Browser.IsFlat = 1;% Is this library "flat" (i.e. no subsystems)?
blkStruct.Browser = Browser;
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2012 年 3 月 13 日
Could you try changing that line to:
Browser.Library = 'DrivetrainLibrary';
You shouldn't specify the .mdl extension.

サインインしてコメントする。

その他の回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2012 年 3 月 8 日
As Titus mentioned, if you have your slblocks.m configured, the blocks should show up. Are your blocks all subsystems? If yes, do they have masks, and do the masks have any parameters?

Michael Walker
Michael Walker 2018 年 9 月 26 日
I have the same problem, but it only recently appeared when we changed from using 2014b, where they do appear, to 2017a, where they do not appear, with no change to the slblocks.m file. What's going on?

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by