Exporting a Model to Simulink and Real-Time Workshop

This section describes how to export a model in a format suitable for use with the MATLAB/Simulink graphical simulation tool.

If you have a license for Export for HILS in addition to the export to Simulink license, your model will be exported in a format suitable for use with the Real-Time Workshop simulation tool.


Before you begin:
  • Ensure you have the correct CATIA licenses installed:
    To export to This license is required License product code
    Simulink Simulink SMK
    Real-Time Workshop Simulink + Export for HILS SMK + HIS

    For further information on licensing, refer to the Dassault Systemes License Server Essentials User's Guide.

  • Create a folder E:/Export.
Related Topics
About Exporting Models
Installing 3D XML Modelica Libraries in the Dynamic Behavior Modeling Workbench
Editing Modelica Text
  1. Load the ExternalInterfaces library.

    The library appears in the Package Browser.

  2. From the Package Browser expand ExternalInterfaces > Export.



  3. Do one of the following:

    • In the tree under Export, click toSimulink and then in the menu bar select Edit > toSimulink (x) object > Call Function...
    • In the tree under Export, right-click toSimulink and then select to Simulink (x) object > 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 the version of the model.

  6. In the Export directory area of the dialog box, enter "E:/Export".

    In this example, the data for Modelica.Mechanics.Rotational.Examples.CoupledClutches model version 3.2 will be exported to the E:/Export folder.

  7. Click the arrow at the end of an input field to access the following commands:

    • Edit : to edit the input field.
    • Edit Text: to edit the input field in a separate dialog box.
    • Copy Default: to overload the value with the default value specified in the Modelica text of the function.

      For example, to enter “18” as a default value, type in the Modelica text: put String FunctionName= "18". You can also refer to Editing Modelica Text).

  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 to Real-time Workshop does not contain the most advanced routines from the binary link libraries. It is therefore, for instance, not possible to export models with dynamic state selection for use on HILS platforms.