フィルターのクリア

Unresolved linked library block: How to change the source block programmatically?

21 ビュー (過去 30 日間)
Kristian
Kristian 2017 年 6 月 23 日
コメント済み: Giuseppe Avallone 2017 年 7 月 28 日
Hi,
assume you have a linked library block in your model. The library is in the path and can be found, so the block is resolved and regularily displayed.
Now you change the library file name. Now the block is unresolved. To fix that you can double-click the block and change the path to the library in the "Source block" field. After hitting OK the block will resolve and show up normally again.
How to do that programmatically? The issue is that I cannot change the "ReferenceBlock" property in case the block is unresolved. It only works when it´s resolved. So I can change from one existing library to another existing library only but not from a missing library to a valid one.
Background: I have several linked blocks in the model but need to change the library names frequently. So I would need to go through the model each time and change the links manually. Apart from that Matlab (2014b) always crashes nearly after the first change and completely after the second one. So my hope would also be that it would survive if the change is done from the command window.
Is there a solution for it?

回答 (1 件)

Mandar Patwardhan
Mandar Patwardhan 2017 年 6 月 27 日
To resolve library links programmatically, use the "SourceBlock" parameter instead of using the "ReferenceBlock" parameter.
  1 件のコメント
Giuseppe Avallone
Giuseppe Avallone 2017 年 7 月 28 日
Hello. I have the same problem. I tried this way, but it results "Reference block parameter 'SourceBlock' is read-only".

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

カテゴリ

Help Center および File ExchangeDependency Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by