Get list of libraries blocks that have "changes" in a model

6 ビュー (過去 30 日間)
langrg
langrg 2019 年 2 月 28 日
回答済み: Joe Rustan 2023 年 5 月 22 日
Hello,
I have a Simulink model with libraries blocks inside. I have modified some of those libraries (from my model) using "set_param". Now those modified blocks are still linked (LinkStatus = resolved) but have "changes". I mean that the blocks have now a "sheriff star" icon on bottom-left, like that :
LibraryIcon.PNG
There is also a new context menu on those blocks : "Library Link\View changes...".
My question is : how can I get a list of all those blocks in my model? (those blocks = libraries blocks with changes)
I thought I would use 'LinkStatus' parameter in a "find_system" command, but as they are still "resolved" it doesn't work... Is there an other modified parameter to look for?
Thanks!

採用された回答

Fangjun Jiang
Fangjun Jiang 2019 年 2 月 28 日
That is called parameterized library links. I couldn't find a way to get the list using find_system(). You could run Model Advisor, search "parameterized" and find and run the check "Identify parameterized library links". It will give a list.
I also tried a=ModelAdvisor.run('model','mathworks.design.ParameterizedLibLinks'). The list is in the returned result but it is hard to parse.
  2 件のコメント
langrg
langrg 2019 年 2 月 28 日
Great! In fact, I was just missing the term "parameterized library links". With a Google search I found how to find thoses blocks:
Chapter "Find parameterized links in a model".
Thank you very much!
Fangjun Jiang
Fangjun Jiang 2019 年 2 月 28 日
Thank you! I am glad to learn this parameter. For whatever reason, it was not included in get(gcbh).
It's good to know the weblink for the example too!

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

その他の回答 (1 件)

Joe Rustan
Joe Rustan 2023 年 5 月 22 日
Similar question. My system model 'SYS' has several linked libraries such as LL1, LL2, LL3, which are in LL1.slx, LL2.slx, etc. in the SYS window, I change the name of a signal or port in LL3. So now LL3 is changed and I'd like to push/propagate these changes back to the original source file LL3.slx.
In general, I'd like to push all such changes back to the source files of the libraries .slx files. The ModelAdvisor.run command output is not particularly useful for scripting.
What I want to do is:
1) Get a list of all the 'changed' libraries in SYS
2) set_param(<library-file-path>, 'LinkStatus', 'propagate')
TIA for any advice.
JR

カテゴリ

Help Center および File ExchangeCustom Libraries についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by