Filter löschen
Filter löschen

Self-modifying block libray

1 Ansicht (letzte 30 Tage)
Ivan Gonzalez Gayoso
Ivan Gonzalez Gayoso am 21 Mär. 2014
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"

Antworten (0)

Kategorien

Mehr zu Subsystems finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by