{"id":167,"date":"2011-11-01T19:58:38","date_gmt":"2011-11-01T19:58:38","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/2011\/11\/01\/promoting-block-parameters-to-a-mask\/"},"modified":"2011-11-01T19:58:38","modified_gmt":"2011-11-01T19:58:38","slug":"promoting-block-parameters-to-a-mask","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2011\/11\/01\/promoting-block-parameters-to-a-mask\/","title":{"rendered":"Promoting Block Parameters to a Mask"},"content":{"rendered":"<p>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 <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011b\/toolbox\/simulink\/ug\/bs6h8z3-1.html\">Promoting Block Parameters<\/a>. Let's see how this works. <\/p>\r\n\r\n<p><strong>Promoting a parameter<\/strong><\/p>\r\n\r\nLet's use this simple system as an example. <\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q4\/example_system.png\" alt=\"Example system\"><\/p>  \r\n\r\n<p>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 <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011b\/toolbox\/simulink\/slref\/ratelimiter.html\">Rate Limiter<\/a> block. I open the <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011b\/toolbox\/simulink\/gui\/f8-3488.html\">Mask Editor<\/a>, add a parameter and click the new <strong>Promote <\/strong>button:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q4\/promote_button.png\" alt=\"Promote Button\"><\/p>  \r\n\r\n<p>This will launch the promoted parameter selector dialog box, where I can choose the block and the parameter I want to promote.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q4\/promote_dialog.png\" alt=\"Promoted parameter selector dialog box\"><\/p>\r\n\r\n\r\n<p><strong>Interface for Multiple Parameters<\/strong><\/p>\r\n\r\n<p>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.<\/p>\r\n\r\n<p>In my example system, I have 3 blocks with a checkbox to <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2011b\/toolbox\/simulink\/ug\/f7-8243.html#f7-9506\">Enable zero-crossing detection<\/a>. 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:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q4\/promote_multiple_parameters.png\" alt=\"Promoting multiple parameters\"><\/p> \r\n\r\n<p>When I come back to the Mask Editor, I can easily see which parameters are promoted to this mask parameter:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q4\/multiple_parameters_promoted.png\" alt=\"Promoting multiple parameters\"><\/p> \r\n\r\n<p>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.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2011Q4\/all_together.png\" alt=\"Final Result\"><\/p> \r\n\r\n<p><strong>Now it's your turn<\/strong><\/p>\r\n\r\n<p>Give this a try and let us know what you think by leaving a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=167&amp;#comment\">comment here<\/a>.<\/p>\r\n\r\n\r\n\r\n ","protected":false},"excerpt":{"rendered":"<p>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... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2011\/11\/01\/promoting-block-parameters-to-a-mask\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[47,16],"tags":[452,231,441],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/167"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/comments?post=167"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/167\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}