Masked systems and masked parameters

In last session we discussed subsystems and some basics of Simulink. Now we are going to discuss masked systems and masked parameters. Our discussion will include following topics

  1. What are masked systems
  2. What are mask parameters
  3. How to mask a system
  4. Mask Editor
  5. How to add picture to masked system
  6. How to add text to masked system
  7. Short cuts
  8. Masked wind turbine system example

 

1-  What are masked systems

A mask is a custom user interface for a block that hides the block’s contents, making it appear to the user as an atomic block with its own icon and parameter dialogue box. Masked system is associated with the word “mask”. We make a subsystem and encapsulate in any mask. Mask system looks exactly like a built in block of Simulink.

2-  What are mask parameters

Mask parameters are parameters which can be changed by just clicking our mask. We have to keep one thing in mind that mask parameters are defined in the mask workspace, while block parameters are defined in the model or base workspace. So we can’t access parameters which are defined inside our mask outside that masked system.

 

We can provide access to one or more underlying block parameters by defining the corresponding number of mask parameters. Mask parameters appear in the Mask Parameters dialog box as fields that can be edited. Simulink® applies the value of a mask parameter to the value of the corresponding block parameter during simulation.

 

3-  How to mask a system

Make a simple Simulink model with a Constant block, Gain block, and a Display block
Set the value of Constant to a variable M.

Make subsystem of these blocks and then convert it into a masked system.

4-  Mask Editor

After creating mask, Mask Editor window appears, in which we can edit our mast according to our requirements. Following tab in Mask Editor are of our concern:  

Prompt

We have to put some name or anything and that name will be appeared in masked system outlook. Like in our case we write Constant value, now that Constant value option will be shown when anyone clicks masked system.

Variable

Whatever value we enter in mask parameter will be assigned directly to variable name written in that place. As we want to change variable ‘M’ (used in constant block) with our masked parameter  so we put variable name here as ‘M’. 
In our example we are just using one variable, but we can use as many variables as we want.
Now we have completely masked our system. Masked systems are recognized by a small arrow pointing downwards. Double click the masked system to insert value of ‘G’.
Outlook of a masked system

 

Putting value of constant G in masked system

Now we can see that same value is going into Constant block  which we are inserting here. We can check inside of masked system by clicking option Look inside mask.



5-  How to add picture to masked system

We can  add any picture of our choice so that our system looks like a built in block and anyone can know function of our system by just looking at it. Add picture as follows:

Mask——-> Edit Mask———-> Icons————> image(imread(‘images.jpg’))
Now we can see that our system looks like a built in block of Simulink.
Masked system looking like a built in library block
We can  write any text of our choice which could depict nature of our masked system. Like if we are going to implement some equation in masked system, we can display that equation by going into icon panel and entering below command :
 
disp(‘{\itEquation:}\alpha^2 + \beta^2\rightarrow \gamma^2,\chi,\phi_3= {\bfcool}’, ‘texmode’,’on’)

Masked System with text at its outlook

6-  Short cuts

Create Subsystem——–>    Ctrl+G
Create Mask————->    Ctrl+M
Edit Mask—————->    Ctrl+M
Look under Mask——– >   Ctrl+U

7-  Masked wind turbine system example

Following example is a masked parameter of a wind turbine. We can see that a lot of parameters can be set in that model by just putting values in our mask without going inside messy model.

 
 
Thanks a lot for your time 🙂
For projects/paper implementations and one to one online training……

 

 


Leave a comment