フィルターのクリア

Self-modifying block libray

1 回表示 (過去 30 日間)
Ivan Gonzalez Gayoso
Ivan Gonzalez Gayoso 2014 年 3 月 21 日
This is my situation. I’m creating a masked subsystem that includes basically Simulink blocks, SimPowerSystems blocks and Matlab functions. According to one masked parameter, I should add or delete blocks to the main structure, so I’m using the instruction Simulink.SubSystem.deleteContents(blk) to delete the whole subsystem, and create it again with the code I write in the Initialization Pane of the mask (the structure could be huge so i think it’s easier to do it in that way). My problem comes when I try to connect the blocks using add_line. Everything works fine if I change the parameter in the unlocked library (I get the number of blocks according to this parameter and they connect each other fine), but when I add my block to a new model, and I change this parameter, i get something like : ‘Initialization commands cannot be evaluated. –> The Destination port already has a line connection”. But if I comment the code about add_line, everything works perfect, obviously without the line connections, so it seems the problem is the add_line instruction. Any idea about where could be the problem? Is there some limitation about which changes could you do in a self-modifying block from a library? Thanks in advance PD: I've already check "Allow library block to modify ist contents"

回答 (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