fmiInfo
Read the model description of an FMI 2.0 or 3.0 FMU.
📝Syntax
info = fmiInfo(fmu)
📥Input Arguments
Parameter Description
fmu a string scalar or character row vector: the path to a .fmu archive, or to an already-extracted FMU directory (a folder that contains a modelDescription.xml file at its root).
📤Output Arguments
Parameter Description
info a scalar structure describing the FMU, with the fields listed below.
📄Description

fmiInfo parses the modelDescription.xml of a Functional Mock-up Unit (FMU) that follows the FMI 2.0 or 3.0 standard and returns its metadata as a Nelson structure. It performs no simulation: it only reads the static description, so it is inexpensive and safe to call for inspection before setting up a run.

The fmu argument may be given in two forms:

The returned structure info has the following fields:

Field Class Details
modelIdentifier char the C model identifier declared by the FMU (used to locate its binary).
fmiVersion char the FMI version string reported by the FMU (for example 2.0 or 3.0).
coSimulation logical true when the FMU provides the Co-Simulation interface (required by fmiCoSimulate).
modelExchange logical true when the FMU provides the Model Exchange interface.
scheduledExecution logical true when the FMU provides the Scheduled Execution interface.
names cell of char the names of the scalar variables declared by the FMU, in declaration order.
valueReferences double the value reference of each variable (the numeric handle used by the FMI get/set calls).
causalities cell of char the causality of each variable: one of parameter, calculatedParameter, input, output, local, independent, or structuralParameter.
dataTypes cell of char the declared data type of each variable (for example Float64, Int32, Boolean, String).
descriptions cell of char the description string of each variable (empty when none is declared).
startValues double the Float64 start value of each variable, or NaN when the variable declares no start value.

The four variable fields (names, valueReferences, causalities, dataTypes) are aligned element by element: the k-th entry of each describes the same variable. To list the outputs of an FMU, select the entries whose causality is output; those are exactly the signals recorded by fmiCoSimulate.

An error is raised when the path does not exist, when the archive cannot be extracted, or when the FMU does not contain a readable modelDescription.xml.

💡Examples
Read the model description of an FMU archive.
info = fmiInfo('VanDerPol.fmu')
List only the output variables of the FMU.
info = fmiInfo('VanDerPol.fmu');
isOutput = strcmp(info.causalities, 'output');
outputs = info.names(isOutput)
Check that an FMU supports Co-Simulation before running it.
info = fmiInfo('VanDerPol.fmu');
if ~info.coSimulation
  error('This FMU does not provide the Co-Simulation interface.');
end
🔗See Also
fmiCoSimulate
🕔Version History
Version Description
2.0.0 initial version
Edit this page on GitHub