Create two different masks for a subsystem

1 visualización (últimos 30 días)
grapevine
grapevine el 9 de Mzo. de 2012
Hello everyone,
I'm looking for a way to create two differents masks for a subsystem block in Simulink. I need it because I need to create a block, which is capable to show a mask when the simulation is stopped and another mask while the simulation is running. For the moment I wrote this code to put inside the OpenFcn
if (strcmp(get_param(gcs, 'SimulationStatus'),'paused') | strcmp(get_param(gcs, 'SimulationStatus'),'running') )
open_system(gcb, 'mask1')
else
open_system(gcb, 'mask')
end
but I cannot use because I don't know how to create two masks for a susbsystem
can you help me? at least is it possible to create two different mask?
thanks in advance
  1 comentario
grapevine
grapevine el 9 de Mzo. de 2012
ps
I don't have a variant subsystem in my matlab
http://www.mathworks.nl/help/toolbox/simulink/ug/bsn6z6m.html#bsk8r3f-7

Iniciar sesión para comentar.

Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 9 de Mzo. de 2012
AFAIK, there's no way to create multiple masks for a block. The best you can do to change the appearance of your mask is to swap the properties of the mask itself. Also, the only thing you can change during a simulation are values of tunable parameters, so I don't think that Simulink will let you change things like MaskVariables like you want to, during simulation.
Perhaps you could explain more about what you're trying to do, so we can suggest an alternate solution if available.
  2 comentarios
grapevine
grapevine el 12 de Mzo. de 2012
Thanks for your answer, actually my prof asked me to create a system, where it's possible to force an ouput value during the simulation, and when the simulation is over it should be possible to access to a different set of parameters
I tried this solution by introducing a susbsystem inside the main model,
if (strcmp(get_param(gcs, 'SimulationStatus'),'paused') | strcmp(get_param(gcs, 'SimulationStatus'),'running') )
open_system(strcat(gcb,'/Forçage'), 'mask')
else
open_system(gcb, 'mask')
end
but we have some problem, when we use this block as linked block of a library
http://www.mathworks.com/matlabcentral/answers/31754-how-to-turn-off-a-warning-dialog-box
Now as you suggested me I'm looking for a solution using the mask properties.
I thought to use set_param and these parameters
- MaskEnables
- MaskVisibilities
in order to show certain parameters only during the simulation
but they accept as argument an array of cells, and I don't undestrand how to create it, do you know how I can do it?
thanks 4 the help
grapevine
grapevine el 12 de Mzo. de 2012
I found it
set_param(gcb,'MaskVisibilities',cellstr(char('on','off'))

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Author Block Masks en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by