In Rhapsody

Procedure

  1. Create a Rhapsody® project.
  2. Right-click the project name in the browser and select Add to Model > Package.
  3. On the Add to Model window, navigate to <Rhapsody installation folder>\Share\Profiles\Simulink and in the Files of type field, select Package (*.sbs).
  4. Select the SimulinkInC.sbs profile if you are using C and Simulink.sbs if you are using C++. Click Open to add the selected profile to the project. Check the Profiles section in the browser to be certain that the selected Simulink profile is now displayed.
  5. Create an object in an object model diagram, and apply the SimulinkBlock stereotype to it (in the Features window).
  6. Right-click the object and select Import/Sync Simulink Model.
  7. In the window that is displayed, provide the following information:
    • Simulink Model File. The location of the Simulink model file
    • Simulink Generated Source Code. The location of the *.cpp files generated by the Simulink Coder (add all files except ert_main.cpp).
    • Simulink Model Sample Time. The interval (in milliseconds) at which Rhapsody activates the Simulink engine.
  8. Click Import/Sync and wait until Rhapsody creates flowports on the block representing the input and output of the Simulink model.
  9. Once the flowports have been created, you can connect the Simulink block to the flowports on other Rhapsody blocks.