Self-modifying block libray
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subsystems에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!