Engineering System Design

Engineering System Design

Come for answers, stay for best practices. All we're missing is you.

 View Only
Expand all | Collapse all

Rhapsody Simulink Integration

  • 1.  Rhapsody Simulink Integration

    Posted 02/21/24 09:51 AM

    Currently, we are in the process of integrating Simulink with Rhapsody to facilitate Model-Based Development (MBD) in our projects. As part of this effort, I have been working on importing Simulink models into Rhapsody to ensure seamless integration between the two tools.

    However, I have encountered some challenges along the way that I am unable to resolve independently. Initially, I encountered an issue related to 'No rule to make target,' which I managed to address temporarily by manually modifying the .mak file. Despite this workaround, I am now facing a different issue that is preventing me from proceeding further with the integration process.

    The specific error message I am encountering is as follows:

    Building ------------  DefaultComponent.exe   ------------

    Executing: ""C:\Program Files\IBM\Rhapsody\9.0.1\Share"\etc\cygwinmake.bat DefaultComponent.mak build "CPU=x64"  "

    "Setting environment for Cygwin x64"

    "make.exe all -f DefaultComponent.mak "CPU=x64"      "

    Linking DefaultComponent.exe

    /cygdrive/c/Cygwin/bin/ld: SL_Gain.o: in function `SL_Gain::SL_Gain(IOxfActive*)':

    /cygdrive/c/Users/pendyaba/Documents/MATLAB/MySLModels/babuNew/Rhp_newGain/DefaultComponent/DefaultConfig/SL_Gain.cpp:100:(.text+0x2fb): undefined reference to `OMSimulinkBlock::OMSimulinkBlock(IOxfActive*)'

    /cygdrive/c/Cygwin/bin/ld: /cygdrive/c/Users/pendyaba/Documents/MATLAB/MySLModels/babuNew/Rhp_newGain/DefaultComponent/DefaultConfig/SL_Gain.cpp:106:(.text+0x548): undefined reference to `OMSimulinkBlock::~OMSimulinkBlock()'

    /cygdrive/c/Cygwin/bin/ld: SL_Gain.o: in function `SL_Gain::~SL_Gain()':

    /cygdrive/c/Users/pendyaba/Documents/MATLAB/MySLModels/babuNew/Rhp_newGain/DefaultComponent/DefaultConfig/SL_Gain.cpp:111:(.text+0x670): undefined reference to `OMSimulinkBlock::~OMSimulinkBlock()'

    /cygdrive/c/Cygwin/bin/ld: SL_Gain.o: in function `SL_Gain::startBehavior()':

    /cygdrive/c/Users/pendyaba/Documents/MATLAB/MySLModels/babuNew/Rhp_newGain/DefaultComponent/DefaultConfig/SL_Gain.cpp:172:(.text+0xa6c): undefined reference to `OMSimulinkBlock::startBehavior()'

    /cygdrive/c/Cygwin/bin/ld: SL_Gain.o:SL_Gain.cpp:(.rdata$_ZTV7SL_Gain[_ZTV7SL_Gain]+0x30): undefined reference to `OMSimulinkBlock::cancelTimeout(IOxfTimeout const*)'

    /cygdrive/c/Cygwin/bin/ld: SL_Gain.o:SL_Gain.cpp:(.rdata$_ZTV7SL_Gain[_ZTV7SL_Gain]+0xb0): undefined reference to `OMSimulinkBlock::rootState_entDef()'

    /cygdrive/c/Cygwin/bin/ld: SL_Gain.o:SL_Gain.cpp:(.rdata$_ZTV7SL_Gain[_ZTV7SL_Gain]+0xb8): undefined reference to `OMSimulinkBlock::rootState_processEvent()'

    collect2: error: ld returned 1 exit status

    make: *** [DefaultComponent.mak:198: DefaultComponent.exe] Error 1.




    ------------------------------
    Babu Shankar P
    ------------------------------


  • 2.  RE: Rhapsody Simulink Integration

    Posted 02/21/24 10:17 AM

    Hi Babu Shankar P

    You probably have some setting wrong, it is difficult to figure out what Is wrong exactly. Could you share you rmodel?

    Kind Regards

    Walter



  • 3.  RE: Rhapsody Simulink Integration

    Posted 02/22/24 12:29 AM

    Hello Walter van der Heiden,

    Thank you for your prompt response. Attached herewith is the Rhapsody model zip file, which also includes the Simulink model. 

    Let me know if you need any thing else.

    Thank you again.



    ------------------------------
    Babu Shankar P
    ------------------------------

    Attachment(s)

    zip
    Rhp_newGain.zip   2.62 MB 1 version
    7z
    Rhp_newGain.7z   1.83 MB 1 version


  • 4.  RE: Rhapsody Simulink Integration

    Posted 03/05/24 06:23 AM
    Hello Mr. Walter van der Heiden,
     
    I hope you are doing well. I would like to understand what might have gone wrong with my Rhapsody Simulink integration settings. Could you please take a look at my model and let me know where the issue lies?
     
    Thank you.


    ------------------------------
    Babu Shankar P
    ------------------------------



  • 5.  RE: Rhapsody Simulink Integration

    Posted 03/13/24 07:03 AM
    Edited by Walter van der Heiden 03/13/24 07:06 AM

    Hi Babu Shankar

    Sorry, I didn't have time to look at this.

    I have now and I see that you forgot to send me your profile. Without that I cannot generate code (missing stereotypes)

    EDIT  I see that somehow the path to the SysML profile was not correct, I repaired that, it's now loading.

    When generating code I see this:
    Warning: Flowport must have a matching attribute (by name and type) on its class owner
        in Package: BlockModeling
            in Block: Snk
                Flow Port: p1
            in Block: Src
                Flow Port: p2

    That is not the cause of the compile error but it will definitely not work after it compiles...

    Walter



  • 6.  RE: Rhapsody Simulink Integration

    Posted 03/13/24 10:20 AM
      |   view attached

    Hi Mr. Walter van der Heiden,

    Here I am attaching the profiles (SysML and Simulink).



    ------------------------------
    Babu Shankar P
    ------------------------------

    Attachment(s)

    zip
    Profiles.zip   2.64 MB 1 version


  • 7.  RE: Rhapsody Simulink Integration

    Posted 03/13/24 10:29 AM

    Hi

    Yes I have them, as said, something wrong with my paths. I now have generated and compiled and I get the same result.

    I have solved your 2 warnings but that doesn't help.
    Current assumption: it is the cygwin environment. Ill try with VS'17 now.

    W.



  • 8.  RE: Rhapsody Simulink Integration

    Posted 03/13/24 10:59 AM

    Yep. Works with VS'17. So it is the creation of the cygwin libraries. Let me check if I can find that.

    W



  • 9.  RE: Rhapsody Simulink Integration

    Posted 03/13/24 11:58 AM

    OK. Not so easy but it works:

    Add to your configuration in the "Settings" Tab under: "Link Switches": "<<UserShare>>/LangCpp/lib/cygwinsimulinkintegrationapplx64.a"

    (Replace the <<UserShare>> with the path to your UserShare directory.

    Then you need to build the simulink library, the following files need to be placed:

    - In the directory <<Share>>\LangCpp\SimulinkIntegration the file cygwinsimulinkintegration.mak

    - In the directory <<Share>>\LangCpp\ the file cygwinbuild.mak

    Then call "Code""Build the Framework" from the menu. there is 1 warning, you can ignore that.

    You can also edit sitec++.prpr and add the Cygwin makefilecontent with the changed linker statement. But this works too.



  • 10.  RE: Rhapsody Simulink Integration

    Posted 03/13/24 12:00 PM
      |   view attached

    The files in zip

    Attachment(s)

    zip
    Files.zip   1 KB 1 version


  • 11.  RE: Rhapsody Simulink Integration

    Posted 03/13/24 10:39 PM

    Hi Mr.Walter van der Heiden,

    This is working, Thank you so much.



    ------------------------------
    Babu Shankar P
    ------------------------------



  • 12.  RE: Rhapsody Simulink Integration

    Posted 03/18/24 06:20 AM

    You're welcome!