{"id":3406,"date":"2014-03-28T07:55:10","date_gmt":"2014-03-28T12:55:10","guid":{"rendered":"https:\/\/blogs.mathworks.com\/seth\/?p=3406"},"modified":"2017-01-04T15:52:22","modified_gmt":"2017-01-04T20:52:22","slug":"improved-workflow-for-converting-a-subsystem-to-a-referenced-model","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/simulink\/2014\/03\/28\/improved-workflow-for-converting-a-subsystem-to-a-referenced-model\/","title":{"rendered":"Improved Workflow for Converting a Subsystem to a Referenced Model"},"content":{"rendered":"<!--introduction-->\r\n<p>This week I want to highlight one of my favorite enhancement in R2014a: The improved workflow for converting a subsystem to a referenced model.<\/p>\r\n<!--\/introduction-->\r\n\r\n<p><strong>Before R2014a<\/strong><\/p>\r\n\r\n<p>As your models are getting larger and larger, you might be interested to convert some of the subsystems to <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/model-reference.html\">Referenced Models<\/a>.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/from_ss_to_mdl.png\" alt=\"Converting to Model Reference menu\" \/><\/p>\r\n\r\n<p>If you are not familiar with Model Referencing and its advantages, I recommend getting started with the documentation page <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/examples\/component-based-modeling-with-model-reference.html\">Component-Based Modeling with Model Reference<\/a>.<\/p>\r\n\r\n<p>To help converting subsystems to referenced models, we have been providing the function <a href=\"https:\/\/www.mathworks.com\/help\/simulink\/slref\/simulink.subsystem.converttomodelreference.html\"><tt>Simulink.SubSystem.convertToModelReference<\/tt><\/a> and a menu option which you can see when right-clicking on a subsystem:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/convert_menu.png\" alt=\"Converting to Model Reference menu\" \/><\/p>\r\n\r\n<p>For all those who tried this approach, you very likely ran into a series of errors that had to be fixed one-by-one before successfully converting your subsystem into a referenced model.<\/p>\r\n\r\n<p><strong>Improved Workflow<\/strong><\/p>\r\n\r\n<p>In R2014a, the Model Reference Conversion Advisor is introduced to improve this workflow. When you right-click on the subsystem, this new tool based on the Model Advisor shows up, listing all the steps you will need to go through to convert the subsystem:<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/Conversion Advisor.png\" alt=\"Converting to Model Reference menu\" \/><\/p>\r\n\r\n<p>Depending on your preferences, you can run the tasks one by one to understand each part of the process, or you can configure the advisor to run all the checks and automatically do all the modifications required by model referencing.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/conversion_config.png\" alt=\"Converting to Model Reference menu\" \/><\/p>\r\n\r\n<p>If needed, the Model Reference Conversion Advisor will create and save the bus objects necessary for the referenced model interface. At the end, it will generate a report so you can review the changes that have been automatically applied.<\/p>\r\n\r\n<p><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/conversion_report.png\" alt=\"Converting to Model Reference Report\" \/><\/p>\r\n\r\n<p><strong>Now it's your turn<\/strong><\/p>\r\n\r\n<p>Try the improved workflow for converting a subsystem to a referenced model, and let us know what you think by leaving a <a href=\"https:\/\/blogs.mathworks.com\/seth\/?p=3406&#comment\">comment here<\/a><\/p>","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/seth\/2014Q1\/conversion_report.png\" onError=\"this.style.display ='none';\" \/><\/div><!--introduction-->\r\n<p>This week I want to highlight one of my favorite enhancement in R2014a: The improved workflow for converting a subsystem to a referenced model.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/simulink\/2014\/03\/28\/improved-workflow-for-converting-a-subsystem-to-a-referenced-model\/\">read more >><\/a><\/p>","protected":false},"author":41,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[66,16],"tags":[373,372],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3406"}],"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=3406"}],"version-history":[{"count":30,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3406\/revisions"}],"predecessor-version":[{"id":6265,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/posts\/3406\/revisions\/6265"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/media?parent=3406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/categories?post=3406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/simulink\/wp-json\/wp\/v2\/tags?post=3406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}