{"id":8701,"date":"2017-07-14T09:00:10","date_gmt":"2017-07-14T13:00:10","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=8701"},"modified":"2017-07-28T06:57:02","modified_gmt":"2017-07-28T10:57:02","slug":"what-are-the-functional-inputs-and-outputs-of-my-simulink-model","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2017\/07\/14\/what-are-the-functional-inputs-and-outputs-of-my-simulink-model\/","title":{"rendered":"What are the functional inputs and outputs of my Simulink model?"},"content":{"rendered":"<div class=\"content\"><!--introduction--><\/p>\n<p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/32620\">Greg&#8217;s<\/a> pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/49897-signature-tool\">Signature Tool<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/6052287-mcscert\">McSCert<\/a>.<\/p>\n<p>Simulink enables you to layout rather large and diverse diagrams.  For large diagrams, this can make it difficult to understand what are all the points in the model where one can input data or have access to output data. The Signature Tool provides 2 capabilies to deal with this issue.<\/p>\n<div>\n<ol>\n<li>Organize the model to provide a interface summary<\/li>\n<li>Generate an interface report document.<\/li>\n<\/ol>\n<\/div>\n<p>There is also a means to generate a testbench, but I won&#8217;t focus on that here as this capability is also available in <a href=\"https:\/\/www.mathworks.com\/products\/simulink-test.html\">Simulink Test<\/a>.<\/p>\n<p><!--\/introduction--><\/p>\n<h3>Contents<\/h3>\n<div>\n<ul>\n<li><a href=\"#542a31b5-081b-4b56-9da8-42c730fe1a39\">Model Interface Summary:<\/a><\/li>\n<li><a href=\"#8385de37-37db-4482-ac2f-b3bd1a3bd0e9\">Report Generation<\/a><\/li>\n<li><a href=\"#0698c037-f606-4f4a-981e-2a4b61073476\">Why did I pick this entry?<\/a><\/li>\n<li><a href=\"#b23fd760-41e0-45d9-8ac8-1edbdec6d9cc\">Simulink Interface View<\/a><\/li>\n<li><a href=\"#bf8e6013-cfd9-44ee-8691-da21a0cbdbcc\">Code Generation Interface Report<\/a><\/li>\n<li><a href=\"#e5c79088-02a6-403b-85ba-b9b5f79b9bf0\">Do you need to report or summarize Simulink model interface information?<\/a><\/li>\n<\/ul>\n<\/div>\n<h4>Model Interface Summary:<a name=\"542a31b5-081b-4b56-9da8-42c730fe1a39\"><\/a><\/h4>\n<p>By applying the model signature to the example model rtwdemo_pmwm (ships with Embedded Coder), you can quickly see that the model requires 4, inputs, 2 outputs, and has a global memory store declared.<\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/pick\/files\/modelSignature.png\"><img decoding=\"async\" loading=\"lazy\" width=\"236\" height=\"300\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/modelSignature-236x300.png\" alt=\"\" class=\"alignnone size-medium wp-image-8698\" \/><\/a><\/p>\n<h4>Report Generation<a name=\"8385de37-37db-4482-ac2f-b3bd1a3bd0e9\"><\/a><\/h4>\n<p>The same tool can also generate a document that describes the inputs and outputs of this same model.<\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/pick\/files\/signatureReport.png\"><img decoding=\"async\" loading=\"lazy\" width=\"258\" height=\"300\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/signatureReport-258x300.png\" alt=\"\" class=\"alignnone size-medium wp-image-8699\" \/><\/a><\/p>\n<p>This is particularly important if you are attempting to share interface information with someone who doesn&#8217;t have access to Simulink, like sharing your interface with an embedded software development group. Or you need to document the interface as part of a rigorous design process.<\/p>\n<h4>Why did I pick this entry?<a name=\"0698c037-f606-4f4a-981e-2a4b61073476\"><\/a><\/h4>\n<p>The two key elements for me are it is:<\/p>\n<div>\n<ul>\n<li>Easy to use<\/li>\n<li>Well documented<\/li>\n<\/ul>\n<\/div>\n<p>Right-click on a model or subsystem, and you are able to generate the signature in the model, or the report.  There&#8217;s also a nice little user interface to help select options for the generation of these two elements.<\/p>\n<p>The documentation for this tool is also well done. The File Exchange entry also contains links to publications about the topics of understanding Simulink model interfaces.<\/p>\n<h4>Simulink Interface View<a name=\"b23fd760-41e0-45d9-8ac8-1edbdec6d9cc\"><\/a><\/h4>\n<p>Simulink does have a <a title=\"https:\/\/www.mathworks.com\/help\/releases\/R2017a\/simulink\/ug\/interface-feature-detailed-example-2.html (link no longer works)\">built-in capability<\/a> to summarize the input and output ports of a given model or subsystem.<\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/pick\/files\/simulinkInterface.png\"><img decoding=\"async\" loading=\"lazy\" width=\"300\" height=\"228\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/simulinkInterface-300x228.png\" alt=\"\" class=\"alignnone size-medium wp-image-8700\" \/><\/a><\/p>\n<p>It does include signal hierarchy for <a title=\"https:\/\/www.mathworks.com\/help\/releases\/R2017a\/simulink\/examples\/simulink-bus-signals.html (link no longer works)\">buses<\/a>, and colors to indicate different <a title=\"https:\/\/www.mathworks.com\/help\/releases\/R2017a\/simulink\/ug\/how-to-view-sample-time-information.html (link no longer works)\">sample rates on a signal<\/a>, but it doesn&#8217;t include Data Store Memory or globally scoped From\/Goto blocks.<\/p>\n<h4>Code Generation Interface Report<a name=\"bf8e6013-cfd9-44ee-8691-da21a0cbdbcc\"><\/a><\/h4>\n<p>If you generate C-code from the model using <a href=\"https:\/\/www.mathworks.com\/products\/embedded-coder.html\">Embedded Coder<\/a>, then you can generate a <a title=\"https:\/\/www.mathworks.com\/help\/releases\/R2017a\/ecoder\/ug\/analyze-the-generated-code-interface.html (link no longer works)\">C-code interface report<\/a><\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/pick\/files\/codeInterfaceReport.png\"><img decoding=\"async\" loading=\"lazy\" width=\"300\" height=\"222\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/codeInterfaceReport-300x222.png\" alt=\"\" class=\"alignnone size-medium wp-image-8697\" \/><\/a><\/p>\n<p>This provides much of the same information as the Signature Tool signature report, but requires that you generate code from the model.<\/p>\n<h4>Do you need to report or summarize Simulink model interface information?<a name=\"e5c79088-02a6-403b-85ba-b9b5f79b9bf0\"><\/a><\/h4>\n<p>Let us know <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=8701#respond\">here<\/a>.<\/p>\n<p><script language=\"JavaScript\"> <!-- \n    function grabCode_5be9f31c01dd4fc7948a8df1634c4b0f() {\n        \/\/ Remember the title so we can use it in the new page\n        title = document.title;\n\n        \/\/ Break up these strings so that their presence\n        \/\/ in the Javascript doesn't mess up the search for\n        \/\/ the MATLAB code.\n        t1='5be9f31c01dd4fc7948a8df1634c4b0f ' + '##### ' + 'SOURCE BEGIN' + ' #####';\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 5be9f31c01dd4fc7948a8df1634c4b0f';\n    \n        b=document.getElementsByTagName('body')[0];\n        i1=b.innerHTML.indexOf(t1)+t1.length;\n        i2=b.innerHTML.indexOf(t2);\n \n        code_string = b.innerHTML.substring(i1, i2);\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\n\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \n        \/\/ in the XML parser.\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\n        \/\/ doesn't go ahead and substitute the less-than character. \n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\n\n        copyright = 'Copyright 2017 The MathWorks, Inc.';\n\n        w = window.open();\n        d = w.document;\n        d.write('\n\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\n\n\\n');\n\n        d.title = title + ' (MATLAB code)';\n        d.close();\n    }   \n     --> <\/script><\/p>\n<p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><a href=\"javascript:grabCode_5be9f31c01dd4fc7948a8df1634c4b0f()\"><span style=\"font-size: x-small;        font-style: italic;\">Get<br \/>\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\n<p>      Published with MATLAB&reg; R2017a<\/p>\n<\/div>\n<p><!--\n5be9f31c01dd4fc7948a8df1634c4b0f ##### SOURCE BEGIN #####\n%% What are the functional inputs and outputs of my Simulink model?\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/32620 Greg's> \n% pick this week is <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/49897-signature-tool \n% Signature Tool> by <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/6052287-mcscert \n% McSCert>.\n% \n% Simulink enables you to layout rather large and diverse diagrams.  For \n% large diagrams, this can make it difficult to understand what are all the points \n% in the model where one can input data or have access to output data. The Signature \n% Tool provides 2 capabilies to deal with this issue.\n% \n% # Organize the model to provide a interface summary\n% # Generate an interface report document.\n% \n% There is also a means to generate a testbench, but I won't focus on that \n% here as this capability is also available in <https:\/\/www.mathworks.com\/products\/simulink-test.html \n% Simulink Test>.\n% \n% \n%% Model Interface Summary:\n% By applying the model signature to the example model rtwdemo_pmwm (ships with \n% Embedded Coder), you can quickly see that the model requires 4, inputs, 3 outputs, \n% and has a global memory store declared.\n% \n% <<modelSignature.png>>\n% \n%\n%% Report Generation\n% The same tool can also generate a document that describes the inputs and outputs \n% of this same model.\n% \n% <<signatureReport.png>>\n% \n% This is particularly important if you are attempting to share interface \n% information with someone who doesn't have access to Simulink, like sharing your \n% interface with an embedded software development group. Or you need to document \n% the interface as part of a rigerous design process.\n% \n% \n%% Why did I pick this entry?\n% The two key elements for me are it is:\n% \n% * Easy to use\n% * Well documented\n% \n% Right-click on a model or subsystem, and you are able to generate the signature \n% in the model, or the report.  There's also a nice little user interface to help \n% select options for the generation of these two elements.\n% \n% The documentation for this tool is also well done. The File Exchange entry \n% also contains links to publications about the topics of understanding Simulink \n% model interfaces.\n%% Simulink Interface View\n% Simulink does have a <https:\/\/www.mathworks.com\/help\/releases\/R2017a\/simulink\/ug\/interface-feature-detailed-example-2.html \n% built-in capability> to summarize the input and output ports of a given model \n% or subsystem.\n% \n% <<simulinkInterface.png>>\n% \n% It does include signal hierarchy for <https:\/\/www.mathworks.com\/help\/releases\/R2017a\/simulink\/examples\/simulink-bus-signals.html \n% buses>, and colors to indicate different <https:\/\/www.mathworks.com\/help\/releases\/R2017a\/simulink\/ug\/how-to-view-sample-time-information.html \n% sample rates on a signal>, but it doesn't include Data Store Memory or globally \n% scoped From\/Goto blocks. \n% \n% \n%% Code Generation Interface Report\n% If you generate C-code from the model using <https:\/\/www.mathworks.com\/products\/embedded-coder.html \n% Embedded Coder>, then you can generate a <https:\/\/www.mathworks.com\/help\/releases\/R2017a\/ecoder\/ug\/analyze-the-generated-code-interface.html \n% C-code interface report>\n% \n% <<codeInterfaceReport.png>>\n% \n% This provides much of the same information as the Signature Tool signature \n% report, but requires that you generate code from the model.\n%% \n%% Do you need to report or summarize Simulink model interface information?\n% Let us know <https:\/\/blogs.mathworks.com\/pick\/?p=8701#respond here>.\n##### SOURCE END ##### 5be9f31c01dd4fc7948a8df1634c4b0f\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/pick\/files\/modelSignature-236x300.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>\nGreg&#8217;s pick this week is Signature Tool by McSCert.<br \/>\nSimulink enables you to layout rather large and diverse diagrams.  For large diagrams, this can make it difficult to understand what are all&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2017\/07\/14\/what-are-the-functional-inputs-and-outputs-of-my-simulink-model\/\">read more >><\/a><\/p>\n","protected":false},"author":36,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8701"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=8701"}],"version-history":[{"count":9,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8701\/revisions"}],"predecessor-version":[{"id":8788,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/8701\/revisions\/8788"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=8701"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=8701"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=8701"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}