Effacer les filtres
Effacer les filtres

copying a simulink library block without its link

46 vues (au cours des 30 derniers jours)
Jagmohan singh
Jagmohan singh le 14 Juin 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,
  1 commentaire
TAB
TAB le 14 Juin 2012
Have you masked your library block ?

Connectez-vous pour commenter.

Réponse acceptée

TAB
TAB le 14 Juin 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.
  1 commentaire
Jagmohan singh
Jagmohan singh le 14 Juin 2012
This solves my Problem.
Thanks...

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Subsystems dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by