<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Model-Based Design Toolbox (MBDT)中的主题 About Code generation in the Model Based Software</title>
    <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645992#M191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I used the simulink/stateflow call external *.c&amp;nbsp;and *.h files,and generated the Test_1_initialize(void) as below,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="182591_182591.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122977i671A800B8F92CC6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="182591_182591.png" alt="182591_182591.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14381iB896108F8F21E68A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but,i wanna put the int_xx() function of&amp;nbsp;the ad.c file in&amp;nbsp;&lt;SPAN&gt;Test_1_initialize(void),shown as yellow mark.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="182569_182569.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122978i1BF1B4F94E1A85D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="182569_182569.png" alt="182569_182569.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14342iF8BF90B4D9082833/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I put stateflow in the&amp;nbsp;Initialize Function,simulink shows that it is not supported,so i don't know how to do!&lt;/P&gt;&lt;P&gt;The attachment is the model built by myself.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="182593_182593.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122979iC797A3430A81A4A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="182593_182593.png" alt="182593_182593.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14471i9D6936CF6C068C3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Who can help me?Thanks very much!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338742"&gt;Model.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Apr 2017 03:39:20 GMT</pubDate>
    <dc:creator>edenli</dc:creator>
    <dc:date>2017-04-27T03:39:20Z</dc:date>
    <item>
      <title>About Code generation in the Model Based Software</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645992#M191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;I used the simulink/stateflow call external *.c&amp;nbsp;and *.h files,and generated the Test_1_initialize(void) as below,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="182591_182591.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122977i671A800B8F92CC6E/image-size/large?v=v2&amp;amp;px=999" role="button" title="182591_182591.png" alt="182591_182591.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_3.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14381iB896108F8F21E68A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_3.png" alt="pastedImage_3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;but,i wanna put the int_xx() function of&amp;nbsp;the ad.c file in&amp;nbsp;&lt;SPAN&gt;Test_1_initialize(void),shown as yellow mark.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="182569_182569.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122978i1BF1B4F94E1A85D4/image-size/large?v=v2&amp;amp;px=999" role="button" title="182569_182569.png" alt="182569_182569.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14342iF8BF90B4D9082833/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I put stateflow in the&amp;nbsp;Initialize Function,simulink shows that it is not supported,so i don't know how to do!&lt;/P&gt;&lt;P&gt;The attachment is the model built by myself.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="182593_182593.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/122979iC797A3430A81A4A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="182593_182593.png" alt="182593_182593.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/14471i9D6936CF6C068C3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Who can help me?Thanks very much!&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338742"&gt;Model.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 03:39:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645992#M191</guid>
      <dc:creator>edenli</dc:creator>
      <dc:date>2017-04-27T03:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: About Code generation in the Model Based Software</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645993#M192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eden Li,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Simulink error you are getting is normal and is listed as a Mathworks limitation:&amp;nbsp;&lt;A class="link-titled" href="https://de.mathworks.com/help/simulink/ug/initialize-reset-and-terminate-function-limitations.html?requestedDomain=www.mathworks.com" title="https://de.mathworks.com/help/simulink/ug/initialize-reset-and-terminate-function-limitations.html?requestedDomain=www.mathworks.com"&gt;Initialize, Reset, and Terminate Function Limitations - MATLAB &amp;amp; Simulink - MathWorks Deutschland&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Charts are not supported by the block you want to use in your model.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nonetheless, we may offer you and alternative:&lt;/P&gt;&lt;P&gt;Just recently another member of the community had a similar request: please see this topic:&lt;A href="https://community.nxp.com/thread/448476"&gt;MCToolbox can't find my hand written code. Does it support S-Function?&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We've also created a tip for it:&amp;nbsp;&lt;A href="https://community.nxp.com/thread/449904"&gt;MBD Toolbox - Tip of the Day&lt;/A&gt;‌&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Tip #3: MBD Toolbox -&amp;nbsp;Add custom code to your Simulink model&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Let us know if you managed to implement your functionality this way.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Hope it helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Apr 2017 13:03:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645993#M192</guid>
      <dc:creator>Daniel_Popa</dc:creator>
      <dc:date>2017-04-27T13:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: About Code generation in the Model Based Software</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645994#M193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi daniel,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG style="background-color: rgba(255, 255, 255, 0.8); color: #666666;"&gt;I haven't realize this function ,The link you had sent to seams not realize &amp;nbsp;my goal that mentaioned abve(the yellow mark) .&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Apr 2017 06:46:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645994#M193</guid>
      <dc:creator>edenli</dc:creator>
      <dc:date>2017-04-29T06:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: About Code generation in the Model Based Software</title>
      <link>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645995#M194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not a direct call of your function but functionally is the same outcome.&lt;/P&gt;&lt;P&gt;The Matlab S-function will call your custom function via a wrapper:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17305i086726F646C9D23D/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That in turns calls the user code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="1.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17383iDEE55B7F1D911B3C/image-size/large?v=v2&amp;amp;px=999" role="button" title="1.JPG" alt="1.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All you have to do is:&lt;/P&gt;&lt;P&gt;#1:&amp;nbsp;place the S-function in the&amp;nbsp;Initialize Function Block&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="2.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17345iC87ADAEB2B26BA37/image-size/large?v=v2&amp;amp;px=999" role="button" title="2.JPG" alt="2.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;#2: customize the S-function Builder to reference the code you want to call&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="3.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17425iFCB9B808950B8664/image-size/large?v=v2&amp;amp;px=999" role="button" title="3.JPG" alt="3.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;#3: follow the tip#3 to copy all custom files in the final generation code folder:&amp;nbsp;&lt;A href="https://community.nxp.com/thread/449904"&gt;https://community.nxp.com/thread/449904&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="5.JPG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/17457iD03DEBEF4A7DD578/image-size/large?v=v2&amp;amp;px=999" role="button" title="5.JPG" alt="5.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Attached is and example with Matlab/Simulink + copy file(that needs to customized for each PC)&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 May 2017 15:31:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/About-Code-generation-in-the-Model-Based-Software/m-p/645995#M194</guid>
      <dc:creator>Daniel_Popa</dc:creator>
      <dc:date>2017-05-01T15:31:46Z</dc:date>
    </item>
  </channel>
</rss>

