You can generate an FMU (Functional Mock-up Unit) for external co-simulation of dynamic models that enables the exchange of simulation results between different simulation tools. The generated FMU exposes the defined input and output parameters of a model, as specified in a Simulation Configuration. The generated FMU runs the server-side simulation of a particular Simulation Configuration using given inputs and returns the outputs after each time step. FMUs can be generated for two platforms: Linux 64-bit and Windows 64-bit.

Prerequisites

  • You must have the same Java HOME version as the modeling tool’s Java version. To check the Java HOME version, run java --version in the command prompt. To check the modeling tool’s Java version, go to Help > About > Environment tab.
  • You must have a simulation server certificate to co-simulate the generated FMU.
  • You must use the generated FMU with tools that use the same JAVA version as the modeling tool; otherwise, you will not be able to run the generated FMU.
  • You must add the JAR files to the plugin library to generate FMU. To learn more, refer to Adding JAR file to the library.

FMU generation uses selected Simulation Configuration properties, and can contain the following defined data:

  • Start Time, End Time, and Step Size property values.
  • Input Parameters property value: the default values from the defined input parameters will be included in the generated FMU.
  • Output Parameters property value: the default values from the defined output parameters will be included in the generated FMU.


To generate an FMU


  1. Open a Teamwork Cloud project.
  2. Right-click a Simulation Configuration and select Simulation > Generate FMU.



  3. In the Generate FMU dialog specify the following:
    • In the File Directory box, specify the location where the generated file should be stored.
    • Select the Win64 or Lin64 radio button, depending on the platform on which you will run the generated FMU. 
    • Optionally, select the Include login credentials check box and specify a server-side simulation server address and login credentials or, token to be stored in the generated FMU file.

      • You can leave the Include login credentials check box empty and provide the login credentials or token later as FMU parameters while importing an FMU file. In this case, the credentials will not be stored in the generated FMU file.
      • You can also generate a personal access token instead of a username and password. To learn more about generating a token, refer to Generating a personal access token.




  4. Click Generate.

In the case of an FMU file generation error, see the detailed error message in the log file.

Adding JAR files to the library

An external library is required to generate the FMU files. You must add the JAR files to the plugin library folder.

To add the JAR files to the plugin library


  1. Download the fmu-builder-2.6.1.jar and the fmu-framework-2.6.1.jar files.
  2. Copy the downloaded JAR files to the <modeling tool installation directory>\plugins\com.nomagic.magicdraw.simulation\lib path.
  3. Restart the modeling tool after copying the JAR files.