Documentation Home Page ePHASORSIM Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

FMUCreator

Page Content

FMUCreator has two functions:

  • Install and uninstall OpenModelica 1.9.1 on an RT-LAB enabled Linux target

  • Export FMU out of a GenUnit for both Windows and Linux platforms using OM 1.9.1, OM 1.16.2 or Dymola. 

In summary:

 

Export FMU for ...

Running a model with existing FMU on...

 

Export FMU for ...

Running a model with existing FMU on...

 

Windows Target

Linux Target

Windows Target

Linux Target

OM 1.9.1

Needs manual installation

Needs manual installation via FMUCreator (RedHat only)

Needs manual installation

Needs manual installation via FMUCreator (RedHat only)

OM 1.16.2

Needs manual installation

Is pre-installed on OPAL-RTLinux v3.5 and later

Does not need installation

Only OPAL-RTLinux v3.5 and later

Dymola 2019*

Needs manual installation

Does not need installation

Does not need installation

Does not need installation

*Dymola 2019, released 2018-04-11. Other versions have not been tested and verified.Commands for checking successful OpenModelica installation.

Exporting FMU

FMUs can be created from GenUnits using the FMUCreator interface shown in the figure below.

Follow the steps shown in the above figure to create an FMU:

  • In the Resources section, click on Select Source and select the Modelica file that contains the GenUnit-type components to be exported as FMU.

  • The Select Package button can be used to open all the GenUnits inside the selected folder that contains the file package.mo.

  • If the GenUnit file has dependencies to other Modelica libraries, they must be also loaded by clicking on Add Dependency and adding them to the corresponding section in FMUCreator as shown in the above figure.

Notes:

  • The Modelica Standard Library is automatically loaded in FMUCreator and does not need to be added as dependency.

  • GenUnit as well as dependency files’ address should not include any special character.

  • If the GenUnit folder includes a package.mo file, opening that file using Select Source button will load all the GenUnits inside that package.mo in the FMUCreator automatically. 

  • In the Models / Classes section, check the check-box for the GenUnits you want to compile.

  • In the Compilation Settings section, the following options can be set:

Compile on selected target also

If this option is not checked, the FMU will be only generated for the windows target.

However, if checked, the FMU will be also compiled for the corresponding Linux target selected in step-4 alongside its compilation for windows.

Keep source

If checked, the FMU also includes the generated c-code of the model.

Debug

If checked, verbose compilation information is shown in the output window during FMU generation.

  • If in Step 3 Compile on selected target also is checked, then a proper target must be chosen in the Available Targets by name/IP section.

A list of already added targets in the RT-LAB is automatically loaded in this section. If the desired target is not listed, the user can still add it by defining its IP address in “Target ip” section and clicking on the “Add Target ip” button.

Also make sure username/password pair matches to the one on the target.

  • In Modelica compiler section, Select the Modelica development tool by which the FMUs will be generated.

Three options are available:

  • Dymola

  • OpenModelica 1.9.1

  • OpenModelica 1.16.2

To use desired version of OpenModelica, install them on the default paths and verify that the values for the Windows user environment variables, OPENMODELICAHOME and OPENMODELICALIBRARY, are set correctly as discussed in the Migration Notes for v2021.3. Otherwise, the corresponding option for OpenModelica is disabled.

Note: If EPHASOR_DYMOLA_FMU license is not enabled in RT-LAB, the Dymola option is disabled.
This means the FMU cannot be exported using Dymola; however, an already built Dymola FMU can still be used for the simulation.

  • In Select Build Directory section, choose the folder to which the generated FMUs will be copied.

Note: Build directory address should not include any special characters.

  • Finally click Compile FMU. The compilation process begins and the generated FMUs are placed in the folder defined in step-6.

  • Depending on the compilation platform chosen, FMUs are created with two different file extensions:

    • [GenUnit Name].win32.fmu FMUs which are compiled for Windows platform.

    • [GenUnit Name].linux32.fmu FMUs which are compiled for the 32-bit Linux platform.

    • [GenUnit Name].linux64.fmu FMUs which are compiled for the 64-bit Linux platform.

OpenModelica 1.9.1 Installation

On older RedHat / CentOS targets, OpenModelica can be installed can be installed via the FMUCreator tool.

  1. Make sure the RT-LAB’s MetaController is running on the local host and the desired target is up and connected to the local host.

  2. Execute FMUCreator.bat that exists in C:\OPAL-RT\RT-LAB\v20XX.X\FMUCreator, figure is shown below in 'Exporting FMU'. The Available Targets by name/ip section shows a list of available targets as defined in the RT-LAB GUI. For this example, the target name is ‘192.168.4.51'. If the desired target is not listed, the user can still add it by defining its IP address in “Target ip” section and clicking on the “Add Target ip” button (Section 4 in the figure showing FMUCreator interface). You should then provide the same username/password as the one on the target in order to establish a successful connection.

  3. Double click on the target name on which OpenModelica needs to be installed and choose Install OpenModelica

Upon successful installation, the following messages should be displayed, both in the FMUCreator command window and the FMUCreator Interface:

Installation in progress... Log at ‘C:\OPAL-RT\RT-LAB\vX.X\FMUCreator\openmodelica_install.log’.Installation complete.

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter