Exporting a Model to Simulink and Simulink Coder

You can export a model in a format suitable for use with the MATLAB/Simulink graphical simulation tool.

If you have a Systems Real Time Execution Export license in addition to the Systems Simulink Export license, your model is exported in a format suitable for use with the Simulink Coder simulation tool.


Before you begin:
  • Ensure you have the correct licenses installed:
    To export This license is required
    to Simulink Systems Simulink Export
    for use with Simulink Coder Systems Simulink Export + Systems Real Time Execution Export

    For further information on licensing, see the Dassault Systèmes License Server Essentials User's Guide.

  • Create a folder E:/Export.
See Also
About Interfacing Other Simulation Environments
Administration Tasks: Installing 3D XML Modelica Libraries
  1. Open the ExternalInterfaces library by searching for it, see Open with Search.
    The ExternalInterfaces library is added to the list in the Package Browser.
  2. From the Package Browser, expand ExternalInterfaces > Export.


  3. In the tree under Export, right-click toSimulink and select Call Function.
    The ExternalInterfaces.Export.toSimulink dialog box is displayed.
  4. In the Model name area of the dialog box:
    1. Click Edit .
      The Select Model dialog box appears.
    2. Select the model you want to export.
    3. Click OK.
    The model name is added to the dialog box.
  5. In the Model version area of the dialog box, enter "x.x" where x.x is the version of the model. An example could be "3.2"
  6. In the Export directory area of the dialog box, enter "E:/Export" (By default, the default directory (cd) is selected.)
    In this example, the data for Modelica.Mechanics.Rotational.Examples.CoupledClutches model version 3.2 is exported to the E:/Export folder.
  7. Click the arrow on the right of a box to access the following commands:
    • Edit: to edit the box.
    • Edit Text: to edit the box in a separate dialog box.
    • Copy Default: to copy the default value (defined in the class) to the box.
  8. Do one of the following:
    • Click OK: The export function is started and when it has finished the dialog box closes.
    • Click Info: A dialog box is displayed which gives a summary of the export parameters.
    • Click Execute: The export function is started and when it has finished the dialog box remains open.
    • Click Copy Call: The export function and its parameters are copied to the clipboard. You can then paste them into the scripting command window or into a script (.mos) file.
    • Click Close: The export function is dismissed and the dialog box closes.
    If you click OK or Execute:
    1. The Modelica Scripting Window dialog box is displayed and shows the status of the function.
    2. The results are computed and exported.

The exported files are saved in the Export directory you specified. Typical results files are listed below:

  • buildlog.txt
  • dsin.txt
  • dsmodel.c
  • dymModelInfo.m
  • dymosim.exe
  • dymosim.exp
  • dymosim.lib
  • dymosimg.exe
Note: The simulation run-time code added to dsmodel.c when exporting for use in Simulink Coder does not contain the most advanced routines from the binary link libraries. It is therefore, for example, not possible to export models with dynamic state selection for use on HILS platforms.