Masking a variant subsystem using Label control
Show older comments
I want to mask a variant subsystem consisting of two subsystems using mask initialization and the following code derived from "slexMaskingExample". I want to set the mode to speed or torque control and thereby use either of the speed or torque controllers to fulfil my purpose. I expect this to reduce my simulation time as the other block shoudl be inactive during the simulation as described by the Label Mode Active Variant in the Block parameters of the Variant subsystem.
But the problem is the underlying code does not make the other controller inactive while simulation. During simulation, both the subsystems are runnning. DUring editing, the results are as desired.
The mask initialization code is as follows:
simulationStatus = get_param(bdroot,'SimulationStatus');
choice = get_param(gcb,'Mode');
Blk = gcb;
if strcmp(choice,'Speed')
set_param(Blk, 'LabelModeActiveChoice', 'SpeedC');
else
set_param(Blk, 'LabelModeActiveChoice', 'TorqueC');
end
Kindly help
Accepted Answer
More Answers (0)
Categories
Find more on Variant Hierarchical Components 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!

