FMI Library: part of JModelica.org
Functions
Functions for handling variable definitions.

All the functions in this group take a pointer to fmi2_import_variable_t as a parameter. A variable pointer may be obtained via a Handling of variable lists module or via functions fmi2_import_get_variable_by_name() and fmi2_import_get_variable_by_vr(). More...

Functions

FMILIB_EXPORT const charfmi2_import_get_variable_name (fmi2_import_variable_t *)
 Get the variable name. More...
 
FMILIB_EXPORT const charfmi2_import_get_variable_description (fmi2_import_variable_t *)
 Get variable description. More...
 
FMILIB_EXPORT fmi2_value_reference_t fmi2_import_get_variable_vr (fmi2_import_variable_t *)
 Get variable value reference. More...
 
FMILIB_EXPORT fmi2_import_variable_typedef_tfmi2_import_get_variable_declared_type (fmi2_import_variable_t *)
 For scalar variable gives the type definition is present. More...
 
FMILIB_EXPORT fmi2_base_type_enu_t fmi2_import_get_variable_base_type (fmi2_import_variable_t *)
 Get variable base type. More...
 
FMILIB_EXPORT int fmi2_import_get_variable_has_start (fmi2_import_variable_t *)
 Check if the variable has "start" attribute. More...
 
FMILIB_EXPORT fmi2_variability_enu_t fmi2_import_get_variability (fmi2_import_variable_t *)
 Get variability attribute. More...
 
FMILIB_EXPORT fmi2_causality_enu_t fmi2_import_get_causality (fmi2_import_variable_t *)
 Get causality attribute. More...
 
FMILIB_EXPORT fmi2_initial_enu_t fmi2_import_get_initial (fmi2_import_variable_t *)
 Get initial attribute. More...
 
FMILIB_EXPORT fmi2_import_variable_tfmi2_import_get_previous (fmi2_import_variable_t *v)
 Get the variable that holds the previous value of this variable, if defined. More...
 
FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_canHandleMultipleSetPerTimeInstant (fmi2_import_variable_t *v)
 Get the canHandleMultipleSetPerTimeInstant flag for a variable. More...
 
FMILIB_EXPORT fmi2_import_real_variable_tfmi2_import_get_variable_as_real (fmi2_import_variable_t *)
 Cast general variable to a one with the specific type. More...
 
FMILIB_EXPORT fmi2_import_integer_variable_tfmi2_import_get_variable_as_integer (fmi2_import_variable_t *)
 Cast general variable to a one with the specific type. More...
 
FMILIB_EXPORT fmi2_import_enum_variable_tfmi2_import_get_variable_as_enum (fmi2_import_variable_t *)
 Cast general variable to a one with the specific type. More...
 
FMILIB_EXPORT fmi2_import_string_variable_tfmi2_import_get_variable_as_string (fmi2_import_variable_t *)
 Cast general variable to a one with the specific type. More...
 
FMILIB_EXPORT fmi2_import_bool_variable_tfmi2_import_get_variable_as_boolean (fmi2_import_variable_t *)
 Cast general variable to a one with the specific type. More...
 
FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_start (fmi2_import_real_variable_t *v)
 Get the variable start attribute. More...
 
FMILIB_EXPORT fmi2_import_real_variable_tfmi2_import_get_real_variable_derivative_of (fmi2_import_real_variable_t *v)
 Get the variable that this is a derivative of, if defined. More...
 
FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_real_variable_reinit (fmi2_import_real_variable_t *v)
 Get the reinit flag for a real variable. More...
 
FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_max (fmi2_import_real_variable_t *v)
 Get maximum value for the variable. More...
 
FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_min (fmi2_import_real_variable_t *v)
 Get minimal value for the variable. More...
 
FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_nominal (fmi2_import_real_variable_t *v)
 Get nominal value for the variable. More...
 
FMILIB_EXPORT fmi2_import_unit_tfmi2_import_get_real_variable_unit (fmi2_import_real_variable_t *v)
 Get associated "unit" object if any. More...
 
FMILIB_EXPORT fmi2_import_display_unit_tfmi2_import_get_real_variable_display_unit (fmi2_import_real_variable_t *v)
 Get associated "display unit" object if any. More...
 
FMILIB_EXPORT const charfmi2_import_get_string_variable_start (fmi2_import_string_variable_t *v)
 Get start value for the variable. More...
 
FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_boolean_variable_start (fmi2_import_bool_variable_t *v)
 Get start value for the variable. More...
 
FMILIB_EXPORT int fmi2_import_get_integer_variable_start (fmi2_import_integer_variable_t *v)
 Get start value for the variable. More...
 
FMILIB_EXPORT int fmi2_import_get_integer_variable_min (fmi2_import_integer_variable_t *v)
 Get minimal value for the variable. More...
 
