Why do I see inconsistent behavior when I copy a masked subsystem from one model to another in Simulink 6.1 (R14SP1) and later versions?
2 views (last 30 days)
Show older comments
When I copy a masked subsystem from mymdl.mdl model into tmp.mdl model by using the following command:
new_system('tmp')
open_system('tmp')
open_system('mymdl')
add_block('mymdl/MyBlock_3','tmp/MyBlock_3');
We see a popup window with the following error message:
Error using ==> get_param
Invalid Simulink object name: tmp/MyBlock_3/IV
However, when we copy the same subsystem by loading the mymdl.mdl instead of opening the model:
new_system('tmp')
open_system('tmp')
load_system('mymdl')
add_block('mymdl/MyBlock_3','tmp/MyBlock_3');
No error message occurs.
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
This is the expected behavior.
It is because the masked subsystem has its "MaskSelfModifiable" parameter set to "on".
If you set this parameter to be "off", by using the command:
set_param('block','MaskSelfModifiable','off')
The issue will be fixed.
Note that the masked subsystem should not change itself, so its "MaskSelfModifiable" parameter should be set to "off".
0 Comments
More Answers (0)
See Also
Categories
Find more on Subsystems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!