Topic
14 replies Latest Post - ‏2014-03-18T10:36:43Z by TheTyke
SystemAdmin
SystemAdmin
1305 Posts
ACCEPTED ANSWER

Pinned topic Importing Simulink does not work.

‏2009-07-22T06:25:14Z |
Problem Details
I tested importing simulink model to rhapsody.
I tried to import a simulink model refer to user guide document(page 1431~).
But I can not find the menu 'Import/Sync Simulink Model' in the object of Rhapsody.
So, I failed the Matlab Interface test. Please reply as soon as possible.

<Tool Ver Info>
Rhapsody : v7.5 Developer
Matleb: v7.7(R2008b)
Product Name: rhapsody
Severity: 0

Rhapsody Information
Version:=7.5
Build:=1159120
Serial No.:=1234567890123456
Language:=C++
Edition:=Development Edition

System Information
OS Version=Windows XP
OS Service Pack=Service Pack 3
OS Build=2600
Updated on 2012-12-09T11:51:33Z at 2012-12-09T11:51:33Z by Robert Duan
  • SystemAdmin
    SystemAdmin
    1305 Posts
    ACCEPTED ANSWER

    Re: Importing Simulink does not work.

    ‏2009-07-22T06:30:33Z  in response to SystemAdmin
    Have you stereotyped the block as "Simulink Block"

    Note: Import/Sync will only appear once you stereotype the block
    • SystemAdmin
      SystemAdmin
      1305 Posts
      ACCEPTED ANSWER

      Re: Importing Simulink does not work.

      ‏2009-07-23T06:33:09Z  in response to SystemAdmin
      After applying the SimulinkBlock stereotype, Import/Sync menu does not be seen.
      Import from Rose, Import from Eclipse, Import from System Architecture are displayed.
  • stevee
    stevee
    11 Posts
    ACCEPTED ANSWER

    Re: Importing Simulink does not work.

    ‏2009-07-23T14:52:48Z  in response to SystemAdmin
    After adding the Simulink profile, applying a <<SimulinkBlock>> stereotype to a new Class, you can RIGHT click over the Class and get the "Import/Sync Simulink Model". Note , this import is not off Tools, it's a pop-up menu off the Class.

    steve
    • SystemAdmin
      SystemAdmin
      1305 Posts
      ACCEPTED ANSWER

      Re: Importing Simulink does not work.

      ‏2009-07-24T05:40:25Z  in response to stevee
      Thank you for replying. I tried as your comment, but I can't find that option. I'll check the tool version and check whether it support this function. Could I get the example of this kind of project??
      • stevee
        stevee
        11 Posts
        ACCEPTED ANSWER

        Re: Importing Simulink does not work.

        ‏2009-07-24T14:31:19Z  in response to SystemAdmin
        Please see screen shot i've attached.
        Note, the profile, stereotype applied, and the pop-up menu.

        KR,
        • SystemAdmin
          SystemAdmin
          1305 Posts
          ACCEPTED ANSWER

          Re: Importing Simulink does not work.

          ‏2009-07-28T08:29:53Z  in response to stevee
          Thank for your detailed reply. As your scaned image, I can see the menu 'Import/Sync simulink model'.

          So, I tested a simple .mdl file and .c file such as 'A+B=C'
          The selected options are Simulink Model File : ex.mdl, Generated Source Code : ex.c, Sampling Time : 100.
          But, 'Failed in import data from Simulink' error displayed. Other models are also failed.
          How should I do?
          • SystemAdmin
            SystemAdmin
            1305 Posts
            ACCEPTED ANSWER

            Re: Importing Simulink does not work.

            ‏2009-07-28T11:00:46Z  in response to SystemAdmin
            Try this:

            Set the environment variable to MATLAB_RESERVE_LO=0 to resolve the issue.
            Below are the steps:
            1. In the Windows Control Panel, select System > Advanced > Environment Variables.
            2. In the User variables for your user name tab, click New.
            3. Enter the name MATLAB_RESERVE_LO and set the value to 0.
            4. Click OK to save your changes and close the Control Panel.
            5. Log Out of Window and Log In again and MATLAB should now start correctly to allow Sync Simulink Code/Model to be performed from Rhapsody without errors.

            if this still doesn't fix then manually start matlab server and perform Sync/Import
            • SystemAdmin
              SystemAdmin
              1305 Posts
              ACCEPTED ANSWER

              Re: Importing Simulink does not work.

              ‏2009-07-29T04:47:49Z  in response to SystemAdmin
              Thanks, I did all the steps as your comment.
              However, 'Failed in import data from Simulink' error message is displayed, too.
              I tried manulally start matlab and perform again, I got a same result.
              It's very hard to resolve the import matlab issue. What should I do next?
              • ggge
                ggge
                2 Posts
                ACCEPTED ANSWER

                Re: Importing Simulink does not work.

                ‏2010-12-16T21:24:55Z  in response to SystemAdmin
                I have the same problem. When I select import/sync simulink model, there's error message saying 'Failed in import data from Simulink' . I did put MATLAB_RESERVE_LO=0 to user variable, log off computer and log on again but still not working.
            • SystemAdmin
              SystemAdmin
              1305 Posts
              ACCEPTED ANSWER

              Re: Importing Simulink does not work.

              ‏2009-08-04T14:29:43Z  in response to SystemAdmin
              I have exactly the same problem! it used to go well with simulink integration just few days ago and i can't remember any change i might have made. I also tried your solution, same error. Has anyone managed to solve this problem?

              Thanks,
  • SystemAdmin
    SystemAdmin
    1305 Posts
    ACCEPTED ANSWER

    Re: Importing Simulink does not work.

    ‏2010-12-19T08:08:07Z  in response to SystemAdmin
    Hi,

    Make sure that the current Matlab version is properlly installed and registered. To register Matlab, please do the following:
    • Open a Command DOS window
    • Browse to <MATLAB_ROOT/bin>
    • type 'matlab /regserver'

    In addition make sure the current matlab is added to the environments path, and if many Matlab version exist make sure the current Matlab is the first in the path list. To do so please do the follwing:
    • R-Click on the 'My Computer' (either in the desktop or in the start
    menu), and choose properties
    • Click on the 'Advanced' tab, and click on 'Environment Variable' button
    • Look for the 'Path' variable in the 'System Variables', click on it and
    press on the 'Edit' button
    • Add to the end of the path list (don't forget to add a ';' before each
    path) the path to where the matlab root and binaries are install. For
    example, on my machine its
    L:\Program Files\MATLAB\R2010a\bin;L:\Program Files\MATLAB\R2010a\bin
    \win32
    • Click 'OK' on all dialogs to apply the change.
    • Rhapsody and Matlab (if opened) must be restart again, to apply the
    change
    • ggge
      ggge
      2 Posts
      ACCEPTED ANSWER

      Re: Importing Simulink does not work.

      ‏2010-12-20T15:44:20Z  in response to SystemAdmin
      Thanks, Chaim.
      You pointed out the root cause of the problem for me. I have multiple Matlab in my laptop. I just registered Matlab and put the current Matlab before other Matlabs in the environment PATH list. It works!
      Thanks again!
    • Robert Duan
      Robert Duan
      2 Posts
      ACCEPTED ANSWER

      Re: Importing Simulink does not work.

      ‏2012-12-09T11:51:33Z  in response to SystemAdmin
      Dear chaim,
      I've tried with the steps you mentioned. But I found the problem still exists.
      And I snap the screen as attachment. My Matlab version is 2012B and Rhapsody version is 7.6.1.0
      My path environment snapshot and simulink block mark snapshot attached too.
      Could you tell me how this problem happens?
  • TheTyke
    TheTyke
    1 Post
    ACCEPTED ANSWER

    Re: Importing Simulink does not work.

    ‏2014-03-18T10:36:43Z  in response to SystemAdmin

    I have tried running the PowerWindowWithSimulink sample from Rhapsody 7.6.1.1 and Simulink R2012b and it doesn't work.

    When trying to Import/Synch the simulink model I get a MATLAB API Failure.

    I have had the sample working from earlier releases of Rhapsody and Simulink.

    The Rhapsody Help implies it only works with a specific earlier release of MATLAB.

    I have tried the previous suggestions and saving the mdl file as a R2010b file without success.

    Anyone know how to fix it?