FMI Library: part of JModelica.org
Functions

List of wrapper functions that are in common for both Model Exchange and Co-Simulation. More...

Functions

FMILIB_EXPORT const charfmi2_import_get_version (fmi2_import_t *fmu)
 Wrapper for the FMI function fmiGetVersion() More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_set_debug_logging (fmi2_import_t *fmu, fmi2_boolean_t loggingOn, size_t nCategories, fmi2_string_t categories[])
 Wrapper for the FMI function fmiSetDebugLogging(...) More...
 
FMILIB_EXPORT jm_status_enu_t fmi2_import_instantiate (fmi2_import_t *fmu, fmi2_string_t instanceName, fmi2_type_t fmuType, fmi2_string_t fmuResourceLocation, fmi2_boolean_t visible)
 Wrapper for the FMI function fmiInstantiate(...) More...
 
FMILIB_EXPORT void fmi2_import_free_instance (fmi2_import_t *fmu)
 Wrapper for the FMI function fmiFreeInstance(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_setup_experiment (fmi2_import_t *fmu, fmi2_boolean_t toleranceDefined, fmi2_real_t tolerance, fmi2_real_t startTime, fmi2_boolean_t stopTimeDefined, fmi2_real_t stopTime)
 Calls the FMI function fmiSetupExperiment(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_enter_initialization_mode (fmi2_import_t *fmu)
 Calls the FMI function fmiEnterInitializationMode(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_exit_initialization_mode (fmi2_import_t *fmu)
 Calls the FMI function fmiExitInitializationMode(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_terminate (fmi2_import_t *fmu)
 Wrapper for the FMI function fmiTerminate(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_reset (fmi2_import_t *fmu)
 Wrapper for the FMI function fmiReset(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_set_real (fmi2_import_t *fmu, const fmi2_value_reference_t vr[], size_t nvr, const fmi2_real_t value[])
 Wrapper for the FMI function fmiSetReal(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_set_integer (fmi2_import_t *fmu, const fmi2_value_reference_t vr[], size_t nvr, const fmi2_integer_t value[])
 Wrapper for the FMI function fmiSetInteger(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_set_boolean (fmi2_import_t *fmu, const fmi2_value_reference_t vr[], size_t nvr, const fmi2_boolean_t value[])
 Wrapper for the FMI function fmiSetBoolean(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_set_string (fmi2_import_t *fmu, const fmi2_value_reference_t vr[], size_t nvr, const fmi2_string_t value[])
 Wrapper for the FMI function fmiSetString(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_get_real (fmi2_import_t *fmu, const fmi2_value_reference_t vr[], size_t nvr, fmi2_real_t value[])
 Wrapper for the FMI function fmiGetReal(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_get_integer (fmi2_import_t *fmu, const fmi2_value_reference_t vr[], size_t nvr, fmi2_integer_t value[])
 Wrapper for the FMI function fmiGetInteger(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_get_boolean (fmi2_import_t *fmu, const fmi2_value_reference_t vr[], size_t nvr, fmi2_boolean_t value[])
 Wrapper for the FMI function fmiGetBoolean(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_get_string (fmi2_import_t *fmu, const fmi2_value_reference_t vr[], size_t nvr, fmi2_string_t value[])
 Wrapper for the FMI function fmiGetString(...) More...
 
FMILIB_EXPORT const charfmi2_import_get_types_platform (fmi2_import_t *fmu)
 Wrapper for the FMI function fmiGetTypesPlatform(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_get_fmu_state (fmi2_import_t *fmu, fmi2_FMU_state_t *s)
 Wrapper for the FMI function fmiGetFMUstate(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_set_fmu_state (fmi2_import_t *fmu, fmi2_FMU_state_t s)
 Wrapper for the FMI function fmiSetFMUstate(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_free_fmu_state (fmi2_import_t *fmu, fmi2_FMU_state_t *s)
 Wrapper for the FMI function fmiFreeFMUstate(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_serialized_fmu_state_size (fmi2_import_t *fmu, fmi2_FMU_state_t s, size_t *sz)
 Wrapper for the FMI function fmiSerializedFMUstateSize(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_serialize_fmu_state (fmi2_import_t *fmu, fmi2_FMU_state_t s, fmi2_byte_t data[], size_t sz)
 Wrapper for the FMI function fmiSerializeFMUstate(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_de_serialize_fmu_state (fmi2_import_t *fmu, const fmi2_byte_t data[], size_t sz, fmi2_FMU_state_t *s)
 Wrapper for the FMI function fmiSerializeFMUstate(...) More...
 
FMILIB_EXPORT fmi2_status_t fmi2_import_get_directional_derivative (fmi2_import_t *fmu, const fmi2_value_reference_t v_ref[], size_t nv, const fmi2_value_reference_t z_ref[], size_t nz, const fmi2_real_t dv[], fmi2_real_t dz[])
 Wrapper for the FMI function fmiGetDirectionalDerivative(...) More...
 

Detailed Description

List of wrapper functions that are in common for both Model Exchange and Co-Simulation.

Function Documentation

FMILIB_EXPORT const char* fmi2_import_get_version ( fmi2_import_t fmu)

Wrapper for the FMI function fmiGetVersion()

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
Returns
FMI version.
FMILIB_EXPORT fmi2_status_t fmi2_import_set_debug_logging ( fmi2_import_t fmu,
fmi2_boolean_t  loggingOn,
size_t  nCategories,
fmi2_string_t  categories[] 
)

Wrapper for the FMI function fmiSetDebugLogging(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
loggingOnEnable or disable the debug logger.
nCategoriesNumber of categories to log.
categoriesWhich categories to log.
Returns
FMI status.
FMILIB_EXPORT jm_status_enu_t fmi2_import_instantiate ( fmi2_import_t fmu,
fmi2_string_t  instanceName,
fmi2_type_t  fmuType,
fmi2_string_t  fmuResourceLocation,
fmi2_boolean_t  visible 
)

Wrapper for the FMI function fmiInstantiate(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
instanceNameThe name of the instance.
fmuTypefmi2_model_exchange or fmi2_cosimulation.
fmuResourceLocationAccess path URI to the FMU archive resources. If this is NULL pointer the FMU will get the path to the unzipped location.
visibleIndicates whether or not the simulator application window shoule be visible.
Returns
Error status. Returnes jm_status_error if fmiInstantiate returned NULL, otherwise jm_status_success.
FMILIB_EXPORT void fmi2_import_free_instance ( fmi2_import_t fmu)

Wrapper for the FMI function fmiFreeInstance(...)

Parameters
fmuAn fmu description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
FMILIB_EXPORT fmi2_status_t fmi2_import_setup_experiment ( fmi2_import_t fmu,
fmi2_boolean_t  toleranceDefined,
fmi2_real_t  tolerance,
fmi2_real_t  startTime,
fmi2_boolean_t  stopTimeDefined,
fmi2_real_t  stopTime 
)

Calls the FMI function fmiSetupExperiment(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
tolerance_definedTrue if the tolerance argument is to be used
toleranceSolvers internal to the FMU should use this tolerance or finer, if tolerance_defined is true
start_timeStart time of the experiment
stop_time_definedTrue if the stop_time argument is to be used
stop_timeStop time of the experiment, if stop_time_defined is true
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_enter_initialization_mode ( fmi2_import_t fmu)

Calls the FMI function fmiEnterInitializationMode(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_exit_initialization_mode ( fmi2_import_t fmu)

Calls the FMI function fmiExitInitializationMode(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_terminate ( fmi2_import_t fmu)

Wrapper for the FMI function fmiTerminate(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_reset ( fmi2_import_t fmu)

Wrapper for the FMI function fmiReset(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_set_real ( fmi2_import_t fmu,
const fmi2_value_reference_t  vr[],
size_t  nvr,
const fmi2_real_t  value[] 
)

Wrapper for the FMI function fmiSetReal(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
vrArray of value references.
nvrNumber of array elements.
valueArray of variable values.
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_set_integer ( fmi2_import_t fmu,
const fmi2_value_reference_t  vr[],
size_t  nvr,
const fmi2_integer_t  value[] 
)

Wrapper for the FMI function fmiSetInteger(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
vrArray of value references.
nvrNumber of array elements.
valueArray of variable values.
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_set_boolean ( fmi2_import_t fmu,
const fmi2_value_reference_t  vr[],
size_t  nvr,
const fmi2_boolean_t  value[] 
)

Wrapper for the FMI function fmiSetBoolean(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
vrArray of value references.
nvrNumber of array elements.
valueArray of variable values.
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_set_string ( fmi2_import_t fmu,
const fmi2_value_reference_t  vr[],
size_t  nvr,
const fmi2_string_t  value[] 
)

Wrapper for the FMI function fmiSetString(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
vrArray of value references.
nvrNumber of array elements.
valueArray of variable values.
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_get_real ( fmi2_import_t fmu,
const fmi2_value_reference_t  vr[],
size_t  nvr,
fmi2_real_t  value[] 
)

Wrapper for the FMI function fmiGetReal(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
vrArray of value references.
nvrNumber of array elements.
value(Output)Array of variable values.
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_get_integer ( fmi2_import_t fmu,
const fmi2_value_reference_t  vr[],
size_t  nvr,
fmi2_integer_t  value[] 
)

Wrapper for the FMI function fmiGetInteger(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
vrArray of value references.
nvrNumber of array elements.
value(Output)Array of variable values.
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_get_boolean ( fmi2_import_t fmu,
const fmi2_value_reference_t  vr[],
size_t  nvr,
fmi2_boolean_t  value[] 
)

Wrapper for the FMI function fmiGetBoolean(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
vrArray of value references.
nvrNumber of array elements.
value(Output)Array of variable values.
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_get_string ( fmi2_import_t fmu,
const fmi2_value_reference_t  vr[],
size_t  nvr,
fmi2_string_t  value[] 
)

Wrapper for the FMI function fmiGetString(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
vrArray of value references.
nvrNumber of array elements.
value(Output)Array of variable values.
Returns
FMI status.
FMILIB_EXPORT const char* fmi2_import_get_types_platform ( fmi2_import_t fmu)

Wrapper for the FMI function fmiGetTypesPlatform(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
Returns
The platform the FMU was compiled for.
FMILIB_EXPORT fmi2_status_t fmi2_import_get_fmu_state ( fmi2_import_t fmu,
fmi2_FMU_state_t *  s 
)

Wrapper for the FMI function fmiGetFMUstate(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
sThe state object to be set by the FMU
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_set_fmu_state ( fmi2_import_t fmu,
fmi2_FMU_state_t  s 
)

Wrapper for the FMI function fmiSetFMUstate(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
sThe FMU state object
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_free_fmu_state ( fmi2_import_t fmu,
fmi2_FMU_state_t *  s 
)

Wrapper for the FMI function fmiFreeFMUstate(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
sThe FMU state object
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_serialized_fmu_state_size ( fmi2_import_t fmu,
fmi2_FMU_state_t  s,
size_t sz 
)

Wrapper for the FMI function fmiSerializedFMUstateSize(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
sThe FMU state object
szThe size of the serialized state in bytes
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_serialize_fmu_state ( fmi2_import_t fmu,
fmi2_FMU_state_t  s,
fmi2_byte_t  data[],
size_t  sz 
)

Wrapper for the FMI function fmiSerializeFMUstate(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
sThe FMU state object
dataThe buffer that will receive serialized FMU state
szThe size of the data buffer
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_de_serialize_fmu_state ( fmi2_import_t fmu,
const fmi2_byte_t  data[],
size_t  sz,
fmi2_FMU_state_t *  s 
)

Wrapper for the FMI function fmiSerializeFMUstate(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
dataThe buffer that contains serialized FMU state
szThe size of the data buffer
sThe FMU state object to be created
Returns
FMI status.
FMILIB_EXPORT fmi2_status_t fmi2_import_get_directional_derivative ( fmi2_import_t fmu,
const fmi2_value_reference_t  v_ref[],
size_t  nv,
const fmi2_value_reference_t  z_ref[],
size_t  nz,
const fmi2_real_t  dv[],
fmi2_real_t  dz[] 
)

Wrapper for the FMI function fmiGetDirectionalDerivative(...)

Parameters
fmuA model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, see fmi2_import_create_dllfmu().
v_refValue references for the seed vector
nvsize of v_ref array
z_refValue references for the derivatives/outputs to be processed
nzSize of z_ref array
dvThe seed vector.
dzCalculated directional derivative on output.
Returns
FMI status.