copying a simulink library block without its link

38 visualizaciones (últimos 30 días)
Jagmohan singh
Jagmohan singh el 14 de Jun. de 2012
Comentada: Sagunthala el 4 de Oct. de 2024
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,

Respuesta aceptada

TAB
TAB el 14 de Jun. de 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.
  2 comentarios
Jagmohan singh
Jagmohan singh el 14 de Jun. de 2012
This solves my Problem.
Thanks...
Sagunthala
Sagunthala el 4 de Oct. de 2024
yes its working

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by