FMILIB_EXPORT int fmi2_import_get_integer_variable_max (fmi2_import_integer_variable_t *v)
 Get max value for the variable. More...
 
FMILIB_EXPORT int fmi2_import_get_enum_variable_start (fmi2_import_enum_variable_t *v)
 Get start value for the variable. More...
 
FMILIB_EXPORT int fmi2_import_get_enum_variable_min (fmi2_import_enum_variable_t *v)
 Get minimal value for the variable. More...
 
FMILIB_EXPORT int fmi2_import_get_enum_variable_max (fmi2_import_enum_variable_t *v)
 Get max value for the variable. More...
 
FMILIB_EXPORT fmi2_variable_alias_kind_enu_t fmi2_import_get_variable_alias_kind (fmi2_import_variable_t *)
 Get the variable alias kind. More...
 
FMILIB_EXPORT size_t fmi2_import_get_variable_original_order (fmi2_import_variable_t *v)
 Get the original index in xml of the variable. More...
 

Scalar variable types

typedef struct fmi2_xml_variable_t fmi2_import_variable_t
 General variable type. More...
 
typedef struct fmi2_xml_real_variable_t fmi2_import_real_variable_t
 Opaque real variable. More...
 
typedef struct fmi2_xml_integer_variable_t fmi2_import_integer_variable_t
 Opaque integer variable. More...
 
typedef struct fmi2_xml_string_variable_t fmi2_import_string_variable_t
 Opaque string variable. More...
 
typedef struct fmi2_xml_enum_variable_t fmi2_import_enum_variable_t
 Opaque enumeration variable. More...
 
typedef struct fmi2_xml_bool_variable_t fmi2_import_bool_variable_t
 Opaque boolean variable. More...
 
typedef struct fmi2_import_variable_list_t fmi2_import_variable_list_t
 List of variables. More...
 

Detailed Description

All the functions in this group take a pointer to fmi2_import_variable_t as a parameter. A variable pointer may be obtained via a Handling of variable lists module or via functions fmi2_import_get_variable_by_name() and fmi2_import_get_variable_by_vr().

Typedef Documentation

typedef struct fmi2_xml_variable_t fmi2_import_variable_t

General variable type.

This type is convenient to unify all the variable list operations. However, typed variables are needed to support specific attributes.

Definition at line 51 of file fmi2_import_variable.h.

typedef struct fmi2_xml_real_variable_t fmi2_import_real_variable_t

Opaque real variable.

Definition at line 53 of file fmi2_import_variable.h.

typedef struct fmi2_xml_integer_variable_t fmi2_import_integer_variable_t

Opaque integer variable.

Definition at line 55 of file fmi2_import_variable.h.

typedef struct fmi2_xml_string_variable_t fmi2_import_string_variable_t

Opaque string variable.

Definition at line 57 of file fmi2_import_variable.h.

typedef struct fmi2_xml_enum_variable_t fmi2_import_enum_variable_t

Opaque enumeration variable.

Definition at line 59 of file fmi2_import_variable.h.

typedef struct fmi2_xml_bool_variable_t fmi2_import_bool_variable_t

Opaque boolean variable.

Definition at line 61 of file fmi2_import_variable.h.

List of variables.

Definition at line 63 of file fmi2_import_variable.h.

Function Documentation

FMILIB_EXPORT const char* fmi2_import_get_variable_name ( fmi2_import_variable_t )

Get the variable name.

FMILIB_EXPORT const char* fmi2_import_get_variable_description ( fmi2_import_variable_t )

Get variable description.

Returns
Description string or empty string ("") if no description in the XML file was given.
FMILIB_EXPORT fmi2_value_reference_t fmi2_import_get_variable_vr ( fmi2_import_variable_t )

Get variable value reference.

FMILIB_EXPORT fmi2_import_variable_typedef_t* fmi2_import_get_variable_declared_type ( fmi2_import_variable_t )

For scalar variable gives the type definition is present.

Returns
Pointer of a type fmi2_import_variable_typedef_t object or NULL of not present.
FMILIB_EXPORT fmi2_base_type_enu_t fmi2_import_get_variable_base_type ( fmi2_import_variable_t )

Get variable base type.

FMILIB_EXPORT int fmi2_import_get_variable_has_start ( fmi2_import_variable_t )

Check if the variable has "start" attribute.

FMILIB_EXPORT fmi2_variability_enu_t fmi2_import_get_variability ( fmi2_import_variable_t )

Get variability attribute.

FMILIB_EXPORT fmi2_causality_enu_t fmi2_import_get_causality ( fmi2_import_variable_t )

Get causality attribute.

