Engee documentation

EDM-Target-FMI

Exporting FMU from a model Engee.

blockType: SubSystem

Path in the library:

/Interfaces/Targets/EDM-Target-FMI

Description

To work with the block, install/update the support package. equipment.

Block EDM-Target-FMI designed for FMU export from the model Engee using a code generator through a subsystem Engee.Integrations.

FMU is an archive containing the model and auxiliary files in the FMI format. The FMI format is used to exchange models between various modeling and simulation tools.

When starting in the mode Target Hardware A C code is generated from the model. It is then compiled on the user’s computer into a shared library. .so or .dll after that, the library is packaged in the FMU archive along with the supporting information for import.

As a result of the block operation, the user receives a ready-made .fmu-a file that can be used to import into FMI-compatible tools.

Limitations

The exported FMU can only be run on a computer with an operating system of the same family on which the FMU was built.:

  • FMU built on Windows is designed to run on Windows;

  • FMU, built on Linux, is designed to run on Linux.

If you need to use FMU on multiple platforms, you should export it separately on each target platform.

Preliminary requirements

Before using the block, make sure that:

  • the model is successfully launched in Engee;

  • The C code generation is available for the model.;

  • a supported compiler is installed on the user’s computer;

  • The assembly system generator is installed;

  • the subsystem is configured Engee.Integrations;

  • the user has write rights to the FMU export directory and to the code generation directory.

To compile a shared library, a compiler and an assembly system generator must be installed on the user’s computer.

Instructions for installing the necessary components for Windows are available at link.

Configuration example

Example of parameter values for Linux:

Parameter Example of the value

FMI version:

2.0

FMU output folder:

/home/user/fmu_export

Codegen folder:

/home/user/fmu_build

Example of parameter values for Windows:

Parameter Example of the value

FMI version:

2.0

FMU output folder:

C:\Users\User\fmu_export

Codegen folder:

C:\Users\User\fmu_build

Operating procedure

  1. Add a block EDM-Target-FMI into the model.

  2. Select the FMI version.

  3. Specify the FMU export directory.

  4. Specify the code generation directory.

  5. Run the model in the mode Target Hardware.

  6. Wait for the code generation and assembly to complete.

  7. Open the FMU export directory and check for availability .fmu- the file.

The result of the work

After successful execution, an FMU file will be created in the export directory.

The code generation directory will contain intermediate code generation files and assembly artifacts. These files can be useful for diagnosing compilation errors or configuring the environment.

Usage example

A ready-made model example example_fmi_target.engee available as part of demo examples Engee-Device-Manager.

To download the examples, use the command engee.package.getdemos:

engee.package.getdemos("Engee-Device-Manager")

Parameters

EDM Target FMI

# FMI version: — FMI version
2.0 | 3.0

Details

The FMI version for export. Options are available 2.0 and 3.0.

Values

2.0 | 3.0

Default value

3.0

Program usage name

fmi_version

Tunable

No

Evaluatable

Yes

# FMU output folder: — the FMU export directory

Details

The directory on the user’s computer where the collected FMU file will be placed.

Default value

.

Program usage name

fmi_folder

Tunable

No

Evaluatable

Yes

# Codegen folder: — the code generation directory

Details

The directory that the host client will use to generate code and build artifacts.

It is recommended to use different directories for FMU export and code generation. The export directory is intended for the final .fmu-a file, and the code generation directory is for intermediate assembly files.
Default value

.

Program usage name

codegen_folder

Tunable

No

Evaluatable

Yes