フィルターのクリア

copying a simulink library block without its link

46 ビュー (過去 30 日間)
Jagmohan singh
Jagmohan singh 2012 年 6 月 14 日
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,
  1 件のコメント
TAB
TAB 2012 年 6 月 14 日
Have you masked your library block ?

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

採用された回答

TAB
TAB 2012 年 6 月 14 日
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.
  1 件のコメント
Jagmohan singh
Jagmohan singh 2012 年 6 月 14 日
This solves my Problem.
Thanks...

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by