Skip to content
Login / Sign Up

Run FMUs Using SimWB

Demos | SIMulation Workbench

Provides a simple Graphical User Interface to import the FMU files into SimWB. These imported FMU models can then be added to ‘Tests’ and can be executed in real-time. One advantage of using SimWB for FMU real-time simulation is that we do not need sources included in the FMU to execute it as long as there is a correct Linux binary included in FMU. We also provide a Virtual Machine image that can be freely distributed to your suppliers. This  Virtual Machine has a utility that will allow your suppliers to provide FMUs without exposing their Intellectual Property (IP), i.e. the source.

 

SIMulation Workbench now also allows you to run Windows™ based FMU. i.e an FMU model whose fmu file packages a 64 bit DLL. This is useful when a third party vendor provides you with an FMU file that does not contain the Linux binary shared library. The Windows™ based FMU’s are run under the wine emulation layer and integrate transparently into the SimWB environment.
In order to run Windows™ based FMU, you will need to install the Linux wine package on your RedHawk™ system. To install wine on your platform visit the Wine HQ website at https://www.winehq.org.

FMU models can be generated from a wide variety of modeling environments, including:

  • Dymola®
  • LMS Virtual.Lab®
  • LMS Amesim®
  • MapleSim®

fmu_models_import_gui.png

Supported Functional Mockup Interface (FMI) versions

  1. FMI 1.0.
  2. FMI 2.0.

Module Licenses required for SimWB

ICS-SWB-502 (FMU) Needed to run FMU models under SimWB
ICS-SWB-506 (FMU_WIN_ADDON) Add-On to run windows based FMU models under SimWB

Work flow

The typical work flow is as explained below:

  1. Import the FMU model to the SimWB using the ‘Select FMU File’. This allows you to import the FMU file from any client machine to the SimWB host.
  2. Parse the FMU file using the ‘Parse FMU’ button. This will allow you to inspect the FMU file and find out if it has the required precompiled binary suitable for the SimWB host architecture. You can optionally choose to ‘Rebuild’ if there are sources available in the FMU. This option is useful if the FMU that you are trying to import does not have a binary for Linux. Currently only the following modeling packages are supported for ‘Rebuild’:
    • Dymola® 2022 and older (FMI 1.0 and 2.0 CoSimulation)
    • MapleSim® 2015 (FMI 1.0 and 2.0 CoSimulation)
  3. Generate an RTDB file for this FMU file. This will allow you to communicate with the model in FMU and you can also map hardware to these RTDB points.
  4. Click on ‘Create FMU model’to install the FMU into SimWB. This will create a main function that loads and talk to the FMU file and create an executable that can be run on SimWB.

OpenMP FMU support for Dymola

If an imported FMU supports OpenMP, then we automatically recompile the FMU and allow users to specify the cores where the individual threads can run. Please make sure to follow the steps below for optimal real-time performance

  1. The OpenMP threads need to run on their own cores. No other tasks should be running on that core including SimWB IO Tasks and scheduler.
  2. The cores used for OpenMP threads should be shielded.
  3. If possible, make sure to run all the threads on the same CPU in a multi-socket system.

Corner Controls

Demonstratehelpvideo00027.png

Opens a short video clip that demonstrates the basic workflow of this form.

Helphelp00028.png

Opens this section of the manual.

FMU Model Properties Pane

Allows user to import FMU files into SimWB.

Select FMU Filefmu_select_fmu_file.png

This allows you to import the FMU file from any client machine to the SimWB host. When you click this button, it will open a file browser that allows you to browse for local FMU file and upload to SimWB host.

SimWB Model Name

This is the name of the model as it appears in the FMU. it is the name that is used to create the SimWB model. This name can be edited and thus allows you to create multiple SimWB models from the same FMU model file.

Parse FMU

Parse FMU

This will analyze the content of the FMU file selected. The available platforms (shared libraries DLL/.so versions) are shown in the “FMU Provides :” label.

A list of the variables available in the FMU models will be displayed as show in the picture to the right.

The first column lists the name of variables that exist in the FMU model, The variable type Input/Output will be accessible in SimWB via the RTDB. The internal FMU variables might contain characters that are not supported in SimWB; the second column will shown the name that is valid in SimWB. The model variable will be created under that in the RTDB. This name can also be edited in place to allow you to specify a name that might best suit your environment and naming convention.

You can select whether to include the variable in the RTDB by checking the associated checkbo in 5. In some cases, you might not want to include all the outputs produced by the model as you could be interested in only a few calculated values.

The variable of type “Parameter” and Variability “Tunable” are created automatically at run-time when the model is loaded into SimWB similarly to what happens with Simulink™ model parameters.

Rebuild FMU

Optionally rebuild the FMU. This is available only if the FMU has source files. Currently Dymola & MapleSim FMUs are supported for rebuilding.

Generate RTDB

Generate RTDB

This allows you to create a RTDB for the FMU that is being imported.

New RTDB

Optionally choose to select to create a new RTDB.

Model RTDBfmu_generate_RTDB_file_model_rtdb.png

Select or Enter the name for the RTDB to be created.

Group

Select the group of the user that the generated RTDB will belong.

Create FMU Model

Create FMU Model

Create the FMU model object in SimWB to be used in Test.When the FMU packages a DLL version of the model, the check box “Use Windows™ FMU” is enabled and allows you to create a Windows™ based FMU to run under SimWB.

Back to top