FMILIB_EXPORT fmi2_initial_enu_t fmi2_import_get_initial ( fmi2_import_variable_t )

Get initial attribute.

FMILIB_EXPORT fmi2_import_variable_t* fmi2_import_get_previous ( fmi2_import_variable_t v)

Get the variable that holds the previous value of this variable, if defined.

Returns
If this variable is a discrete-time state, return the variable holds its previous value; NULL otherwise.
FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_canHandleMultipleSetPerTimeInstant ( fmi2_import_variable_t v)

Get the canHandleMultipleSetPerTimeInstant flag for a variable.

Returns
For inputs: If false, then only one fmiSetXXX call is allowed at one super dense time instant. In other words, this input is not allowed to appear in an algebraic loop.
FMILIB_EXPORT fmi2_import_real_variable_t* fmi2_import_get_variable_as_real ( fmi2_import_variable_t )

Cast general variable to a one with the specific type.

Returns
Typed object or NULL if base type does not match
FMILIB_EXPORT fmi2_import_integer_variable_t* fmi2_import_get_variable_as_integer ( fmi2_import_variable_t )

Cast general variable to a one with the specific type.

Returns
Typed object or NULL if base type does not match
FMILIB_EXPORT fmi2_import_enum_variable_t* fmi2_import_get_variable_as_enum ( fmi2_import_variable_t )

Cast general variable to a one with the specific type.

Returns
Typed object or NULL if base type does not match
FMILIB_EXPORT fmi2_import_string_variable_t* fmi2_import_get_variable_as_string ( fmi2_import_variable_t )

Cast general variable to a one with the specific type.

Returns
Typed object or NULL if base type does not match
FMILIB_EXPORT fmi2_import_bool_variable_t* fmi2_import_get_variable_as_boolean ( fmi2_import_variable_t )

Cast general variable to a one with the specific type.

Returns
Typed object or NULL if base type does not match
FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_start ( fmi2_import_real_variable_t v)

Get the variable start attribute.

Returns
The "start" attribute as specified in the XML file or variable nominal value.
FMILIB_EXPORT fmi2_import_real_variable_t* fmi2_import_get_real_variable_derivative_of ( fmi2_import_real_variable_t v)

Get the variable that this is a derivative of, if defined.

Returns
If this variable is a derivative, return the variable that it is a derivative of; NULL otherwise.
FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_real_variable_reinit ( fmi2_import_real_variable_t v)

Get the reinit flag for a real variable.

Returns
True if the real variable may change value at events.
FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_max ( fmi2_import_real_variable_t v)

Get maximum value for the variable.

Returns
Either the value specified in the XML file or DBL_MAX as defined in <float.h>
FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_min ( fmi2_import_real_variable_t v)

Get minimal value for the variable.

Returns
Either the value specified in the XML file or negated DBL_MAX as defined in <float.h>
FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_nominal ( fmi2_import_real_variable_t v)

Get nominal value for the variable.

FMILIB_EXPORT fmi2_import_unit_t* fmi2_import_get_real_variable_unit ( fmi2_import_real_variable_t v)

Get associated "unit" object if any.

FMILIB_EXPORT fmi2_import_display_unit_t* fmi2_import_get_real_variable_display_unit ( fmi2_import_real_variable_t v)

Get associated "display unit" object if any.

FMILIB_EXPORT const char* fmi2_import_get_string_variable_start ( fmi2_import_string_variable_t v)

Get start value for the variable.

FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_boolean_variable_start ( fmi2_import_bool_variable_t v)

Get start value for the variable.

FMILIB_EXPORT int fmi2_import_get_integer_variable_start ( fmi2_import_integer_variable_t v)

Get start value for the variable.

FMILIB_EXPORT int fmi2_import_get_integer_variable_min ( fmi2_import_integer_variable_t v)

Get minimal value for the variable.

FMILIB_EXPORT int fmi2_import_get_integer_variable_max ( fmi2_import_integer_variable_t v)

Get max value for the variable.

FMILIB_EXPORT int fmi2_import_get_enum_variable_start ( fmi2_import_enum_variable_t v)

Get start value for the variable.

FMILIB_EXPORT int fmi2_import_get_enum_variable_min ( fmi2_import_enum_variable_t v)

Get minimal value for the variable.

FMILIB_EXPORT int fmi2_import_get_enum_variable_max ( fmi2_import_enum_variable_t v)

Get max value for the variable.

FMILIB_EXPORT fmi2_variable_alias_kind_enu_t fmi2_import_get_variable_alias_kind ( fmi2_import_variable_t )

Get the variable alias kind.

FMILIB_EXPORT size_t fmi2_import_get_variable_original_order ( fmi2_import_variable_t v)

Get the original index in xml of the variable.