FMU Class Reference
Last update: 16.07.2025Public Member Functions | |
| addScalarVariable (string name, string type, string causality, string variability, string description, number min=0, number max=0, number start=0) | |
| Add a scalar variable to the FMU, see the FMI documentation at https://fmi-standard.org for details on the scalar variable description schema. More... | |
| FMU () | |
| Create an FMU 2.0 (Functional Mockup Unit, https://fmi-standard.org). More... | |
| setAuthor (string author) | |
| Set m_model_name. | |
| setDllPath (string path) | |
| Set the path pointing to the SoS libraries. An auto-detection attempt is performed on FMU construction. | |
| setModelDescription (string model_description) | |
| Set m_model_name. | |
| setModelName (string model_name) | |
| Set m_model_name. | |
| setScript (string code) | |
| Writes the script code to a temporary file and calls setScriptFile(). Only use either of setScript or setScriptFile. More... | |
| setScriptFile (string filename) | |
| Set the absolute path to an existing script file to be included with the .fmu archive. Only use either of setScript or setScriptFile. | |
| bool | writeFMU (string archive, bool includeEntireDatabase=false, bool replace_files=false) |
| Write the .fmu archive file to disk. More... | |
Constructor & Destructor Documentation
◆ FMU()
| FMU | ( | ) |
Create an FMU 2.0 (Functional Mockup Unit, https://fmi-standard.org).
Usage:
Member Function Documentation
◆ addScalarVariable()
| addScalarVariable | ( | string | name, |
| string | type, | ||
| string | causality, | ||
| string | variability, | ||
| string | description, | ||
| number | min = 0, |
||
| number | max = 0, |
||
| number | start = 0 |
||
| ) |
Add a scalar variable to the FMU, see the FMI documentation at https://fmi-standard.org for details on the scalar variable description schema.
- Parameters
-
name Variable name type Variable type: supporting String or Real causality For SoS FMUs this is either "input" or "output". variability SoS FMUs support "discrete" variability only. description Variable description. min The variable's lower bound. max The variable's upper bound. start The variables's default value.
◆ setScript()
| setScript | ( | string | code | ) |
Writes the script code to a temporary file and calls setScriptFile(). Only use either of setScript or setScriptFile.
- Parameters
-
code The script code to be executed by the FMU.
◆ writeFMU()
| bool writeFMU | ( | string | archive, |
| bool | includeEntireDatabase = false, |
||
| bool | replace_files = false |
||
| ) |
Write the .fmu archive file to disk.
- Parameters
-
archive A absolute or relative path to the archive to be written. includeEntireDatabase If false, a reduced .sdb database file, containing minimal Information (e.g. no designs), is included with the .fmu archive. replace_files If false, an already existing .fmu archive is not overwritten. Instead an error message is displayed.