Guy on Simulink

Simulink & Model-Based Design

Promoting Block Parameters to a Mask

In R2011b, we are trying to make it easier to interface the parameters of a masked subsystem with the parameters of the blocks under this mask. We call this Promoting Block Parameters. Let's see how this works.

Promoting a parameter

Let's use this simple system as an example.

Example system

I want to create a mask on top of it and allow users to tune only certain values. For example, I want to give the user the ability to specify the rising slew rate of the Rate Limiter block. I open the Mask Editor, add a parameter and click the new Promote button:

Promote Button

This will launch the promoted parameter selector dialog box, where I can choose the block and the parameter I want to promote.

Promoted parameter selector dialog box

Interface for Multiple Parameters

One of my favorite thing about this feature is that you can easily map one mask parameter to multiple parameters under the mask. In older releases, a good amount of code-gymnastics might have been necessary to make that happen.

In my example system, I have 3 blocks with a checkbox to Enable zero-crossing detection. In the promoted parameter selector dialog, I can use the Search field to find all the blocks with this parameter and promote them to one parameter of my mask:

Promoting multiple parameters

When I come back to the Mask Editor, I can easily see which parameters are promoted to this mask parameter:

Promoting multiple parameters

The result looks like this. If I look under the the mask, the promoted block parameters are grayed and can be tuned in the top mask.

Final Result

Now it's your turn

Give this a try and let us know what you think by leaving a comment here.

|
  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.