When using HDL coder you can't have masked subsystems under a subsystem with a mask, in other words there can be only one mask in a model. What I would like to do is programmatically copy masks from lower subsystems to the highest level masked subsystem I have. I can use find_system(' modelname ','Mask','on')to find masked blocks and use the commands:
pSource = Simulink.Mask.get( srcBlockName )
pDest = Simulink.Mask.create(destBlockName)
To get a mask and copy a mask from one block to another. However, pDest.copy(pSource) replaces any existing mask. What I would like to do is if masks already exists add the new mask as a separate tab. That way all my masks could be at the top level and exist as separate tabs for "neatness" although not absolutely necessary.
Any help appreciated