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.

Create Single Component FMU

Page Content

Export FMU using FMUCreator

A FMU of a single component Modelica model can be created using the steps shown in the FMUCreator interface figure below.

Refer to FMUCreator section for detailed explanation. However, note the following to export FMU of a single component:

  1. In the Resources section, click on Select Source and select the Modelica package file that contains the component model to be exported. The selected package must be created with following rules:

    1. In Modelica code this file must be a package.

    2. The package name either must be OpalRT_Dev.mo or contain _standalone keyword as a suffix, for example myLIB_standalone.mo.

  2. The exported FMU name, which is used to import the FMU as discussed in Import Using Excel Template v2.0, depends on the Modelica compiler setting:

    1. OpenModelica 1.9.1: The exported FMU name is the full address of the model inside the package. Example: OpalRT_Electrical_Control_Excitation_ESST4B.win32.fmu

    2. OpenModelica 1.16.2: The exported FMU name is the name of the model in the package. Example: ESST4B.win32.fmu

    3. Dymola: The exported FMU name is the name of the model in the package. Example: ESST4B.win32.fmu

FMUCreator window

Notes:

  • Model file address as well as the FMU build directory address must not include any special characters.

  • A package with name OpalRT_Dev.mo or _standalone as a suffix only supports Single Component FMU and not a GenUnit model inside it. Example: for a GenUnit model named GENROU_myEX and Single Component model myEX inside a package named myLIB_standalone.mo, when imported in FMUCreator, GENROU_myEX will not appear in the Models/Classes window.

  • 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.

Export FMU for windows using Modelica Tools

OpenModelica 1.9.1

Follow the steps below to export FMU of a single component directly from OpenModelica 1.9.1:

  1. Load the Modelica package in the OpenModelica 1.9.1 and right click the component model to find the Export FMU option as shown in figure below,



  2. The location where FMU is exported appears in the message browser window of the OpenModelica. The default location is %userprofile%/AppData/Local/Temp/OpenModelica/OMEdit/.

  3. Notice that the exported FMU name is the full address of the model inside the package. Make sure to use this exact name in the Excel Template to import data.

  4. In order for ePHASORSIM to load the FMU, rename its extension from .fmu to .win32.fmu

OpenModelica 1.16.2

Follow the steps below to export FMU of a single component directly from OpenModelica 1.16.2:

  1. Load the Modelica package in the OpenModelica 1.16.2.

  2. In the Tools tab select Options as shown in the figure blow,

     

  3. Navigate to the FMI tab as shown in the figure below,



  4. Make sure to set version as 1.0 and Type to Model exchange as shown in the figure above,

    1. Type the required FMU name in the FMU Name field. If no custom name is provided, the default exported FMU name is the full address of the model inside the package.

    2. In the Move FMU field if a custom path is provided, the OM 1.16.2 is found to discard the FMU Name field value and use the default name. Thus, to use a custom FMU name, leave the Move FMU field empty. 

  5. Right click the component model to find the Export → FMU option as shown in figure below,


  6. The location where FMU is exported appears in the message browser window of the OpenModelica. The default location is %userprofile%/AppData/Local/Temp/OpenModelica/OMEdit/.

    In order for ePHASORSIM to load the FMU, rename its extension from '.fmu' to '.win32.fmu'

Dymola

Follow the steps below to export FMU of a single component directly from Dymola:

  1. Load the Modelica package and open the component model,

  2. When the model is open, switch the tab from Modeling to Simulation at the bottom right,

  3. Set the flag Advanced.EnableCodeExport = true using the command windows as shown below if the exported FMU will be used in a pc without Dymola licence,


  4. In the Simulation tab under Translate select FMU to export FMU of the selected model as shown in the figure blow,



  5. Type the required exported FMU name in the Model identifier field and make sure to set Type to Model exchange, version as 1.0 and Binaries to both 32 and 64-bit to export FMU for both architecture as shown in the figure below,


  6. The exported FMU can be found the same directory of the loaded package,

  7. In order for ePHASORSIM to load the FMU, rename its extension from .fmu to .win32.fmu.

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323