How can I lock a block in Simulink?

4 visualizzazioni (ultimi 30 giorni)
Andrea
Andrea il 30 Lug 2013
I wrote my own library, with one S-Function Block in Simulink. I want that it is possible to insert the block once in a Simulink Model, but not a second time (in the same model). I want that the my block is unique in the model. I need the block for some settings. Is there a chance to do that?

Risposta accettata

Andreas Goser
Andreas Goser il 30 Lug 2013
I suppose there is no way to present inserting the block a second time, but you can verify if more than one block of this type exists right before running the model. You would need to apply MATLAB code with e.g. the "find_system" command as a model callback .
  3 Commenti
Andrea
Andrea il 30 Lug 2013
With "find_system" I can see if there are more than one blocks. Is it possible to delete, or remove the second one?
Andreas Goser
Andreas Goser il 30 Lug 2013
Yes. There are more Simulink API commands. Here DELETE_BLOCK

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Programmatic Model Editing in Help Center e File Exchange

Tag

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by