Effacer les filtres
Effacer les filtres

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

21 vues (au cours des 30 derniers jours)
Kristian
Kristian le 23 Juin 2017
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?

Réponses (1)

Mandar Patwardhan
Mandar Patwardhan le 27 Juin 2017
To resolve library links programmatically, use the "SourceBlock" parameter instead of using the "ReferenceBlock" parameter.
  1 commentaire
Giuseppe Avallone
Giuseppe Avallone le 28 Juil 2017
Hello. I have the same problem. I tried this way, but it results "Reference block parameter 'SourceBlock' is read-only".

Connectez-vous pour commenter.

Catégories

En savoir plus sur Dependency Analysis dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by