FMU Export and Import
System Modeler supports:
- FMI 1.0 and 2.0 for Model Exchange (import and export).
To export a class as an FMU, choose File ▶ Export ▶ FMU in Model Center. This will open up the FMU Export dialog box.
Exporting an FMU.
The FMU Export dialog box contains a set of export options for the FMU:
To import an FMU, choose File ▶ Import ▶ FMU in Model Center and select the FMU file. This will open up the Import FMU dialog with information about the selected FMU. It is also possible to trigger the import dialog by dragging and dropping the FMU anywhere on the main window in Model Center.
During the import, a wrapper model is created for the FMU. The wrapper model will mirror the variables and parameters in the FMU. The Options section of the FMU Import dialog allows control of which variables will be present in the created model and how variable and parameter names in the FMU are translated to Modelica identifiers.
Content of the FMU Import dialog box:
Importing an FMU.
- FMU kind. Specifies whether to import as a Model Exchange FMU or a Co-Simulation FMU in the case when the FMU contains both kinds.
- Name. The top-level class name the FMU wrapper model will be given in System Modeler.
- Create in. The directory in which the FMU wrapper model will be created.
- Include derivatives. If unchecked, all derivative variables as determined by the structured naming convention will be excluded. If Flat is chosen from the Variable naming convention drop-down menu, this alternative becomes disabled, as it is not possible to specify derivative variables using a flat naming convention.
- Allow use of quoted Modelica identifiers for imported variables. Allow variable names generated by the FMU import to be Modelica quoted identifiers. Note that all quoted identifiers will be reserved for generated names, so quoted identifiers in the FMU will become mangled if this option is checked.
- Variable naming convention. Interpret variable names according to the FMI standard's Structured or Flat naming convention. More information on variable naming conventions can be found in the specification for FMI at fmi-standard.org.
- Variables that need name mangling. Treatment of variables subjected to name mangling. Note that if Treat as error is chosen, the import will not succeed if variable name mangling is needed during the import. That a variable has been subjected to name mangling means that its original name as specified in the model description file could not be maintained in System Modeler, for example, if the name contains characters that are not allowed in a valid Modelica identifier.
- Add FMU interface filters. Adding filters to inputs or outputs allows the FMU to be safely connected to other components or FMUs in a loop. Regardless of filters on the outputs, the outputs will have uninitialized values during initialization, while absence of filters on the inputs will allow the FMU to initialize with correct values on its inputs. Use filters on outputs to allow the FMU to initialize with correct values on its inputs; otherwise, use filters on inputs.
For more information on the combination of Variable naming convention and Allow use of quoted Modelica identifiers for imported variables, as well as examples of name mangling related to Variables that need name mangling, see FMI—Variable Naming.
Clicking OK will import the FMU with the given options. The progress of the import can be followed from the Messages window at the bottom of Model Center, where all major steps in the import process are logged.