Unresolved linked library block: How to change the source block programmatically?
26 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuestas (1)
Mandar Patwardhan
el 27 de Jun. de 2017
To resolve library links programmatically, use the "SourceBlock" parameter instead of using the "ReferenceBlock" parameter.
1 comentario
Giuseppe Avallone
el 28 de Jul. de 2017
Hello. I have the same problem. I tried this way, but it results "Reference block parameter 'SourceBlock' is read-only".
Ver también
Categorías
Más información sobre Custom Libraries en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!