Working with the FMI model description
The FMI model description provides all human readable information on the model. The following functions can be used to obtain all information provided by the model description, which in turn can be extracted from the fmu.
Loading/Parsing
fmi3LoadModelDescription
general information about the FMU
fmi3GetGenerationTool fmi3GetGenerationDateAndTime
technical information about the FMU
FMICore.fmi3GetVersion
— FunctionSource: FMISpec3.0, Version D5ef1c1: 2.2.4. Inquire Version Number of Header Files
This function returns fmi3Version of the fmi3Functions.h header file which was used to compile the functions of the FMU. This function call is allowed always and in all interface types.
The standard header file as documented in this specification has version "3.0-beta.2", so this function returns "3.0-beta.2".
fmi3GetVersion(fmu::FMU3)
Arguments
fmu::FMU3
: Mutable struct representing a FMU and all it instantiated instances in the FMI 3.0 Standard.
Returns
- Returns a string from the address of a C-style (NUL-terminated) string. The string represents the version of the “fmi3Functions.h” header file which was used to compile the functions of the FMU. The function returns “fmiVersion” which is defined in this header file. The standard header file as documented in this specification has version “3.0”
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4. Inquire Version Number of Header Files
function fmi3GetVersion(fmu::FMU3)
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
- Returns a string from the address of a C-style (NUL-terminated) string. The string represents the version of the “fmi3Functions.h” header file which was used to compile the functions of the FMU. The function returns “fmiVersion” which is defined in this header file. The standard header file as documented in this specification has version “3.0”
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.4. Inquire Version Number of Header Files
FMIImport.fmi3GetNumberOfEventIndicators
— Functionfmi3GetNumberOfEventIndicators(c::FMU3Instance)
This function returns the number of event indicators. This function can only be called in Model Exchange.
fmi3GetNumberOfEventIndicators
must be called after a structural parameter is changed. As long as no structural parameters changed, the number of states is given in the modelDescription.xml, alleviating the need to call this function.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.
Returns
size::Integer
: Returnsize
is the number of event indicators of this instance
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3GetNumberOfEventIndicators
.
FMICore.fmi3GetNumberOfEventIndicators!
— FunctionSource: FMISpec3.0, Version D5ef1c1: 2.3.2. State: Instantiated
This function returns the number of event indicators. This function can only be called in Model Exchange.
fmi3GetNumberOfEventIndicators must be called after a structural parameter is changed. As long as no structural parameters changed, the number of states is given in the modelDescription.xml, alleviating the need to call this function.
fmi3GetNumberOfEventIndicators!(c::FMU3Instance, nEventIndicators::Ref{Csize_t})
This function returns the number of event indicators. This function can only be called in Model Exchange.
fmi3GetNumberOfEventIndicators
must be called after a structural parameter is changed. As long as no structural parameters changed, the number of states is given in the modelDescription.xml, alleviating the need to call this function.
Arguments
c::FMU3Instance
: Mutable struct represents an instantiated instance of an FMU in the FMI 3.0 Standard.nEventIndicators::Ref{Csize_t}
: Stores the number of continuous states returned by the function
Returns
status::fmi3Status
: Returnstatus
is an enumeration of typefmi3Status
and indicates the success of the function call.
More detailed:
fmi3OK
: all wellfmi3Warning
: things are not quite right, but the computation can continuefmi3Discard
: if the slave computed successfully only a subinterval of the communication stepfmi3Error
: the communication step could not be carried out at allfmi3Fatal
: if an error occurred which corrupted the FMU irreparably
Source
- FMISpec3.0 Link: https://fmi-standard.org/
- FMISpec3.0: 2.2.3 Platform Dependent Definitions
- FMISpec3.0: 2.2.4 Status Returned by Functions
- FMISpec3.0: 2.3.2. State: Instantiated
See also fmi3GetNumberOfEventIndicators!
.
FMU capabilities
fmi3CanGetSetState fmi3CanSerializeFMUState