Topic
  • 8 replies
  • Latest Post - ‏2017-04-28T09:43:15Z by saman_ricardo
myrmidon
myrmidon
23 Posts

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
    39 Posts
    ACCEPTED ANSWER

    Re: Problem while exporting to Simulink

    ‏2013-06-14T05:23:29Z  
    • myrmidon
    • ‏2013-06-13T08:10:09Z

    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!

     

    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

  • SAKAIRITakashi
    SAKAIRITakashi
    39 Posts

    Re: Problem while exporting to Simulink

    ‏2013-06-12T01:55:01Z  

    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

    Re: Problem while exporting to Simulink

    ‏2013-06-13T08:10:09Z  

    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

    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
    39 Posts

    Re: Problem while exporting to Simulink

    ‏2013-06-14T05:23:29Z  
    • myrmidon
    • ‏2013-06-13T08:10:09Z

    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!

     

    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

  • ChaimCohen
    ChaimCohen
    5 Posts

    Re: Problem while exporting to Simulink

    ‏2013-06-16T08:55:30Z  

    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

  • myrmidon
    myrmidon
    23 Posts

    Re: Problem while exporting to Simulink

    ‏2013-06-17T09:12:19Z  

    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

    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

  • myrmidon
    myrmidon
    23 Posts

    Re: Problem while exporting to Simulink

    ‏2013-06-17T09:16:04Z  

    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

    Hello,

    Tthanks for your answer, the problem is solved, please check my response to SAKAIRITakashi.

    However I include the model that did not work and the one with the fix.

    Thanks again!

  • saman_ricardo
    saman_ricardo
    2 Posts

    Re: Problem while exporting to Simulink

    ‏2017-04-28T09:38:58Z  

    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

    Hi Takashi,

    I have a similar problem as the others while exporting for animation. The Lession5 example you have provided works fine on my PC. I even could add more blocks and export to Simulink for animation and animate/simulate the model. however, when I build the similar model from scratch it doesn't work.

    I also face the similar error as the other people. this is the message I get in the Rhapsody log window and a pop-up message as:

     

     

     

    Warning: Flowport must have a matching attribute (by name and type) on its class owner
        in Package: Default
            in Block: block_4
                Flow Port: input1


    Checker Done
    0  Error(s), 1  Warning(s)

    Code generated to directory: C:/Program Files (x86)/IBM/Rational/Rhapsody/8.1.3/saman_projects/integrationWithSimulink/Default_Model_test/integrationTest/block_2Comp/SimulinkAnim
    Generating file block_4.h (unmodified)
    Generating file block_4.cpp (unmodified)
    Generating file SFunctionBlockblock_2.h (unmodified)
    Generating file SFunctionBlockblock_2.cpp (unmodified)
    Generating file Default.h (unmodified)
    Generating file Default.cpp (unmodified)
    Generating main file Mainblock_2Comp.h (unmodified)
    Generating main file Mainblock_2Comp.cpp (unmodified)
    Generating make file block_2Comp.mak (unmodified)

    Code Generation Done

    0  Error(s), 1  Warning(s), 0  Message(s)

    Exporting Simulink Model

    Simulink Model Export/Update Failed
    Building with 'Microsoft Windows SDK 7.1 (C++)'.

     

    **********************************************************

    I figured out that the problem is with the flow ports. if I remove the flow port of the SysML block, the export for animation command builds a Simulink model containing only the block that is stereotyped as Simulink block.

    is there any hidden setting that I have to do in order to make it work?

    please find attached my project. 

    I will appreciate it if you could help me with this.

    Attachments

  • saman_ricardo
    saman_ricardo
    2 Posts

    Re: Problem while exporting to Simulink

    ‏2017-04-28T09:43:15Z  

    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

    Hi Takashi,

    here is my model attached.

    could you please have a look and let me what the problem is?

    Kind Regards

    Saman 

     

     

     

    Attachments