MATLAB Answers

Creation of Simulink Libraries

1 view (last 30 days)
Sameer
Sameer on 8 Apr 2015
Commented: Sameer on 9 Apr 2015
Hello all
I have created a Simulink library but the library I created is linked to its block. I want to have it such a way that all the blocks which I am using in a model from this lib must be unlinked. So that any further change either in Model block or Library should not have any effect on each other.
It should be in such a way that it's block should be unlinked from the library the moment it is used in a model.
Hope to hear from you guys soon.
Best Regards

  0 Comments

Sign in to comment.

Accepted Answer

Sebastian Castro
Sebastian Castro on 8 Apr 2015
Edited: Sebastian Castro on 8 Apr 2015
Yes, you can do this.
When you drag a block in from a library, it essentially copies and pastes it into your new model. So, the key is to programmatically disable the library link when this block is copied.
To do this, you can right-click your block and go to Properties. Then, go to the Callbacks tab. Then, add the following line to your CopyFcn callback:
>> set_param(gcb,'LinkStatus','inactive');
Does this work?
- Sebastian

  3 Comments

Sameer
Sameer on 9 Apr 2015
Hi Sebastian,
Thank you for replying. It worked with slight changes. Now I have another doubt may be you will be able to help me. Its about linking the subsystems. For example I am having a lib. at in a folder called 'abc'. I want that lib. in 'abc folder' in another library which I am calling 'Haupt'. Now what I want is... when I make changes in Hapt then it should also be reflected in 'abc folder lib.' and not vice versa. Can you suggest any way? It would be a great help.
Best Regards
Sebastian Castro
Sebastian Castro on 9 Apr 2015
You can certainly nest libraries. If you drag a block from one library to another library other, it will preserve the original library link.
I'd be careful about doing this, though, because it makes you very prone to unwanted changes... although the "Resolve Links" dialog has gotten much better in the last few releases with regards to resolving multi-level library links.
- Sebastian
Sameer
Sameer on 9 Apr 2015
Hi, thanks a lot. But let me try to be more specific in explaning my Question. Is such an arrangement possible?
If yes then Please throw some light.
Thanking you in anticipation.
Regards

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by