Topic
6 replies Latest Post - ‏2013-06-17T09:16:04Z by myrmidon
myrmidon
myrmidon
23 Posts
ACCEPTED ANSWER

Pinned topic Problem while exporting to Simulink

‏2013-06-11T06:04:37Z |

Hello,

I use the evaluation version of Rhapsody 8 (Developper Edition). I am on Windows XP, and I am using Visual Studio 2008 C++ Express.

I am trying to mix Rhapsody and Simulink blocks in Rhapsody (according to this tutorial https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Wecb8ab5c4be5_4a1e_a0d0_e5a706eb66dc/page/Rhapsody%20and%20Simulink%20Integration-- after min 9:00) and export them to Simulink.

First I was getting an error about not finding "rtwtypes.h". I do not know if I did correct, but I found the file in the MATLAB directory and copied it in the Rhapsody project configuration folder.

Unfortunately after the previous error, it gives me the following one (see image). It cannot find the doStep() inside the StructureSimulink block that I created (in order to link the rhapsody and simulink block)

Any ideas?

Thanks in advance!

Attachments

Updated on 2013-06-13T09:39:32Z at 2013-06-13T09:39:32Z by myrmidon
  • SAKAIRITakashi
    SAKAIRITakashi
    31 Posts
    ACCEPTED ANSWER

    Re: Problem while exporting to Simulink

    ‏2013-06-12T01:55:01Z  in response to myrmidon

    Hi,

     

    Thank you very much for using Rhapsody. Did you set up your C++ compiler for compiling S-Functions? If you did not, please open your MATLAB window, and execute "mex -setup" command.

     

    Cheers,

     

    SAKAIRI Takashi

    IBM Research - Tokyo

    • myrmidon
      myrmidon
      23 Posts
      ACCEPTED ANSWER

      Re: Problem while exporting to Simulink

      ‏2013-06-13T08:10:09Z  in response to SAKAIRITakashi

      Hello,

      Thanks for your quick answer!

      I found (partially) the solution. The problem is not the compiler in matlab.

      The problem is that when there is a block in Rhapsody (with no stereotype) and I want to export it to Simulink, Rhapsody automatically creates a class with stereotype "S-Function", in which it also creates a statechart (see img02.png). The problem with this statechart is the "doStep()" function. I understood that the doStep() refers to (the name of) my original class/block that I want to export. So I tried to rename the name of "doStep" with the name of my block, but it did not work, as Rhapsody recreates the statechart each time you do the export, so "doStep" is there everytime.

      Finally, I changed the name of my block to "doStep" (see img03) and it worked but as you understand if I have more than one blocks to export, it cannot work!

      So please, can you provide a fix for that and untill then please describe a procedure in order to resolve this manually, because as I understood this bug was existing in previous Rhapsody versions also..

      ( This problem exists from 2010 https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014475723&ps=25

      http://www-01.ibm.com/support/docview.wss?uid=swg1PM36318 )

      Thanks a lot for your time!

       

      Attachments

      • SAKAIRITakashi
        SAKAIRITakashi
        31 Posts
        ACCEPTED ANSWER

        Re: Problem while exporting to Simulink

        ‏2013-06-14T05:23:29Z  in response to myrmidon

        Hi,

         

        We can export a Rhapsody model to a Simulink model from Rhapsody V7.6 (2011). The problem exists from 2010 is not related to the Simulink export capability.

         

        I was wondering if you could try the attached model? Please right-click <<StructuredSimulinkBlock>> MySystem block, and select "Export and Simulate". You can see a plot.

         

        If you want to try a panel diagram and animation, please execute "Export and Simulate for Animation". When you see "Go (F4)" icon, please click it..

         

        Cheers,

         

        SAKAIRI Takashi

        IBM Research - Tokyo

        Attachments

        • myrmidon
          myrmidon
          23 Posts
          ACCEPTED ANSWER

          Re: Problem while exporting to Simulink

          ‏2013-06-17T09:12:19Z  in response to SAKAIRITakashi

          Thank you so much!!!

          Yes your model works (Simulink Integration + Panel diagram). The only difference with mine was that I had not my bdd in the Deafault package (check the png) :SSS. I modified my model and put the bdd in the Default package and it works fine, but do you know the reason for that?

          (Sorry for waisting your time :s I am new..)

          Attachments

  • ChaimCohen
    ChaimCohen
    5 Posts
    ACCEPTED ANSWER

    Re: Problem while exporting to Simulink

    ‏2013-06-16T08:55:30Z  in response to myrmidon

    Hi,

    Is it possible you attach your model, so we can have a closer look to what you did ?

    From what you've explained above, it's hard to understand what is the problem.

    Thanks a lot

    Chaim Cohen

    Rhapsody Development