Filter löschen
Filter löschen

copying a simulink library block without its link

46 Ansichten (letzte 30 Tage)
Jagmohan singh
Jagmohan singh am 14 Jun. 2012
Hi, I have a created a subsystem through s-function with variable number of inports. I want to use this library block at many places in my model assigning separate numbers of Inports. Problem comes when i close the model and open it again, at all the places i have same number of inports which is defined in library block, so I have to manually assign number of inports at all the place before running the simulation. I have overcome with this problem by disabling the link for each block with its library block. I am wondering is there any way by which I can assign a property to my library block so that whenever someone copies this block in his simulink model, it will disable its link automatically instead of doing it manually everytime?
Thanks,

Akzeptierte Antwort

TAB
TAB am 14 Jun. 2012
If you have masked your block then it is easy to disable the link of block every time block is added in the model from library. In initialization pane of Mask Editor dialog box enter below command.
set_param(gcb,'LinkStatus','none');
If you are using block without masking, then in PreSaveFcn or PostSaveFcn callback function of your model, write code to find all your library blocks using find_system() and set their 'LinkStatus' to 'none'. In this way, when your model will be saved, library link will be disabled.

Weitere Antworten (0)

Kategorien

Mehr zu Subsystems finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by