fmi library: part of jmodelica · contents 1 fmi library: part of jmodelica.org1 1.1 summary. . . ....

481
FMI Library: part of JModelica.org Generated by Doxygen 1.8.11

Upload: others

Post on 24-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

FMI Library: part of JModelica.org

Generated by Doxygen 1.8.11

Page 2: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Page 3: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Contents

1 FMI Library: part of JModelica.org 1

1.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Configuring and building . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.3 Automatic tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.4 Using logs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.5 License . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.6 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2 Module Index 7

2.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3 Data Structure Index 9

3.1 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

4 File Index 11

4.1 File List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

5 Module Documentation 15

5.1 FMI import library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

5.2 Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2.2.1 jm_string . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2.2.2 jm_voidp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

Page 4: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

iv CONTENTS

5.2.2.3 jm_name_ID_map_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2.3.1 fmi_version_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2.3.2 jm_status_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

5.2.3.3 jm_log_level_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.2.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.2.4.1 fmi_construct_dll_dir_name(jm_callbacks ∗callbacks, const char ∗fmu_←↩

unzipped_path) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.2.4.2 fmi_construct_dll_file_name(jm_callbacks ∗callbacks, const char ∗dll_dir_name,const char ∗model_identifier) . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

5.2.4.3 fmi_version_to_string(fmi_version_enu_t v) . . . . . . . . . . . . . . . . . . . . 19

5.2.4.4 jm_log_level_to_string(jm_log_level_enu_t level) . . . . . . . . . . . . . . . . . 19

5.3 A basic stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.3.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.3.2.1 jm_stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.3.2.2 jm_stack_alloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

5.3.2.3 jm_stack_free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

5.3.2.4 jm_stack_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

5.3.2.5 jm_stack_free_data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

5.3.2.6 jm_stack_get_size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.3.2.7 jm_stack_reserve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.3.2.8 jm_stack_push . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.3.2.9 jm_stack_is_empty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.3.2.10 jm_stack_pop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

5.3.2.11 jm_stack_top . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.3.2.12 jm_stack_foreach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.3.2.13 JM_STACK_MINIMAL_CAPACITY . . . . . . . . . . . . . . . . . . . . . . . . 23

5.3.2.14 JM_STACK_MAX_MEMORY_CHUNK . . . . . . . . . . . . . . . . . . . . . . 23

5.3.2.15 jm_stack_declare_template . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

5.4 FMI 1.0 import interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Generated by Doxygen

Page 5: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS v

5.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5.5 Handling of variable lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

5.5.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.5.2.1 fmi1_import_variable_filter_function_ft . . . . . . . . . . . . . . . . . . . . . . 26

5.5.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5.5.3.1 fmi1_import_alloc_variable_list(fmi1_import_t ∗fmu, size_t size) . . . . . . . . . 26

5.5.3.2 fmi1_import_free_variable_list(fmi1_import_variable_list_t ∗vl) . . . . . . . . . . 26

5.5.3.3 fmi1_import_clone_variable_list(fmi1_import_variable_list_t ∗vl) . . . . . . . . . 26

5.5.3.4 fmi1_import_get_variable_list_size(fmi1_import_variable_list_t ∗vl) . . . . . . . 26

5.5.3.5 fmi1_import_get_value_referece_list(fmi1_import_variable_list_t ∗vl) . . . . . . 26

5.5.3.6 fmi1_import_get_variable(fmi1_import_variable_list_t ∗vl, unsigned int index) . . 26

5.5.3.7 fmi1_import_get_sublist(fmi1_import_variable_list_t ∗vl, unsigned int fromIndex,unsigned int toIndex) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.5.3.8 fmi1_import_filter_variables(fmi1_import_variable_list_t ∗vl, fmi1_import_←↩

variable_filter_function_ft filter, void ∗context) . . . . . . . . . . . . . . . . . . . 27

5.5.3.9 fmi1_import_join_var_list(fmi1_import_variable_list_t ∗a, fmi1_import_variable←↩

_list_t ∗b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.5.3.10 fmi1_import_append_to_var_list(fmi1_import_variable_list_t ∗vl, fmi1_import_←↩

variable_t ∗v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

5.5.3.11 fmi1_import_prepend_to_var_list(fmi1_import_variable_list_t ∗vl, fmi1_import_←↩

variable_t ∗v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

5.5.3.12 fmi1_import_var_list_push_back(fmi1_import_variable_list_t ∗vl, fmi1_import_←↩

variable_t ∗v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

5.6 FMI 2.0 import interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

5.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

5.7 Handling of variable lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

5.7.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.7.2.1 fmi2_import_variable_filter_function_ft . . . . . . . . . . . . . . . . . . . . . . 31

5.7.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5.7.3.1 fmi2_import_alloc_variable_list(fmi2_import_t ∗fmu, size_t size) . . . . . . . . . 31

5.7.3.2 fmi2_import_free_variable_list(fmi2_import_variable_list_t ∗vl) . . . . . . . . . . 31

Generated by Doxygen

Page 6: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

vi CONTENTS

5.7.3.3 fmi2_import_clone_variable_list(fmi2_import_variable_list_t ∗vl) . . . . . . . . . 31

5.7.3.4 fmi2_import_get_variable_list_size(fmi2_import_variable_list_t ∗vl) . . . . . . . 31

5.7.3.5 fmi2_import_get_value_referece_list(fmi2_import_variable_list_t ∗vl) . . . . . . 31

5.7.3.6 fmi2_import_get_variable(fmi2_import_variable_list_t ∗vl, size_t index) . . . . . 32

5.7.3.7 fmi2_import_get_sublist(fmi2_import_variable_list_t ∗vl, size_t fromIndex, size←↩

_t toIndex) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5.7.3.8 fmi2_import_filter_variables(fmi2_import_variable_list_t ∗vl, fmi2_import_←↩

variable_filter_function_ft filter, void ∗context) . . . . . . . . . . . . . . . . . . . 32

5.7.3.9 fmi2_import_join_var_list(fmi2_import_variable_list_t ∗a, fmi2_import_variable←↩

_list_t ∗b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

5.7.3.10 fmi2_import_append_to_var_list(fmi2_import_variable_list_t ∗vl, fmi2_import_←↩

variable_t ∗v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.7.3.11 fmi2_import_prepend_to_var_list(fmi2_import_variable_list_t ∗vl, fmi2_import_←↩

variable_t ∗v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.7.3.12 fmi2_import_var_list_push_back(fmi2_import_variable_list_t ∗vl, fmi2_import_←↩

variable_t ∗v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

5.8 Functions and types supporting FMI 1.0 processing. . . . . . . . . . . . . . . . . . . . . . . . . . 34

5.8.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.2.1 fmiComponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.2.2 fmiValueReference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.2.3 fmiReal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.2.4 fmiInteger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.2.5 fmiBoolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.2.6 fmiString . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.3.1 fmi1_callback_logger_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.3.2 fmi1_callback_allocate_memory_ft . . . . . . . . . . . . . . . . . . . . . . . . 36

5.8.3.3 fmi1_callback_free_memory_ft . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.8.3.4 fmi1_step_finished_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.8.3.5 fmi1_get_version_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.8.3.6 fmi1_set_debug_logging_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.8.3.7 fmi1_set_real_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

Generated by Doxygen

Page 7: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS vii

5.8.3.8 fmi1_set_integer_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.8.3.9 fmi1_set_boolean_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.8.3.10 fmi1_set_string_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.8.3.11 fmi1_get_real_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

5.8.3.12 fmi1_get_integer_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.13 fmi1_get_boolean_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.14 fmi1_get_string_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.15 fmi1_get_model_typesPlatform_ft . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.16 fmi1_instantiate_model_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.17 fmi1_free_model_instance_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.18 fmi1_set_time_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.19 fmi1_set_continuous_states_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.20 fmi1_completed_integrator_step_ft . . . . . . . . . . . . . . . . . . . . . . . . 38

5.8.3.21 fmi1_initialize_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.22 fmi1_get_derivatives_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.23 fmi1_get_event_indicators_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.24 fmi1_event_update_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.25 fmi1_get_continuous_states_ft . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.26 fmi1_get_nominal_continuousStates_ft . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.27 fmi1_get_state_valueReferences_ft . . . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.28 fmi1_terminate_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.29 fmi1_get_types_platform_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

5.8.3.30 fmi1_instantiate_slave_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.8.3.31 fmi1_initialize_slave_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.8.3.32 fmi1_terminate_slave_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.8.3.33 fmi1_reset_slave_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.8.3.34 fmi1_free_slave_instance_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.8.3.35 fmi1_set_real_inputDerivatives_ft . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.8.3.36 fmi1_get_real_outputDerivatives_ft . . . . . . . . . . . . . . . . . . . . . . . . 40

5.8.3.37 fmi1_cancel_step_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Generated by Doxygen

Page 8: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

viii CONTENTS

5.8.3.38 fmi1_do_step_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

5.8.3.39 fmi1_get_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.8.3.40 fmi1_get_real_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.8.3.41 fmi1_get_integer_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.8.3.42 fmi1_get_boolean_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.8.3.43 fmi1_get_string_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.8.3.44 fmi1_value_reference_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.8.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.8.4.1 fmi1_status_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

5.8.4.2 fmi1_status_kind_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5.8.4.3 fmi1_boolean_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5.8.4.4 fmi1_value_reference_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5.8.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5.8.5.1 fmi1_status_to_string(fmi1_status_t status) . . . . . . . . . . . . . . . . . . . . 42

5.8.5.2 fmi1_get_platform(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42

5.9 Enum types used with FMI 1.0 libs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

5.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.9.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.9.2.1 fmi1_variable_naming_convension_enu_t . . . . . . . . . . . . . . . . . . . . . 44

5.9.2.2 fmi1_fmu_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.9.2.3 fmi1_variability_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.9.2.4 fmi1_causality_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.9.2.5 fmi1_variable_alias_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.9.2.6 fmi1_base_type_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.9.3 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

5.9.3.1 fmi1_variable_naming_convension_enu_t . . . . . . . . . . . . . . . . . . . . . 44

5.9.3.2 fmi1_fmu_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.9.3.3 fmi1_variability_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.9.3.4 fmi1_causality_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5.9.3.5 fmi1_variable_alias_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . 45

Generated by Doxygen

Page 9: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS ix

5.9.3.6 fmi1_base_type_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5.9.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5.9.4.1 fmi1_naming_convention_to_string(fmi1_variable_naming_convension_enu_tconvention) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

5.9.4.2 fmi1_fmu_kind_to_string(fmi1_fmu_kind_enu_t kind) . . . . . . . . . . . . . . . 46

5.9.4.3 fmi1_variability_to_string(fmi1_variability_enu_t v) . . . . . . . . . . . . . . . . 46

5.9.4.4 fmi1_causality_to_string(fmi1_causality_enu_t c) . . . . . . . . . . . . . . . . . 46

5.9.4.5 fmi1_base_type_to_string(fmi1_base_type_enu_t bt) . . . . . . . . . . . . . . . 46

5.10 Functions and types supporting FMI 2.0 processing. . . . . . . . . . . . . . . . . . . . . . . . . . 48

5.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2.1 fmi2Component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2.2 fmi2ComponentEnvironment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2.3 fmi2FMUstate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2.4 fmi2ValueReference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2.5 fmi2Real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2.6 fmi2Integer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2.7 fmi2Boolean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5.10.2.8 fmi2Char . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.2.9 fmi2String . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.2.10 fmi2Byte . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.3.1 fmi2_callback_logger_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.3.2 fmi2_callback_allocate_memory_ft . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.3.3 fmi2_callback_free_memory_ft . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.3.4 fmi2_step_finished_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.3.5 fmi2_get_types_platform_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51

5.10.3.6 fmi2_get_version_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.7 fmi2_set_debug_logging_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.8 fmi2_instantiate_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.9 fmi2_free_instance_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

Generated by Doxygen

Page 10: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

x CONTENTS

5.10.3.10 fmi2_setup_experiment_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.11 fmi2_enter_initialization_mode_ft . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.12 fmi2_exit_initialization_mode_ft . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.13 fmi2_terminate_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.14 fmi2_reset_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.15 fmi2_get_real_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

5.10.3.16 fmi2_get_integer_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.17 fmi2_get_boolean_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.18 fmi2_get_string_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.19 fmi2_set_real_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.20 fmi2_set_integer_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.21 fmi2_set_boolean_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.22 fmi2_set_string_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.23 fmi2_get_fmu_state_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.24 fmi2_set_fmu_state_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

5.10.3.25 fmi2_free_fmu_state_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.26 fmi2_serialized_fmu_state_size_ft . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.27 fmi2_serialize_fmu_state_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.28 fmi2_de_serialize_fmu_state_ft . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.29 fmi2_get_directional_derivative_ft . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.30 fmi2_enter_event_mode_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.31 fmi2_new_discrete_states_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.32 fmi2_enter_continuous_time_mode_ft . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.33 fmi2_completed_integrator_step_ft . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.34 fmi2_set_time_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

5.10.3.35 fmi2_set_continuous_states_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.36 fmi2_get_derivatives_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.37 fmi2_get_event_indicators_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.38 fmi2_get_continuous_states_ft . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.39 fmi2_get_nominals_of_continuous_states_ft . . . . . . . . . . . . . . . . . . . 55

Generated by Doxygen

Page 11: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xi

5.10.3.40 fmi2_set_real_input_derivatives_ft . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.41 fmi2_get_real_output_derivatives_ft . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.42 fmi2_do_step_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.43 fmi2_cancel_step_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.44 fmi2_get_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

5.10.3.45 fmi2_get_real_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.10.3.46 fmi2_get_integer_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.10.3.47 fmi2_get_boolean_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.10.3.48 fmi2_get_string_status_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.10.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.10.4.1 fmi2_status_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.10.4.2 fmi2_type_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

5.10.4.3 fmi2_status_kind_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.10.4.4 fmi2_boolean_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.10.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.10.5.1 fmi2_status_to_string(fmi2_status_t status) . . . . . . . . . . . . . . . . . . . . 57

5.10.5.2 fmi2_get_types_platform(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.11 Enum types used with FMI 2.0 libs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

5.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.11.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.11.2.1 FMI2_ME_CAPABILITIES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.11.2.2 FMI2_CS_CAPABILITIES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.11.2.3 FMI2_SI_BASE_UNITS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

5.11.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.1 fmi2_variable_naming_convension_enu_t . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.2 fmi2_fmu_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.3 fmi2_variability_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.4 fmi2_causality_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.5 fmi2_initial_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.6 fmi2_variable_alias_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . 61

Generated by Doxygen

Page 12: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xii CONTENTS

5.11.3.7 fmi2_base_type_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.8 fmi2_capabilities_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.9 fmi2_SI_base_units_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.3.10 fmi2_dependency_factor_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . 61

5.11.4 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

5.11.4.1 fmi2_variable_naming_convension_enu_t . . . . . . . . . . . . . . . . . . . . . 62

5.11.4.2 fmi2_fmu_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

5.11.4.3 fmi2_variability_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

5.11.4.4 fmi2_causality_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5.11.4.5 fmi2_initial_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5.11.4.6 fmi2_variable_alias_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5.11.4.7 fmi2_base_type_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5.11.4.8 fmi2_capabilities_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

5.11.4.9 fmi2_SI_base_units_enu_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

5.11.4.10 fmi2_dependency_factor_kind_enu_t . . . . . . . . . . . . . . . . . . . . . . . 64

5.11.5 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

5.11.5.1 fmi2_naming_convention_to_string(fmi2_variable_naming_convension_enu_tconvention) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

5.11.5.2 fmi2_fmu_kind_to_string(fmi2_fmu_kind_enu_t kind) . . . . . . . . . . . . . . . 64

5.11.5.3 fmi2_variability_to_string(fmi2_variability_enu_t v) . . . . . . . . . . . . . . . . 65

5.11.5.4 fmi2_causality_to_string(fmi2_causality_enu_t c) . . . . . . . . . . . . . . . . . 65

5.11.5.5 fmi2_initial_to_string(fmi2_initial_enu_t c) . . . . . . . . . . . . . . . . . . . . . 65

5.11.5.6 fmi2_get_default_initial(fmi2_variability_enu_t v, fmi2_causality_enu_t c) . . . . 65

5.11.5.7 fmi2_get_valid_initial(fmi2_variability_enu_t v, fmi2_causality_enu_t c, fmi2_←↩

initial_enu_t i) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65

5.11.5.8 fmi2_base_type_to_string(fmi2_base_type_enu_t bt) . . . . . . . . . . . . . . . 65

5.11.5.9 fmi2_capability_to_string(fmi2_capabilities_enu_t id) . . . . . . . . . . . . . . . 66

5.11.5.10 fmi2_SI_base_unit_to_string(fmi2_SI_base_units_enu_t id) . . . . . . . . . . . 67

5.11.5.11 fmi2_SI_base_unit_exp_to_string(const int exp[fmi2_SI_base_units_Num],size_t bufSize, char buf[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

5.11.5.12 fmi2_dependency_factor_kind_to_string(fmi2_dependency_factor_kind_enu_t fc) 67

5.12 Definition of XML callbacks struct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Generated by Doxygen

Page 13: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xiii

5.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

5.12.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

5.12.2.1 fmi2_xml_callbacks_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

5.12.2.2 fmi2_xml_element_start_handle_ft . . . . . . . . . . . . . . . . . . . . . . . . 69

5.12.2.3 fmi2_xml_element_data_handle_ft . . . . . . . . . . . . . . . . . . . . . . . . 70

5.12.2.4 fmi2_xml_element_end_handle_ft . . . . . . . . . . . . . . . . . . . . . . . . . 70

5.12.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

5.12.3.1 startHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

5.12.3.2 dataHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

5.12.3.3 endHandle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

5.12.3.4 context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71

5.13 Definition of callbacks struct and supporting functions . . . . . . . . . . . . . . . . . . . . . . . . 72

5.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

5.13.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

5.13.2.1 JM_MAX_ERROR_MESSAGE_SIZE . . . . . . . . . . . . . . . . . . . . . . . 73

5.13.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

5.13.3.1 jm_callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73

5.13.3.2 jm_malloc_f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5.13.3.3 jm_realloc_f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5.13.3.4 jm_calloc_f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5.13.3.5 jm_free_f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5.13.3.6 jm_logger_f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5.13.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5.13.4.1 jm_get_last_error(jm_callbacks ∗cb) . . . . . . . . . . . . . . . . . . . . . . . 74

5.13.4.2 jm_clear_last_error(jm_callbacks ∗cb) . . . . . . . . . . . . . . . . . . . . . . . 74

5.13.4.3 jm_set_default_callbacks(jm_callbacks ∗c) . . . . . . . . . . . . . . . . . . . . 74

5.13.4.4 jm_get_default_callbacks(void) . . . . . . . . . . . . . . . . . . . . . . . . . . 75

5.13.4.5 jm_default_logger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_←↩

level, jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

5.13.4.6 jm_log(jm_callbacks ∗cb, const char ∗module, jm_log_level_enu_t log_level,const char ∗fmt,...) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

Generated by Doxygen

Page 14: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xiv CONTENTS

5.13.4.7 jm_log_v(jm_callbacks ∗cb, const char ∗module, jm_log_level_enu_t log_level,const char ∗fmt, va_list ap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75

5.13.4.8 jm_log_fatal_v(jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap) 76

5.13.4.9 jm_log_fatal(jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...) . . . . . 76

5.13.4.10 jm_log_error_v(jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap) 76

5.13.4.11 jm_log_error(jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...) . . . . . 76

5.13.4.12 jm_log_warning_v(jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_listap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

5.13.4.13 jm_log_warning(jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...) . . . 76

5.13.4.14 jm_log_info_v(jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap) 76

5.13.4.15 jm_log_info(jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...) . . . . . 76

5.13.4.16 jm_log_verbose_v(jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_listap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

5.13.4.17 jm_log_verbose(jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...) . . . 76

5.13.4.18 jm_log_debug_v(jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_listap) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

5.13.4.19 jm_log_debug(jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...) . . . . 77

5.14 Named objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

5.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

5.14.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

5.14.2.1 jm_named_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

5.14.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78

5.14.3.1 jm_named_alloc(jm_string name, size_t size, size_t nameoffset, jm_callbacks ∗c) 78

5.14.3.2 jm_named_alloc_v(jm_vector(char)∗name, size_t size, size_t nameoffset, jm_←↩

callbacks ∗c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

5.14.3.3 jm_named_free(jm_named_ptr np, jm_callbacks ∗c) . . . . . . . . . . . . . . . 79

5.14.3.4 jm_vector_declare_template(jm_named_ptr) jm_define_comp_f(jm_compare_←↩

named . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

5.14.3.5 jm_named_vector_free_data(jm_vector(jm_named_ptr)∗v) . . . . . . . . . . . . 79

5.14.3.6 jm_named_vector_free(jm_vector(jm_named_ptr)∗v) . . . . . . . . . . . . . . . 79

5.15 Handling platform specific defines and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

5.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

5.15.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

Generated by Doxygen

Page 15: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xv

5.15.2.1 jm_dll_function_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80

5.15.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

5.15.3.1 jm_portability_load_dll_handle(const char ∗dll_file_path) . . . . . . . . . . . . . 81

5.15.3.2 jm_portability_free_dll_handle(DLL_HANDLE dll_handle) . . . . . . . . . . . . 81

5.15.3.3 jm_portability_load_dll_function(DLL_HANDLE dll_handle, char ∗dll_function_←↩

name, jm_dll_function_ptr ∗dll_function_ptrptr) . . . . . . . . . . . . . . . . . . 81

5.15.3.4 jm_portability_get_last_dll_error(void) . . . . . . . . . . . . . . . . . . . . . . . 81

5.15.3.5 jm_portability_get_current_working_directory(char ∗buffer, size_t len) . . . . . . 81

5.15.3.6 jm_portability_set_current_working_directory(const char ∗cwd) . . . . . . . . . 81

5.15.3.7 jm_get_system_temp_dir() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81

5.15.3.8 jm_mkdtemp(jm_callbacks ∗cb, char ∗tmplt) . . . . . . . . . . . . . . . . . . . 81

5.15.3.9 jm_get_dir_abspath(jm_callbacks ∗cb, const char ∗dir, char ∗outPath, size_t len) 82

5.15.3.10 jm_mk_temp_dir(jm_callbacks ∗cb, const char ∗systemTempDir, const char∗tempPrefix) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

5.15.3.11 jm_create_URL_from_abs_path(jm_callbacks ∗cb, const char ∗absPath) . . . . 82

5.15.3.12 jm_mkdir(jm_callbacks ∗cb, const char ∗dir) . . . . . . . . . . . . . . . . . . . 83

5.15.3.13 jm_rmdir(jm_callbacks ∗cb, const char ∗dir) . . . . . . . . . . . . . . . . . . . . 83

5.15.3.14 jm_vsnprintf(char ∗str, size_t size, const char ∗fmt, va_list al) . . . . . . . . . . 83

5.15.3.15 jm_snprintf(char ∗str, size_t size, const char ∗fmt,...) . . . . . . . . . . . . . . . 83

5.16 A set of strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

5.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

5.16.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

5.16.2.1 jm_string_set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

5.16.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

5.16.3.1 jm_string_set_find(jm_string_set ∗s, jm_string str) . . . . . . . . . . . . . . . . 84

5.16.3.2 jm_string_set_find_index(jm_string_set ∗s, jm_string str) . . . . . . . . . . . . . 84

5.16.3.3 jm_string_set_put(jm_string_set ∗s, jm_string str) . . . . . . . . . . . . . . . . 85

5.17 A vector of items (dynamic array) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

5.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.17.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.17.2.1 jm_mangle_ex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

Generated by Doxygen

Page 16: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xvi CONTENTS

5.17.2.2 jm_mangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.17.2.3 jm_vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.17.2.4 jm_vector_alloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.17.2.5 jm_vector_free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

5.17.2.6 jm_vector_init . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5.17.2.7 jm_vector_free_data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5.17.2.8 jm_vector_get_size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5.17.2.9 jm_vector_get_item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5.17.2.10 jm_vector_get_itemp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5.17.2.11 jm_vector_get_last . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

5.17.2.12 jm_vector_get_lastp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

5.17.2.13 jm_define_comp_f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

5.17.2.14 jm_diff . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

5.17.2.15 jm_vector_find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

5.17.2.16 jm_vector_find_index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

5.17.2.17 jm_vector_qsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

5.17.2.18 jm_vector_bsearch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

5.17.2.19 jm_vector_bsearch_index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

5.17.2.20 jm_vector_set_item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

5.17.2.21 jm_vector_zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

5.17.2.22 jm_vector_resize . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

5.17.2.23 jm_vector_reserve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

5.17.2.24 jm_vector_copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

5.17.2.25 jm_vector_clone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

5.17.2.26 jm_vector_append . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

5.17.2.27 jm_vector_insert . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

5.17.2.28 jm_vector_remove_item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

5.17.2.29 jm_vector_resize1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

5.17.2.30 jm_vector_push_back . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

5.17.2.31 jm_vector_foreach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

Generated by Doxygen

Page 17: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xvii

5.17.2.32 jm_vector_foreach_c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

5.17.2.33 JM_VECTOR_MINIMAL_CAPACITY . . . . . . . . . . . . . . . . . . . . . . . 93

5.17.2.34 JM_VECTOR_MAX_MEMORY_CHUNK . . . . . . . . . . . . . . . . . . . . . 93

5.17.2.35 jm_vector_declare_template . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

5.17.2.36 jm_vector_ptr2index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.3.1 jm_compare_ft . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.1 jm_vector_declare_template(char) static jm_string jm_vector_char2string(jm_←↩

vector(char)∗v) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.2 jm_vector_declare_template(int) jm_vector_declare_template(double) jm_←↩

vector_declare_template(jm_voidp) jm_vector_declare_template(size_t) jm_←↩

vector_declare_template(jm_string) jm_vector_declare_template(jm_name_ID←↩

_map_t) jm_define_comp_f(jm_compare_voidp . . . . . . . . . . . . . . . . . . 94

5.17.4.3 jm_define_comp_f(jm_compare_int, int, jm_diff) jm_define_comp_f(jm_←↩

compare_char . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.4 jm_define_comp_f(jm_compare_double, double, jm_diff) jm_define_comp_f(jm←↩

_compare_size_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.5 jm_define_comp_f(jm_compare_string, jm_string, strcmp) jm_define_comp_←↩

f(jm_compare_name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.6 jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗jm_vector_alloc(JM_TEMPLA←↩

TE_INSTANCE_TYPE)(size_t size . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.7 if(c) cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.8 if(reserve< size) reserve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.9 if(reserve > JM_VECTOR_MINIMAL_CAPACITY) . . . . . . . . . . . . . . . . 94

5.17.4.10 if("!v) return 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.11 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

5.17.4.12 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a, size_t initSize, jm_callbacks ∗c) . . . . . . . . . . . . . . . . . . . . 95

5.17.4.13 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a, size_t size) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

5.17.4.14 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗destination, jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗source) . . 95

5.17.4.15 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a, size_t index, JM_TEMPLATE_INSTANCE_TYPE item) . . . . . . . . 95

Generated by Doxygen

Page 18: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xviii CONTENTS

5.17.4.16 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a, JM_TEMPLATE_INSTANCE_TYPE item) . . . . . . . . . . . . . . . 95

5.17.4.17 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a, void(∗f)(JM_TEMPLATE_INSTANCE_TYPE, void ∗), void ∗data) . . . 95

5.17.4.18 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a, void(∗f)(JM_TEMPLATE_INSTANCE_TYPE)) . . . . . . . . . . . . . 95

5.17.4.19 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗v, jm_compare_ft f) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95

5.17.4.20 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗v, JM_TEMPLATE_INSTANCE_TYPE ∗itemp) . . . . . . . . . . . . . . 95

5.17.4.21 JM_TEMPLATE_INSTANCE_TYPE(jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗v, JM_TEMPLATE_INSTANCE_TYPE ∗key, jm_compare_ft f) . . . . . . 96

5.17.5 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.17.5.1 char . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.17.5.2 size_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.17.5.3 jm_name_ID_map_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.17.5.4 jm_diff_name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.17.5.5 capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.17.5.6 c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.17.5.7 cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

5.17.5.8 reserve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

5.17.5.9 else . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

5.17.5.10 callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

5.17.5.11 items . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

5.17.5.12 size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

5.17.5.13 v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97

5.18 Library initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

5.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

5.18.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

5.18.2.1 FMI_IMPORT_NAME_CHECK . . . . . . . . . . . . . . . . . . . . . . . . . . 99

5.18.3 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

5.18.3.1 fmi_import_context_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

5.18.3.2 fmi1_import_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

Generated by Doxygen

Page 19: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xix

5.18.3.3 fmi2_import_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

5.18.4 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99

5.18.4.1 fmi_import_allocate_context(jm_callbacks ∗callbacks) . . . . . . . . . . . . . . 99

5.18.4.2 fmi_import_free_context(fmi_import_context_t ∗c) . . . . . . . . . . . . . . . . 100

5.18.4.3 fmi_import_set_configuration(fmi_import_context_t ∗c, int conf) . . . . . . . . . 100

5.18.4.4 fmi_import_get_fmi_version(fmi_import_context_t ∗c, const char ∗fileName,const char ∗dirName) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

5.18.4.5 fmi1_import_parse_xml(fmi_import_context_t ∗c, const char ∗dirName) . . . . . 100

5.18.4.6 fmi2_import_parse_xml(fmi_import_context_t ∗context, const char ∗dirPath,fmi2_xml_callbacks_t ∗xml_callbacks) . . . . . . . . . . . . . . . . . . . . . . 100

5.19 Utility functions supporting interactions with the library . . . . . . . . . . . . . . . . . . . . . . . . 102

5.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

5.19.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

5.19.2.1 fmi_import_mk_temp_dir(jm_callbacks ∗cb, const char ∗systemTempDir, constchar ∗tempPrefix) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

5.19.2.2 fmi_import_rmdir(jm_callbacks ∗cb, const char ∗dir) . . . . . . . . . . . . . . . 102

5.19.2.3 fmi_import_create_URL_from_abs_path(jm_callbacks ∗cb, const char ∗absPath) 103

5.19.2.4 fmi_import_get_dll_path(const char ∗fmu_unzipped_path, const char ∗model_←↩

identifier, jm_callbacks ∗callBackFunctions) . . . . . . . . . . . . . . . . . . . . 103

5.19.2.5 fmi_import_get_model_description_path(const char ∗fmu_unzipped_path, jm_←↩

callbacks ∗callBackFunctions) . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

5.20 Constuction, destruction and error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

5.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

5.20.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104

5.20.2.1 fmi1_import_parse_xml(fmi_import_context_t ∗context, const char ∗dirPath) . . 104

5.20.2.2 fmi1_import_get_last_error(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . 104

5.20.2.3 fmi1_import_clear_last_error(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . 105

5.20.2.4 fmi1_import_free(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . . . 105

5.21 General information retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

5.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

5.21.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107

5.21.2.1 fmi1_import_get_model_name(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . 107

5.21.2.2 fmi1_import_get_model_identifier(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . 107

Generated by Doxygen

Page 20: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xx CONTENTS

5.21.2.3 fmi1_import_get_GUID(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . 107

5.21.2.4 fmi1_import_get_description(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . 108

5.21.2.5 fmi1_import_get_author(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . 108

5.21.2.6 fmi1_import_get_model_version(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . 108

5.21.2.7 fmi1_import_get_model_standard_version(fmi1_import_t ∗fmu) . . . . . . . . . 108

5.21.2.8 fmi1_import_get_generation_tool(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . 108

5.21.2.9 fmi1_import_get_generation_date_and_time(fmi1_import_t ∗fmu) . . . . . . . . 108

5.21.2.10 fmi1_import_get_naming_convention(fmi1_import_t ∗fmu) . . . . . . . . . . . . 109

5.21.2.11 fmi1_import_get_number_of_continuous_states(fmi1_import_t ∗fmu) . . . . . . 109

5.21.2.12 fmi1_import_get_number_of_event_indicators(fmi1_import_t ∗fmu) . . . . . . . 109

5.21.2.13 fmi1_import_get_default_experiment_start(fmi1_import_t ∗fmu) . . . . . . . . . 109

5.21.2.14 fmi1_import_get_default_experiment_stop(fmi1_import_t ∗fmu) . . . . . . . . . 109

5.21.2.15 fmi1_import_get_default_experiment_tolerance(fmi1_import_t ∗fmu) . . . . . . . 109

5.21.2.16 fmi1_import_get_fmu_kind(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . 109

5.21.2.17 fmi1_import_get_capabilities(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . 110

5.21.2.18 fmi1_import_get_type_definitions(fmi1_import_t ∗) . . . . . . . . . . . . . . . . 110

5.21.2.19 fmi1_import_get_unit_definitions(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . 110

5.21.2.20 fmi1_import_get_direct_dependency(fmi1_import_t ∗fmu, fmi1_import_←↩

variable_t ∗) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

5.21.2.21 fmi1_import_get_variable_alias_base(fmi1_import_t ∗fmu, fmi1_import_←↩

variable_t ∗) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

5.21.2.22 fmi1_import_get_variable_aliases(fmi1_import_t ∗fmu, fmi1_import_variable_t ∗) 110

5.21.2.23 fmi1_import_get_variable_list(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . 110

5.21.2.24 fmi1_import_get_variable_list_alphabetical_order(fmi1_import_t ∗fmu) . . . . . 111

5.21.2.25 fmi1_import_create_var_list(fmi1_import_t ∗fmu, fmi1_import_variable_t ∗v) . . 111

5.22 Interface to the standard FMI 1.0 "C" API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

5.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

5.23 Functions to retrieve capability flags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

5.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

5.23.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

5.23.2.1 fmi1_import_capabilities_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

Generated by Doxygen

Page 21: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxi

5.23.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

5.23.3.1 fmi1_import_get_canHandleVariableCommunicationStepSize(fmi1_import_←↩

capabilities_t ∗) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

5.23.3.2 fmi1_import_get_canHandleEvents(fmi1_import_capabilities_t ∗) . . . . . . . . 114

5.23.3.3 fmi1_import_get_canRejectSteps(fmi1_import_capabilities_t ∗) . . . . . . . . . 114

5.23.3.4 fmi1_import_get_canInterpolateInputs(fmi1_import_capabilities_t ∗) . . . . . . . 114

5.23.3.5 fmi1_import_get_maxOutputDerivativeOrder(fmi1_import_capabilities_t ∗) . . . 114

5.23.3.6 fmi1_import_get_canRunAsynchronuously(fmi1_import_capabilities_t ∗) . . . . 114

5.23.3.7 fmi1_import_get_canSignalEvents(fmi1_import_capabilities_t ∗) . . . . . . . . . 114

5.23.3.8 fmi1_import_get_canBeInstantiatedOnlyOncePerProcess(fmi1_import_←↩

capabilities_t ∗) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

5.23.3.9 fmi1_import_get_canNotUseMemoryManagementFunctions(fmi1_import_←↩

capabilities_t ∗) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114

5.24 FMI 1.0 Constructor and Destructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

5.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

5.24.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115

5.24.2.1 fmi1_import_create_dllfmu(fmi1_import_t ∗fmu, fmi1_callback_functions_t call←↩

BackFunctions, int registerGlobally) . . . . . . . . . . . . . . . . . . . . . . . . 115

5.24.2.2 fmi1_import_destroy_dllfmu(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . 115

5.24.2.3 fmi1_import_set_debug_mode(fmi1_import_t ∗fmu, int mode) . . . . . . . . . . 116

5.25 FMI 1.0 (ME) Model Exchange functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

5.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117

5.25.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

5.25.2.1 fmi1_import_get_model_types_platform(fmi1_import_t ∗fmu) . . . . . . . . . . 118

5.25.2.2 fmi1_import_instantiate_model(fmi1_import_t ∗fmu, fmi1_string_t instanceName) 119

5.25.2.3 fmi1_import_free_model_instance(fmi1_import_t ∗fmu) . . . . . . . . . . . . . 119

5.25.2.4 fmi1_import_set_time(fmi1_import_t ∗fmu, fmi1_real_t time) . . . . . . . . . . . 119

5.25.2.5 fmi1_import_set_continuous_states(fmi1_import_t ∗fmu, const fmi1_real_t x[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

5.25.2.6 fmi1_import_completed_integrator_step(fmi1_import_t ∗fmu, fmi1_boolean_t∗callEventUpdate) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120

5.25.2.7 fmi1_import_initialize(fmi1_import_t ∗fmu, fmi1_boolean_t toleranceControlled,fmi1_real_t relativeTolerance, fmi1_event_info_t ∗eventInfo) . . . . . . . . . . . 120

Generated by Doxygen

Page 22: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxii CONTENTS

5.25.2.8 fmi1_import_get_derivatives(fmi1_import_t ∗fmu, fmi1_real_t derivatives[], size←↩

_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

5.25.2.9 fmi1_import_get_event_indicators(fmi1_import_t ∗fmu, fmi1_real_t event←↩

Indicators[], size_t ni) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

5.25.2.10 fmi1_import_eventUpdate(fmi1_import_t ∗fmu, fmi1_boolean_t intermediate←↩

Results, fmi1_event_info_t ∗eventInfo) . . . . . . . . . . . . . . . . . . . . . . 121

5.25.2.11 fmi1_import_get_continuous_states(fmi1_import_t ∗fmu, fmi1_real_t states[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

5.25.2.12 fmi1_import_get_nominal_continuous_states(fmi1_import_t ∗fmu, fmi1_real_←↩

t x_nominal[], size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

5.25.2.13 fmi1_import_get_state_value_references(fmi1_import_t ∗fmu, fmi1_value_←↩

reference_t vrx[], size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122

5.25.2.14 fmi1_import_terminate(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . 123

5.26 FMI 1.0 (CS) Co-Simulation functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

5.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124

5.26.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

5.26.2.1 fmi1_import_get_types_platform(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . 125

5.26.2.2 fmi1_import_instantiate_slave(fmi1_import_t ∗fmu, fmi1_string_t instanceName,fmi1_string_t fmuLocation, fmi1_string_t mimeType, fmi1_real_t timeout, fmi1_←↩

boolean_t visible, fmi1_boolean_t interactive) . . . . . . . . . . . . . . . . . . . 125

5.26.2.3 fmi1_import_initialize_slave(fmi1_import_t ∗fmu, fmi1_real_t tStart, fmi1_←↩

boolean_t StopTimeDefined, fmi1_real_t tStop) . . . . . . . . . . . . . . . . . . 125

5.26.2.4 fmi1_import_terminate_slave(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . 126

5.26.2.5 fmi1_import_reset_slave(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . 126

5.26.2.6 fmi1_import_free_slave_instance(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . 126

5.26.2.7 fmi1_import_set_real_input_derivatives(fmi1_import_t ∗fmu, const fmi1_value←↩

_reference_t vr[], size_t nvr, const fmi1_integer_t order[], const fmi1_real_t value[]) 126

5.26.2.8 fmi1_import_get_real_output_derivatives(fmi1_import_t ∗fmu, const fmi1_←↩

value_reference_t vr[], size_t nvr, const fmi1_integer_t order[], fmi1_real_t value[]) 127

5.26.2.9 fmi1_import_cancel_step(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . 127

5.26.2.10 fmi1_import_do_step(fmi1_import_t ∗fmu, fmi1_real_t currentCommunication←↩

Point, fmi1_real_t communicationStepSize, fmi1_boolean_t newStep) . . . . . . 128

5.26.2.11 fmi1_import_get_status(fmi1_import_t ∗fmu, const fmi1_status_kind_t s, fmi1_←↩

status_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

5.26.2.12 fmi1_import_get_real_status(fmi1_import_t ∗fmu, const fmi1_status_kind_t s,fmi1_real_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128

Generated by Doxygen

Page 23: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxiii

5.26.2.13 fmi1_import_get_integer_status(fmi1_import_t ∗fmu, const fmi1_status_kind_t s,fmi1_integer_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

5.26.2.14 fmi1_import_get_boolean_status(fmi1_import_t ∗fmu, const fmi1_status_kind_←↩

t s, fmi1_boolean_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

5.26.2.15 fmi1_import_get_string_status(fmi1_import_t ∗fmu, const fmi1_status_kind_t s,fmi1_string_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129

5.27 FMI 1.0 (ME & CS) Common functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

5.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

5.27.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

5.27.2.1 fmi1_import_get_version(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . 131

5.27.2.2 fmi1_import_set_debug_logging(fmi1_import_t ∗fmu, fmi1_boolean_t loggingOn) 132

5.27.2.3 fmi1_import_set_real(fmi1_import_t ∗fmu, const fmi1_value_reference_t vr[],size_t nvr, const fmi1_real_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . 132

5.27.2.4 fmi1_import_set_integer(fmi1_import_t ∗fmu, const fmi1_value_reference_t vr[],size_t nvr, const fmi1_integer_t value[]) . . . . . . . . . . . . . . . . . . . . . . 132

5.27.2.5 fmi1_import_set_boolean(fmi1_import_t ∗fmu, const fmi1_value_reference_t vr[],size_t nvr, const fmi1_boolean_t value[]) . . . . . . . . . . . . . . . . . . . . . 133

5.27.2.6 fmi1_import_set_string(fmi1_import_t ∗fmu, const fmi1_value_reference_t vr[],size_t nvr, const fmi1_string_t value[]) . . . . . . . . . . . . . . . . . . . . . . . 133

5.27.2.7 fmi1_import_get_real(fmi1_import_t ∗fmu, const fmi1_value_reference_t vr[],size_t nvr, fmi1_real_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . 134

5.27.2.8 fmi1_import_get_integer(fmi1_import_t ∗fmu, const fmi1_value_reference_t vr[],size_t nvr, fmi1_integer_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . . 134

5.27.2.9 fmi1_import_get_boolean(fmi1_import_t ∗fmu, const fmi1_value_reference_t vr[],size_t nvr, fmi1_boolean_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . . 134

5.27.2.10 fmi1_import_get_string(fmi1_import_t ∗fmu, const fmi1_value_reference_t vr[],size_t nvr, fmi1_string_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . 135

5.28 Convenience functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

5.28.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

5.28.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

5.28.2.1 fmi1_import_collect_model_counts(fmi1_import_t ∗fmu, fmi1_import_model_←↩

counts_t ∗counts) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136

5.28.2.2 fmi1_import_expand_variable_references(fmi1_import_t ∗fmu, const char∗msgIn, char ∗msgOut, size_t maxMsgSize) . . . . . . . . . . . . . . . . . . . 137

5.28.2.3 fmi1_log_forwarding(fmi1_component_t c, fmi1_string_t instanceName, fmi1_←↩

status_t status, fmi1_string_t category, fmi1_string_t message,...) . . . . . . . . 137

Generated by Doxygen

Page 24: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxiv CONTENTS

5.28.2.4 fmi1_log_forwarding_v(fmi1_component_t c, fmi1_string_t instanceName, fmi1←↩

_status_t status, fmi1_string_t category, fmi1_string_t message, va_list args) . . 137

5.28.2.5 fmi1_default_callback_logger(fmi1_component_t c, fmi1_string_t instanceName,fmi1_status_t status, fmi1_string_t category, fmi1_string_t message,...) . . . . . 137

5.28.2.6 fmi1_import_init_logger(jm_callbacks ∗cb, fmi1_callback_functions_t ∗fmi←↩

Callbacks) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137

5.29 Functions to retrieve co-simulation related information. . . . . . . . . . . . . . . . . . . . . . . . . 139

5.29.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

5.29.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139

5.29.2.1 fmi1_import_get_entry_point(fmi1_import_t ∗) . . . . . . . . . . . . . . . . . . 139

5.29.2.2 fmi1_import_get_mime_type(fmi1_import_t ∗) . . . . . . . . . . . . . . . . . . 139

5.29.2.3 fmi1_import_get_manual_start(fmi1_import_t ∗) . . . . . . . . . . . . . . . . . 139

5.29.2.4 fmi1_import_get_number_of_additional_models(fmi1_import_t ∗fmu) . . . . . . 139

5.29.2.5 fmi1_import_get_additional_model_name(fmi1_import_t ∗fmu, size_t index) . . . 139

5.30 Support for processing variable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140

5.30.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

5.30.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

5.30.2.1 fmi1_import_real_typedef_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

5.30.2.2 fmi1_import_integer_typedef_t . . . . . . . . . . . . . . . . . . . . . . . . . . 141

5.30.2.3 fmi1_import_enumeration_typedef_t . . . . . . . . . . . . . . . . . . . . . . . 141

5.30.2.4 fmi1_import_variable_typedef_t . . . . . . . . . . . . . . . . . . . . . . . . . . 141

5.30.2.5 fmi1_import_type_definitions_t . . . . . . . . . . . . . . . . . . . . . . . . . . 141

5.30.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

5.30.3.1 fmi1_import_get_type_definition_number(fmi1_import_type_definitions_t ∗td) . . 141

5.30.3.2 fmi1_import_get_typedef(fmi1_import_type_definitions_t ∗td, unsigned int index) 141

5.30.3.3 fmi1_import_get_type_display_unit(fmi1_import_real_typedef_t ∗) . . . . . . . . 142

5.30.3.4 fmi1_import_get_type_name(fmi1_import_variable_typedef_t ∗) . . . . . . . . . 142

5.30.3.5 fmi1_import_get_type_description(fmi1_import_variable_typedef_t ∗) . . . . . . 142

5.30.3.6 fmi1_import_get_base_type(fmi1_import_variable_typedef_t ∗) . . . . . . . . . 142

5.30.3.7 fmi1_import_get_type_as_real(fmi1_import_variable_typedef_t ∗) . . . . . . . . 142

5.30.3.8 fmi1_import_get_type_as_int(fmi1_import_variable_typedef_t ∗) . . . . . . . . . 143

5.30.3.9 fmi1_import_get_type_as_enum(fmi1_import_variable_typedef_t ∗) . . . . . . . 143

Generated by Doxygen

Page 25: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxv

5.30.3.10 fmi1_import_get_type_quantity(fmi1_import_variable_typedef_t ∗) . . . . . . . . 143

5.30.3.11 fmi1_import_get_real_type_min(fmi1_import_real_typedef_t ∗) . . . . . . . . . 143

5.30.3.12 fmi1_import_get_real_type_max(fmi1_import_real_typedef_t ∗) . . . . . . . . . 143

5.30.3.13 fmi1_import_get_real_type_nominal(fmi1_import_real_typedef_t ∗) . . . . . . . 143

5.30.3.14 fmi1_import_get_real_type_unit(fmi1_import_real_typedef_t ∗) . . . . . . . . . 144

5.30.3.15 fmi1_import_get_real_type_is_relative_quantity(fmi1_import_real_typedef_t ∗) . 144

5.30.3.16 fmi1_import_get_integer_type_min(fmi1_import_integer_typedef_t ∗) . . . . . . 144

5.30.3.17 fmi1_import_get_integer_type_max(fmi1_import_integer_typedef_t ∗) . . . . . . 144

5.30.3.18 fmi1_import_get_enum_type_min(fmi1_import_enumeration_typedef_t ∗) . . . . 144

5.30.3.19 fmi1_import_get_enum_type_max(fmi1_import_enumeration_typedef_t ∗) . . . . 144

5.30.3.20 fmi1_import_get_enum_type_size(fmi1_import_enumeration_typedef_t ∗) . . . . 144

5.30.3.21 fmi1_import_get_enum_type_item_name(fmi1_import_enumeration_typedef_t ∗,unsigned int item) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

5.30.3.22 fmi1_import_get_enum_type_item_description(fmi1_import_enumeration_←↩

typedef_t ∗, unsigned int item) . . . . . . . . . . . . . . . . . . . . . . . . . . . 144

5.31 Functions for handling unit definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

5.31.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

5.31.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

5.31.2.1 fmi1_import_unit_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145

5.31.2.2 fmi1_import_display_unit_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

5.31.2.3 fmi1_import_unit_definitions_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

5.31.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146

5.31.3.1 fmi1_import_get_unit_definitions_number(fmi1_import_unit_definitions_t ∗) . . . 146

5.31.3.2 fmi1_import_get_unit(fmi1_import_unit_definitions_t ∗, unsigned int index) . . . 146

5.31.3.3 fmi1_import_get_unit_name(fmi1_import_unit_t ∗) . . . . . . . . . . . . . . . . 146

5.31.3.4 fmi1_import_get_unit_display_unit_number(fmi1_import_unit_t ∗) . . . . . . . . 146

5.31.3.5 fmi1_import_get_unit_display_unit(fmi1_import_unit_t ∗, size_t index) . . . . . . 146

5.31.3.6 fmi1_import_get_base_unit(fmi1_import_display_unit_t ∗) . . . . . . . . . . . . 147

5.31.3.7 fmi1_import_get_display_unit_name(fmi1_import_display_unit_t ∗) . . . . . . . 147

5.31.3.8 fmi1_import_get_display_unit_gain(fmi1_import_display_unit_t ∗) . . . . . . . . 147

5.31.3.9 fmi1_import_get_display_unit_offset(fmi1_import_display_unit_t ∗) . . . . . . . 147

Generated by Doxygen

Page 26: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxvi CONTENTS

5.31.3.10 fmi1_import_convert_to_display_unit(fmi1_real_t value, fmi1_import_display_←↩

unit_t ∗du, int isRelativeQuantity) . . . . . . . . . . . . . . . . . . . . . . . . . 147

5.31.3.11 fmi1_import_convert_from_display_unit(fmi1_real_t value, fmi1_import_display←↩

_unit_t ∗du, int isRelativeQuantity) . . . . . . . . . . . . . . . . . . . . . . . . 147

5.32 Functions for handling variable definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148

5.32.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.32.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.32.2.1 fmi1_import_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.32.2.2 fmi1_import_real_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.32.2.3 fmi1_import_integer_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.32.2.4 fmi1_import_string_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.32.2.5 fmi1_import_enum_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.32.2.6 fmi1_import_bool_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

5.32.2.7 fmi1_import_variable_list_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

5.32.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

5.32.3.1 fmi1_import_get_variable_by_name(fmi1_import_t ∗fmu, const char ∗name) . . 151

5.32.3.2 fmi1_import_get_variable_by_vr(fmi1_import_t ∗fmu, fmi1_base_type_enu_tbaseType, fmi1_value_reference_t vr) . . . . . . . . . . . . . . . . . . . . . . . 152

5.32.3.3 fmi1_import_get_variable_name(fmi1_import_variable_t ∗) . . . . . . . . . . . . 152

5.32.3.4 fmi1_import_get_variable_description(fmi1_import_variable_t ∗) . . . . . . . . . 152

5.32.3.5 fmi1_import_get_variable_vr(fmi1_import_variable_t ∗) . . . . . . . . . . . . . . 152

5.32.3.6 fmi1_import_get_variable_declared_type(fmi1_import_variable_t ∗) . . . . . . . 152

5.32.3.7 fmi1_import_get_variable_base_type(fmi1_import_variable_t ∗) . . . . . . . . . 153

5.32.3.8 fmi1_import_get_variable_has_start(fmi1_import_variable_t ∗) . . . . . . . . . . 153

5.32.3.9 fmi1_import_get_variable_is_fixed(fmi1_import_variable_t ∗) . . . . . . . . . . . 153

5.32.3.10 fmi1_import_get_variability(fmi1_import_variable_t ∗) . . . . . . . . . . . . . . 153

5.32.3.11 fmi1_import_get_causality(fmi1_import_variable_t ∗) . . . . . . . . . . . . . . . 153

5.32.3.12 fmi1_import_get_variable_as_real(fmi1_import_variable_t ∗) . . . . . . . . . . . 153

5.32.3.13 fmi1_import_get_variable_as_integer(fmi1_import_variable_t ∗) . . . . . . . . . 153

5.32.3.14 fmi1_import_get_variable_as_enum(fmi1_import_variable_t ∗) . . . . . . . . . . 153

5.32.3.15 fmi1_import_get_variable_as_string(fmi1_import_variable_t ∗) . . . . . . . . . . 154

5.32.3.16 fmi1_import_get_variable_as_boolean(fmi1_import_variable_t ∗) . . . . . . . . 154

Generated by Doxygen

Page 27: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxvii

5.32.3.17 fmi1_import_get_real_variable_start(fmi1_import_real_variable_t ∗v) . . . . . . 154

5.32.3.18 fmi1_import_get_real_variable_max(fmi1_import_real_variable_t ∗v) . . . . . . 154

5.32.3.19 fmi1_import_get_real_variable_min(fmi1_import_real_variable_t ∗v) . . . . . . . 154

5.32.3.20 fmi1_import_get_real_variable_nominal(fmi1_import_real_variable_t ∗v) . . . . 154

5.32.3.21 fmi1_import_get_real_variable_unit(fmi1_import_real_variable_t ∗v) . . . . . . . 155

5.32.3.22 fmi1_import_get_real_variable_display_unit(fmi1_import_real_variable_t ∗v) . . 155

5.32.3.23 fmi1_import_get_string_variable_start(fmi1_import_string_variable_t ∗v) . . . . 155

5.32.3.24 fmi1_import_get_boolean_variable_start(fmi1_import_bool_variable_t ∗v) . . . . 155

5.32.3.25 fmi1_import_get_integer_variable_start(fmi1_import_integer_variable_t ∗v) . . . 155

5.32.3.26 fmi1_import_get_integer_variable_min(fmi1_import_integer_variable_t ∗v) . . . 155

5.32.3.27 fmi1_import_get_integer_variable_max(fmi1_import_integer_variable_t ∗v) . . . 155

5.32.3.28 fmi1_import_get_enum_variable_start(fmi1_import_enum_variable_t ∗v) . . . . 155

5.32.3.29 fmi1_import_get_enum_variable_min(fmi1_import_enum_variable_t ∗v) . . . . . 155

5.32.3.30 fmi1_import_get_enum_variable_max(fmi1_import_enum_variable_t ∗v) . . . . 155

5.32.3.31 fmi1_import_get_variable_alias_kind(fmi1_import_variable_t ∗) . . . . . . . . . 155

5.32.3.32 fmi1_import_get_variable_original_order(fmi1_import_variable_t ∗v) . . . . . . . 155

5.33 Basic support for vendor annotations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

5.33.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

5.33.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

5.33.2.1 fmi1_import_vendor_list_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

5.33.2.2 fmi1_import_vendor_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

5.33.2.3 fmi1_import_annotation_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

5.33.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157

5.33.3.1 fmi1_import_get_number_of_vendors(fmi1_import_vendor_list_t ∗) . . . . . . . 157

5.33.3.2 fmi1_import_get_vendor(fmi1_import_vendor_list_t ∗, unsigned int index) . . . . 157

5.33.3.3 fmi1_import_get_vendor_name(fmi1_import_vendor_t ∗) . . . . . . . . . . . . . 157

5.33.3.4 fmi1_import_get_number_of_vendor_annotations(fmi1_import_vendor_t ∗) . . . 157

5.33.3.5 fmi1_import_get_vendor_annotation(fmi1_import_vendor_t ∗, unsigned int index) 157

5.33.3.6 fmi1_import_get_annotation_name(fmi1_import_annotation_t ∗) . . . . . . . . . 157

5.33.3.7 fmi1_import_get_annotation_value(fmi1_import_annotation_t ∗) . . . . . . . . . 157

Generated by Doxygen

Page 28: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxviii CONTENTS

5.33.3.8 fmi1_import_get_vendor_list(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . 157

5.34 Constuction, destruction and error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

5.34.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

5.34.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

5.34.2.1 fmi2_import_get_last_error(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . 158

5.34.2.2 fmi2_import_clear_last_error(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . 158

5.34.2.3 fmi2_import_free(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . . . 159

5.35 General information retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

5.35.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

5.35.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

5.35.2.1 fmi2_import_get_model_name(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . 162

5.35.2.2 fmi2_import_get_capability(fmi2_import_t ∗, fmi2_capabilities_enu_t id) . . . . . 162

5.35.2.3 fmi2_import_get_model_identifier_ME(fmi2_import_t ∗fmu) . . . . . . . . . . . 162

5.35.2.4 fmi2_import_get_model_identifier_CS(fmi2_import_t ∗fmu) . . . . . . . . . . . 162

5.35.2.5 fmi2_import_get_GUID(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . 163

5.35.2.6 fmi2_import_get_description(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . 163

5.35.2.7 fmi2_import_get_author(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . 163

5.35.2.8 fmi2_import_get_copyright(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . 163

5.35.2.9 fmi2_import_get_license(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . 163

5.35.2.10 fmi2_import_get_model_version(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . 163

5.35.2.11 fmi2_import_get_model_standard_version(fmi2_import_t ∗fmu) . . . . . . . . . 164

5.35.2.12 fmi2_import_get_generation_tool(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . 164

5.35.2.13 fmi2_import_get_generation_date_and_time(fmi2_import_t ∗fmu) . . . . . . . . 164

5.35.2.14 fmi2_import_get_naming_convention(fmi2_import_t ∗fmu) . . . . . . . . . . . . 164

5.35.2.15 fmi2_import_get_number_of_continuous_states(fmi2_import_t ∗fmu) . . . . . . 164

5.35.2.16 fmi2_import_get_number_of_event_indicators(fmi2_import_t ∗fmu) . . . . . . . 165

5.35.2.17 fmi2_import_get_default_experiment_start(fmi2_import_t ∗fmu) . . . . . . . . . 165

5.35.2.18 fmi2_import_get_default_experiment_stop(fmi2_import_t ∗fmu) . . . . . . . . . 165

5.35.2.19 fmi2_import_get_default_experiment_tolerance(fmi2_import_t ∗fmu) . . . . . . . 165

5.35.2.20 fmi2_import_get_default_experiment_step(fmi2_import_t ∗fmu) . . . . . . . . . 165

Generated by Doxygen

Page 29: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxix

5.35.2.21 fmi2_import_get_fmu_kind(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . 165

5.35.2.22 fmi2_import_get_type_definitions(fmi2_import_t ∗) . . . . . . . . . . . . . . . . 165

5.35.2.23 fmi2_import_get_unit_definitions(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . 165

5.35.2.24 fmi2_import_get_variable_alias_base(fmi2_import_t ∗fmu, fmi2_import_←↩

variable_t ∗) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165

5.35.2.25 fmi2_import_get_variable_aliases(fmi2_import_t ∗fmu, fmi2_import_variable_t ∗) 165

5.35.2.26 fmi2_import_get_variable_list(fmi2_import_t ∗fmu, int sortOrder) . . . . . . . . . 165

5.35.2.27 fmi2_import_create_var_list(fmi2_import_t ∗fmu, fmi2_import_variable_t ∗v) . . 166

5.35.2.28 fmi2_import_get_vendors_num(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . 166

5.35.2.29 fmi2_import_get_vendor_name(fmi2_import_t ∗fmu, size_t index) . . . . . . . . 166

5.35.2.30 fmi2_import_get_log_categories_num(fmi2_import_t ∗fmu) . . . . . . . . . . . 166

5.35.2.31 fmi2_import_get_log_category(fmi2_import_t ∗fmu, size_t index) . . . . . . . . 166

5.35.2.32 fmi2_import_get_log_category_description(fmi2_import_t ∗fmu, size_t index) . . 166

5.35.2.33 fmi2_import_get_source_files_me_num(fmi2_import_t ∗fmu) . . . . . . . . . . . 167

5.35.2.34 fmi2_import_get_source_file_me(fmi2_import_t ∗fmu, size_t index) . . . . . . . 167

5.35.2.35 fmi2_import_get_source_files_cs_num(fmi2_import_t ∗fmu) . . . . . . . . . . . 167

5.35.2.36 fmi2_import_get_source_file_cs(fmi2_import_t ∗fmu, size_t index) . . . . . . . . 167

5.35.2.37 fmi2_import_get_variable_by_name(fmi2_import_t ∗fmu, const char ∗name) . . 167

5.35.2.38 fmi2_import_get_variable_by_vr(fmi2_import_t ∗fmu, fmi2_base_type_enu_tbaseType, fmi2_value_reference_t vr) . . . . . . . . . . . . . . . . . . . . . . . 167

5.35.2.39 fmi2_import_get_outputs_list(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . 168

5.35.2.40 fmi2_import_get_derivatives_list(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . 168

5.35.2.41 fmi2_import_get_discrete_states_list(fmi2_import_t ∗fmu) . . . . . . . . . . . . 168

5.35.2.42 fmi2_import_get_initial_unknowns_list(fmi2_import_t ∗fmu) . . . . . . . . . . . 168

5.35.2.43 fmi2_import_get_outputs_dependencies(fmi2_import_t ∗fmu, size_t ∗∗start←↩

Index, size_t ∗∗dependency, char ∗∗factorKind) . . . . . . . . . . . . . . . . . . 169

5.35.2.44 fmi2_import_get_derivatives_dependencies(fmi2_import_t ∗fmu, size_t ∗∗start←↩

Index, size_t ∗∗dependency, char ∗∗factorKind) . . . . . . . . . . . . . . . . . . 169

5.35.2.45 fmi2_import_get_discrete_states_dependencies(fmi2_import_t ∗fmu, size_←↩

t ∗∗startIndex, size_t ∗∗dependency, char ∗∗factorKind) . . . . . . . . . . . . . 169

5.35.2.46 fmi2_import_get_initial_unknowns_dependencies(fmi2_import_t ∗fmu, size_t∗∗startIndex, size_t ∗∗dependency, char ∗∗factorKind) . . . . . . . . . . . . . . 170

5.36 Interface to the standard FMI 2.0 "C" API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

Generated by Doxygen

Page 30: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxx CONTENTS

5.36.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

5.37 FMI 2.0 Constructor and Destructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

5.37.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

5.37.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

5.37.2.1 fmi2_import_create_dllfmu(fmi2_import_t ∗fmu, fmi2_fmu_kind_enu_t fmuKind,const fmi2_callback_functions_t ∗callBackFunctions) . . . . . . . . . . . . . . . 172

5.37.2.2 fmi2_import_destroy_dllfmu(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . 172

5.37.2.3 fmi2_import_set_debug_mode(fmi2_import_t ∗fmu, int mode) . . . . . . . . . . 173

5.38 FMI 2.0 (ME) Model Exchange functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

5.38.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

5.38.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174

5.38.2.1 fmi2_import_enter_event_mode(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . 174

5.38.2.2 fmi2_import_new_discrete_states(fmi2_import_t ∗fmu, fmi2_event_info_←↩

t ∗eventInfo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175

5.38.2.3 fmi2_import_enter_continuous_time_mode(fmi2_import_t ∗fmu) . . . . . . . . . 175

5.38.2.4 fmi2_import_set_time(fmi2_import_t ∗fmu, fmi2_real_t time) . . . . . . . . . . . 175

5.38.2.5 fmi2_import_set_continuous_states(fmi2_import_t ∗fmu, const fmi2_real_t x[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

5.38.2.6 fmi2_import_completed_integrator_step(fmi2_import_t ∗fmu, fmi2_boolean_tnoSetFMUStatePriorToCurrentPoint, fmi2_boolean_t ∗enterEventMode, fmi2_←↩

boolean_t ∗terminateSimulation) . . . . . . . . . . . . . . . . . . . . . . . . . 176

5.38.2.7 fmi2_import_get_derivatives(fmi2_import_t ∗fmu, fmi2_real_t derivatives[], size←↩

_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

5.38.2.8 fmi2_import_get_event_indicators(fmi2_import_t ∗fmu, fmi2_real_t event←↩

Indicators[], size_t ni) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

5.38.2.9 fmi2_import_get_continuous_states(fmi2_import_t ∗fmu, fmi2_real_t states[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

5.38.2.10 fmi2_import_get_nominals_of_continuous_states(fmi2_import_t ∗fmu, fmi2_←↩

real_t x_nominal[], size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . 177

5.39 FMI 2.0 (CS) Co-Simulation functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

5.39.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

5.39.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

5.39.2.1 fmi2_import_set_real_input_derivatives(fmi2_import_t ∗fmu, const fmi2_value←↩

_reference_t vr[], size_t nvr, const fmi2_integer_t order[], const fmi2_real_t value[]) 179

Generated by Doxygen

Page 31: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxxi

5.39.2.2 fmi2_import_get_real_output_derivatives(fmi2_import_t ∗fmu, const fmi2_←↩

value_reference_t vr[], size_t nvr, const fmi2_integer_t order[], fmi2_real_t value[]) 180

5.39.2.3 fmi2_import_cancel_step(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . 180

5.39.2.4 fmi2_import_do_step(fmi2_import_t ∗fmu, fmi2_real_t currentCommunication←↩

Point, fmi2_real_t communicationStepSize, fmi2_boolean_t newStep) . . . . . . 180

5.39.2.5 fmi2_import_get_status(fmi2_import_t ∗fmu, const fmi2_status_kind_t s, fmi2_←↩

status_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

5.39.2.6 fmi2_import_get_real_status(fmi2_import_t ∗fmu, const fmi2_status_kind_t s,fmi2_real_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

5.39.2.7 fmi2_import_get_integer_status(fmi2_import_t ∗fmu, const fmi2_status_kind_t s,fmi2_integer_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181

5.39.2.8 fmi2_import_get_boolean_status(fmi2_import_t ∗fmu, const fmi2_status_kind_←↩

t s, fmi2_boolean_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

5.39.2.9 fmi2_import_get_string_status(fmi2_import_t ∗fmu, const fmi2_status_kind_t s,fmi2_string_t ∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

5.40 FMI 2.0 (ME & CS) Common functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

5.40.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

5.40.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

5.40.2.1 fmi2_import_get_version(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . 184

5.40.2.2 fmi2_import_set_debug_logging(fmi2_import_t ∗fmu, fmi2_boolean_t loggingOn,size_t nCategories, fmi2_string_t categories[]) . . . . . . . . . . . . . . . . . . 184

5.40.2.3 fmi2_import_instantiate(fmi2_import_t ∗fmu, fmi2_string_t instanceName, fmi2←↩

_type_t fmuType, fmi2_string_t fmuResourceLocation, fmi2_boolean_t visible) . 185

5.40.2.4 fmi2_import_free_instance(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . 185

5.40.2.5 fmi2_import_setup_experiment(fmi2_import_t ∗fmu, fmi2_boolean_t tolerance←↩

Defined, fmi2_real_t tolerance, fmi2_real_t startTime, fmi2_boolean_t stop←↩

TimeDefined, fmi2_real_t stopTime) . . . . . . . . . . . . . . . . . . . . . . . . 185

5.40.2.6 fmi2_import_enter_initialization_mode(fmi2_import_t ∗fmu) . . . . . . . . . . . 186

5.40.2.7 fmi2_import_exit_initialization_mode(fmi2_import_t ∗fmu) . . . . . . . . . . . . 186

5.40.2.8 fmi2_import_terminate(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . 186

5.40.2.9 fmi2_import_reset(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . . 187

5.40.2.10 fmi2_import_set_real(fmi2_import_t ∗fmu, const fmi2_value_reference_t vr[],size_t nvr, const fmi2_real_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . 187

5.40.2.11 fmi2_import_set_integer(fmi2_import_t ∗fmu, const fmi2_value_reference_t vr[],size_t nvr, const fmi2_integer_t value[]) . . . . . . . . . . . . . . . . . . . . . . 187

5.40.2.12 fmi2_import_set_boolean(fmi2_import_t ∗fmu, const fmi2_value_reference_t vr[],size_t nvr, const fmi2_boolean_t value[]) . . . . . . . . . . . . . . . . . . . . . 188

Generated by Doxygen

Page 32: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxxii CONTENTS

5.40.2.13 fmi2_import_set_string(fmi2_import_t ∗fmu, const fmi2_value_reference_t vr[],size_t nvr, const fmi2_string_t value[]) . . . . . . . . . . . . . . . . . . . . . . . 188

5.40.2.14 fmi2_import_get_real(fmi2_import_t ∗fmu, const fmi2_value_reference_t vr[],size_t nvr, fmi2_real_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

5.40.2.15 fmi2_import_get_integer(fmi2_import_t ∗fmu, const fmi2_value_reference_t vr[],size_t nvr, fmi2_integer_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . . 189

5.40.2.16 fmi2_import_get_boolean(fmi2_import_t ∗fmu, const fmi2_value_reference_t vr[],size_t nvr, fmi2_boolean_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . . 189

5.40.2.17 fmi2_import_get_string(fmi2_import_t ∗fmu, const fmi2_value_reference_t vr[],size_t nvr, fmi2_string_t value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . 190

5.40.2.18 fmi2_import_get_types_platform(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . 190

5.40.2.19 fmi2_import_get_fmu_state(fmi2_import_t ∗fmu, fmi2_FMU_state_t ∗s) . . . . . 190

5.40.2.20 fmi2_import_set_fmu_state(fmi2_import_t ∗fmu, fmi2_FMU_state_t s) . . . . . . 191

5.40.2.21 fmi2_import_free_fmu_state(fmi2_import_t ∗fmu, fmi2_FMU_state_t ∗s) . . . . . 191

5.40.2.22 fmi2_import_serialized_fmu_state_size(fmi2_import_t ∗fmu, fmi2_FMU_state_←↩

t s, size_t ∗sz) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191

5.40.2.23 fmi2_import_serialize_fmu_state(fmi2_import_t ∗fmu, fmi2_FMU_state_t s,fmi2_byte_t data[], size_t sz) . . . . . . . . . . . . . . . . . . . . . . . . . . . 192

5.40.2.24 fmi2_import_de_serialize_fmu_state(fmi2_import_t ∗fmu, const fmi2_byte_←↩

t data[], size_t sz, fmi2_FMU_state_t ∗s) . . . . . . . . . . . . . . . . . . . . . 192

5.40.2.25 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[]) . . . . . . . . . . . . . . . . . . . . . . 192

5.41 Convenience functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

5.41.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

5.41.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

5.41.2.1 fmi2_import_collect_model_counts(fmi2_import_t ∗fmu, fmi2_import_model_←↩

counts_t ∗counts) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

5.41.2.2 fmi2_import_expand_variable_references(fmi2_import_t ∗fmu, const char∗msgIn, char ∗msgOut, size_t maxMsgSize) . . . . . . . . . . . . . . . . . . . 195

5.41.2.3 fmi2_log_forwarding(fmi2_component_t c, fmi2_string_t instanceName, fmi2_←↩

status_t status, fmi2_string_t category, fmi2_string_t message,...) . . . . . . . . 195

5.41.2.4 fmi2_log_forwarding_v(fmi2_component_t c, fmi2_string_t instanceName, fmi2←↩

_status_t status, fmi2_string_t category, fmi2_string_t message, va_list args) . . 195

5.41.2.5 fmi2_default_callback_logger(fmi2_component_t c, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...) . . . . . 195

5.41.2.6 fmi2_import_init_logger(jm_callbacks ∗cb, fmi2_callback_functions_t ∗fmi←↩

Callbacks) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195

Generated by Doxygen

Page 33: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxxiii

5.42 Support for processing variable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197

5.42.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

5.42.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

5.42.2.1 fmi2_import_real_typedef_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198

5.42.2.2 fmi2_import_integer_typedef_t . . . . . . . . . . . . . . . . . . . . . . . . . . 198

5.42.2.3 fmi2_import_enumeration_typedef_t . . . . . . . . . . . . . . . . . . . . . . . 198

5.42.2.4 fmi2_import_variable_typedef_t . . . . . . . . . . . . . . . . . . . . . . . . . . 199

5.42.2.5 fmi2_import_type_definitions_t . . . . . . . . . . . . . . . . . . . . . . . . . . 199

5.42.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199

5.42.3.1 fmi2_import_get_type_definition_number(fmi2_import_type_definitions_t ∗td) . . 199

5.42.3.2 fmi2_import_get_typedef(fmi2_import_type_definitions_t ∗td, unsigned int index) 199

5.42.3.3 fmi2_import_get_type_display_unit(fmi2_import_real_typedef_t ∗) . . . . . . . . 199

5.42.3.4 fmi2_import_get_type_name(fmi2_import_variable_typedef_t ∗) . . . . . . . . . 200

5.42.3.5 fmi2_import_get_type_description(fmi2_import_variable_typedef_t ∗) . . . . . . 200

5.42.3.6 fmi2_import_get_base_type(fmi2_import_variable_typedef_t ∗) . . . . . . . . . 200

5.42.3.7 fmi2_import_get_type_as_real(fmi2_import_variable_typedef_t ∗) . . . . . . . . 200

5.42.3.8 fmi2_import_get_type_as_int(fmi2_import_variable_typedef_t ∗) . . . . . . . . . 200

5.42.3.9 fmi2_import_get_type_as_enum(fmi2_import_variable_typedef_t ∗) . . . . . . . 200

5.42.3.10 fmi2_import_get_type_quantity(fmi2_import_variable_typedef_t ∗) . . . . . . . . 201

5.42.3.11 fmi2_import_get_real_type_min(fmi2_import_real_typedef_t ∗) . . . . . . . . . 201

5.42.3.12 fmi2_import_get_real_type_max(fmi2_import_real_typedef_t ∗) . . . . . . . . . 201

5.42.3.13 fmi2_import_get_real_type_nominal(fmi2_import_real_typedef_t ∗) . . . . . . . 201

5.42.3.14 fmi2_import_get_real_type_unit(fmi2_import_real_typedef_t ∗) . . . . . . . . . 201

5.42.3.15 fmi2_import_get_real_type_is_relative_quantity(fmi2_import_real_typedef_t ∗) . 201

5.42.3.16 fmi2_import_get_real_type_is_unbounded(fmi2_import_real_typedef_t ∗) . . . . 201

5.42.3.17 fmi2_import_get_integer_type_min(fmi2_import_integer_typedef_t ∗) . . . . . . 202

5.42.3.18 fmi2_import_get_integer_type_max(fmi2_import_integer_typedef_t ∗) . . . . . . 202

5.42.3.19 fmi2_import_get_enum_type_min(fmi2_import_enumeration_typedef_t ∗) . . . . 202

5.42.3.20 fmi2_import_get_enum_type_max(fmi2_import_enumeration_typedef_t ∗) . . . . 202

5.42.3.21 fmi2_import_get_enum_type_size(fmi2_import_enumeration_typedef_t ∗) . . . . 202

Generated by Doxygen

Page 34: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxxiv CONTENTS

5.42.3.22 fmi2_import_get_enum_type_item_name(fmi2_import_enumeration_typedef_t ∗,unsigned int item) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202

5.42.3.23 fmi2_import_get_enum_type_item_value(fmi2_import_enumeration_typedef_t ∗,unsigned int item) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

5.42.3.24 fmi2_import_get_enum_type_item_description(fmi2_import_enumeration_←↩

typedef_t ∗, unsigned int item) . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

5.42.3.25 fmi2_import_get_enum_type_value_name(fmi2_import_enumeration_typedef←↩

_t ∗t, int value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203

5.43 Functions for handling unit definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204

5.43.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

5.43.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

5.43.2.1 fmi2_import_unit_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

5.43.2.2 fmi2_import_display_unit_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

5.43.2.3 fmi2_import_unit_definitions_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

5.43.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

5.43.3.1 fmi2_import_get_unit_definitions_number(fmi2_import_unit_definitions_t ∗) . . . 205

5.43.3.2 fmi2_import_get_unit(fmi2_import_unit_definitions_t ∗, unsigned int index) . . . 205

5.43.3.3 fmi2_import_get_unit_name(fmi2_import_unit_t ∗) . . . . . . . . . . . . . . . . 205

5.43.3.4 fmi2_import_get_unit_display_unit_number(fmi2_import_unit_t ∗) . . . . . . . . 205

5.43.3.5 fmi2_import_get_SI_unit_exponents(fmi2_import_unit_t ∗) . . . . . . . . . . . . 206

5.43.3.6 fmi2_import_get_SI_unit_factor(fmi2_import_unit_t ∗) . . . . . . . . . . . . . . 206

5.43.3.7 fmi2_import_get_SI_unit_offset(fmi2_import_unit_t ∗) . . . . . . . . . . . . . . 206

5.43.3.8 fmi2_import_convert_to_SI_base_unit(double, fmi2_import_unit_t ∗) . . . . . . . 206

5.43.3.9 fmi2_import_convert_from_SI_base_unit(double, fmi2_import_unit_t ∗) . . . . . 206

5.43.3.10 fmi2_import_get_unit_display_unit(fmi2_import_unit_t ∗, size_t index) . . . . . . 206

5.43.3.11 fmi2_import_get_base_unit(fmi2_import_display_unit_t ∗) . . . . . . . . . . . . 206

5.43.3.12 fmi2_import_get_display_unit_name(fmi2_import_display_unit_t ∗) . . . . . . . 206

5.43.3.13 fmi2_import_get_display_unit_factor(fmi2_import_display_unit_t ∗) . . . . . . . 206

5.43.3.14 fmi2_import_get_display_unit_offset(fmi2_import_display_unit_t ∗) . . . . . . . 207

5.43.3.15 fmi2_import_convert_to_display_unit(fmi2_real_t value, fmi2_import_display_←↩

unit_t ∗du, int isRelativeQuantity) . . . . . . . . . . . . . . . . . . . . . . . . . 207

5.43.3.16 fmi2_import_convert_from_display_unit(fmi2_real_t value, fmi2_import_display←↩

_unit_t ∗du, int isRelativeQuantity) . . . . . . . . . . . . . . . . . . . . . . . . 207

Generated by Doxygen

Page 35: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxxv

5.44 Functions for handling variable definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

5.44.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

5.44.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

5.44.2.1 fmi2_import_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

5.44.2.2 fmi2_import_real_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

5.44.2.3 fmi2_import_integer_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . 210

5.44.2.4 fmi2_import_string_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

5.44.2.5 fmi2_import_enum_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

5.44.2.6 fmi2_import_bool_variable_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210

5.44.2.7 fmi2_import_variable_list_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

5.44.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

5.44.3.1 fmi2_import_get_variable_name(fmi2_import_variable_t ∗) . . . . . . . . . . . . 211

5.44.3.2 fmi2_import_get_variable_description(fmi2_import_variable_t ∗) . . . . . . . . . 211

5.44.3.3 fmi2_import_get_variable_vr(fmi2_import_variable_t ∗) . . . . . . . . . . . . . . 211

5.44.3.4 fmi2_import_get_variable_declared_type(fmi2_import_variable_t ∗) . . . . . . . 211

5.44.3.5 fmi2_import_get_variable_base_type(fmi2_import_variable_t ∗) . . . . . . . . . 211

5.44.3.6 fmi2_import_get_variable_has_start(fmi2_import_variable_t ∗) . . . . . . . . . . 211

5.44.3.7 fmi2_import_get_variability(fmi2_import_variable_t ∗) . . . . . . . . . . . . . . 212

5.44.3.8 fmi2_import_get_causality(fmi2_import_variable_t ∗) . . . . . . . . . . . . . . . 212

5.44.3.9 fmi2_import_get_initial(fmi2_import_variable_t ∗) . . . . . . . . . . . . . . . . . 212

5.44.3.10 fmi2_import_get_previous(fmi2_import_variable_t ∗v) . . . . . . . . . . . . . . 212

5.44.3.11 fmi2_import_get_canHandleMultipleSetPerTimeInstant(fmi2_import_variable_t ∗v) 212

5.44.3.12 fmi2_import_get_variable_as_real(fmi2_import_variable_t ∗) . . . . . . . . . . . 212

5.44.3.13 fmi2_import_get_variable_as_integer(fmi2_import_variable_t ∗) . . . . . . . . . 212

5.44.3.14 fmi2_import_get_variable_as_enum(fmi2_import_variable_t ∗) . . . . . . . . . . 213

5.44.3.15 fmi2_import_get_variable_as_string(fmi2_import_variable_t ∗) . . . . . . . . . . 213

5.44.3.16 fmi2_import_get_variable_as_boolean(fmi2_import_variable_t ∗) . . . . . . . . 213

5.44.3.17 fmi2_import_get_real_variable_start(fmi2_import_real_variable_t ∗v) . . . . . . 213

5.44.3.18 fmi2_import_get_real_variable_derivative_of(fmi2_import_real_variable_t ∗v) . . 213

5.44.3.19 fmi2_import_get_real_variable_reinit(fmi2_import_real_variable_t ∗v) . . . . . . 214

Generated by Doxygen

Page 36: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxxvi CONTENTS

5.44.3.20 fmi2_import_get_real_variable_max(fmi2_import_real_variable_t ∗v) . . . . . . 214

5.44.3.21 fmi2_import_get_real_variable_min(fmi2_import_real_variable_t ∗v) . . . . . . . 214

5.44.3.22 fmi2_import_get_real_variable_nominal(fmi2_import_real_variable_t ∗v) . . . . 214

5.44.3.23 fmi2_import_get_real_variable_unit(fmi2_import_real_variable_t ∗v) . . . . . . . 214

5.44.3.24 fmi2_import_get_real_variable_display_unit(fmi2_import_real_variable_t ∗v) . . 214

5.44.3.25 fmi2_import_get_string_variable_start(fmi2_import_string_variable_t ∗v) . . . . 214

5.44.3.26 fmi2_import_get_boolean_variable_start(fmi2_import_bool_variable_t ∗v) . . . . 215

5.44.3.27 fmi2_import_get_integer_variable_start(fmi2_import_integer_variable_t ∗v) . . . 215

5.44.3.28 fmi2_import_get_integer_variable_min(fmi2_import_integer_variable_t ∗v) . . . 215

5.44.3.29 fmi2_import_get_integer_variable_max(fmi2_import_integer_variable_t ∗v) . . . 215

5.44.3.30 fmi2_import_get_enum_variable_start(fmi2_import_enum_variable_t ∗v) . . . . 215

5.44.3.31 fmi2_import_get_enum_variable_min(fmi2_import_enum_variable_t ∗v) . . . . . 215

5.44.3.32 fmi2_import_get_enum_variable_max(fmi2_import_enum_variable_t ∗v) . . . . 215

5.44.3.33 fmi2_import_get_variable_alias_kind(fmi2_import_variable_t ∗) . . . . . . . . . 215

5.44.3.34 fmi2_import_get_variable_original_order(fmi2_import_variable_t ∗v) . . . . . . . 215

6 Data Structure Documentation 217

6.1 component_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217

6.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

6.1.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

6.1.2.1 states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

6.1.2.2 states_nom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

6.1.2.3 states_vr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

6.1.2.4 states_der . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

6.1.2.5 event_indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218

6.1.2.6 reals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.7 integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.8 booleans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.9 strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.10 loggingOn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.11 instanceName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

Generated by Doxygen

Page 37: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxxvii

6.1.2.12 GUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.13 functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.14 fmitime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.15 callEventUpdate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

6.1.2.16 toleranceControlled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.17 relativeTolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.18 eventInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.19 states_prev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.20 fmuLocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.21 mimeType . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.22 timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.23 visible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.24 interactive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.25 tStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

6.1.2.26 StopTimeDefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.27 tStop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.28 input_real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.29 output_real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.30 states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.31 states_nom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.32 states_der . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.33 event_indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.34 reals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.35 integers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

6.1.2.36 booleans . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.37 strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.38 loggingOn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.39 functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.40 fmitime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.41 toleranceControlled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

Generated by Doxygen

Page 38: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xxxviii CONTENTS

6.1.2.42 relativeTolerance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.43 eventInfo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.44 states_prev . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.45 visible . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222

6.1.2.46 tStart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

6.1.2.47 StopTimeDefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

6.1.2.48 tStop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

6.1.2.49 input_real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

6.1.2.50 output_real . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

6.2 fmi1_callback_functions_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

6.2.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

6.2.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

6.2.2.1 logger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

6.2.2.2 allocateMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

6.2.2.3 freeMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

6.2.2.4 stepFinished . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

6.3 fmi1_event_info_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

6.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

6.3.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

6.3.2.1 iterationConverged . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

6.3.2.2 stateValueReferencesChanged . . . . . . . . . . . . . . . . . . . . . . . . . . 225

6.3.2.3 stateValuesChanged . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

6.3.2.4 terminateSimulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

6.3.2.5 upcomingTimeEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

6.3.2.6 nextEventTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

6.4 fmi1_import_model_counts_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

6.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

6.4.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

6.4.2.1 num_constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

6.4.2.2 num_parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226

Generated by Doxygen

Page 39: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xxxix

6.4.2.3 num_discrete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

6.4.2.4 num_continuous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

6.4.2.5 num_inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

6.4.2.6 num_outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

6.4.2.7 num_internal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

6.4.2.8 num_causality_none . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

6.4.2.9 num_real_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

6.4.2.10 num_integer_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227

6.4.2.11 num_enum_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

6.4.2.12 num_bool_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

6.4.2.13 num_string_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

6.5 fmi1_me_callback_functions_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

6.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

6.5.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

6.5.2.1 logger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228

6.5.2.2 allocateMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6.5.2.3 freeMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6.6 fmi2_callback_functions_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6.6.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6.6.2.1 logger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6.6.2.2 allocateMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6.6.2.3 freeMemory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

6.6.2.4 stepFinished . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

6.6.2.5 componentEnvironment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

6.7 fmi2_event_info_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

6.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

6.7.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

6.7.2.1 newDiscreteStatesNeeded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

6.7.2.2 terminateSimulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

Generated by Doxygen

Page 40: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xl CONTENTS

6.7.2.3 nominalsOfContinuousStatesChanged . . . . . . . . . . . . . . . . . . . . . . 230

6.7.2.4 valuesOfContinuousStatesChanged . . . . . . . . . . . . . . . . . . . . . . . . 231

6.7.2.5 nextEventTimeDefined . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

6.7.2.6 nextEventTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

6.8 fmi2_import_model_counts_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

6.8.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

6.8.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

6.8.2.1 num_constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

6.8.2.2 num_fixed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

6.8.2.3 num_tunable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

6.8.2.4 num_discrete . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232

6.8.2.5 num_continuous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6.8.2.6 num_parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6.8.2.7 num_calculated_parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6.8.2.8 num_inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6.8.2.9 num_outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6.8.2.10 num_local . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6.8.2.11 num_independent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6.8.2.12 num_real_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233

6.8.2.13 num_integer_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

6.8.2.14 num_enum_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

6.8.2.15 num_bool_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

6.8.2.16 num_string_vars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

6.9 fmi2_xml_callbacks_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

6.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

6.10 fmul_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

6.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

6.10.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

6.10.2.1 fmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

6.10.2.2 context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

Generated by Doxygen

Page 41: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xli

6.10.2.3 callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

6.10.2.4 callBackFunctions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235

6.11 jm_callbacks Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

6.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

6.11.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

6.11.2.1 malloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

6.11.2.2 calloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

6.11.2.3 realloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

6.11.2.4 free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

6.11.2.5 logger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

6.11.2.6 log_level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

6.11.2.7 context . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

6.11.2.8 errMessageBuffer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

6.12 jm_name_ID_map_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237

6.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

6.12.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

6.12.2.1 name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

6.12.2.2 ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

6.13 jm_named_ptr Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

6.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238

6.13.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

6.13.2.1 ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

6.13.2.2 name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

6.14 xml_test_files_t Struct Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

6.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

6.14.2 Field Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

6.14.2.1 filename . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

6.14.2.2 performTest . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

6.14.2.3 fcn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

Generated by Doxygen

Page 42: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xlii CONTENTS

7 File Documentation 241

7.1 src/Import/include/FMI/fmi_import_context.h File Reference . . . . . . . . . . . . . . . . . . . . . 241

7.1.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242

7.2 src/Import/include/FMI/fmi_import_util.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 242

7.3 src/Import/include/FMI1/fmi1_import.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 243

7.3.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

7.4 src/Import/include/FMI1/fmi1_import_capabilities.h File Reference . . . . . . . . . . . . . . . . . . 244

7.4.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245

7.5 src/Import/include/FMI1/fmi1_import_capi.h File Reference . . . . . . . . . . . . . . . . . . . . . 245

7.5.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

7.6 src/Import/include/FMI1/fmi1_import_convenience.h File Reference . . . . . . . . . . . . . . . . . 248

7.6.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

7.7 src/Import/include/FMI1/fmi1_import_cosim.h File Reference . . . . . . . . . . . . . . . . . . . . 249

7.7.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

7.8 src/Import/include/FMI1/fmi1_import_type.h File Reference . . . . . . . . . . . . . . . . . . . . . 249

7.8.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251

7.9 src/Import/include/FMI1/fmi1_import_unit.h File Reference . . . . . . . . . . . . . . . . . . . . . . 251

7.9.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252

7.10 src/Import/include/FMI1/fmi1_import_variable.h File Reference . . . . . . . . . . . . . . . . . . . 252

7.10.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254

7.11 src/Import/include/FMI1/fmi1_import_variable_list.h File Reference . . . . . . . . . . . . . . . . . 254

7.11.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255

7.12 src/Import/include/FMI1/fmi1_import_vendor_annotations.h File Reference . . . . . . . . . . . . . 255

7.12.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256

7.13 src/Import/include/FMI2/fmi2_import.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 256

7.13.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258

7.14 src/Import/include/FMI2/fmi2_import_capi.h File Reference . . . . . . . . . . . . . . . . . . . . . 258

7.14.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

7.15 src/Import/include/FMI2/fmi2_import_convenience.h File Reference . . . . . . . . . . . . . . . . . 261

7.15.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262

Generated by Doxygen

Page 43: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xliii

7.16 src/Import/include/FMI2/fmi2_import_type.h File Reference . . . . . . . . . . . . . . . . . . . . . 262

7.16.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264

7.17 src/Import/include/FMI2/fmi2_import_unit.h File Reference . . . . . . . . . . . . . . . . . . . . . . 264

7.17.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265

7.18 src/Import/include/FMI2/fmi2_import_variable.h File Reference . . . . . . . . . . . . . . . . . . . 265

7.18.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267

7.19 src/Import/include/FMI2/fmi2_import_variable_list.h File Reference . . . . . . . . . . . . . . . . . 267

7.19.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268

7.20 src/Util/include/FMI/fmi_util.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268

7.20.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269

7.21 src/Util/include/FMI/fmi_version.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 269

7.21.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269

7.22 src/Util/include/FMI1/fmi1_enums.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 269

7.22.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271

7.23 src/Util/include/FMI1/fmi1_functions.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 271

7.23.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272

7.24 src/Util/include/FMI1/fmi1_types.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 273

7.24.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273

7.25 src/Util/include/FMI2/fmi2_enums.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 273

7.25.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

7.25.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

7.25.2.1 FMI2_EXPAND_ME_CAPABILITIES_ENU . . . . . . . . . . . . . . . . . . . . 275

7.25.2.2 FMI2_EXPAND_CS_CAPABILITIES_ENU . . . . . . . . . . . . . . . . . . . . 276

7.25.2.3 FMI2_EXPAND_SI_BASE_UNIT_ENU . . . . . . . . . . . . . . . . . . . . . . 276

7.26 src/Util/include/FMI2/fmi2_functions.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 276

7.26.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278

7.27 src/Util/include/FMI2/fmi2_types.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 278

7.27.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278

7.28 src/Util/include/FMI2/fmi2_xml_callbacks.h File Reference . . . . . . . . . . . . . . . . . . . . . . 278

7.28.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279

Generated by Doxygen

Page 44: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xliv CONTENTS

7.29 src/Util/include/JM/jm_callbacks.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 279

7.29.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281

7.30 src/Util/include/JM/jm_named_ptr.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 281

7.30.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

7.30.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

7.30.2.1 jm_diff_named . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

7.31 src/Util/include/JM/jm_portability.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 282

7.31.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

7.31.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

7.31.2.1 DLL_HANDLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

7.32 src/Util/include/JM/jm_stack.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

7.33 src/Util/include/JM/jm_string_set.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 284

7.33.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284

7.34 src/Util/include/JM/jm_types.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284

7.34.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

7.35 src/Util/include/JM/jm_vector.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285

7.35.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

7.35.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

7.35.2.1 jm_diff_name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287

7.36 src/Util/include/JM/jm_vector_template.h File Reference . . . . . . . . . . . . . . . . . . . . . . . 287

7.36.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288

7.37 Test/compress_test_fmu_zip.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288

7.37.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

7.37.1.1 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

7.37.1.2 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

7.38 Test/FMI1/compress_test_fmu_zip.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . 289

7.38.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

7.38.1.1 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

7.38.1.2 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

Generated by Doxygen

Page 45: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xlv

7.39 Test/FMI1/fmi1_capi_cs_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290

7.39.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291

7.39.1.1 MODEL_IDENTIFIER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291

7.39.1.2 INSTANCE_NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

7.39.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

7.39.2.1 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

7.39.2.2 fmilogger(fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t sta-tus, fmi1_string_t category, fmi1_string_t message,...) . . . . . . . . . . . . . . 292

7.39.2.3 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

7.39.2.4 test_create_dllfmu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

7.39.2.5 test_load_dll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

7.39.2.6 test_load_dll_fcn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

7.39.2.7 test_fmi_get_version() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292

7.39.2.8 test_get_types_platform() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

7.39.2.9 test_instantiate_slave() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

7.39.2.10 test_initialize_slave() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

7.39.2.11 test_set_debug_logging() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

7.39.2.12 test_cancel_step() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

7.39.2.13 test_do_step() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

7.39.2.14 test_get_status() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

7.39.2.15 test_get_real_status() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

7.39.2.16 test_get_integer_status() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

7.39.2.17 test_get_boolean_status() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

7.39.2.18 test_get_string_status() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

7.39.2.19 test_set_get_string() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

7.39.2.20 test_set_get_integer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

7.39.2.21 test_set_get_boolean() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

7.39.2.22 test_set_get_real() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294

7.39.2.23 test_reset_slave() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

7.39.2.24 test_set_real_input_derivatives() . . . . . . . . . . . . . . . . . . . . . . . . . 295

Generated by Doxygen

Page 46: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xlvi CONTENTS

7.39.2.25 test_get_real_output_derivatives() . . . . . . . . . . . . . . . . . . . . . . . . . 295

7.39.2.26 test_terminate_slave() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

7.39.2.27 test_free_slave_instance() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

7.39.2.28 test_free_dll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

7.39.2.29 test_destroy_dllfmu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295

7.39.2.30 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

7.39.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

7.39.3.1 fmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

7.39.3.2 callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

7.40 Test/FMI1/fmi1_capi_me_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

7.40.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

7.40.1.1 MODEL_IDENTIFIER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

7.40.1.2 INSTANCE_NAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

7.40.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

7.40.2.1 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

7.40.2.2 fmilogger(fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t sta-tus, fmi1_string_t category, fmi1_string_t message,...) . . . . . . . . . . . . . . 298

7.40.2.3 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

7.40.2.4 test_create_dllfmu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299

7.40.2.5 test_load_dll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299

7.40.2.6 test_load_dll_fcn() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299

7.40.2.7 test_fmi_get_version() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299

7.40.2.8 test_fmi_get_model_types_platform() . . . . . . . . . . . . . . . . . . . . . . . 299

7.40.2.9 test_instantiate_model() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299

7.40.2.10 test_fmi_set_time() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299

7.40.2.11 test_set_continuous_states() . . . . . . . . . . . . . . . . . . . . . . . . . . . 299

7.40.2.12 test_initialize() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

7.40.2.13 test_completed_integrator_step() . . . . . . . . . . . . . . . . . . . . . . . . . 300

7.40.2.14 test_get_derivatives() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

7.40.2.15 test_get_event_indicators() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

Generated by Doxygen

Page 47: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xlvii

7.40.2.16 test_event_update() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

7.40.2.17 test_get_continuous_states() . . . . . . . . . . . . . . . . . . . . . . . . . . . 300

7.40.2.18 test_get_nominal_continuous_states() . . . . . . . . . . . . . . . . . . . . . . 300

7.40.2.19 test_get_state_value_references() . . . . . . . . . . . . . . . . . . . . . . . . . 300

7.40.2.20 test_set_debug_logging() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.40.2.21 test_set_get_string() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.40.2.22 test_set_get_integer() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.40.2.23 test_set_get_boolean() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.40.2.24 test_set_get_real() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.40.2.25 test_terminate() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.40.2.26 test_free_model_instance() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

7.40.2.27 test_free_dll() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

7.40.2.28 test_destroy_dllfmu() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

7.40.2.29 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

7.40.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

7.40.3.1 fmu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

7.40.3.2 callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

7.41 Test/FMI1/fmi1_import_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302

7.41.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303

7.41.1.1 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303

7.41.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303

7.41.2.1 fmi1logger(fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t sta-tus, fmi1_string_t category, fmi1_string_t message,...) . . . . . . . . . . . . . . 303

7.41.2.2 fmi1_test(fmi_import_context_t ∗context, const char ∗dirPath) . . . . . . . . . . 303

7.42 Test/FMI1/fmi1_logger_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303

7.42.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

7.42.1.1 MESSAGE_SIZE_TO_EXPAND_AND_PRINT . . . . . . . . . . . . . . . . . . 304

7.42.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

7.42.2.1 logger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_←↩

string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

7.42.2.2 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

Generated by Doxygen

Page 48: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

xlviii CONTENTS

7.42.2.3 test_logger(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . . . . . . 304

7.42.2.4 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

7.42.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

7.42.3.1 logFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304

7.43 Test/FMI1/fmi1_xml_parsing_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 304

7.43.1 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

7.43.1.1 fmu_test_f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

7.43.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

7.43.2.1 concat(char ∗s1, char ∗s2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

7.43.2.2 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306

7.43.2.3 destroy_parse_test_callbacks(jm_callbacks ∗cb) . . . . . . . . . . . . . . . . . 306

7.43.2.4 create_parse_test_callbacks(void) . . . . . . . . . . . . . . . . . . . . . . . . . 306

7.43.2.5 test_parser(jm_callbacks ∗cb, char ∗xml_dir, int should_log_expected_msg, intconfiguration) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306

7.43.2.6 test_parser_with_cleanup(char ∗xml_dir, int should_log_expected_msg, int con-figuration) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306

7.43.2.7 fail_name_check(char ∗xml_dir) . . . . . . . . . . . . . . . . . . . . . . . . . . 306

7.43.2.8 pass_name_check(char ∗xml_dir) . . . . . . . . . . . . . . . . . . . . . . . . . 306

7.43.2.9 parser_log_expected_message(char ∗xml_dir) . . . . . . . . . . . . . . . . . . 306

7.43.2.10 parser_no_log_expected_message(char ∗xml_dir) . . . . . . . . . . . . . . . . 306

7.43.2.11 test_parsing_and_fmu(char ∗xml_dir, fmu_test_f fmu_test, int should_log_←↩

expected_msg) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306

7.43.2.12 test_parsing_fail_and_fmu(char ∗xml_dir, fmu_test_f fmu_test) . . . . . . . . . . 307

7.43.2.13 test_parsing_pass_and_fmu(char ∗xml_dir, fmu_test_f fmu_test) . . . . . . . . . 307

7.43.2.14 test_variable_naming_conventions(void) . . . . . . . . . . . . . . . . . . . . . 307

7.43.2.15 should_have_no_vars(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . 307

7.43.2.16 should_have_1_no_alias_var(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . 307

7.43.2.17 should_have_size_2_alias_group(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . 307

7.43.2.18 should_have_size_2_no_alis(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . 307

7.43.2.19 should_have_size_3_alias_group(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . 307

7.43.2.20 test_alias_set_error_handling(void) . . . . . . . . . . . . . . . . . . . . . . . . 307

Generated by Doxygen

Page 49: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS xlix

7.43.2.21 test_deprecation_errors(void) . . . . . . . . . . . . . . . . . . . . . . . . . . . 307

7.43.2.22 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7.43.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7.43.3.1 NO_LOG_EXPECTED_MSG . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7.43.3.2 DO_LOG_EXPECTED_MSG . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7.43.3.3 did_log_expected_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7.43.3.4 expected_message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7.43.3.5 name_check_test_directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7.44 Test/FMI1/fmi_import_cs_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

7.44.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

7.44.1.1 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

7.44.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

7.44.2.1 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

7.44.2.2 fmilogger(fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t sta-tus, fmi1_string_t category, fmi1_string_t message,...) . . . . . . . . . . . . . . 309

7.44.2.3 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309

7.44.2.4 test_xml_modelDescription_cs_tc(const char ∗xmlFileName, fmi1_import_t ∗fmu) 309

7.44.2.5 test_xml(const char ∗xmlFileName, fmi1_import_t ∗fmu) . . . . . . . . . . . . . 309

7.44.2.6 test_simulate_cs(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . . . 310

7.44.2.7 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310

7.44.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310

7.44.3.1 xml_test_files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310

7.45 Test/FMI1/fmi_import_me_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 310

7.45.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

7.45.1.1 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

7.45.1.2 NUMBER_OF_TESTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

7.45.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

7.45.2.1 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

7.45.2.2 test_simulate_me(fmi1_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . . 311

7.45.2.3 load(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

Generated by Doxygen

Page 50: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

l CONTENTS

7.45.2.4 destroy(fmul_t ∗fmus) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

7.45.2.5 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

7.46 Test/FMI1/fmi_import_xml_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 311

7.46.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312

7.46.1.1 mylogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm←↩

_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312

7.46.1.2 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312

7.46.1.3 print_int(int i, void ∗data) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312

7.46.1.4 print_dbl(double d, void ∗data) . . . . . . . . . . . . . . . . . . . . . . . . . . . 312

7.46.1.5 printTypeInfo(fmi1_import_variable_typedef_t ∗vt) . . . . . . . . . . . . . . . . 312

7.46.1.6 testVariableSearch(fmi1_import_t ∗fmu, fmi1_import_variable_t ∗v) . . . . . . . 312

7.46.1.7 printVariableInfo(fmi1_import_t ∗fmu, fmi1_import_variable_t ∗v) . . . . . . . . . 312

7.46.1.8 printCapabilitiesInfo(fmi1_import_capabilities_t ∗capabilities) . . . . . . . . . . . 313

7.46.1.9 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

7.47 Test/FMI1/fmi_total_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

7.47.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

7.47.1.1 PRINT_MY_DEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

7.47.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313

7.47.2.1 mylogger(fmiComponent c, fmiString instanceName, fmiStatus status, fmiStringcategory, fmiString message,...) . . . . . . . . . . . . . . . . . . . . . . . . . . 313

7.47.2.2 do_pause() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

7.47.2.3 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

7.48 Test/FMI1/fmi_zip_unzip_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

7.48.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

7.48.1.1 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

7.48.1.2 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

7.48.1.3 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

7.49 Test/fmi_zip_unzip_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

7.49.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

7.49.1.1 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

Generated by Doxygen

Page 51: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS li

7.49.1.2 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

7.49.1.3 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

7.50 Test/FMI1/fmi_zip_zip_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

7.50.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

7.50.1.1 PRINT_MY_DEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

7.50.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

7.50.2.1 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

7.50.2.2 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

7.50.2.3 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

7.51 Test/fmi_zip_zip_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

7.51.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

7.51.1.1 PRINT_MY_DEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

7.51.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

7.51.2.1 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

7.51.2.2 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

7.51.2.3 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317

7.52 Test/FMI1/fmu_dummy/fmu1_model.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . 317

7.52.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

7.52.1.1 FMI_TEST_LOGGER_TEST_RESULT_FILE . . . . . . . . . . . . . . . . . . . 319

7.52.1.2 FMI_TEST_LOGGER_TEST_SOURCE_FILE . . . . . . . . . . . . . . . . . . 319

7.52.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

7.52.2.1 calc_initialize(component_ptr_t comp) . . . . . . . . . . . . . . . . . . . . . . . 319

7.52.2.2 calc_get_derivatives(component_ptr_t comp) . . . . . . . . . . . . . . . . . . . 319

7.52.2.3 calc_get_event_indicators(component_ptr_t comp) . . . . . . . . . . . . . . . . 319

7.52.2.4 calc_event_update(component_ptr_t comp) . . . . . . . . . . . . . . . . . . . . 319

7.52.2.5 fmi_get_version() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

7.52.2.6 fmi_set_debug_logging(fmiComponent c, fmiBoolean loggingOn) . . . . . . . . 320

7.52.2.7 fmi_get_real(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiRealvalue[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

Generated by Doxygen

Page 52: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lii CONTENTS

7.52.2.8 fmi_get_integer(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

7.52.2.9 fmi_get_boolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

7.52.2.10 fmi_get_string(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

7.52.2.11 fmi_set_real(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiReal value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

7.52.2.12 fmi_set_integer(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiInteger value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

7.52.2.13 fmi_set_boolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiBoolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

7.52.2.14 fmi_set_string(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiString value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320

7.52.2.15 fmi_get_model_types_platform() . . . . . . . . . . . . . . . . . . . . . . . . . . 321

7.52.2.16 fmi_instantiate_model(fmiString instanceName, fmiString GUID, fmiCallback←↩

Functions functions, fmiBoolean loggingOn) . . . . . . . . . . . . . . . . . . . . 321

7.52.2.17 fmi_free_model_instance(fmiComponent c) . . . . . . . . . . . . . . . . . . . . 321

7.52.2.18 fmi_set_time(fmiComponent c, fmiReal fmitime) . . . . . . . . . . . . . . . . . 321

7.52.2.19 fmi_set_continuous_states(fmiComponent c, const fmiReal x[], size_t nx) . . . . 321

7.52.2.20 fmi_completed_integrator_step(fmiComponent c, fmiBoolean ∗callEventUpdate) 321

7.52.2.21 fmi_initialize(fmiComponent c, fmiBoolean toleranceControlled, fmiReal relative←↩

Tolerance, fmiEventInfo ∗eventInfo) . . . . . . . . . . . . . . . . . . . . . . . . 321

7.52.2.22 fmi_get_derivatives(fmiComponent c, fmiReal derivatives[], size_t nx) . . . . . . 321

7.52.2.23 fmi_get_event_indicators(fmiComponent c, fmiReal eventIndicators[], size_t ni) . 321

7.52.2.24 fmi_event_update(fmiComponent c, fmiBoolean intermediateResults, fmiEvent←↩

Info ∗eventInfo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321

7.52.2.25 fmi_get_continuous_states(fmiComponent c, fmiReal states[], size_t nx) . . . . . 322

7.52.2.26 fmi_get_nominal_continuousstates(fmiComponent c, fmiReal x_nominal[], size←↩

_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

7.52.2.27 fmi_get_state_value_references(fmiComponent c, fmiValueReference vrx[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

7.52.2.28 fmi_terminate(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . . . . . 322

7.52.2.29 fmi_get_types_platform() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

7.52.2.30 fmi_instantiate_slave(fmiString instanceName, fmiString fmuGUID, fmiStringfmuLocation, fmiString mimeType, fmiReal timeout, fmiBoolean visible, fmi←↩

Boolean interactive, fmiCallbackFunctions functions, fmiBoolean loggingOn) . . . 322

Generated by Doxygen

Page 53: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS liii

7.52.2.31 fmi_initialize_slave(fmiComponent c, fmiReal tStart, fmiBoolean StopTime←↩

Defined, fmiReal tStop) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322

7.52.2.32 fmi_terminate_slave(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . 322

7.52.2.33 fmi_reset_slave(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . . . . 322

7.52.2.34 fmi_free_slave_instance(fmiComponent c) . . . . . . . . . . . . . . . . . . . . 322

7.52.2.35 fmi_set_real_input_derivatives(fmiComponent c, const fmiValueReference vr[],size_t nvr, const fmiInteger order[], const fmiReal value[]) . . . . . . . . . . . . . 323

7.52.2.36 fmi_get_real_output_derivatives(fmiComponent c, const fmiValueReference vr[],size_t nvr, const fmiInteger order[], fmiReal value[]) . . . . . . . . . . . . . . . . 323

7.52.2.37 fmi_cancel_step(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . . . . 323

7.52.2.38 fmi_do_step(fmiComponent c, fmiReal currentCommunicationPoint, fmiRealcommunicationStepSize, fmiBoolean newStep) . . . . . . . . . . . . . . . . . . 323

7.52.2.39 fmi_get_status(fmiComponent c, const fmiStatusKind s, fmiStatus ∗value) . . . . 323

7.52.2.40 fmi_get_real_status(fmiComponent c, const fmiStatusKind s, fmiReal ∗value) . . 323

7.52.2.41 fmi_get_integer_status(fmiComponent c, const fmiStatusKind s, fmiInteger ∗value) 323

7.52.2.42 fmi_get_boolean_status(fmiComponent c, const fmiStatusKind s, fmiBoolean∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323

7.52.2.43 fmi_get_string_status(fmiComponent c, const fmiStatusKind s, fmiString ∗value) 323

7.53 Test/FMI1/fmu_dummy/fmu1_model.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 324

7.53.1 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324

7.53.1.1 component_ptr_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324

7.53.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

7.53.2.1 fmi_get_version() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

7.53.2.2 fmi_set_debug_logging(fmiComponent c, fmiBoolean loggingOn) . . . . . . . . 325

7.53.2.3 fmi_get_real(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiRealvalue[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

7.53.2.4 fmi_get_integer(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

7.53.2.5 fmi_get_boolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

7.53.2.6 fmi_get_string(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

7.53.2.7 fmi_set_real(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiReal value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

Generated by Doxygen

Page 54: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

liv CONTENTS

7.53.2.8 fmi_set_integer(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiInteger value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

7.53.2.9 fmi_set_boolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiBoolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

7.53.2.10 fmi_set_string(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiString value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326

7.53.2.11 fmi_get_model_types_platform() . . . . . . . . . . . . . . . . . . . . . . . . . . 326

7.53.2.12 fmi_instantiate_model(fmiString instanceName, fmiString GUID, fmiCallback←↩

Functions functions, fmiBoolean loggingOn) . . . . . . . . . . . . . . . . . . . . 326

7.53.2.13 fmi_free_model_instance(fmiComponent c) . . . . . . . . . . . . . . . . . . . . 326

7.53.2.14 fmi_set_time(fmiComponent c, fmiReal fmitime) . . . . . . . . . . . . . . . . . 326

7.53.2.15 fmi_set_continuous_states(fmiComponent c, const fmiReal x[], size_t nx) . . . . 326

7.53.2.16 fmi_completed_integrator_step(fmiComponent c, fmiBoolean ∗callEventUpdate) 326

7.53.2.17 fmi_initialize(fmiComponent c, fmiBoolean toleranceControlled, fmiReal relative←↩

Tolerance, fmiEventInfo ∗eventInfo) . . . . . . . . . . . . . . . . . . . . . . . . 326

7.53.2.18 fmi_get_derivatives(fmiComponent c, fmiReal derivatives[], size_t nx) . . . . . . 326

7.53.2.19 fmi_get_event_indicators(fmiComponent c, fmiReal eventIndicators[], size_t ni) . 326

7.53.2.20 fmi_event_update(fmiComponent c, fmiBoolean intermediateResults, fmiEvent←↩

Info ∗eventInfo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

7.53.2.21 fmi_get_continuous_states(fmiComponent c, fmiReal states[], size_t nx) . . . . . 327

7.53.2.22 fmi_get_nominal_continuousstates(fmiComponent c, fmiReal x_nominal[], size←↩

_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

7.53.2.23 fmi_get_state_value_references(fmiComponent c, fmiValueReference vrx[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327

7.53.2.24 fmi_terminate(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . . . . . 327

7.54 Test/FMI1/fmu_dummy/fmu1_model_cs.c File Reference . . . . . . . . . . . . . . . . . . . . . . 327

7.54.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

7.54.1.1 MODEL_IDENTIFIER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

7.54.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

7.54.2.1 fmiGetVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

7.54.2.2 fmiSetDebugLogging(fmiComponent c, fmiBoolean loggingOn) . . . . . . . . . . 329

7.54.2.3 fmiGetReal(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiRealvalue[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

7.54.2.4 fmiGetInteger(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

Generated by Doxygen

Page 55: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS lv

7.54.2.5 fmiGetBoolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

7.54.2.6 fmiGetString(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiStringvalue[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

7.54.2.7 fmiSetReal(fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmi←↩

Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

7.54.2.8 fmiSetInteger(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiInteger value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

7.54.2.9 fmiSetBoolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiBoolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

7.54.2.10 fmiSetString(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiString value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329

7.54.2.11 fmiGetTypesPlatform() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330

7.54.2.12 fmiInstantiateSlave(fmiString instanceName, fmiString fmuGUID, fmiString fmu←↩

Location, fmiString mimeType, fmiReal timeout, fmiBoolean visible, fmiBooleaninteractive, fmiCallbackFunctions functions, fmiBoolean loggingOn) . . . . . . . 330

7.54.2.13 fmiInitializeSlave(fmiComponent c, fmiReal tStart, fmiBoolean StopTimeDefined,fmiReal tStop) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330

7.54.2.14 fmiTerminateSlave(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . . 330

7.54.2.15 fmiResetSlave(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . . . . 330

7.54.2.16 fmiFreeSlaveInstance(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . 330

7.54.2.17 fmiSetRealInputDerivatives(fmiComponent c, const fmiValueReference vr[],size_t nvr, const fmiInteger order[], const fmiReal value[]) . . . . . . . . . . . . . 330

7.54.2.18 fmiGetRealOutputDerivatives(fmiComponent c, const fmiValueReference vr[],size_t nvr, const fmiInteger order[], fmiReal value[]) . . . . . . . . . . . . . . . . 330

7.54.2.19 fmiCancelStep(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . . . . 330

7.54.2.20 fmiDoStep(fmiComponent c, fmiReal currentCommunicationPoint, fmiRealcommunicationStepSize, fmiBoolean newStep) . . . . . . . . . . . . . . . . . . 331

7.54.2.21 fmiGetStatus(fmiComponent c, const fmiStatusKind s, fmiStatus ∗value) . . . . . 331

7.54.2.22 fmiGetRealStatus(fmiComponent c, const fmiStatusKind s, fmiReal ∗value) . . . 331

7.54.2.23 fmiGetIntegerStatus(fmiComponent c, const fmiStatusKind s, fmiInteger ∗value) . 331

7.54.2.24 fmiGetBooleanStatus(fmiComponent c, const fmiStatusKind s, fmiBoolean ∗value) 331

7.54.2.25 fmiGetStringStatus(fmiComponent c, const fmiStatusKind s, fmiString ∗value) . . 331

7.55 Test/FMI1/fmu_dummy/fmu1_model_defines.h File Reference . . . . . . . . . . . . . . . . . . . . 331

7.55.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.1 STRINGIFY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

Generated by Doxygen

Page 56: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lvi CONTENTS

7.55.1.2 STRINGIFY2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.3 MODEL_IDENTIFIER_STR . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.4 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.5 MAGIC_TEST_VALUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.6 VAR_R_HIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.7 VAR_R_HIGHT_SPEED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.8 VAR_R_GRATIVY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.9 VAR_R_BOUNCE_CONF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.10 EVENT_HIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332

7.55.1.11 VAR_S_LOGGER_TEST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.12 N_STATES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.13 N_EVENT_INDICATORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.14 N_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.15 N_INTEGER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.16 N_BOOLEAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.17 N_STRING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.18 N_INPUT_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.19 N_INPUT_REAL_MAX_ORDER . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.20 N_OUTPUT_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333

7.55.1.21 N_OUTPUT_REAL_MAX_ORDER . . . . . . . . . . . . . . . . . . . . . . . . 334

7.55.1.22 FMI_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334

7.55.1.23 FMI_GUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334

7.56 Test/FMI1/fmu_dummy/fmu1_model_me.c File Reference . . . . . . . . . . . . . . . . . . . . . . 334

7.56.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335

7.56.1.1 MODEL_IDENTIFIER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335

7.56.2 Enumeration Type Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335

7.56.2.1 fmiStatusKind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335

7.56.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335

7.56.3.1 fmiGetVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335

7.56.3.2 fmiSetDebugLogging(fmiComponent c, fmiBoolean loggingOn) . . . . . . . . . . 335

Generated by Doxygen

Page 57: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS lvii

7.56.3.3 fmiGetReal(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiRealvalue[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.4 fmiGetInteger(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.5 fmiGetBoolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmi←↩

Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.6 fmiGetString(fmiComponent c, const fmiValueReference vr[], size_t nvr, fmiStringvalue[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.7 fmiSetReal(fmiComponent c, const fmiValueReference vr[], size_t nvr, const fmi←↩

Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.8 fmiSetInteger(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiInteger value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.9 fmiSetBoolean(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiBoolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.10 fmiSetString(fmiComponent c, const fmiValueReference vr[], size_t nvr, constfmiString value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.11 fmiGetModelTypesPlatform() . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336

7.56.3.12 fmiInstantiateModel(fmiString instanceName, fmiString GUID, fmiCallback←↩

Functions functions, fmiBoolean loggingOn) . . . . . . . . . . . . . . . . . . . . 337

7.56.3.13 fmiFreeModelInstance(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . 337

7.56.3.14 fmiSetTime(fmiComponent c, fmiReal fmitime) . . . . . . . . . . . . . . . . . . 337

7.56.3.15 fmiSetContinuousStates(fmiComponent c, const fmiReal x[], size_t nx) . . . . . 337

7.56.3.16 fmiCompletedIntegratorStep(fmiComponent c, fmiBoolean ∗callEventUpdate) . . 337

7.56.3.17 fmiInitialize(fmiComponent c, fmiBoolean toleranceControlled, fmiReal relative←↩

Tolerance, fmiEventInfo ∗eventInfo) . . . . . . . . . . . . . . . . . . . . . . . . 337

7.56.3.18 fmiGetDerivatives(fmiComponent c, fmiReal derivatives[], size_t nx) . . . . . . . 337

7.56.3.19 fmiGetEventIndicators(fmiComponent c, fmiReal eventIndicators[], size_t ni) . . . 337

7.56.3.20 fmiEventUpdate(fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo∗eventInfo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337

7.56.3.21 fmiGetContinuousStates(fmiComponent c, fmiReal states[], size_t nx) . . . . . . 337

7.56.3.22 fmiGetNominalContinuousStates(fmiComponent c, fmiReal x_nominal[], size_t nx) 338

7.56.3.23 fmiGetStateValueReferences(fmiComponent c, fmiValueReference vrx[], size_t nx) 338

7.56.3.24 fmiTerminate(fmiComponent c) . . . . . . . . . . . . . . . . . . . . . . . . . . 338

7.57 Test/FMI1/jm_vector_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338

7.57.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338

Generated by Doxygen

Page 58: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lviii CONTENTS

7.57.1.1 TESTVAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338

7.57.1.2 VINIT_SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.57.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.57.2.1 print_int(int i, void ∗data) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.57.2.2 print_dbl(double d, void ∗data) . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.57.2.3 compar_int(int ∗a, int ∗b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.57.2.4 log_error(const char ∗fmt,...) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.57.2.5 main() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.57.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.57.3.1 return_code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.58 Test/jm_vector_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

7.58.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.1.1 TESTVAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.1.2 VINIT_SIZE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.2.1 print_int(int i, void ∗data) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.2.2 print_dbl(double d, void ∗data) . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.2.3 compar_int(int ∗a, int ∗b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.2.4 log_error(const char ∗fmt,...) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.2.5 main() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 340

7.58.3 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

7.58.3.1 return_code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

7.59 Test/FMI2/fmi2_import_cs_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

7.59.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

7.59.1.1 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

7.59.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

7.59.2.1 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341

7.59.2.2 fmilogger(fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t sta-tus, fmi2_string_t category, fmi2_string_t message,...) . . . . . . . . . . . . . . 341

7.59.2.3 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

Generated by Doxygen

Page 59: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS lix

7.59.2.4 test_simulate_cs(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . . . 342

7.59.2.5 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

7.60 Test/FMI2/fmi2_import_me_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

7.60.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

7.60.1.1 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

7.60.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

7.60.2.1 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342

7.60.2.2 do_event_iteration(fmi2_import_t ∗fmu, fmi2_event_info_t ∗eventInfo) . . . . . . 343

7.60.2.3 test_parsed_all_varialbes(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . 343

7.60.2.4 test_simulate_me(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . . 343

7.60.2.5 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

7.61 Test/FMI2/fmi2_import_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

7.61.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

7.61.1.1 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343

7.61.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344

7.61.2.1 fmi2logger(fmi2_component_environment_t env, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...) . . . . . 344

7.61.2.2 stepFinished(fmi2_component_environment_t env, fmi2_status_t status) . . . . . 344

7.61.2.3 fmi2_test(fmi_import_context_t ∗context, const char ∗dirPath) . . . . . . . . . . 344

7.62 Test/FMI2/fmi2_import_xml_test.cc File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 344

7.62.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

7.62.1.1 annotation_start_handle(void ∗context, const char ∗parentName, void ∗parent,const char ∗elm, const char ∗∗attr) . . . . . . . . . . . . . . . . . . . . . . . . 345

7.62.1.2 annotation_data_handle(void ∗context, const char ∗s, int len) . . . . . . . . . . 345

7.62.1.3 annotation_end_handle(void ∗context, const char ∗elm) . . . . . . . . . . . . . 345

7.62.1.4 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

7.62.1.5 mylogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm←↩

_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

7.62.1.6 print_int(int i, void ∗data) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

7.62.1.7 print_dbl(double d, void ∗data) . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

7.62.1.8 printTypeInfo(fmi2_import_variable_typedef_t ∗vt) . . . . . . . . . . . . . . . . 345

7.62.1.9 testVariableSearch(fmi2_import_t ∗fmu, fmi2_import_variable_t ∗v) . . . . . . . 346

Generated by Doxygen

Page 60: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lx CONTENTS

7.62.1.10 printVariableInfo(fmi2_import_t ∗fmu, fmi2_import_variable_t ∗v) . . . . . . . . . 346

7.62.1.11 printCapabilitiesInfo(fmi2_import_t ∗fmu) . . . . . . . . . . . . . . . . . . . . . 346

7.62.1.12 printDependenciesInfo(fmi2_import_t ∗fmu, fmi2_import_variable_list_t ∗rows,fmi2_import_variable_list_t ∗cols, size_t ∗start, size_t ∗dep, char ∗factor) . . . . 346

7.62.1.13 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

7.62.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

7.62.2.1 expect_error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

7.62.2.2 annotation_callbacks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346

7.63 Test/FMI2/fmi2_xml_parsing_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . 346

7.63.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

7.63.1.1 concat(char ∗s1, char ∗s2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

7.63.1.2 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

7.63.1.3 test_parser(char ∗xml_dir, int should_not_log_expected_msg, int configuration) . 347

7.63.1.4 fail_name_check(char ∗xml_dir) . . . . . . . . . . . . . . . . . . . . . . . . . . 347

7.63.1.5 pass_name_check(char ∗xml_dir) . . . . . . . . . . . . . . . . . . . . . . . . . 347

7.63.1.6 parser_log_expected_message(char ∗xml_dir) . . . . . . . . . . . . . . . . . . 347

7.63.1.7 test_variable_naming_conventions(void) . . . . . . . . . . . . . . . . . . . . . 348

7.63.1.8 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

7.63.2 Variable Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

7.63.2.1 SHOULD_NOT_LOG_EXPECTED_MSG . . . . . . . . . . . . . . . . . . . . . 348

7.63.2.2 SHOULD_LOG_EXPECTED_MSG . . . . . . . . . . . . . . . . . . . . . . . . 348

7.63.2.3 did_not_log_expected_msg . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

7.63.2.4 expected_message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

7.63.2.5 name_check_test_directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348

7.64 Test/FMI2/fmu_dummy/fmu2_model.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . 348

7.64.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350

7.64.1.1 calc_initialize(component_ptr_t comp) . . . . . . . . . . . . . . . . . . . . . . . 350

7.64.1.2 calc_get_derivatives(component_ptr_t comp) . . . . . . . . . . . . . . . . . . . 350

7.64.1.3 calc_get_event_indicators(component_ptr_t comp) . . . . . . . . . . . . . . . . 350

7.64.1.4 calc_event_update(component_ptr_t comp) . . . . . . . . . . . . . . . . . . . . 350

Generated by Doxygen

Page 61: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS lxi

7.64.1.5 fmi_get_version() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350

7.64.1.6 fmi_set_debug_logging(fmi2Component c, fmi2Boolean loggingOn) . . . . . . . 350

7.64.1.7 fmi_get_real(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, fmi2←↩

Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350

7.64.1.8 fmi_get_integer(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350

7.64.1.9 fmi_get_boolean(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 350

7.64.1.10 fmi_get_string(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.11 fmi_set_real(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, constfmi2Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.12 fmi_set_integer(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,const fmi2Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.13 fmi_set_boolean(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,const fmi2Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.14 fmi_set_string(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, constfmi2String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.15 fmi_get_model_types_platform() . . . . . . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.16 fmi_instantiate(fmi2String instanceName, fmi2Type fmuType, fmi2String fmu←↩

GUID, fmi2String fmuLocation, const fmi2CallbackFunctions ∗functions, fmi2←↩

Boolean visible, fmi2Boolean loggingOn) . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.17 fmi_free_instance(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.18 fmi_setup_experiment(fmi2Component c, fmi2Boolean toleranceDefined, fmi2←↩

Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2RealstopTime) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351

7.64.1.19 fmi_enter_initialization_mode(fmi2Component c) . . . . . . . . . . . . . . . . . 352

7.64.1.20 fmi_exit_initialization_mode(fmi2Component c) . . . . . . . . . . . . . . . . . . 352

7.64.1.21 fmi_enter_event_mode(fmi2Component c) . . . . . . . . . . . . . . . . . . . . 352

7.64.1.22 fmi_new_discrete_states(fmi2Component c, fmi2EventInfo ∗eventInfo) . . . . . . 352

7.64.1.23 fmi_enter_continuous_time_mode(fmi2Component c) . . . . . . . . . . . . . . 352

7.64.1.24 fmi_set_time(fmi2Component c, fmi2Real fmitime) . . . . . . . . . . . . . . . . 352

7.64.1.25 fmi_set_continuous_states(fmi2Component c, const fmi2Real x[], size_t nx) . . . 352

7.64.1.26 fmi_completed_integrator_step(fmi2Component c, fmi2Boolean noSetF←↩

MUStatePriorToCurrentPoint, fmi2Boolean ∗enterEventMode, fmi2Boolean∗terminateSimulation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352

7.64.1.27 fmi_get_derivatives(fmi2Component c, fmi2Real derivatives[], size_t nx) . . . . . 352

Generated by Doxygen

Page 62: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lxii CONTENTS

7.64.1.28 fmi_get_event_indicators(fmi2Component c, fmi2Real eventIndicators[], size_t ni) 352

7.64.1.29 fmi_get_continuous_states(fmi2Component c, fmi2Real states[], size_t nx) . . . 353

7.64.1.30 fmi_get_nominals_of_continuousstates(fmi2Component c, fmi2Real x_nominal[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

7.64.1.31 fmi_terminate(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . . 353

7.64.1.32 fmi_get_types_platform() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

7.64.1.33 fmi_reset(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

7.64.1.34 fmi_set_real_input_derivatives(fmi2Component c, const fmi2ValueReference vr[],size_t nvr, const fmi2Integer order[], const fmi2Real value[]) . . . . . . . . . . . 353

7.64.1.35 fmi_get_real_output_derivatives(fmi2Component c, const fmi2ValueReferencevr[], size_t nvr, const fmi2Integer order[], fmi2Real value[]) . . . . . . . . . . . . 353

7.64.1.36 fmi_cancel_step(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . 353

7.64.1.37 fmi_do_step(fmi2Component c, fmi2Real currentCommunicationPoint, fmi2RealcommunicationStepSize, fmi2Boolean newStep) . . . . . . . . . . . . . . . . . 353

7.64.1.38 fmi_get_status(fmi2Component c, const fmi2StatusKind s, fmi2Status ∗value) . . 353

7.64.1.39 fmi_get_real_status(fmi2Component c, const fmi2StatusKind s, fmi2Real ∗value) 354

7.64.1.40 fmi_get_integer_status(fmi2Component c, const fmi2StatusKind s, fmi2Integer∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354

7.64.1.41 fmi_get_boolean_status(fmi2Component c, const fmi2StatusKind s, fmi2Boolean∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354

7.64.1.42 fmi_get_string_status(fmi2Component c, const fmi2StatusKind s, fmi2String ∗value)354

7.65 Test/FMI2/fmu_dummy/fmu2_model.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 354

7.65.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355

7.65.1.1 FMI2_Export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355

7.65.2 Typedef Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355

7.65.2.1 component_ptr_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355

7.65.3 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356

7.65.3.1 fmi_get_version() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356

7.65.3.2 fmi_set_debug_logging(fmi2Component c, fmi2Boolean loggingOn) . . . . . . . 356

7.65.3.3 fmi_instantiate(fmi2String instanceName, fmi2Type fmuType, fmi2String fmu←↩

GUID, fmi2String fmuLocation, const fmi2CallbackFunctions ∗functions, fmi2←↩

Boolean visible, fmi2Boolean loggingOn) . . . . . . . . . . . . . . . . . . . . . 356

7.65.3.4 fmi_free_instance(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . 356

Generated by Doxygen

Page 63: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS lxiii

7.65.3.5 fmi_setup_experiment(fmi2Component c, fmi2Boolean toleranceDefined, fmi2←↩

Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2RealstopTime) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356

7.65.3.6 fmi_enter_initialization_mode(fmi2Component c) . . . . . . . . . . . . . . . . . 356

7.65.3.7 fmi_exit_initialization_mode(fmi2Component c) . . . . . . . . . . . . . . . . . . 356

7.65.3.8 fmi_terminate(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . . 356

7.65.3.9 fmi_reset(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356

7.65.3.10 fmi_get_real(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, fmi2←↩

Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.11 fmi_get_integer(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.12 fmi_get_boolean(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.13 fmi_get_string(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.14 fmi_set_real(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, constfmi2Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.15 fmi_set_integer(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,const fmi2Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.16 fmi_set_boolean(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,const fmi2Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.17 fmi_set_string(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, constfmi2String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.18 fmi_get_model_types_platform() . . . . . . . . . . . . . . . . . . . . . . . . . . 357

7.65.3.19 fmi_enter_event_mode(fmi2Component c) . . . . . . . . . . . . . . . . . . . . 358

7.65.3.20 fmi_new_discrete_states(fmi2Component c, fmi2EventInfo ∗eventInfo) . . . . . . 358

7.65.3.21 fmi_enter_continuous_time_mode(fmi2Component c) . . . . . . . . . . . . . . 358

7.65.3.22 fmi_set_time(fmi2Component c, fmi2Real fmitime) . . . . . . . . . . . . . . . . 358

7.65.3.23 fmi_set_continuous_states(fmi2Component c, const fmi2Real x[], size_t nx) . . . 358

7.65.3.24 fmi_completed_integrator_step(fmi2Component c, fmi2Boolean noSetF←↩

MUStatePriorToCurrentPoint, fmi2Boolean ∗enterEventMode, fmi2Boolean∗terminateSimulation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358

7.65.3.25 fmi_get_derivatives(fmi2Component c, fmi2Real derivatives[], size_t nx) . . . . . 358

7.65.3.26 fmi_get_event_indicators(fmi2Component c, fmi2Real eventIndicators[], size_t ni) 358

7.65.3.27 fmi_get_continuous_states(fmi2Component c, fmi2Real states[], size_t nx) . . . 358

Generated by Doxygen

Page 64: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lxiv CONTENTS

7.65.3.28 fmi_get_nominals_of_continuousstates(fmi2Component c, fmi2Real x_nominal[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358

7.66 Test/FMI2/fmu_dummy/fmu2_model_cs.c File Reference . . . . . . . . . . . . . . . . . . . . . . 359

7.66.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

7.66.1.1 fmi2GetVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

7.66.1.2 fmi2SetDebugLogging(fmi2Component c, fmi2Boolean loggingOn, size_t n, constfmi2String cat[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

7.66.1.3 fmi2Instantiate(fmi2String instanceName, fmi2Type fmuType, fmi2String GUID,fmi2String location, const fmi2CallbackFunctions ∗functions, fmi2Boolean visible,fmi2Boolean loggingOn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

7.66.1.4 fmi2FreeInstance(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . 360

7.66.1.5 fmi2SetupExperiment(fmi2Component c, fmi2Boolean toleranceDefined, fmi2←↩

Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2RealstopTime) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

7.66.1.6 fmi2EnterInitializationMode(fmi2Component c) . . . . . . . . . . . . . . . . . . 360

7.66.1.7 fmi2ExitInitializationMode(fmi2Component c) . . . . . . . . . . . . . . . . . . . 360

7.66.1.8 fmi2GetReal(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, fmi2←↩

Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

7.66.1.9 fmi2GetInteger(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360

7.66.1.10 fmi2GetBoolean(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.11 fmi2GetString(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.12 fmi2SetReal(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, constfmi2Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.13 fmi2SetInteger(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,const fmi2Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.14 fmi2SetBoolean(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,const fmi2Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.15 fmi2SetString(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, constfmi2String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.16 fmi2GetTypesPlatform() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.17 fmi2Terminate(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.18 fmi2Reset(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . . . . 361

7.66.1.19 fmi2SetRealInputDerivatives(fmi2Component c, const fmi2ValueReference vr[],size_t nvr, const fmi2Integer order[], const fmi2Real value[]) . . . . . . . . . . . 362

Generated by Doxygen

Page 65: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS lxv

7.66.1.20 fmi2GetRealOutputDerivatives(fmi2Component c, const fmi2ValueReference vr[],size_t nvr, const fmi2Integer order[], fmi2Real value[]) . . . . . . . . . . . . . . 362

7.66.1.21 fmi2CancelStep(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . 362

7.66.1.22 fmi2DoStep(fmi2Component c, fmi2Real currentCommunicationPoint, fmi2RealcommunicationStepSize, fmi2Boolean newStep) . . . . . . . . . . . . . . . . . 362

7.66.1.23 fmi2GetStatus(fmi2Component c, const fmi2StatusKind s, fmi2Status ∗value) . . 362

7.66.1.24 fmi2GetRealStatus(fmi2Component c, const fmi2StatusKind s, fmi2Real ∗value) 362

7.66.1.25 fmi2GetIntegerStatus(fmi2Component c, const fmi2StatusKind s, fmi2Integer∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362

7.66.1.26 fmi2GetBooleanStatus(fmi2Component c, const fmi2StatusKind s, fmi2Boolean∗value) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362

7.66.1.27 fmi2GetStringStatus(fmi2Component c, const fmi2StatusKind s, fmi2String ∗value) 362

7.67 Test/FMI2/fmu_dummy/fmu2_model_defines.h File Reference . . . . . . . . . . . . . . . . . . . . 363

7.67.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

7.67.1.1 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

7.67.1.2 MAGIC_TEST_VALUE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

7.67.1.3 VAR_R_HIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

7.67.1.4 VAR_R_HIGHT_SPEED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

7.67.1.5 VAR_R_GRATIVY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363

7.67.1.6 VAR_R_BOUNCE_CONF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.7 EVENT_HIGHT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.8 VAR_S_LOGGER_TEST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.9 N_STATES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.10 N_EVENT_INDICATORS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.11 N_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.12 N_INTEGER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.13 N_BOOLEAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.14 N_STRING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.15 N_INPUT_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

7.67.1.16 N_INPUT_REAL_MAX_ORDER . . . . . . . . . . . . . . . . . . . . . . . . . . 365

7.67.1.17 N_OUTPUT_REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365

7.67.1.18 N_OUTPUT_REAL_MAX_ORDER . . . . . . . . . . . . . . . . . . . . . . . . 365

Generated by Doxygen

Page 66: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lxvi CONTENTS

7.67.1.19 FMI_VERSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365

7.67.1.20 FMI_GUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365

7.68 Test/FMI2/fmu_dummy/fmu2_model_me.c File Reference . . . . . . . . . . . . . . . . . . . . . . 365

7.68.1 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366

7.68.1.1 fmi2GetVersion() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366

7.68.1.2 fmi2SetDebugLogging(fmi2Component c, fmi2Boolean loggingOn, size_t n, constfmi2String cat[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366

7.68.1.3 fmi2Instantiate(fmi2String instanceName, fmi2Type fmuType, fmi2String GUID,fmi2String location, const fmi2CallbackFunctions ∗functions, fmi2Boolean visible,fmi2Boolean loggingOn) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366

7.68.1.4 fmi2FreeInstance(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . 366

7.68.1.5 fmi2SetupExperiment(fmi2Component c, fmi2Boolean toleranceDefined, fmi2←↩

Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2RealstopTime) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

7.68.1.6 fmi2EnterInitializationMode(fmi2Component c) . . . . . . . . . . . . . . . . . . 367

7.68.1.7 fmi2ExitInitializationMode(fmi2Component c) . . . . . . . . . . . . . . . . . . . 367

7.68.1.8 fmi2GetReal(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, fmi2←↩

Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

7.68.1.9 fmi2GetInteger(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

7.68.1.10 fmi2GetBoolean(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

7.68.1.11 fmi2GetString(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,fmi2String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

7.68.1.12 fmi2SetReal(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, constfmi2Real value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

7.68.1.13 fmi2SetInteger(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,const fmi2Integer value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 367

7.68.1.14 fmi2SetBoolean(fmi2Component c, const fmi2ValueReference vr[], size_t nvr,const fmi2Boolean value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

7.68.1.15 fmi2SetString(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, constfmi2String value[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

7.68.1.16 fmi2GetTypesPlatform() . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

7.68.1.17 fmi2EnterEventMode(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . 368

7.68.1.18 fmi2NewDiscreteStates(fmi2Component c, fmi2EventInfo ∗eventInfo) . . . . . . 368

7.68.1.19 fmi2EnterContinuousTimeMode(fmi2Component c) . . . . . . . . . . . . . . . . 368

Generated by Doxygen

Page 67: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

CONTENTS lxvii

7.68.1.20 fmi2SetTime(fmi2Component c, fmi2Real fmitime) . . . . . . . . . . . . . . . . 368

7.68.1.21 fmi2SetContinuousStates(fmi2Component c, const fmi2Real x[], size_t nx) . . . 368

7.68.1.22 fmi2CompletedIntegratorStep(fmi2Component c, fmi2Boolean noSetFMUState←↩

PriorToCurrentPoint, fmi2Boolean ∗enterEventMode, fmi2Boolean ∗terminate←↩

Simulation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 368

7.68.1.23 fmi2GetDerivatives(fmi2Component c, fmi2Real derivatives[], size_t nx) . . . . . 368

7.68.1.24 fmi2GetEventIndicators(fmi2Component c, fmi2Real eventIndicators[], size_t ni) . 369

7.68.1.25 fmi2GetContinuousStates(fmi2Component c, fmi2Real states[], size_t nx) . . . . 369

7.68.1.26 fmi2GetNominalsOfContinuousStates(fmi2Component c, fmi2Real x_nominal[],size_t nx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369

7.68.1.27 fmi2Terminate(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . . 369

7.68.1.28 fmi2Reset(fmi2Component c) . . . . . . . . . . . . . . . . . . . . . . . . . . . 369

7.69 Test/fmi_import_test.c File Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369

7.69.1 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

7.69.1.1 BUFFER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

7.69.2 Function Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

7.69.2.1 fmi1_test(fmi_import_context_t ∗context, const char ∗dirPath) . . . . . . . . . . 370

7.69.2.2 fmi2_test(fmi_import_context_t ∗context, const char ∗dirPath) . . . . . . . . . . 370

7.69.2.3 importlogger(jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

7.69.2.4 do_exit(int code) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

7.69.2.5 main(int argc, char ∗argv[]) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

7.70 /tmp/FMILibraryBuild/build/doc/fmilib.h File Reference . . . . . . . . . . . . . . . . . . . . . . . . 370

7.70.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370

7.71 /tmp/FMILibraryBuild/build/doc/fmilib_config.h File Reference . . . . . . . . . . . . . . . . . . . . 371

7.71.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371

7.71.2 Macro Definition Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371

7.71.2.1 CMAKE_INTDIR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371

7.71.2.2 FMI_FILE_SEP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371

7.71.2.3 FMI_DLL_EXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.4 FMI_PLATFORM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.5 FMI_BINARIES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.6 FMI_MODEL_DESCRIPTION_XML . . . . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.7 FMILIB_EXPORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.8 FMILIB_PRIVATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.9 FMILIB_ENABLE_LOG_LEVEL_DEBUG . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.10 FMILIB_SIZET_FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.11 FMILIB_GENERATE_BUILD_STAMP . . . . . . . . . . . . . . . . . . . . . . . 372

7.71.2.12 HAVE___VA_COPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

7.71.2.13 HAVE_VSNPRINTF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

7.71.2.14 jm_rpl_vsnprintf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

7.72 /tmp/FMILibraryBuild/build/doc/fmilib_mainpage.h File Reference . . . . . . . . . . . . . . . . . . 373

7.72.1 Detailed Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

Generated by Doxygen

Page 68: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

lxviii CONTENTS

Index 375

Generated by Doxygen

Page 69: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 1

FMI Library: part of JModelica.org

Version

2.0.3

Date

6 November 2017

1.1 Summary

FMI library is intended as a foundation for applications interfacing FMUs (Functional Mockup Units) that follow FMIStandard. This version of the library supports FMI 1.0 and FMI2.0. See http://www.fmi-standard.org/

The test codes provided with the library can serve as starting point for the development of custom applications. SeeSection Automatic tests for details.

1.2 Configuring and building

CMake (see http://www.cmake.org/) is used to generate the native build scripts for the library. It is recom-mended to use "cmake-gui" on Windows or "ccmake <FMIL source dir>" to configure the build. All the requiredthird party libraries are included into the distribution.

CMake 2.8.6 is required since this is the version used in development both on Windows and Linux. The build scriptis KNOWN NOT TO WORK WITH CMake 2.8.3 and below (due to ExternalProject interface changes). CMake 2.8.4and 2.8.5 are not tested.

To build from a terminal command line on Linux or Mac with default settings use:

mkdir build-fmil; cd build-fmilcmake -DFMILIB_INSTALL_PREFIX=<prefix> <path to FMIL source>make install test

To build in MSYS terminal with g++/gcc on Windows:

Page 70: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 FMI Library: part of JModelica.org

mkdir build-fmil; cd build-fmilcmake -DFMILIB_INSTALL_PREFIX=<prefix> -G "MSYS Makefiles" <path to FMIL source>make install test

To build from command line with Microsoft Visual Studio compilers on Windows:

mkdir build-fmil; cd build-fmilcmake -DFMILIB_INSTALL_PREFIX=<prefix> -G "Visual Studio 10" <path to FMIL source>cmake --build . --config MinSizeRel --target install

The primary targets of the library build script are:

• <prefix>/include/fmilib.hThe include file to be used in client applications.

• Library files under <prefix>/lib/Static library is named 'fmilib' and shared library 'fmilib_shared'. The prefix/suffix of the library files differdepending on the platform. Note that if you have configure and built both static and shared library on Windowsbut want to link with the static library compile time define "FMILIB_BUILDING_LIBRARY" must be set.

• Doxygen generated documentation under <prefix>/doc/. Note that documentation is not generated as partof install target and you need to build the 'doc' target separately, i.e., run 'make doc' or explicitly build theproject in Visual Studio.

The following build configuration options are provided:

• FMILIB_INSTALL_PREFIX - prefix prepended to install directories.Default: "../install"This is the main install directory name. Include files will be located in the "include" subdirectory and libraryfiles in the "lib" subdirectory. Client applications should only include "fmilib.h"

• FMILIB_THIRDPARTYLIBS - thirdparty libaries are currently shipped with the library.

• FMILIB_FMI_STANDARD_HEADERS - Path to the FMI standard headers directory. Header for specificstandards files are expected in subdirectories FMI1, FMI2, etc.Default: "ThirdParty/FMI/default"

• FMILIB_DEFAULT_BUILD_TYPE_RELEASE - Controls build-type used for Makefile generation.Default: ONIf this option is on then 'Release' mode compile flags are used. Otherwize, 'Debug' mode flags are generatedinto the Makefile. The option may be overwritten by explicitly setting CMAKE_BUILD_TYPE.

• FMILIB_BUILD_WITH_STATIC_RTLIB Use static run-time libraries (/MT or /MTd code generation flags).Default: OFFThis is only used when generating Microsoft Visual Studio solutions. If the options is on then the library willbe built against static runtime, otherwise - dynamic runtime (/MD or /MDd). Make sure the client code is usingmatching runtime.

• FMILIB_BUILD_STATIC_LIB Build the library as static.Default: ON'fmilib' may be used for static linking.

• FMILIB_BUILD_SHARED_LIB Build the library as shared (dll/so/dylib).Default: ON'fmilib_shared' may be used for dynamic linking.

• FMILIB_FMI_PLATFORM - FMI platform defines the subdirectory within FMU where binary is located.The build system will automatically detect win32, win64, linux32, linux64, darwin32, darwin64.

Generated by Doxygen

Page 71: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.3 Automatic tests 3

• FMILIB_BUILD_FOR_SHARED_LIBS The static library 'fmilib' can be linked into shared libraries.Default: ONOn LINUX position independent code (-fPIC) must be used on all files to be linked into a shared library (.sofile). On other systems this is not needed (either is default or relocation is done). Set this option to OFF if youare building an application on Linux and use static library only.

• FMILIB_ENABLE_LOG_LEVEL_DEBUG Enable log level 'debug'.Default: OFFIf the option is OFF then the debug level messages are not compiled in.

• FMILIB_GENERATE_DOXYGEN_DOC Enable doxygen target.Default: ONYou need Doxygen to be installed on the system for this option to have an effect.

• FMILIB_BUILD_TESTS Enable build of the tests supplied with the library.Default: ONRUN_TESTS - target will be provided in Visual Studio. 'make test' will run tests on Makefile based platforms.

• FMILIB_BUILD_BEFORE_TESTS Force build before testing, i.e., building the FMI library becomes the firsttest.Default: ON

• FMILIB_LINK_TEST_TO_SHAREDLIB Link the tests to fmilib_shared (if built) instead of static fmilib.Default: ON

• FMILIB_GENERATE_BUILD_STAMP Generate a build time stamp and include in into the library.Default: OFFThe function fmilib_get_build_stamp() may be used to retrieve the time stamp.

const char* fmilib_get_build_stamp(void);

• FMILIB_BUILD_LEX_AND_PARSER_FILES Generate scanner and parser for variable name syntax check-ing. Requiers Flex and Bison commands to be specified. Please read src/XML/NOTE if using this option.Can only be used on windows. Only tested with versions 2.4.3/2.5.3.

• BISON_COMMAND Specifies the path to the Bison executable. Only visible if FMILIB_BUILD_LEX_AND←↩

_PARSER_FILES is checked.

• FLEX_COMMAND Specifies the path to the Flex executable. Only visible if FMILIB_BUILD_LEX_AND_P←↩

ARSER_FILES is checked.

1.3 Automatic tests

The FMI library comes with a number of automatic tests. Building of the test is controlled by FMILIB_BUILD_TESTSconfiguration option. The test porgrams are also intended as examples of library usage.The tests can be run in Visual Studio by building project RUN_TESTS. For Makefile based configurations (MSYS,Linux, Mac OSx) run 'make test'.Output from the test programs and test logs can be found in the Testing folder in the build directory.

The supplied tests are:

• ctest_build_allBuild the library. This test is controlled by FMILIB_BUILD_BEFORE_TESTS configuration option.

• ctest_fmi_zip_unzip_testBasic unzip functionality test. Test executable is fmi_zip_unzip_test.

• ctest_fmi_zip_zip_testBasic zip functionality test. Test executable is fmi_zip_zip_test.

Generated by Doxygen

Page 72: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4 FMI Library: part of JModelica.org

• ctest_fmi1_check_variable_naming_conventions_testTests the name checker functionality to follow the variable naming conventions. Test executable is ctest←↩

_fmi1_check_variable_naming_conventions_test, main source file is ctest_fmi1_check_variable_naming_←↩

conventions_test::c. fmi_import_me_test, main source file is fmi_import_me_test.c.

• ctest_fmi_import_me_testLoad a basic model exchange FMU and simulate it. Test executable is fmi_import_me_test, main source fileis fmi_import_me_test.c.

• ctest_fmi_import_cs_testLoad a basic co-simulation FMU and simulate it. Test executable is fmi_import_cs_test, main source file isfmi_import_cs_test.c.

• ctest_fmi_import_cs_tc_testLoad a basic co-simulation tools coupling FMU and simulate it. Test executable is fmi_import_cs_test, mainsource file is fmi_import_cs_test.c.

• ctest_fmi_import_xml_test, ctest_fmi_import_xml_test_empty, ctest_fmi_import_xml_test_mfLoad a small model description XML file and print out detailed information on it. Test executable is fmi_←↩

import_xml_text, main source file is fmi_import_xml_test::cc. The test is run on three different XML files. Thistest depends on the success of the ctest_fmi_import_cs_test.

• ctest_fmi1_capi_cs_testLow level test of FMI CAPI functionality for co-simulation. Test executable is fmi1_capi_cs_test.

• ctest_fmi1_capi_me_testLow level test of FMI CAPI functionality for model exchange. Test executable is fmi1_capi_me_test.

• ctest_fmi1_logger_test_runRun logger test generating output fmi1_logger_test_output.txt. Test executable is fmi1_logger_test.

• ctest_fmi1_logger_test_checkCheck that the logger test output generated by ctest_fmi1_logger_test_run is identical with the referencefile found in the Test subdirectory.

• ctest_fmi2_check_variable_naming_conventions_testTests the name checker functionality to follow the variable naming conventions. Test executable is ctest←↩

_fmi2_check_variable_naming_conventions_test, main source file is ctest_fmi2_check_variable_naming_←↩

conventions_test::c.

• ctest_fmi2_import_xml_test_empty, ctest_fmi2_import_xml_test_me, ctest_fmi2_import_xml_test_←↩

cs, ctest_fmi2_import_xml_test_mfSame as ctest_fmi_import_xml_test for FMI 2.0 modules. Test executable is fmi2_import_xml_test.exe,main source file fmi2_import_xml_test.cc.

• ctest_fmi2_import_test_meLoad a basic FMI 2.0 model exchange FMU and simulate it. Test executable is fmi2_import_me_test, mainsource file is fmi2_import_me_test.c.

• ctest_fmi2_import_test_cs \ Load a basic FMI 2.0 co-simulation FMU and simulate it. Test executable isfmi2_import_cs_test, main source file is fmi2_import_me_test.c.

• ctest_fmi_import_test_no_xml, ctest_fmi_import_test_me_1, ctest_fmi_import_test_cs_1, ctest_←↩

fmi_import_test_me_2, ctest_fmi_import_test_cs_2Test library functionality of handling FMUs with different standard interfaces within a single application. Testexecutable is fmi_import_test.exe. Main source file is fmi_import_test.c

1.4 Using logs

In the text below we consider an FMU importing application (referenced as an 'application') that uses the FMIL.The library is designed to send log messages to a logger callback function jm_logger_f provided as a part of jm←↩

_callbacks structure in the call to fmi_import_allocate_context(). The logging/error reporting functions within FMILsupport following modes:

Generated by Doxygen

Page 73: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.5 License 5

1. An importing application relies on default logging functions provided by FMIL and only chooses the log-level

• FMIL provides default jm logger callback (See jm_callbacks.h jm_default_logger())

• FMIL provides default fmi logger callback for each standard version. See fmi1_import_convenience.hfmi1_default_callback_logger() and fmi2_import_convenience.h fmi2_default_callback_logger().

2. An application provides a callback for reporting error messages according to jm_callbacks.h (jm_logger_f)

• Only errors from FMIL can be propagated to this callback in a thread-safe manner for FMI1. ImportedFMUs may still use the default callback provided by the library. This is since logger function in FMI1.0 standard is context independent. The non-thread safe implementation on the FMI1 callback can befound in fmi1_import_convenience.h fmi1_log_forwarding().In FMI 2 the fmiComponentEnvironment can be utilized to forward messages from the default fmi2 loggerfunction as provided by the library to the user defined jm_logger_f function. The fmi2_log_forwarding()function expects the context to be set to fmi2_import_t.

3. An importing application provides logging function according to the specific FMI standard version.

• Errors from FMIL may be forwarded to this callback. There is a function that translates calls according tojm_callbacks.h jm_logger_f into calls according to fmi_functions.h fmi_callbacks_logger_ft (see fmi1←↩

_import_init_logger() or fmi2_import_init_logger() that are used to setup 'forwarding').Setting of the callback can only be done at the stage where FMU standard is known.

4. An importing application may choose not to use logging function but rely on return codes and jm_get_last_←↩

error()

• jm_logger function should be set to NULL

• Errors from a FMI 1.0 fmu1 cannot be handled this way in a thread-safe way (see point 2 above). Itworks fine with FMI 2.0.

1.5 License

Copyright

(C) 2012 Modelon AB

Redistribution and use in source and binary forms, with or without modification, are permitted provided that thefollowing conditions are met:

• Redistributions of source code must retain the above copyright notice, this list of conditions and the followingdisclaimer.

• Redistributions in binary form must reproduce the above copyright notice, this list of conditions and thefollowing disclaimer in the documentation and/or other materials provided with the distribution.

• Neither the name of the Modelon AB nor the names of its contributors may be used to endorse or promoteproducts derived from this software without specific prior written permission.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WA←↩

RRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.IN NO EVENT SHALL MODELON AB BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENTOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERR←↩

UPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THEUSE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Generated by Doxygen

Page 74: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6 FMI Library: part of JModelica.org

1.6 Acknowledgements

The FMI Library utilizes contains code from third party tools and packages. The respective copyright informationand licenses are listed with URL references to the full texts.

• eXPatThe parsing of the file modelDescription.xml is using eXpat.Homepage: http://www.libexpat.org/MIT License: http://www.jclark.com/xml/copying.txt

• MinizipThe unziping of the FMU is performed partially by using Minizip library.Homepage: http://www.winimage.com/zLibDll/minizip.html.Condition of use and distribution are the same as Zlib http://www.zlib.net/zlib_license.←↩

html.

• ZlibThe unziping is performed by using Zlib library called via minizip library.Homepage: http://www.zlib.net/.Zlib License: http://www.zlib.net/zlib_license.html.

• C99 snprintfC99 snprintf library is used to realize the snprintf functionality staying with C89 code.Homepage: http://www.jhweiss.de/software/snprintf.htmlThe code is free to use. See notice in the COPYING file included with the code.

Generated by Doxygen

Page 75: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 2

Module Index

2.1 Modules

Here is a list of all modules:

FMI import library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Library initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98FMI 1.0 import interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

Handling of variable lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Constuction, destruction and error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104General information retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106Interface to the standard FMI 1.0 "C" API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112

FMI 1.0 Constructor and Destructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115FMI 1.0 (ME) Model Exchange functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117FMI 1.0 (CS) Co-Simulation functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124FMI 1.0 (ME & CS) Common functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

Functions to retrieve capability flags. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113Convenience functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136Functions to retrieve co-simulation related information. . . . . . . . . . . . . . . . . . . . . . . . . 139Support for processing variable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140Functions for handling unit definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145Functions for handling variable definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148Basic support for vendor annotations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156

FMI 2.0 import interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29Handling of variable lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30Constuction, destruction and error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158General information retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160Interface to the standard FMI 2.0 "C" API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171

FMI 2.0 Constructor and Destructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172FMI 2.0 (ME) Model Exchange functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174FMI 2.0 (CS) Co-Simulation functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179FMI 2.0 (ME & CS) Common functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183

Convenience functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194Support for processing variable types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197Functions for handling unit definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204Functions for handling variable definitions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

Utility functions supporting interactions with the library . . . . . . . . . . . . . . . . . . . . . . . . . . 102

Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

A basic stack . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

Page 76: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8 Module Index

Functions and types supporting FMI 1.0 processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . 34Enum types used with FMI 1.0 libs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

Functions and types supporting FMI 2.0 processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . 48Enum types used with FMI 2.0 libs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Definition of XML callbacks struct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

Definition of callbacks struct and supporting functions . . . . . . . . . . . . . . . . . . . . . . . . . . 72Named objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78Handling platform specific defines and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80A set of strings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84A vector of items (dynamic array) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

Generated by Doxygen

Page 77: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 3

Data Structure Index

3.1 Data Structures

Here are the data structures with brief descriptions:

component_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217fmi1_callback_functions_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223fmi1_event_info_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224fmi1_import_model_counts_t

Collection of counters providing model information . . . . . . . . . . . . . . . . . . . . . . . . 225fmi1_me_callback_functions_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228fmi2_callback_functions_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229fmi2_event_info_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230fmi2_import_model_counts_t

Collection of counters providing model information . . . . . . . . . . . . . . . . . . . . . . . . 231fmi2_xml_callbacks_t

XML callbacks are used to process parts of XML that are not handled by the library . . . . . . 234fmul_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235jm_callbacks

The callbacks struct is sent to all the modules in the library . . . . . . . . . . . . . . . . . . . 236jm_name_ID_map_t

Mapping between a string and an integer ID . . . . . . . . . . . . . . . . . . . . . . . . . . . 237jm_named_ptr

Name and object pointer pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238xml_test_files_t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239

Page 78: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

10 Data Structure Index

Generated by Doxygen

Page 79: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 4

File Index

4.1 File List

Here is a list of all files with brief descriptions:

src/Import/include/FMI/fmi_import_context.hImport context is the entry point to the library. It is used to initialize, unzip, get FMI version andstart parsing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

src/Import/include/FMI/fmi_import_util.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242src/Import/include/FMI1/fmi1_import.h

Public interface to the FMI import C-library . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243src/Import/include/FMI1/fmi1_import_capabilities.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244src/Import/include/FMI1/fmi1_import_capi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245src/Import/include/FMI1/fmi1_import_convenience.h

Public interface to the FMI import C-library. Convenience functions . . . . . . . . . . . . . . . 248src/Import/include/FMI1/fmi1_import_cosim.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249src/Import/include/FMI1/fmi1_import_type.h

Public interface to the FMI XML C-library: variable types handling . . . . . . . . . . . . . . . . 249src/Import/include/FMI1/fmi1_import_unit.h

Public interface to the FMI import C-library. Handling of variable units . . . . . . . . . . . . . . 251src/Import/include/FMI1/fmi1_import_variable.h

Public interface to the FMI import C-library. Handling of model variables . . . . . . . . . . . . 252src/Import/include/FMI1/fmi1_import_variable_list.h

Public interface to the FMI XML C-library. Handling of variable lists . . . . . . . . . . . . . . . 254src/Import/include/FMI1/fmi1_import_vendor_annotations.h

Public interface to the FMI XML C-library. Handling of vendor annotations . . . . . . . . . . . 255src/Import/include/FMI2/fmi2_import.h

Public interface to the FMI import C-library . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256src/Import/include/FMI2/fmi2_import_capi.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258src/Import/include/FMI2/fmi2_import_convenience.h

Public interface to the FMI import C-library. Convenience functions . . . . . . . . . . . . . . . 261src/Import/include/FMI2/fmi2_import_type.h

Public interface to the FMI XML C-library: variable types handling . . . . . . . . . . . . . . . . 262src/Import/include/FMI2/fmi2_import_unit.h

Public interface to the FMI import C-library. Handling of variable units . . . . . . . . . . . . . . 264src/Import/include/FMI2/fmi2_import_variable.h

Public interface to the FMI import C-library. Handling of model variables . . . . . . . . . . . . 265src/Import/include/FMI2/fmi2_import_variable_list.h

Public interface to the FMI XML C-library. Handling of variable lists . . . . . . . . . . . . . . . 267src/Util/include/FMI/fmi_util.h

Some low-level utility functions suitable for all standards . . . . . . . . . . . . . . . . . . . . . 268

Page 80: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12 File Index

src/Util/include/FMI/fmi_version.hEnum defining supported FMI versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269

src/Util/include/FMI1/fmi1_enums.hDefinions the enum types used with FMI 1.0 libs . . . . . . . . . . . . . . . . . . . . . . . . . 269

src/Util/include/FMI1/fmi1_functions.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271src/Util/include/FMI1/fmi1_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273src/Util/include/FMI2/fmi2_enums.h

Definions the enum types used with FMI 2.0 libs . . . . . . . . . . . . . . . . . . . . . . . . . 273src/Util/include/FMI2/fmi2_functions.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276src/Util/include/FMI2/fmi2_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278src/Util/include/FMI2/fmi2_xml_callbacks.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278src/Util/include/JM/jm_callbacks.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279src/Util/include/JM/jm_named_ptr.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281src/Util/include/JM/jm_portability.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282src/Util/include/JM/jm_stack.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283src/Util/include/JM/jm_string_set.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284src/Util/include/JM/jm_types.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284src/Util/include/JM/jm_vector.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285src/Util/include/JM/jm_vector_template.h

Vector template definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287Test/compress_test_fmu_zip.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288Test/fmi_import_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369Test/fmi_zip_unzip_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315Test/fmi_zip_zip_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316Test/jm_vector_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339Test/FMI1/compress_test_fmu_zip.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289Test/FMI1/fmi1_capi_cs_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290Test/FMI1/fmi1_capi_me_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296Test/FMI1/fmi1_import_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302Test/FMI1/fmi1_logger_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303Test/FMI1/fmi1_xml_parsing_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304Test/FMI1/fmi_import_cs_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308Test/FMI1/fmi_import_me_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310Test/FMI1/fmi_import_xml_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311Test/FMI1/fmi_total_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313Test/FMI1/fmi_zip_unzip_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314Test/FMI1/fmi_zip_zip_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315Test/FMI1/jm_vector_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338Test/FMI1/fmu_dummy/fmu1_model.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317Test/FMI1/fmu_dummy/fmu1_model.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324Test/FMI1/fmu_dummy/fmu1_model_cs.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327Test/FMI1/fmu_dummy/fmu1_model_defines.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331Test/FMI1/fmu_dummy/fmu1_model_me.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334Test/FMI2/fmi2_import_cs_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 341Test/FMI2/fmi2_import_me_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 342Test/FMI2/fmi2_import_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343Test/FMI2/fmi2_import_xml_test.cc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344Test/FMI2/fmi2_xml_parsing_test.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346Test/FMI2/fmu_dummy/fmu2_model.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348Test/FMI2/fmu_dummy/fmu2_model.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354Test/FMI2/fmu_dummy/fmu2_model_cs.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359Test/FMI2/fmu_dummy/fmu2_model_defines.h . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363Test/FMI2/fmu_dummy/fmu2_model_me.c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365/tmp/FMILibraryBuild/build/doc/fmilib.h

Include file to be used in client applications of the FMI Library . . . . . . . . . . . . . . . . . . 370/tmp/FMILibraryBuild/build/doc/fmilib_config.h

Library configuration file generated by the build system . . . . . . . . . . . . . . . . . . . . . 371

Generated by Doxygen

Page 81: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.1 File List 13

/tmp/FMILibraryBuild/build/doc/fmilib_mainpage.hAutogenerated file with documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 373

Generated by Doxygen

Page 82: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

14 File Index

Generated by Doxygen

Page 83: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 5

Module Documentation

5.1 FMI import library

Modules

• Library initialization• FMI 1.0 import interface• FMI 2.0 import interface• Utility functions supporting interactions with the library

5.1.1 Detailed Description

Page 84: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16 Module Documentation

5.2 Utilities

Modules

• A basic stack• Functions and types supporting FMI 1.0 processing.• Functions and types supporting FMI 2.0 processing.• Definition of callbacks struct and supporting functions• Named objects• Handling platform specific defines and functions• A set of strings• A vector of items (dynamic array)

Data Structures

• struct jm_name_ID_map_t

Mapping between a string and an integer ID.

Typedefs

• typedef const char ∗ jm_string

A constant string.

• typedef void ∗ jm_voidp

A void pointer.

• typedef struct jm_name_ID_map_t jm_name_ID_map_t

Mapping between a string and an integer ID.

Enumerations

• enum fmi_version_enu_t { fmi_version_unknown_enu = 0, fmi_version_1_enu, fmi_version_2_0_enu, fmi_←↩

version_unsupported_enu }

Suported versions of FMI standard.

• enum jm_status_enu_t { jm_status_error = -1, jm_status_success = 0, jm_status_warning = 1 }

Return status codes.

• enum jm_log_level_enu_t {jm_log_level_nothing = 0, jm_log_level_fatal, jm_log_level_error, jm_log_level_warning,jm_log_level_info, jm_log_level_verbose, jm_log_level_debug, jm_log_level_all }

Log levels supported via the logger functions in jm_callbacks.

Functions

• FMILIB_EXPORT char ∗ fmi_construct_dll_dir_name (jm_callbacks ∗callbacks, const char ∗fmu_unzipped←↩

_path)

Given directory name fmu_unzipped_path and construct the directory path for Dll/so.

• FMILIB_EXPORT char ∗ fmi_construct_dll_file_name (jm_callbacks ∗callbacks, const char ∗dll_dir_name,const char ∗model_identifier)

Given model_identifier construct the dll/so name by adding platform suffix.

• FMILIB_EXPORT const char ∗ fmi_version_to_string (fmi_version_enu_t v)• FMILIB_EXPORT const char ∗ jm_log_level_to_string (jm_log_level_enu_t level)

Convert log level into a string.

Generated by Doxygen

Page 85: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.2 Utilities 17

5.2.1 Detailed Description

5.2.2 Typedef Documentation

5.2.2.1 typedef const char∗ jm_string

A constant string.

Definition at line 33 of file jm_types.h.

5.2.2.2 typedef void∗ jm_voidp

A void pointer.

Definition at line 35 of file jm_types.h.

5.2.2.3 typedef struct jm_name_ID_map_t jm_name_ID_map_t

Mapping between a string and an integer ID.

5.2.3 Enumeration Type Documentation

5.2.3.1 enum fmi_version_enu_t

Suported versions of FMI standard.

Enumerator

fmi_version_unknown_enu

fmi_version_1_enu

fmi_version_2_0_enu

fmi_version_unsupported_enu

Definition at line 34 of file fmi_version.h.

5.2.3.2 enum jm_status_enu_t

Return status codes.

Enumerator

jm_status_error

jm_status_success

jm_status_warning

Definition at line 44 of file jm_types.h.

Generated by Doxygen

Page 86: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18 Module Documentation

5.2.3.3 enum jm_log_level_enu_t

Log levels supported via the logger functions in jm_callbacks.

Enumerator

jm_log_level_nothing

jm_log_level_fatal Must be first in this enum. May be usefull in application relying solely on jm_get_last_←↩

error()

jm_log_level_error Unrecoverable errors.

jm_log_level_warning Errors that may be not critical for some FMUs.

jm_log_level_info Non-critical issues.

jm_log_level_verbose Informative messages.

jm_log_level_debug Verbose messages.

jm_log_level_all Debug messages. Only enabled if library is configured with FMILIB_ENABLE_LOG_LE←↩

VEL_DEBUG. Must be last in this enum.

Definition at line 51 of file jm_types.h.

5.2.4 Function Documentation

5.2.4.1 FMILIB_EXPORT char∗ fmi_construct_dll_dir_name ( jm_callbacks ∗ callbacks, const char ∗fmu_unzipped_path )

Given directory name fmu_unzipped_path and construct the directory path for Dll/so.

Parameters

fmu_unzipped_path Directory name where FMU is unpacked.

callbacks Callbacks for memory allocation.

Returns

Pointer to a string with the directory name (last symbol is directory separator). Caller is responsible for freeingthe memory.

5.2.4.2 FMILIB_EXPORT char∗ fmi_construct_dll_file_name ( jm_callbacks ∗ callbacks, const char ∗ dll_dir_name,const char ∗ model_identifier )

Given model_identifier construct the dll/so name by adding platform suffix.

Parameters

callbacks Callbacks for memory allocation.

dll_dir_name Directory path for Dll/so as returned by fmi_construct_dll_dir_name

model_identifier The FMU model identifier.

Generated by Doxygen

Page 87: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.2 Utilities 19

Returns

Pointer to a string with the file name. Caller is responsible for freeing the memory.

5.2.4.3 FMILIB_EXPORT const char∗ fmi_version_to_string ( fmi_version_enu_t v )

Convert version enum into string

5.2.4.4 FMILIB_EXPORT const char∗ jm_log_level_to_string ( jm_log_level_enu_t level )

Convert log level into a string.

Generated by Doxygen

Page 88: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20 Module Documentation

5.3 A basic stack

Macros

• #define jm_stack(T) jm_mangle(jm_stack, T)

A basic stack of items.

• #define jm_stack_alloc(T) jm_mangle(jm_stack_alloc, T)

Allocates a stack with the given reserved memory.

• #define jm_stack_free(T) jm_mangle(jm_stack_free, T)

Release memory allocated for a stack.

• #define jm_stack_init(T) jm_mangle(jm_stack_init, T)

Initializes a jm_stack allocated on stack.

• #define jm_stack_free_data(T) jm_mangle(jm_stack_free_data, T)

Releases memory allocated for stack data.

• #define jm_stack_get_size(T) jm_mangle(jm_stack_get_size, T)

Get the number of elements in the stack.

• #define jm_stack_reserve(T) jm_mangle(jm_stack_reserve, T)

Preallocate memory for the stack (to speed up consequent push).

• #define jm_stack_push(T) jm_mangle(jm_stack_push, T)

Put an element on the stack.

• #define jm_stack_is_empty(T) jm_mangle(jm_stack_is_empty, T)• #define jm_stack_pop(T) jm_mangle(jm_stack_pop, T)• #define jm_stack_top(T) jm_mangle(jm_stack_top, T)• #define jm_stack_foreach(T) jm_mangle(jm_stack_foreach, T)• #define JM_STACK_MINIMAL_CAPACITY JM_VECTOR_MINIMAL_CAPACITY• #define JM_STACK_MAX_MEMORY_CHUNK JM_VECTOR_MAX_MEMORY_CHUNK• #define jm_stack_declare_template(T)

5.3.1 Detailed Description

5.3.2 Macro Definition Documentation

5.3.2.1 #define jm_stack( T ) jm_mangle(jm_stack, T)

A basic stack of items.

Stack is implemented on top of jm_vector right now. There is a couple of extra methonds that are convenient.

Definition at line 41 of file jm_stack.h.

5.3.2.2 #define jm_stack_alloc( T ) jm_mangle(jm_stack_alloc, T)

Allocates a stack with the given reserved memory.

1 jm_stack(T)* jm_stack_alloc(T)(size_t capacity,jm_callbacks*c );

Generated by Doxygen

Page 89: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.3 A basic stack 21

Parameters

capacity - initial stack capacity, can be 0

c - jm_callbacks callbacks, can be zero

Returns

Newly allocated stack

Definition at line 52 of file jm_stack.h.

5.3.2.3 #define jm_stack_free( T ) jm_mangle(jm_stack_free, T)

Release memory allocated for a stack.

1 extern void jm_stack_free(T)(jm_stack(T)* a);

Definition at line 60 of file jm_stack.h.

5.3.2.4 #define jm_stack_init( T ) jm_mangle(jm_stack_init, T)

Initializes a jm_stack allocated on stack.

Parameters

a - pointer to the stack to be initialized;

c - jm_callbacks callbacks, can be zero

1 void jm_stack_init(T)(jm_stack(T)* a, jm_callbacks* c)

Definition at line 71 of file jm_stack.h.

5.3.2.5 #define jm_stack_free_data( T ) jm_mangle(jm_stack_free_data, T)

Releases memory allocated for stack data.

This only needs to be called both for stack allocated jm_stack structs.

1 inline void jm_stack_free_data(T)(jm_stack(T)* a)

Parameters

a - pointer to the stack.

Generated by Doxygen

Page 90: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22 Module Documentation

Definition at line 83 of file jm_stack.h.

5.3.2.6 #define jm_stack_get_size( T ) jm_mangle(jm_stack_get_size, T)

Get the number of elements in the stack.

1 inline size_t jm_stack_get_size(T)(jm_stack(T)* a)

Definition at line 92 of file jm_stack.h.

5.3.2.7 #define jm_stack_reserve( T ) jm_mangle(jm_stack_reserve, T)

Preallocate memory for the stack (to speed up consequent push).

Returns

The actually reserved space. Can be smaller than "capacity" if memory allocation failed. Can be largerthan "capacity" if more memory was previously allocated. size_t jm_stack_reserve(T)(jm_stack(T)∗ a, size_tcapacity)

Definition at line 101 of file jm_stack.h.

5.3.2.8 #define jm_stack_push( T ) jm_mangle(jm_stack_push, T)

Put an element on the stack.

Returns

A pointer to the inserted element or zero pointer if failed.

1 T* jm_stack_push_back(jm_stack(T)* a, T item);

Definition at line 111 of file jm_stack.h.

5.3.2.9 #define jm_stack_is_empty( T ) jm_mangle(jm_stack_is_empty, T)

jm_stack_is_empty returns 1 if the stack is empty and 0 otherwize. int jm_stack_is_empty(jm_stack(T)∗)

Definition at line 117 of file jm_stack.h.

5.3.2.10 #define jm_stack_pop( T ) jm_mangle(jm_stack_pop, T)

jm_stack_pop gets the stack head and moves to the next element. Popping an empty stack gives assertion failure.T jm_stack_pop(jm_stack(T)∗ a)

Definition at line 123 of file jm_stack.h.

Generated by Doxygen

Page 91: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.3 A basic stack 23

5.3.2.11 #define jm_stack_top( T ) jm_mangle(jm_stack_top, T)

jm_stack_top gets the stack top. Call on an empty stack gives assertion failure. T jm_stack_top(jm_stack(T)∗ a)

Definition at line 129 of file jm_stack.h.

5.3.2.12 #define jm_stack_foreach( T ) jm_mangle(jm_stack_foreach, T)

jm_stack_foreach calls f for each element in the stack. "data" parameter is forwarded to the function as the secondargument. void jm_stack_foreach(T)(jm_stack(T)∗ a, void (f)(T, void), void ∗ data)

Definition at line 136 of file jm_stack.h.

5.3.2.13 #define JM_STACK_MINIMAL_CAPACITY JM_VECTOR_MINIMAL_CAPACITY

minimal number of items always allocated for the stack

Definition at line 140 of file jm_stack.h.

5.3.2.14 #define JM_STACK_MAX_MEMORY_CHUNK JM_VECTOR_MAX_MEMORY_CHUNK

maximum memory chunk (in items) to be allocated in push.

Definition at line 143 of file jm_stack.h.

5.3.2.15 #define jm_stack_declare_template( T )

Declare stack for the specific type.

Definition at line 146 of file jm_stack.h.

Generated by Doxygen

Page 92: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24 Module Documentation

5.4 FMI 1.0 import interface

Modules

• Handling of variable lists

Variable lists are provided to handle sets of variables.

• Constuction, destruction and error handling• General information retrieval

Functions for retrieving general model information. Memory for the strings is allocated and deallocated in the module.All the functions take an FMU object as returned by fmi1_import_parse_xml() as a parameter. The information isretrieved from the XML file.

• Interface to the standard FMI 1.0 "C" API

Convenient functions for calling the FMI functions. This interface wrappes the "C" API.

• Functions to retrieve capability flags.• Convenience functions.

The functions in this module are provided for convenience. The functionality is already available via other lower levelfunctions.

• Functions to retrieve co-simulation related information.• Support for processing variable types• Functions for handling unit definitions.• Functions for handling variable definitions.

All the functions in this group take a pointer to fmi1_import_variable_t as a parameter. A variable pointer may beobtained via a Handling of variable lists module or via functions fmi1_import_get_variable_by_name() and fmi1_←↩

import_get_variable_by_vr().

• Basic support for vendor annotations.

5.4.1 Detailed Description

All the structures used in the interfaces are intended to be treated as opaque objects by the client code.

Generated by Doxygen

Page 93: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.5 Handling of variable lists 25

5.5 Handling of variable lists

Variable lists are provided to handle sets of variables.

Functions

• fmi1_import_variable_list_t ∗ fmi1_import_alloc_variable_list (fmi1_import_t ∗fmu, size_t size)• FMILIB_EXPORT void fmi1_import_free_variable_list (fmi1_import_variable_list_t ∗vl)

Free a variable list. Note that variable lists are allocated dynamically and must be freed when not needed any longer.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_clone_variable_list (fmi1_import_variable_list←↩

_t ∗vl)

Make a copy of the list.

• FMILIB_EXPORT size_t fmi1_import_get_variable_list_size (fmi1_import_variable_list_t ∗vl)

Get number of variables in a list.

• FMILIB_EXPORT const fmi1_value_reference_t ∗ fmi1_import_get_value_referece_list (fmi1_import_←↩

variable_list_t ∗vl)

Get a pointer to the list of the value references for all the variables.

• FMILIB_EXPORT fmi1_import_variable_t ∗ fmi1_import_get_variable (fmi1_import_variable_list_t ∗vl, un-signed int index)

Get a single variable from the list.

Operations on variable lists. Every operation creates a new list.

• typedef int(∗ fmi1_import_variable_filter_function_ft) (fmi1_import_variable_t ∗vl, void ∗data)

Callback function typedef for the fmiFilterVariables.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_sublist (fmi1_import_variable_list_t ∗vl, un-signed int fromIndex, unsigned int toIndex)

Select sub-lists.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_filter_variables (fmi1_import_variable_list_t ∗vl,fmi1_import_variable_filter_function_ft filter, void ∗context)

Call the provided 'filter' function on every variable in the list and create a new list.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_join_var_list (fmi1_import_variable_list_t ∗a,fmi1_import_variable_list_t ∗b)

Create a new variable list by concatenating two lists.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_append_to_var_list (fmi1_import_variable_←↩

list_t ∗vl, fmi1_import_variable_t ∗v)

Append a variable to the variable list.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_prepend_to_var_list (fmi1_import_variable_←↩

list_t ∗vl, fmi1_import_variable_t ∗v)

Prepend a variable to the variable list.

• FMILIB_EXPORT jm_status_enu_t fmi1_import_var_list_push_back (fmi1_import_variable_list_t ∗vl, fmi1←↩

_import_variable_t ∗v)

Add a variable to a variable list.

5.5.1 Detailed Description

Variable lists are provided to handle sets of variables.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

Generated by Doxygen

Page 94: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

26 Module Documentation

5.5.2 Typedef Documentation

5.5.2.1 typedef int(∗ fmi1_import_variable_filter_function_ft) (fmi1_import_variable_t ∗vl, void ∗data)

Callback function typedef for the fmiFilterVariables.

The function should return 0 to prevent a variable from coming to the output list.

Definition at line 81 of file fmi1_import_variable_list.h.

5.5.3 Function Documentation

5.5.3.1 fmi1_import_variable_list_t∗ fmi1_import_alloc_variable_list ( fmi1_import_t ∗ fmu, size_t size )

5.5.3.2 FMILIB_EXPORT void fmi1_import_free_variable_list ( fmi1_import_variable_list_t ∗ vl )

Free a variable list. Note that variable lists are allocated dynamically and must be freed when not needed any longer.

Parameters

vl A variable list.

5.5.3.3 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_clone_variable_list (fmi1_import_variable_list_t ∗ vl )

Make a copy of the list.

Parameters

vl A variable list.

5.5.3.4 FMILIB_EXPORT size_t fmi1_import_get_variable_list_size ( fmi1_import_variable_list_t ∗ vl )

Get number of variables in a list.

5.5.3.5 FMILIB_EXPORT const fmi1_value_reference_t∗ fmi1_import_get_value_referece_list (fmi1_import_variable_list_t ∗ vl )

Get a pointer to the list of the value references for all the variables.

5.5.3.6 FMILIB_EXPORT fmi1_import_variable_t∗ fmi1_import_get_variable ( fmi1_import_variable_list_t ∗ vl,unsigned int index )

Get a single variable from the list.

Generated by Doxygen

Page 95: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.5 Handling of variable lists 27

5.5.3.7 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_get_sublist ( fmi1_import_variable_list_t ∗vl, unsigned int fromIndex, unsigned int toIndex )

Select sub-lists.

Parameters

vl A variable list.fromIndex Zero based start index, inclusive.toIndex Zero based end index, inclusive.

Returns

A sublist. NULL is returned if toIndex is less than fromIndex or is larger than the list size or if memory allocationfailed.

5.5.3.8 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_filter_variables ( fmi1_←↩

import_variable_list_t ∗ vl, fmi1_import_variable_filter_function_ft filter, void ∗ context)

Call the provided 'filter' function on every variable in the list and create a new list.

Parameters

vl A variable list.filter A filter function according to fmi1_import_variable_filter_function_ft.

context A parameter to be forwarded to the filter function.

Returns

A sub-list with the variables for which filter returned non-zero value.

5.5.3.9 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_join_var_list ( fmi1_import_variable_list_t ∗a, fmi1_import_variable_list_t ∗ b )

Create a new variable list by concatenating two lists.

Parameters

a A variable list.b A variable list.

5.5.3.10 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_append_to_var_list (fmi1_import_variable_list_t ∗ vl, fmi1_import_variable_t ∗ v )

Append a variable to the variable list.

Generated by Doxygen

Page 96: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28 Module Documentation

Parameters

vl A variable list.v A variable.

5.5.3.11 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_prepend_to_var_list (fmi1_import_variable_list_t ∗ vl, fmi1_import_variable_t ∗ v )

Prepend a variable to the variable list.

Parameters

vl A variable list.v A variable.

5.5.3.12 FMILIB_EXPORT jm_status_enu_t fmi1_import_var_list_push_back ( fmi1_import_variable_list_t ∗ vl,fmi1_import_variable_t ∗ v )

Add a variable to a variable list.

Parameters

vl A variable list.v A variable.

Generated by Doxygen

Page 97: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.6 FMI 2.0 import interface 29

5.6 FMI 2.0 import interface

Modules

• Handling of variable lists

Variable lists are provided to handle sets of variables.

• Constuction, destruction and error handling• General information retrieval

Functions for retrieving general model information. Memory for the strings is allocated and deallocated in the module.All the functions take an FMU object as returned by fmi2_import_parse_xml() as a parameter. The information isretrieved from the XML file.

• Interface to the standard FMI 2.0 "C" API

Convenient functions for calling the FMI functions. This interface wrappes the "C" API.

• Convenience functions.

The functions in this module are provided for convenience. The functionality is already available via other lower levelfunctions.

• Support for processing variable types• Functions for handling unit definitions.• 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 beobtained via a Handling of variable lists module or via functions fmi2_import_get_variable_by_name() and fmi2_←↩

import_get_variable_by_vr().

5.6.1 Detailed Description

All the structures used in the interfaces are intended to be treated as opaque objects by the client code.

Generated by Doxygen

Page 98: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30 Module Documentation

5.7 Handling of variable lists

Variable lists are provided to handle sets of variables.

Functions

• fmi2_import_variable_list_t ∗ fmi2_import_alloc_variable_list (fmi2_import_t ∗fmu, size_t size)

Allocate an empty list.

• FMILIB_EXPORT void fmi2_import_free_variable_list (fmi2_import_variable_list_t ∗vl)

Free a variable list. Note that variable lists are allocated dynamically and must be freed when not needed any longer.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_clone_variable_list (fmi2_import_variable_list←↩

_t ∗vl)

Make a copy of the list.

• FMILIB_EXPORT size_t fmi2_import_get_variable_list_size (fmi2_import_variable_list_t ∗vl)

Get number of variables in a list.

• FMILIB_EXPORT const fmi2_value_reference_t ∗ fmi2_import_get_value_referece_list (fmi2_import_←↩

variable_list_t ∗vl)

Get a pointer to the list of the value references for all the variables.

• FMILIB_EXPORT fmi2_import_variable_t ∗ fmi2_import_get_variable (fmi2_import_variable_list_t ∗vl, size←↩

_t index)

Get a single variable from the list.

Operations on variable lists. Every operation creates a new list.

• typedef int(∗ fmi2_import_variable_filter_function_ft) (fmi2_import_variable_t ∗vl, void ∗data)

Callback function typedef for the fmiFilterVariables.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_sublist (fmi2_import_variable_list_t ∗vl,size_t fromIndex, size_t toIndex)

Select sub-lists.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_filter_variables (fmi2_import_variable_list_t ∗vl,fmi2_import_variable_filter_function_ft filter, void ∗context)

Call the provided 'filter' function on every variable in the list and create a new list.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_join_var_list (fmi2_import_variable_list_t ∗a,fmi2_import_variable_list_t ∗b)

Create a new variable list by concatenating two lists.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_append_to_var_list (fmi2_import_variable_←↩

list_t ∗vl, fmi2_import_variable_t ∗v)

Append a variable to the variable list.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_prepend_to_var_list (fmi2_import_variable_←↩

list_t ∗vl, fmi2_import_variable_t ∗v)

Prepend a variable to the variable list.

• FMILIB_EXPORT jm_status_enu_t fmi2_import_var_list_push_back (fmi2_import_variable_list_t ∗vl, fmi2←↩

_import_variable_t ∗v)

Add a variable to a variable list.

5.7.1 Detailed Description

Variable lists are provided to handle sets of variables.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

Generated by Doxygen

Page 99: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.7 Handling of variable lists 31

5.7.2 Typedef Documentation

5.7.2.1 typedef int(∗ fmi2_import_variable_filter_function_ft) (fmi2_import_variable_t ∗vl, void ∗data)

Callback function typedef for the fmiFilterVariables.

The function should return 0 to prevent a variable from coming to the output list.

Definition at line 81 of file fmi2_import_variable_list.h.

5.7.3 Function Documentation

5.7.3.1 fmi2_import_variable_list_t∗ fmi2_import_alloc_variable_list ( fmi2_import_t ∗ fmu, size_t size )

Allocate an empty list.

5.7.3.2 FMILIB_EXPORT void fmi2_import_free_variable_list ( fmi2_import_variable_list_t ∗ vl )

Free a variable list. Note that variable lists are allocated dynamically and must be freed when not needed any longer.

Parameters

vl A variable list.

5.7.3.3 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_clone_variable_list (fmi2_import_variable_list_t ∗ vl )

Make a copy of the list.

Parameters

vl A variable list.

5.7.3.4 FMILIB_EXPORT size_t fmi2_import_get_variable_list_size ( fmi2_import_variable_list_t ∗ vl )

Get number of variables in a list.

5.7.3.5 FMILIB_EXPORT const fmi2_value_reference_t∗ fmi2_import_get_value_referece_list (fmi2_import_variable_list_t ∗ vl )

Get a pointer to the list of the value references for all the variables.

Generated by Doxygen

Page 100: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32 Module Documentation

5.7.3.6 FMILIB_EXPORT fmi2_import_variable_t∗ fmi2_import_get_variable ( fmi2_import_variable_list_t ∗ vl,size_t index )

Get a single variable from the list.

5.7.3.7 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_get_sublist ( fmi2_import_variable_list_t ∗vl, size_t fromIndex, size_t toIndex )

Select sub-lists.

Parameters

vl A variable list.fromIndex Zero based start index, inclusive.toIndex Zero based end index, inclusive.

Returns

A sublist. NULL is returned if toIndex is less than fromIndex or is larger than the list size or if memory allocationfailed.

5.7.3.8 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_filter_variables ( fmi2_←↩

import_variable_list_t ∗ vl, fmi2_import_variable_filter_function_ft filter, void ∗ context)

Call the provided 'filter' function on every variable in the list and create a new list.

Parameters

vl A variable list.filter A filter function according to fmi2_import_variable_filter_function_ft.

context A parameter to be forwarded to the filter function.

Returns

A sub-list with the variables for which filter returned non-zero value.

5.7.3.9 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_join_var_list ( fmi2_import_variable_list_t ∗a, fmi2_import_variable_list_t ∗ b )

Create a new variable list by concatenating two lists.

Parameters

a A variable list.b A variable list.

Generated by Doxygen

Page 101: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.7 Handling of variable lists 33

5.7.3.10 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_append_to_var_list (fmi2_import_variable_list_t ∗ vl, fmi2_import_variable_t ∗ v )

Append a variable to the variable list.

Parameters

vl A variable list.v A variable.

5.7.3.11 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_prepend_to_var_list (fmi2_import_variable_list_t ∗ vl, fmi2_import_variable_t ∗ v )

Prepend a variable to the variable list.

Parameters

vl A variable list.v A variable.

5.7.3.12 FMILIB_EXPORT jm_status_enu_t fmi2_import_var_list_push_back ( fmi2_import_variable_list_t ∗ vl,fmi2_import_variable_t ∗ v )

Add a variable to a variable list.

Parameters

vl A variable list.v A variable.

Generated by Doxygen

Page 102: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34 Module Documentation

5.8 Functions and types supporting FMI 1.0 processing.

Modules

• Enum types used with FMI 1.0 libs

Data Structures

• struct fmi1_me_callback_functions_t• struct fmi1_callback_functions_t• struct fmi1_event_info_t

Typedefs

• typedef void(∗ fmi1_callback_logger_ft) (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_←↩

t status, fmi1_string_t category, fmi1_string_t message,...)• typedef void ∗(∗ fmi1_callback_allocate_memory_ft) (size_t nobj, size_t size)• typedef void(∗ fmi1_callback_free_memory_ft) (void ∗obj)• typedef void(∗ fmi1_step_finished_ft) (fmi1_component_t c, fmi1_status_t status)• typedef const char ∗(∗ fmi1_get_version_ft) (void)• typedef fmi1_status_t(∗ fmi1_set_debug_logging_ft) (fmi1_component_t c, fmi1_boolean_t loggingOn)• typedef fmi1_status_t(∗ fmi1_set_real_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,

const fmi1_real_t value[ ])• typedef fmi1_status_t(∗ fmi1_set_integer_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size←↩

_t nvr, const fmi1_integer_t value[ ])• typedef fmi1_status_t(∗ fmi1_set_boolean_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ],

size_t nvr, const fmi1_boolean_t value[ ])• typedef fmi1_status_t(∗ fmi1_set_string_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t

nvr, const fmi1_string_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_real_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,

fmi1_real_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_integer_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size←↩

_t nvr, fmi1_integer_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_boolean_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ],

size_t nvr, fmi1_boolean_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_string_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t

nvr, fmi1_string_t value[ ])• typedef const char ∗(∗ fmi1_get_model_typesPlatform_ft) (void)• typedef fmi1_component_t(∗ fmi1_instantiate_model_ft) (fmi1_string_t instanceName, fmi1_string_t GUID,

fmi1_me_callback_functions_t functions, fmi1_boolean_t loggingOn)• typedef void(∗ fmi1_free_model_instance_ft) (fmi1_component_t c)• typedef fmi1_status_t(∗ fmi1_set_time_ft) (fmi1_component_t c, fmi1_real_t time)• typedef fmi1_status_t(∗ fmi1_set_continuous_states_ft) (fmi1_component_t c, const fmi1_real_t x[ ], size_t

nx)• typedef fmi1_status_t(∗ fmi1_completed_integrator_step_ft) (fmi1_component_t c, fmi1_boolean_t ∗call←↩

EventUpdate)• typedef fmi1_status_t(∗ fmi1_initialize_ft) (fmi1_component_t c, fmi1_boolean_t toleranceControlled, fmi1←↩

_real_t relativeTolerance, fmi1_event_info_t ∗eventInfo)• typedef fmi1_status_t(∗ fmi1_get_derivatives_ft) (fmi1_component_t c, fmi1_real_t derivatives[ ], size_t nx)• typedef fmi1_status_t(∗ fmi1_get_event_indicators_ft) (fmi1_component_t c, fmi1_real_t eventIndicators[ ],

size_t ni)• typedef fmi1_status_t(∗ fmi1_event_update_ft) (fmi1_component_t c, fmi1_boolean_t intermediateResults,

fmi1_event_info_t ∗eventInfo)

Generated by Doxygen

Page 103: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.8 Functions and types supporting FMI 1.0 processing. 35

• typedef fmi1_status_t(∗ fmi1_get_continuous_states_ft) (fmi1_component_t c, fmi1_real_t states[ ], size_t nx)• typedef fmi1_status_t(∗ fmi1_get_nominal_continuousStates_ft) (fmi1_component_t c, fmi1_real_t x_←↩

nominal[ ], size_t nx)• typedef fmi1_status_t(∗ fmi1_get_state_valueReferences_ft) (fmi1_component_t c, fmi1_value_reference_t

vrx[ ], size_t nx)• typedef fmi1_status_t(∗ fmi1_terminate_ft) (fmi1_component_t c)• typedef const char ∗(∗ fmi1_get_types_platform_ft) (void)• typedef fmi1_component_t(∗ fmi1_instantiate_slave_ft) (fmi1_string_t instanceName, fmi1_string_t fmuGU←↩

ID, fmi1_string_t fmuLocation, fmi1_string_t mimeType, fmi1_real_t timeout, fmi1_boolean_t visible, fmi1_←↩

boolean_t interactive, fmi1_callback_functions_t functions, fmi1_boolean_t loggingOn)• typedef fmi1_status_t(∗ fmi1_initialize_slave_ft) (fmi1_component_t c, fmi1_real_t tStart, fmi1_boolean_←↩

t StopTimeDefined, fmi1_real_t tStop)• typedef fmi1_status_t(∗ fmi1_terminate_slave_ft) (fmi1_component_t c)• typedef fmi1_status_t(∗ fmi1_reset_slave_ft) (fmi1_component_t c)• typedef void(∗ fmi1_free_slave_instance_ft) (fmi1_component_t c)• typedef fmi1_status_t(∗ fmi1_set_real_inputDerivatives_ft) (fmi1_component_t c, const fmi1_value_←↩

reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], const fmi1_real_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_real_outputDerivatives_ft) (fmi1_component_t c, const fmi1_value_←↩

reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], fmi1_real_t value[ ])• typedef fmi1_status_t(∗ fmi1_cancel_step_ft) (fmi1_component_t c)• typedef fmi1_status_t(∗ fmi1_do_step_ft) (fmi1_component_t c, fmi1_real_t currentCommunicationPoint,

fmi1_real_t communicationStepSize, fmi1_boolean_t newStep)• typedef fmi1_status_t(∗ fmi1_get_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1_status←↩

_t ∗value)• typedef fmi1_status_t(∗ fmi1_get_real_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1_←↩

real_t ∗value)• typedef fmi1_status_t(∗ fmi1_get_integer_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1←↩

_integer_t ∗value)• typedef fmi1_status_t(∗ fmi1_get_boolean_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s,

fmi1_boolean_t ∗value)• typedef fmi1_status_t(∗ fmi1_get_string_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1←↩

_string_t ∗value)• typedef enum fmi1_value_reference_enu_t fmi1_value_reference_enu_t

Enumerations

• enum fmi1_status_t {fmi1_status_ok, fmi1_status_warning, fmi1_status_discard, fmi1_status_error,fmi1_status_fatal, fmi1_status_pending }

• enum fmi1_status_kind_t { fmi1_do_step_status, fmi1_pending_status, fmi1_last_successful_time }• enum fmi1_boolean_enu_t { fmi1_true =fmiTrue, fmi1_false =fmiFalse }• enum fmi1_value_reference_enu_t { fmi1_undefined_value_reference = (int)fmiUndefinedValueReference }

Functions

• FMILIB_EXPORT const char ∗ fmi1_status_to_string (fmi1_status_t status)• static const char ∗ fmi1_get_platform (void)

Renaming of typedefs

• #define fmiComponent fmi1_component_t• #define fmiValueReference fmi1_value_reference_t• #define fmiReal fmi1_real_t• #define fmiInteger fmi1_integer_t• #define fmiBoolean fmi1_boolean_t• #define fmiString fmi1_string_t

Generated by Doxygen

Page 104: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36 Module Documentation

5.8.1 Detailed Description

5.8.2 Macro Definition Documentation

5.8.2.1 #define fmiComponent fmi1_component_t

Definition at line 33 of file fmi1_types.h.

5.8.2.2 #define fmiValueReference fmi1_value_reference_t

Definition at line 34 of file fmi1_types.h.

5.8.2.3 #define fmiReal fmi1_real_t

Definition at line 35 of file fmi1_types.h.

5.8.2.4 #define fmiInteger fmi1_integer_t

Definition at line 36 of file fmi1_types.h.

5.8.2.5 #define fmiBoolean fmi1_boolean_t

Definition at line 37 of file fmi1_types.h.

5.8.2.6 #define fmiString fmi1_string_t

Definition at line 38 of file fmi1_types.h.

5.8.3 Typedef Documentation

5.8.3.1 typedef void(∗ fmi1_callback_logger_ft) (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status,fmi1_string_t category, fmi1_string_t message,...)

FMI 1.0 logger function type

Definition at line 44 of file fmi1_functions.h.

5.8.3.2 typedef void∗(∗ fmi1_callback_allocate_memory_ft) (size_t nobj, size_t size)

FMI 1.0 allocate memory function type

Definition at line 46 of file fmi1_functions.h.

Generated by Doxygen

Page 105: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.8 Functions and types supporting FMI 1.0 processing. 37

5.8.3.3 typedef void(∗ fmi1_callback_free_memory_ft) (void ∗obj)

FMI 1.0 free memory function type

Definition at line 48 of file fmi1_functions.h.

5.8.3.4 typedef void(∗ fmi1_step_finished_ft) (fmi1_component_t c, fmi1_status_t status)

FMI 1.0 step finished callback function type

Definition at line 50 of file fmi1_functions.h.

5.8.3.5 typedef const char∗(∗ fmi1_get_version_ft) (void)

Definition at line 85 of file fmi1_functions.h.

5.8.3.6 typedef fmi1_status_t(∗ fmi1_set_debug_logging_ft) (fmi1_component_t c, fmi1_boolean_t loggingOn)

Definition at line 86 of file fmi1_functions.h.

5.8.3.7 typedef fmi1_status_t(∗ fmi1_set_real_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr, constfmi1_real_t value[ ])

Definition at line 87 of file fmi1_functions.h.

5.8.3.8 typedef fmi1_status_t(∗ fmi1_set_integer_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,const fmi1_integer_t value[ ])

Definition at line 88 of file fmi1_functions.h.

5.8.3.9 typedef fmi1_status_t(∗ fmi1_set_boolean_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,const fmi1_boolean_t value[ ])

Definition at line 89 of file fmi1_functions.h.

5.8.3.10 typedef fmi1_status_t(∗ fmi1_set_string_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,const fmi1_string_t value[ ])

Definition at line 90 of file fmi1_functions.h.

5.8.3.11 typedef fmi1_status_t(∗ fmi1_get_real_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,fmi1_real_t value[ ])

Definition at line 91 of file fmi1_functions.h.

Generated by Doxygen

Page 106: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38 Module Documentation

5.8.3.12 typedef fmi1_status_t(∗ fmi1_get_integer_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,fmi1_integer_t value[ ])

Definition at line 92 of file fmi1_functions.h.

5.8.3.13 typedef fmi1_status_t(∗ fmi1_get_boolean_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,fmi1_boolean_t value[ ])

Definition at line 93 of file fmi1_functions.h.

5.8.3.14 typedef fmi1_status_t(∗ fmi1_get_string_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,fmi1_string_t value[ ])

Definition at line 94 of file fmi1_functions.h.

5.8.3.15 typedef const char∗(∗ fmi1_get_model_typesPlatform_ft) (void)

Definition at line 97 of file fmi1_functions.h.

5.8.3.16 typedef fmi1_component_t(∗ fmi1_instantiate_model_ft) (fmi1_string_t instanceName, fmi1_string_t GUID,fmi1_me_callback_functions_t functions, fmi1_boolean_t loggingOn)

Definition at line 98 of file fmi1_functions.h.

5.8.3.17 typedef void(∗ fmi1_free_model_instance_ft) (fmi1_component_t c)

Definition at line 99 of file fmi1_functions.h.

5.8.3.18 typedef fmi1_status_t(∗ fmi1_set_time_ft) (fmi1_component_t c, fmi1_real_t time)

Definition at line 100 of file fmi1_functions.h.

5.8.3.19 typedef fmi1_status_t(∗ fmi1_set_continuous_states_ft) (fmi1_component_t c, const fmi1_real_t x[ ], size_t nx)

Definition at line 101 of file fmi1_functions.h.

5.8.3.20 typedef fmi1_status_t(∗ fmi1_completed_integrator_step_ft) (fmi1_component_t c, fmi1_boolean_t∗callEventUpdate)

Definition at line 102 of file fmi1_functions.h.

Generated by Doxygen

Page 107: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.8 Functions and types supporting FMI 1.0 processing. 39

5.8.3.21 typedef fmi1_status_t(∗ fmi1_initialize_ft) (fmi1_component_t c, fmi1_boolean_t toleranceControlled, fmi1_real_trelativeTolerance, fmi1_event_info_t ∗eventInfo)

Definition at line 103 of file fmi1_functions.h.

5.8.3.22 typedef fmi1_status_t(∗ fmi1_get_derivatives_ft) (fmi1_component_t c, fmi1_real_t derivatives[ ], size_t nx)

Definition at line 104 of file fmi1_functions.h.

5.8.3.23 typedef fmi1_status_t(∗ fmi1_get_event_indicators_ft) (fmi1_component_t c, fmi1_real_t eventIndicators[ ], size_tni)

Definition at line 105 of file fmi1_functions.h.

5.8.3.24 typedef fmi1_status_t(∗ fmi1_event_update_ft) (fmi1_component_t c, fmi1_boolean_t intermediateResults,fmi1_event_info_t ∗eventInfo)

Definition at line 106 of file fmi1_functions.h.

5.8.3.25 typedef fmi1_status_t(∗ fmi1_get_continuous_states_ft) (fmi1_component_t c, fmi1_real_t states[ ], size_t nx)

Definition at line 107 of file fmi1_functions.h.

5.8.3.26 typedef fmi1_status_t(∗ fmi1_get_nominal_continuousStates_ft) (fmi1_component_t c, fmi1_real_t x_nominal[ ],size_t nx)

Definition at line 108 of file fmi1_functions.h.

5.8.3.27 typedef fmi1_status_t(∗ fmi1_get_state_valueReferences_ft) (fmi1_component_t c, fmi1_value_reference_t vrx[ ],size_t nx)

Definition at line 109 of file fmi1_functions.h.

5.8.3.28 typedef fmi1_status_t(∗ fmi1_terminate_ft) (fmi1_component_t c)

Definition at line 110 of file fmi1_functions.h.

5.8.3.29 typedef const char∗(∗ fmi1_get_types_platform_ft) (void)

Definition at line 114 of file fmi1_functions.h.

Generated by Doxygen

Page 108: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40 Module Documentation

5.8.3.30 typedef fmi1_component_t(∗ fmi1_instantiate_slave_ft) (fmi1_string_t instanceName, fmi1_string_t fmuGUID,fmi1_string_t fmuLocation, fmi1_string_t mimeType, fmi1_real_t timeout, fmi1_boolean_t visible, fmi1_boolean_tinteractive, fmi1_callback_functions_t functions, fmi1_boolean_t loggingOn)

Definition at line 115 of file fmi1_functions.h.

5.8.3.31 typedef fmi1_status_t(∗ fmi1_initialize_slave_ft) (fmi1_component_t c, fmi1_real_t tStart, fmi1_boolean_tStopTimeDefined, fmi1_real_t tStop)

Definition at line 118 of file fmi1_functions.h.

5.8.3.32 typedef fmi1_status_t(∗ fmi1_terminate_slave_ft) (fmi1_component_t c)

Definition at line 119 of file fmi1_functions.h.

5.8.3.33 typedef fmi1_status_t(∗ fmi1_reset_slave_ft) (fmi1_component_t c)

Definition at line 120 of file fmi1_functions.h.

5.8.3.34 typedef void(∗ fmi1_free_slave_instance_ft) (fmi1_component_t c)

Definition at line 121 of file fmi1_functions.h.

5.8.3.35 typedef fmi1_status_t(∗ fmi1_set_real_inputDerivatives_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ],size_t nvr, const fmi1_integer_t order[ ], const fmi1_real_t value[ ])

Definition at line 122 of file fmi1_functions.h.

5.8.3.36 typedef fmi1_status_t(∗ fmi1_get_real_outputDerivatives_ft) (fmi1_component_t c, const fmi1_value_reference_tvr[ ], size_t nvr, const fmi1_integer_t order[ ], fmi1_real_t value[ ])

Definition at line 123 of file fmi1_functions.h.

5.8.3.37 typedef fmi1_status_t(∗ fmi1_cancel_step_ft) (fmi1_component_t c)

Definition at line 124 of file fmi1_functions.h.

5.8.3.38 typedef fmi1_status_t(∗ fmi1_do_step_ft) (fmi1_component_t c, fmi1_real_t currentCommunicationPoint,fmi1_real_t communicationStepSize, fmi1_boolean_t newStep)

Definition at line 125 of file fmi1_functions.h.

Generated by Doxygen

Page 109: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.8 Functions and types supporting FMI 1.0 processing. 41

5.8.3.39 typedef fmi1_status_t(∗ fmi1_get_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1_status_t∗value)

Definition at line 127 of file fmi1_functions.h.

5.8.3.40 typedef fmi1_status_t(∗ fmi1_get_real_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1_real_t∗value)

Definition at line 128 of file fmi1_functions.h.

5.8.3.41 typedef fmi1_status_t(∗ fmi1_get_integer_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s,fmi1_integer_t ∗value)

Definition at line 129 of file fmi1_functions.h.

5.8.3.42 typedef fmi1_status_t(∗ fmi1_get_boolean_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s,fmi1_boolean_t ∗value)

Definition at line 130 of file fmi1_functions.h.

5.8.3.43 typedef fmi1_status_t(∗ fmi1_get_string_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s,fmi1_string_t ∗value)

Definition at line 131 of file fmi1_functions.h.

5.8.3.44 typedef enum fmi1_value_reference_enu_t fmi1_value_reference_enu_t

Undefined value for fmiValueReference (largest unsigned int value)

5.8.4 Enumeration Type Documentation

5.8.4.1 enum fmi1_status_t

FMI 1.0 status codes

Enumerator

fmi1_status_ok

fmi1_status_warning

fmi1_status_discard

fmi1_status_error

fmi1_status_fatal

fmi1_status_pending

Definition at line 31 of file fmi1_functions.h.

Generated by Doxygen

Page 110: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

42 Module Documentation

5.8.4.2 enum fmi1_status_kind_t

FMI 1.0 asyncronous co-simulation status

Enumerator

fmi1_do_step_status

fmi1_pending_status

fmi1_last_successful_time

Definition at line 78 of file fmi1_functions.h.

5.8.4.3 enum fmi1_boolean_enu_t

FMI boolean constants.

Enumerator

fmi1_true

fmi1_false

Definition at line 55 of file fmi1_types.h.

5.8.4.4 enum fmi1_value_reference_enu_t

Undefined value for fmiValueReference (largest unsigned int value)

Enumerator

fmi1_undefined_value_reference

Definition at line 64 of file fmi1_types.h.

5.8.5 Function Documentation

5.8.5.1 FMILIB_EXPORT const char∗ fmi1_status_to_string ( fmi1_status_t status )

Convert fmi1_status_t variable to string

5.8.5.2 static const char∗ fmi1_get_platform ( void ) [static]

FMI platform name constant string.

Definition at line 48 of file fmi1_types.h.

Generated by Doxygen

Page 111: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.9 Enum types used with FMI 1.0 libs 43

5.9 Enum types used with FMI 1.0 libs

Typedefs

• typedef enum fmi1_variable_naming_convension_enu_t fmi1_variable_naming_convension_enu_t

Naming convention for the variables in XML file.

• typedef enum fmi1_fmu_kind_enu_t fmi1_fmu_kind_enu_t

FMU 1.0 kinds.

• typedef enum fmi1_variability_enu_t fmi1_variability_enu_t

Variability property for variables.

• typedef enum fmi1_causality_enu_t fmi1_causality_enu_t

Causality property for variables.

• typedef enum fmi1_variable_alias_kind_enu_t fmi1_variable_alias_kind_enu_t

Alias property for variables.

• typedef enum fmi1_base_type_enu_t fmi1_base_type_enu_t

Base types used in type definitions.

Enumerations

• enum fmi1_variable_naming_convension_enu_t { fmi1_naming_enu_flat, fmi1_naming_enu_structured,fmi1_naming_enu_unknown }

Naming convention for the variables in XML file.

• enum fmi1_fmu_kind_enu_t { fmi1_fmu_kind_enu_me = 0, fmi1_fmu_kind_enu_cs_standalone, fmi1_fmu←↩

_kind_enu_cs_tool, fmi1_fmu_kind_enu_unknown }

FMU 1.0 kinds.

• enum fmi1_variability_enu_t {fmi1_variability_enu_constant, fmi1_variability_enu_parameter, fmi1_variability_enu_discrete, fmi1_←↩

variability_enu_continuous,fmi1_variability_enu_unknown }

Variability property for variables.

• enum fmi1_causality_enu_t {fmi1_causality_enu_input, fmi1_causality_enu_output, fmi1_causality_enu_internal, fmi1_causality_enu_←↩

none,fmi1_causality_enu_unknown }

Causality property for variables.

• enum fmi1_variable_alias_kind_enu_t { fmi1_variable_is_negated_alias = -1, fmi1_variable_is_not_alias = 0,fmi1_variable_is_alias = 1 }

Alias property for variables.

• enum fmi1_base_type_enu_t {fmi1_base_type_real, fmi1_base_type_int, fmi1_base_type_bool, fmi1_base_type_str,fmi1_base_type_enum }

Base types used in type definitions.

Functions

• FMILIB_EXPORT const char ∗ fmi1_naming_convention_to_string (fmi1_variable_naming_convension_←↩

enu_t convention)

Convert a fmi1_variable_naming_convension_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi1_fmu_kind_to_string (fmi1_fmu_kind_enu_t kind)

Convert a fmi1_fmu_kind_enu_t constant into string.

Generated by Doxygen

Page 112: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

44 Module Documentation

• FMILIB_EXPORT const char ∗ fmi1_variability_to_string (fmi1_variability_enu_t v)

Convert a fmi1_variability_enu_t constant into string.• FMILIB_EXPORT const char ∗ fmi1_causality_to_string (fmi1_causality_enu_t c)

Convert a fmi1_causality_enu_t constant into string.• FMILIB_EXPORT const char ∗ fmi1_base_type_to_string (fmi1_base_type_enu_t bt)

Convert base type constant to string.

5.9.1 Detailed Description

5.9.2 Typedef Documentation

5.9.2.1 typedef enum fmi1_variable_naming_convension_enu_t fmi1_variable_naming_convension_enu_t

Naming convention for the variables in XML file.

5.9.2.2 typedef enum fmi1_fmu_kind_enu_t fmi1_fmu_kind_enu_t

FMU 1.0 kinds.

5.9.2.3 typedef enum fmi1_variability_enu_t fmi1_variability_enu_t

Variability property for variables.

5.9.2.4 typedef enum fmi1_causality_enu_t fmi1_causality_enu_t

Causality property for variables.

5.9.2.5 typedef enum fmi1_variable_alias_kind_enu_t fmi1_variable_alias_kind_enu_t

Alias property for variables.

5.9.2.6 typedef enum fmi1_base_type_enu_t fmi1_base_type_enu_t

Base types used in type definitions.

5.9.3 Enumeration Type Documentation

5.9.3.1 enum fmi1_variable_naming_convension_enu_t

Naming convention for the variables in XML file.

Enumerator

fmi1_naming_enu_flat

fmi1_naming_enu_structured

fmi1_naming_enu_unknown

Definition at line 38 of file fmi1_enums.h.

Generated by Doxygen

Page 113: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.9 Enum types used with FMI 1.0 libs 45

5.9.3.2 enum fmi1_fmu_kind_enu_t

FMU 1.0 kinds.

Enumerator

fmi1_fmu_kind_enu_me

fmi1_fmu_kind_enu_cs_standalone

fmi1_fmu_kind_enu_cs_tool

fmi1_fmu_kind_enu_unknown

Definition at line 49 of file fmi1_enums.h.

5.9.3.3 enum fmi1_variability_enu_t

Variability property for variables.

Enumerator

fmi1_variability_enu_constant

fmi1_variability_enu_parameter

fmi1_variability_enu_discrete

fmi1_variability_enu_continuous

fmi1_variability_enu_unknown

Definition at line 61 of file fmi1_enums.h.

5.9.3.4 enum fmi1_causality_enu_t

Causality property for variables.

Enumerator

fmi1_causality_enu_input

fmi1_causality_enu_output

fmi1_causality_enu_internal

fmi1_causality_enu_none

fmi1_causality_enu_unknown

Definition at line 73 of file fmi1_enums.h.

5.9.3.5 enum fmi1_variable_alias_kind_enu_t

Alias property for variables.

Enumerator

fmi1_variable_is_negated_alias

fmi1_variable_is_not_alias

fmi1_variable_is_alias

Definition at line 85 of file fmi1_enums.h.

Generated by Doxygen

Page 114: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

46 Module Documentation

5.9.3.6 enum fmi1_base_type_enu_t

Base types used in type definitions.

Enumerator

fmi1_base_type_real

fmi1_base_type_int

fmi1_base_type_bool

fmi1_base_type_str

fmi1_base_type_enum

Definition at line 92 of file fmi1_enums.h.

5.9.4 Function Documentation

5.9.4.1 FMILIB_EXPORT const char∗ fmi1_naming_convention_to_string ( fmi1_variable_naming_convension_←↩

enu_t convention )

Convert a fmi1_variable_naming_convension_enu_t constant into string.

5.9.4.2 FMILIB_EXPORT const char∗ fmi1_fmu_kind_to_string ( fmi1_fmu_kind_enu_t kind )

Convert a fmi1_fmu_kind_enu_t constant into string.

5.9.4.3 FMILIB_EXPORT const char∗ fmi1_variability_to_string ( fmi1_variability_enu_t v )

Convert a fmi1_variability_enu_t constant into string.

5.9.4.4 FMILIB_EXPORT const char∗ fmi1_causality_to_string ( fmi1_causality_enu_t c )

Convert a fmi1_causality_enu_t constant into string.

5.9.4.5 FMILIB_EXPORT const char∗ fmi1_base_type_to_string ( fmi1_base_type_enu_t bt )

Convert base type constant to string.

Parameters

bt Base type identifier.

Generated by Doxygen

Page 115: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.9 Enum types used with FMI 1.0 libs 47

Returns

Corresponding base type name.

Generated by Doxygen

Page 116: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

48 Module Documentation

5.10 Functions and types supporting FMI 2.0 processing.

Modules

• Enum types used with FMI 2.0 libs• Definition of XML callbacks struct

Data Structures

• struct fmi2_callback_functions_t• struct fmi2_event_info_t

Typedefs

• typedef void(∗ fmi2_callback_logger_ft) (fmi2_component_environment_t env, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...)

• typedef void ∗(∗ fmi2_callback_allocate_memory_ft) (size_t nobj, size_t size)• typedef void(∗ fmi2_callback_free_memory_ft) (void ∗obj)• typedef void(∗ fmi2_step_finished_ft) (fmi2_component_environment_t env, fmi2_status_t status)• typedef const char ∗(∗ fmi2_get_types_platform_ft) ()• typedef const char ∗(∗ fmi2_get_version_ft) ()• typedef fmi2_status_t(∗ fmi2_set_debug_logging_ft) (fmi2_component_t, fmi2_boolean_t, size_t n←↩

Categories, const fmi2_string_t categories[ ])• typedef fmi2_component_t(∗ fmi2_instantiate_ft) (fmi2_string_t, fmi2_type_t, fmi2_string_t, fmi2_string_←↩

t, const fmi2_callback_functions_t ∗, fmi2_boolean_t, fmi2_boolean_t)• typedef void(∗ fmi2_free_instance_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_setup_experiment_ft) (fmi2_component_t, fmi2_boolean_t, fmi2_real_t, fmi2←↩

_real_t, fmi2_boolean_t, fmi2_real_t)• typedef fmi2_status_t(∗ fmi2_enter_initialization_mode_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_exit_initialization_mode_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_terminate_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_reset_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_get_real_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, fmi2←↩

_real_t[ ])• typedef fmi2_status_t(∗ fmi2_get_integer_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, fmi2_integer_t[ ])• typedef fmi2_status_t(∗ fmi2_get_boolean_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, fmi2_boolean_t[ ])• typedef fmi2_status_t(∗ fmi2_get_string_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, fmi2_string_t[ ])• typedef fmi2_status_t(∗ fmi2_set_real_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, const

fmi2_real_t[ ])• typedef fmi2_status_t(∗ fmi2_set_integer_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, const fmi2_integer_t[ ])• typedef fmi2_status_t(∗ fmi2_set_boolean_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, const fmi2_boolean_t[ ])• typedef fmi2_status_t(∗ fmi2_set_string_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, const

fmi2_string_t[ ])• typedef fmi2_status_t(∗ fmi2_get_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t ∗)• typedef fmi2_status_t(∗ fmi2_set_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t)• typedef fmi2_status_t(∗ fmi2_free_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t ∗)• typedef fmi2_status_t(∗ fmi2_serialized_fmu_state_size_ft) (fmi2_component_t, fmi2_FMU_state_t, size_t ∗)

Generated by Doxygen

Page 117: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.10 Functions and types supporting FMI 2.0 processing. 49

• typedef fmi2_status_t(∗ fmi2_serialize_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t, fmi2_byte_t[ ],size_t)

• typedef fmi2_status_t(∗ fmi2_de_serialize_fmu_state_ft) (fmi2_component_t, const fmi2_byte_t[ ], size_←↩

t, fmi2_FMU_state_t ∗)

• typedef fmi2_status_t(∗ fmi2_get_directional_derivative_ft) (fmi2_component_t, const fmi2_value_←↩

reference_t[ ], size_t, const fmi2_value_reference_t[ ], size_t, const fmi2_real_t[ ], fmi2_real_t[ ])

• typedef fmi2_status_t(∗ fmi2_enter_event_mode_ft) (fmi2_component_t)

• typedef fmi2_status_t(∗ fmi2_new_discrete_states_ft) (fmi2_component_t, fmi2_event_info_t ∗)

• typedef fmi2_status_t(∗ fmi2_enter_continuous_time_mode_ft) (fmi2_component_t)

• typedef fmi2_status_t(∗ fmi2_completed_integrator_step_ft) (fmi2_component_t, fmi2_boolean_t, fmi2_←↩

boolean_t ∗, fmi2_boolean_t ∗)

• typedef fmi2_status_t(∗ fmi2_set_time_ft) (fmi2_component_t, fmi2_real_t)

• typedef fmi2_status_t(∗ fmi2_set_continuous_states_ft) (fmi2_component_t, const fmi2_real_t[ ], size_t)

• typedef fmi2_status_t(∗ fmi2_get_derivatives_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)

• typedef fmi2_status_t(∗ fmi2_get_event_indicators_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)

• typedef fmi2_status_t(∗ fmi2_get_continuous_states_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)

• typedef fmi2_status_t(∗ fmi2_get_nominals_of_continuous_states_ft) (fmi2_component_t, fmi2_real_t[ ],size_t)

• typedef fmi2_status_t(∗ fmi2_set_real_input_derivatives_ft) (fmi2_component_t, const fmi2_value_←↩

reference_t[ ], size_t, const fmi2_integer_t[ ], const fmi2_real_t[ ])

• typedef fmi2_status_t(∗ fmi2_get_real_output_derivatives_ft) (fmi2_component_t, const fmi2_value_←↩

reference_t[ ], size_t, const fmi2_integer_t[ ], fmi2_real_t[ ])

• typedef fmi2_status_t(∗ fmi2_do_step_ft) (fmi2_component_t, fmi2_real_t, fmi2_real_t, fmi2_boolean_t)

• typedef fmi2_status_t(∗ fmi2_cancel_step_ft) (fmi2_component_t)

• typedef fmi2_status_t(∗ fmi2_get_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_status_t ∗)

• typedef fmi2_status_t(∗ fmi2_get_real_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_real_t∗)

• typedef fmi2_status_t(∗ fmi2_get_integer_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_←↩

integer_t ∗)

• typedef fmi2_status_t(∗ fmi2_get_boolean_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_←↩

boolean_t ∗)

• typedef fmi2_status_t(∗ fmi2_get_string_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_←↩

string_t ∗)

Enumerations

• enum fmi2_status_t {fmi2_status_ok, fmi2_status_warning, fmi2_status_discard, fmi2_status_error,fmi2_status_fatal, fmi2_status_pending }

• enum fmi2_type_t { fmi2_model_exchange, fmi2_cosimulation }

• enum fmi2_status_kind_t { fmi2_do_step_status, fmi2_pending_status, fmi2_last_successful_time, fmi2_←↩

terminated }

• enum fmi2_boolean_enu_t { fmi2_true =fmi2True, fmi2_false =fmi2False }

Functions

• FMILIB_EXPORT const char ∗ fmi2_status_to_string (fmi2_status_t status)

• static const char ∗ fmi2_get_types_platform (void)

Generated by Doxygen

Page 118: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

50 Module Documentation

Renaming of typedefs

• #define fmi2Component fmi2_component_t• #define fmi2ComponentEnvironment fmi2_component_environment_t• #define fmi2FMUstate fmi2_FMU_state_t• #define fmi2ValueReference fmi2_value_reference_t• #define fmi2Real fmi2_real_t• #define fmi2Integer fmi2_integer_t• #define fmi2Boolean fmi2_boolean_t• #define fmi2Char fmi2_char_t• #define fmi2String fmi2_string_t• #define fmi2Byte fmi2_byte_t

5.10.1 Detailed Description

5.10.2 Macro Definition Documentation

5.10.2.1 #define fmi2Component fmi2_component_t

Definition at line 33 of file fmi2_types.h.

5.10.2.2 #define fmi2ComponentEnvironment fmi2_component_environment_t

Definition at line 34 of file fmi2_types.h.

5.10.2.3 #define fmi2FMUstate fmi2_FMU_state_t

Definition at line 35 of file fmi2_types.h.

5.10.2.4 #define fmi2ValueReference fmi2_value_reference_t

Definition at line 36 of file fmi2_types.h.

5.10.2.5 #define fmi2Real fmi2_real_t

Definition at line 37 of file fmi2_types.h.

5.10.2.6 #define fmi2Integer fmi2_integer_t

Definition at line 38 of file fmi2_types.h.

5.10.2.7 #define fmi2Boolean fmi2_boolean_t

Definition at line 39 of file fmi2_types.h.

Generated by Doxygen

Page 119: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.10 Functions and types supporting FMI 2.0 processing. 51

5.10.2.8 #define fmi2Char fmi2_char_t

Definition at line 40 of file fmi2_types.h.

5.10.2.9 #define fmi2String fmi2_string_t

Definition at line 41 of file fmi2_types.h.

5.10.2.10 #define fmi2Byte fmi2_byte_t

Definition at line 42 of file fmi2_types.h.

5.10.3 Typedef Documentation

5.10.3.1 typedef void(∗ fmi2_callback_logger_ft) (fmi2_component_environment_t env, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...)

FMI 2.0 logger function type

Definition at line 61 of file fmi2_functions.h.

5.10.3.2 typedef void∗(∗ fmi2_callback_allocate_memory_ft) (size_t nobj, size_t size)

FMI 2.0 allocate memory function type

Definition at line 63 of file fmi2_functions.h.

5.10.3.3 typedef void(∗ fmi2_callback_free_memory_ft) (void ∗obj)

FMI 2.0 free memory function type

Definition at line 65 of file fmi2_functions.h.

5.10.3.4 typedef void(∗ fmi2_step_finished_ft) (fmi2_component_environment_t env, fmi2_status_t status)

FMI 2.0 step finished callback function type

Definition at line 67 of file fmi2_functions.h.

5.10.3.5 typedef const char∗(∗ fmi2_get_types_platform_ft) ()

Definition at line 112 of file fmi2_functions.h.

Generated by Doxygen

Page 120: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

52 Module Documentation

5.10.3.6 typedef const char∗(∗ fmi2_get_version_ft) ()

Definition at line 113 of file fmi2_functions.h.

5.10.3.7 typedef fmi2_status_t(∗ fmi2_set_debug_logging_ft) (fmi2_component_t, fmi2_boolean_t, size_t nCategories, constfmi2_string_t categories[ ])

Definition at line 114 of file fmi2_functions.h.

5.10.3.8 typedef fmi2_component_t(∗ fmi2_instantiate_ft) (fmi2_string_t, fmi2_type_t, fmi2_string_t, fmi2_string_t, constfmi2_callback_functions_t ∗, fmi2_boolean_t, fmi2_boolean_t)

Definition at line 117 of file fmi2_functions.h.

5.10.3.9 typedef void(∗ fmi2_free_instance_ft) (fmi2_component_t)

Definition at line 118 of file fmi2_functions.h.

5.10.3.10 typedef fmi2_status_t(∗ fmi2_setup_experiment_ft) (fmi2_component_t, fmi2_boolean_t, fmi2_real_t, fmi2_real_t,fmi2_boolean_t, fmi2_real_t)

Definition at line 121 of file fmi2_functions.h.

5.10.3.11 typedef fmi2_status_t(∗ fmi2_enter_initialization_mode_ft) (fmi2_component_t)

Definition at line 122 of file fmi2_functions.h.

5.10.3.12 typedef fmi2_status_t(∗ fmi2_exit_initialization_mode_ft) (fmi2_component_t)

Definition at line 123 of file fmi2_functions.h.

5.10.3.13 typedef fmi2_status_t(∗ fmi2_terminate_ft) (fmi2_component_t)

Definition at line 124 of file fmi2_functions.h.

5.10.3.14 typedef fmi2_status_t(∗ fmi2_reset_ft) (fmi2_component_t)

Definition at line 125 of file fmi2_functions.h.

5.10.3.15 typedef fmi2_status_t(∗ fmi2_get_real_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t,fmi2_real_t[ ])

Definition at line 128 of file fmi2_functions.h.

Generated by Doxygen

Page 121: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.10 Functions and types supporting FMI 2.0 processing. 53

5.10.3.16 typedef fmi2_status_t(∗ fmi2_get_integer_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t,fmi2_integer_t[ ])

Definition at line 129 of file fmi2_functions.h.

5.10.3.17 typedef fmi2_status_t(∗ fmi2_get_boolean_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t,fmi2_boolean_t[ ])

Definition at line 130 of file fmi2_functions.h.

5.10.3.18 typedef fmi2_status_t(∗ fmi2_get_string_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t,fmi2_string_t[ ])

Definition at line 131 of file fmi2_functions.h.

5.10.3.19 typedef fmi2_status_t(∗ fmi2_set_real_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, constfmi2_real_t[ ])

Definition at line 133 of file fmi2_functions.h.

5.10.3.20 typedef fmi2_status_t(∗ fmi2_set_integer_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, constfmi2_integer_t[ ])

Definition at line 134 of file fmi2_functions.h.

5.10.3.21 typedef fmi2_status_t(∗ fmi2_set_boolean_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, constfmi2_boolean_t[ ])

Definition at line 135 of file fmi2_functions.h.

5.10.3.22 typedef fmi2_status_t(∗ fmi2_set_string_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, constfmi2_string_t[ ])

Definition at line 136 of file fmi2_functions.h.

5.10.3.23 typedef fmi2_status_t(∗ fmi2_get_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t ∗)

Definition at line 139 of file fmi2_functions.h.

5.10.3.24 typedef fmi2_status_t(∗ fmi2_set_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t)

Definition at line 140 of file fmi2_functions.h.

Generated by Doxygen

Page 122: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

54 Module Documentation

5.10.3.25 typedef fmi2_status_t(∗ fmi2_free_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t ∗)

Definition at line 141 of file fmi2_functions.h.

5.10.3.26 typedef fmi2_status_t(∗ fmi2_serialized_fmu_state_size_ft) (fmi2_component_t, fmi2_FMU_state_t, size_t ∗)

Definition at line 142 of file fmi2_functions.h.

5.10.3.27 typedef fmi2_status_t(∗ fmi2_serialize_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t, fmi2_byte_t[ ],size_t)

Definition at line 143 of file fmi2_functions.h.

5.10.3.28 typedef fmi2_status_t(∗ fmi2_de_serialize_fmu_state_ft) (fmi2_component_t, const fmi2_byte_t[ ], size_t,fmi2_FMU_state_t ∗)

Definition at line 144 of file fmi2_functions.h.

5.10.3.29 typedef fmi2_status_t(∗ fmi2_get_directional_derivative_ft) (fmi2_component_t, const fmi2_value_reference_t[ ],size_t, const fmi2_value_reference_t[ ], size_t, const fmi2_real_t[ ], fmi2_real_t[ ])

Definition at line 147 of file fmi2_functions.h.

5.10.3.30 typedef fmi2_status_t(∗ fmi2_enter_event_mode_ft) (fmi2_component_t)

Definition at line 156 of file fmi2_functions.h.

5.10.3.31 typedef fmi2_status_t(∗ fmi2_new_discrete_states_ft) (fmi2_component_t, fmi2_event_info_t ∗)

Definition at line 157 of file fmi2_functions.h.

5.10.3.32 typedef fmi2_status_t(∗ fmi2_enter_continuous_time_mode_ft) (fmi2_component_t)

Definition at line 158 of file fmi2_functions.h.

5.10.3.33 typedef fmi2_status_t(∗ fmi2_completed_integrator_step_ft) (fmi2_component_t, fmi2_boolean_t, fmi2_boolean_t∗, fmi2_boolean_t ∗)

Definition at line 159 of file fmi2_functions.h.

5.10.3.34 typedef fmi2_status_t(∗ fmi2_set_time_ft) (fmi2_component_t, fmi2_real_t)

Definition at line 162 of file fmi2_functions.h.

Generated by Doxygen

Page 123: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.10 Functions and types supporting FMI 2.0 processing. 55

5.10.3.35 typedef fmi2_status_t(∗ fmi2_set_continuous_states_ft) (fmi2_component_t, const fmi2_real_t[ ], size_t)

Definition at line 163 of file fmi2_functions.h.

5.10.3.36 typedef fmi2_status_t(∗ fmi2_get_derivatives_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)

Definition at line 166 of file fmi2_functions.h.

5.10.3.37 typedef fmi2_status_t(∗ fmi2_get_event_indicators_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)

Definition at line 167 of file fmi2_functions.h.

5.10.3.38 typedef fmi2_status_t(∗ fmi2_get_continuous_states_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)

Definition at line 168 of file fmi2_functions.h.

5.10.3.39 typedef fmi2_status_t(∗ fmi2_get_nominals_of_continuous_states_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)

Definition at line 169 of file fmi2_functions.h.

5.10.3.40 typedef fmi2_status_t(∗ fmi2_set_real_input_derivatives_ft) (fmi2_component_t, const fmi2_value_reference_t[ ],size_t, const fmi2_integer_t[ ], const fmi2_real_t[ ])

Definition at line 177 of file fmi2_functions.h.

5.10.3.41 typedef fmi2_status_t(∗ fmi2_get_real_output_derivatives_ft) (fmi2_component_t, const fmi2_value_reference_t[ ],size_t, const fmi2_integer_t[ ], fmi2_real_t[ ])

Definition at line 178 of file fmi2_functions.h.

5.10.3.42 typedef fmi2_status_t(∗ fmi2_do_step_ft) (fmi2_component_t, fmi2_real_t, fmi2_real_t, fmi2_boolean_t)

Definition at line 180 of file fmi2_functions.h.

5.10.3.43 typedef fmi2_status_t(∗ fmi2_cancel_step_ft) (fmi2_component_t)

Definition at line 181 of file fmi2_functions.h.

5.10.3.44 typedef fmi2_status_t(∗ fmi2_get_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_status_t ∗)

Definition at line 184 of file fmi2_functions.h.

Generated by Doxygen

Page 124: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

56 Module Documentation

5.10.3.45 typedef fmi2_status_t(∗ fmi2_get_real_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_real_t ∗)

Definition at line 185 of file fmi2_functions.h.

5.10.3.46 typedef fmi2_status_t(∗ fmi2_get_integer_status_ft) (fmi2_component_t, const fmi2_status_kind_t,fmi2_integer_t ∗)

Definition at line 186 of file fmi2_functions.h.

5.10.3.47 typedef fmi2_status_t(∗ fmi2_get_boolean_status_ft) (fmi2_component_t, const fmi2_status_kind_t,fmi2_boolean_t ∗)

Definition at line 187 of file fmi2_functions.h.

5.10.3.48 typedef fmi2_status_t(∗ fmi2_get_string_status_ft) (fmi2_component_t, const fmi2_status_kind_t,fmi2_string_t ∗)

Definition at line 188 of file fmi2_functions.h.

5.10.4 Enumeration Type Documentation

5.10.4.1 enum fmi2_status_t

FMI 2.0 status codes

Enumerator

fmi2_status_ok

fmi2_status_warning

fmi2_status_discard

fmi2_status_error

fmi2_status_fatal

fmi2_status_pending

Definition at line 40 of file fmi2_functions.h.

5.10.4.2 enum fmi2_type_t

Enumerator

fmi2_model_exchange

fmi2_cosimulation

Definition at line 49 of file fmi2_functions.h.

Generated by Doxygen

Page 125: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.10 Functions and types supporting FMI 2.0 processing. 57

5.10.4.3 enum fmi2_status_kind_t

Co-simulation status for FMI 2.0 CS

Enumerator

fmi2_do_step_status

fmi2_pending_status

fmi2_last_successful_time

fmi2_terminated

Definition at line 91 of file fmi2_functions.h.

5.10.4.4 enum fmi2_boolean_enu_t

FMI boolean constants.

Enumerator

fmi2_true

fmi2_false

Definition at line 60 of file fmi2_types.h.

5.10.5 Function Documentation

5.10.5.1 FMILIB_EXPORT const char∗ fmi2_status_to_string ( fmi2_status_t status )

Convert fmi2_status_t variable to string

5.10.5.2 static const char∗ fmi2_get_types_platform ( void ) [static]

FMI platform name constant string.

Definition at line 53 of file fmi2_types.h.

Generated by Doxygen

Page 126: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

58 Module Documentation

5.11 Enum types used with FMI 2.0 libs

Macros

• #define FMI2_ME_CAPABILITIES(H)

List of capability flags for ModelExchange.

• #define FMI2_CS_CAPABILITIES(H)

List of capability flags for CoSimulation.

• #define FMI2_SI_BASE_UNITS(H) H(kg) H(m) H(s) H(A) H(K) H(mol) H(cd) H(rad)

List of SI base units used in Unit defitions.

Typedefs

• typedef enum fmi2_variable_naming_convension_enu_t fmi2_variable_naming_convension_enu_t

Naming convention for the variables in XML file.

• typedef enum fmi2_fmu_kind_enu_t fmi2_fmu_kind_enu_t

FMU 2.0 kinds.

• typedef enum fmi2_variability_enu_t fmi2_variability_enu_t

Variability property for variables.

• typedef enum fmi2_causality_enu_t fmi2_causality_enu_t

Causality property for variables.

• typedef enum fmi2_initial_enu_t fmi2_initial_enu_t

Initial property for variables.

• typedef enum fmi2_variable_alias_kind_enu_t fmi2_variable_alias_kind_enu_t

Alias property for variables.

• typedef enum fmi2_base_type_enu_t fmi2_base_type_enu_t

Base types used in type definitions.

• typedef enum fmi2_capabilities_enu_t fmi2_capabilities_enu_t

Capability flags for ModelExchange and CoSimulation.

• typedef enum fmi2_SI_base_units_enu_t fmi2_SI_base_units_enu_t

SI base units used in Unit defitions.

• typedef enum fmi2_dependency_factor_kind_enu_t fmi2_dependency_factor_kind_enu_t

Dependency factor kinds are used as part of ModelStructure definition.

Enumerations

• enum fmi2_variable_naming_convension_enu_t { fmi2_naming_enu_flat, fmi2_naming_enu_structured,fmi2_naming_enu_unknown }

Naming convention for the variables in XML file.

• enum fmi2_fmu_kind_enu_t { fmi2_fmu_kind_unknown = 0, fmi2_fmu_kind_me = 1, fmi2_fmu_kind_cs = 2,fmi2_fmu_kind_me_and_cs = 3 }

FMU 2.0 kinds.

• enum fmi2_variability_enu_t {fmi2_variability_enu_constant = 0, fmi2_variability_enu_fixed = 1, fmi2_variability_enu_tunable = 2, fmi2_←↩

variability_enu_discrete = 3,fmi2_variability_enu_continuous = 4, fmi2_variability_enu_unknown = 5 }

Variability property for variables.

Generated by Doxygen

Page 127: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.11 Enum types used with FMI 2.0 libs 59

• enum fmi2_causality_enu_t {fmi2_causality_enu_parameter = 0, fmi2_causality_enu_calculated_parameter = 1, fmi2_causality_enu_←↩

input = 2, fmi2_causality_enu_output = 3,fmi2_causality_enu_local = 4, fmi2_causality_enu_independent = 5, fmi2_causality_enu_unknown = 6 }

Causality property for variables.

• enum fmi2_initial_enu_t { fmi2_initial_enu_exact, fmi2_initial_enu_approx, fmi2_initial_enu_calculated,fmi2_initial_enu_unknown }

Initial property for variables.

• enum fmi2_variable_alias_kind_enu_t { fmi2_variable_is_not_alias = 0, fmi2_variable_is_alias = 1 }

Alias property for variables.

• enum fmi2_base_type_enu_t {fmi2_base_type_real, fmi2_base_type_int, fmi2_base_type_bool, fmi2_base_type_str,fmi2_base_type_enum }

Base types used in type definitions.

• enum fmi2_capabilities_enu_t { fmi2_capabilities_Num }

Capability flags for ModelExchange and CoSimulation.

• enum fmi2_SI_base_units_enu_t { fmi2_SI_base_units_Num }

SI base units used in Unit defitions.

• enum fmi2_dependency_factor_kind_enu_t {fmi2_dependency_factor_kind_dependent = 0, fmi2_dependency_factor_kind_constant, fmi2_dependency←↩

_factor_kind_fixed, fmi2_dependency_factor_kind_tunable,fmi2_dependency_factor_kind_discrete, fmi2_dependency_factor_kind_num }

Dependency factor kinds are used as part of ModelStructure definition.

Functions

• FMILIB_EXPORT const char ∗ fmi2_naming_convention_to_string (fmi2_variable_naming_convension_←↩

enu_t convention)

Convert a fmi2_variable_naming_convension_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi2_fmu_kind_to_string (fmi2_fmu_kind_enu_t kind)

Convert a fmi2_fmu_kind_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi2_variability_to_string (fmi2_variability_enu_t v)

Convert a fmi2_variability_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi2_causality_to_string (fmi2_causality_enu_t c)

Convert a fmi2_causality_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi2_initial_to_string (fmi2_initial_enu_t c)

Convert a fmi2_initial_enu_t constant into string.

• FMILIB_EXPORT fmi2_initial_enu_t fmi2_get_default_initial (fmi2_variability_enu_t v, fmi2_causality_enu_tc)

Get default initial attribute value for the given variability and causality combination.

• FMILIB_EXPORT fmi2_initial_enu_t fmi2_get_valid_initial (fmi2_variability_enu_t v, fmi2_causality_enu_t c,fmi2_initial_enu_t i)

Check if the combination of variability, causality and initial is valid.

• FMILIB_EXPORT const char ∗ fmi2_base_type_to_string (fmi2_base_type_enu_t bt)

Convert base type constant to string.

• FMILIB_EXPORT const char ∗ fmi2_capability_to_string (fmi2_capabilities_enu_t id)

Convert capability flag to a string.

• FMILIB_EXPORT const char ∗ fmi2_SI_base_unit_to_string (fmi2_SI_base_units_enu_t id)

Convert SI base unit ID a string.

• FMILIB_EXPORT size_t fmi2_SI_base_unit_exp_to_string (const int exp[fmi2_SI_base_units_Num], size_tbufSize, char buf[ ])

Generated by Doxygen

Page 128: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

60 Module Documentation

Convert a list of SI base unit exponents (corresponding to the IDs from fmi2_SI_base_units_enu_t) to a string of theform kg∗m∧2/s∧2. Prints '-' if all the exponents are zero.

• FMILIB_EXPORT const char ∗ fmi2_dependency_factor_kind_to_string (fmi2_dependency_factor_kind_←↩

enu_t fc)

Convert dependency factor kind constant to string.

5.11.1 Detailed Description

5.11.2 Macro Definition Documentation

5.11.2.1 #define FMI2_ME_CAPABILITIES( H )

Value:

H(needsExecutionTool) \H(completedIntegratorStepNotNeeded) \H(canBeInstantiatedOnlyOncePerProcess) \H(canNotUseMemoryManagementFunctions) \H(canGetAndSetFMUstate) \H(canSerializeFMUstate) \H(providesDirectionalDerivatives)\H(completedEventIterationIsProvided)

List of capability flags for ModelExchange.

Definition at line 134 of file fmi2_enums.h.

5.11.2.2 #define FMI2_CS_CAPABILITIES( H )

Value:

H(needsExecutionTool) \H(canHandleVariableCommunicationStepSize) \H(canInterpolateInputs) \H(maxOutputDerivativeOrder) \H(canRunAsynchronuously) \H(canBeInstantiatedOnlyOncePerProcess) \H(canNotUseMemoryManagementFunctions) \H(canGetAndSetFMUstate) \H(canSerializeFMUstate) \H(providesDirectionalDerivatives)

List of capability flags for CoSimulation.

Definition at line 145 of file fmi2_enums.h.

5.11.2.3 #define FMI2_SI_BASE_UNITS( H ) H(kg) H(m) H(s) H(A) H(K) H(mol) H(cd) H(rad)

List of SI base units used in Unit defitions.

Definition at line 173 of file fmi2_enums.h.

Generated by Doxygen

Page 129: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.11 Enum types used with FMI 2.0 libs 61

5.11.3 Typedef Documentation

5.11.3.1 typedef enum fmi2_variable_naming_convension_enu_t fmi2_variable_naming_convension_enu_t

Naming convention for the variables in XML file.

5.11.3.2 typedef enum fmi2_fmu_kind_enu_t fmi2_fmu_kind_enu_t

FMU 2.0 kinds.

5.11.3.3 typedef enum fmi2_variability_enu_t fmi2_variability_enu_t

Variability property for variables.

5.11.3.4 typedef enum fmi2_causality_enu_t fmi2_causality_enu_t

Causality property for variables.

5.11.3.5 typedef enum fmi2_initial_enu_t fmi2_initial_enu_t

Initial property for variables.

5.11.3.6 typedef enum fmi2_variable_alias_kind_enu_t fmi2_variable_alias_kind_enu_t

Alias property for variables.

5.11.3.7 typedef enum fmi2_base_type_enu_t fmi2_base_type_enu_t

Base types used in type definitions.

5.11.3.8 typedef enum fmi2_capabilities_enu_t fmi2_capabilities_enu_t

Capability flags for ModelExchange and CoSimulation.

5.11.3.9 typedef enum fmi2_SI_base_units_enu_t fmi2_SI_base_units_enu_t

SI base units used in Unit defitions.

5.11.3.10 typedef enum fmi2_dependency_factor_kind_enu_t fmi2_dependency_factor_kind_enu_t

Dependency factor kinds are used as part of ModelStructure definition.

Generated by Doxygen

Page 130: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

62 Module Documentation

5.11.4 Enumeration Type Documentation

5.11.4.1 enum fmi2_variable_naming_convension_enu_t

Naming convention for the variables in XML file.

Enumerator

fmi2_naming_enu_flat

fmi2_naming_enu_structured

fmi2_naming_enu_unknown

Definition at line 38 of file fmi2_enums.h.

5.11.4.2 enum fmi2_fmu_kind_enu_t

FMU 2.0 kinds.

Enumerator

fmi2_fmu_kind_unknown

fmi2_fmu_kind_me

fmi2_fmu_kind_cs

fmi2_fmu_kind_me_and_cs

Definition at line 49 of file fmi2_enums.h.

5.11.4.3 enum fmi2_variability_enu_t

Variability property for variables.

Enumerator

fmi2_variability_enu_constant

fmi2_variability_enu_fixed

fmi2_variability_enu_tunable

fmi2_variability_enu_discrete

fmi2_variability_enu_continuous

fmi2_variability_enu_unknown

Definition at line 61 of file fmi2_enums.h.

Generated by Doxygen

Page 131: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.11 Enum types used with FMI 2.0 libs 63

5.11.4.4 enum fmi2_causality_enu_t

Causality property for variables.

Enumerator

fmi2_causality_enu_parameter

fmi2_causality_enu_calculated_parameter

fmi2_causality_enu_input

fmi2_causality_enu_output

fmi2_causality_enu_local

fmi2_causality_enu_independent

fmi2_causality_enu_unknown

Definition at line 74 of file fmi2_enums.h.

5.11.4.5 enum fmi2_initial_enu_t

Initial property for variables.

Enumerator

fmi2_initial_enu_exact

fmi2_initial_enu_approx

fmi2_initial_enu_calculated

fmi2_initial_enu_unknown

Definition at line 88 of file fmi2_enums.h.

5.11.4.6 enum fmi2_variable_alias_kind_enu_t

Alias property for variables.

Enumerator

fmi2_variable_is_not_alias

fmi2_variable_is_alias

Definition at line 112 of file fmi2_enums.h.

5.11.4.7 enum fmi2_base_type_enu_t

Base types used in type definitions.

Enumerator

fmi2_base_type_real

fmi2_base_type_int

fmi2_base_type_bool

fmi2_base_type_str

fmi2_base_type_enum

Definition at line 118 of file fmi2_enums.h.

Generated by Doxygen

Page 132: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

64 Module Documentation

5.11.4.8 enum fmi2_capabilities_enu_t

Capability flags for ModelExchange and CoSimulation.

Enumerator

fmi2_capabilities_Num

Definition at line 158 of file fmi2_enums.h.

5.11.4.9 enum fmi2_SI_base_units_enu_t

SI base units used in Unit defitions.

Enumerator

fmi2_SI_base_units_Num

Definition at line 177 of file fmi2_enums.h.

5.11.4.10 enum fmi2_dependency_factor_kind_enu_t

Dependency factor kinds are used as part of ModelStructure definition.

Enumerator

fmi2_dependency_factor_kind_dependent

fmi2_dependency_factor_kind_constant

fmi2_dependency_factor_kind_fixed

fmi2_dependency_factor_kind_tunable

fmi2_dependency_factor_kind_discrete

fmi2_dependency_factor_kind_num

Definition at line 201 of file fmi2_enums.h.

5.11.5 Function Documentation

5.11.5.1 FMILIB_EXPORT const char∗ fmi2_naming_convention_to_string ( fmi2_variable_naming_convension_←↩

enu_t convention )

Convert a fmi2_variable_naming_convension_enu_t constant into string.

5.11.5.2 FMILIB_EXPORT const char∗ fmi2_fmu_kind_to_string ( fmi2_fmu_kind_enu_t kind )

Convert a fmi2_fmu_kind_enu_t constant into string.

Generated by Doxygen

Page 133: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.11 Enum types used with FMI 2.0 libs 65

5.11.5.3 FMILIB_EXPORT const char∗ fmi2_variability_to_string ( fmi2_variability_enu_t v )

Convert a fmi2_variability_enu_t constant into string.

5.11.5.4 FMILIB_EXPORT const char∗ fmi2_causality_to_string ( fmi2_causality_enu_t c )

Convert a fmi2_causality_enu_t constant into string.

5.11.5.5 FMILIB_EXPORT const char∗ fmi2_initial_to_string ( fmi2_initial_enu_t c )

Convert a fmi2_initial_enu_t constant into string.

5.11.5.6 FMILIB_EXPORT fmi2_initial_enu_t fmi2_get_default_initial ( fmi2_variability_enu_t v,fmi2_causality_enu_t c )

Get default initial attribute value for the given variability and causality combination.

Returns

The default initial attribute or fmi2_initial_enu_unknown if combination of causality and variability is not valid.

5.11.5.7 FMILIB_EXPORT fmi2_initial_enu_t fmi2_get_valid_initial ( fmi2_variability_enu_t v,fmi2_causality_enu_t c, fmi2_initial_enu_t i )

Check if the combination of variability, causality and initial is valid.

Returns

Same initial as submitted if the combination is valid. Otherwise, same as fmi2_get_default_initial.

5.11.5.8 FMILIB_EXPORT const char∗ fmi2_base_type_to_string ( fmi2_base_type_enu_t bt )

Convert base type constant to string.

Parameters

bt Base type identifier.

Returns

Corresponding base type name.

Generated by Doxygen

Page 134: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

66 Module Documentation

5.11.5.9 FMILIB_EXPORT const char∗ fmi2_capability_to_string ( fmi2_capabilities_enu_t id )

Convert capability flag to a string.

Generated by Doxygen

Page 135: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.11 Enum types used with FMI 2.0 libs 67

Parameters

id Capability flag ID.

Returns

Name of the flag or Unknown if the id is out of range.

5.11.5.10 FMILIB_EXPORT const char∗ fmi2_SI_base_unit_to_string ( fmi2_SI_base_units_enu_t id )

Convert SI base unit ID a string.

Parameters

id SI base unit ID.

Returns

Name of the base unit or "unknown" if the id is out of range.

5.11.5.11 FMILIB_EXPORT size_t fmi2_SI_base_unit_exp_to_string ( const int exp[fmi2_SI_base_units_Num], size_tbufSize, char buf[ ] )

Convert a list of SI base unit exponents (corresponding to the IDs from fmi2_SI_base_units_enu_t) to a string of theform kg∗m∧2/s∧2. Prints '-' if all the exponents are zero.

Parameters

exp An array of SI base units exponents.

bufSize Size of the buffer to store the string.

buf Buffer to store the string

Returns

Required size of the buffer to store the string. This most likely be under [8∗fmi2_SI_base_units_Num]. If thereturn value is larger or equal than bufSize than the string could not be fitted in the buffer.

5.11.5.12 FMILIB_EXPORT const char∗ fmi2_dependency_factor_kind_to_string ( fmi2_dependency_factor_kind_←↩

enu_t fc )

Convert dependency factor kind constant to string.

Parameters

fc Dependency factor kind identifier.

Generated by Doxygen

Page 136: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

68 Module Documentation

Returns

Corresponding factor kind as string.

Generated by Doxygen

Page 137: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.12 Definition of XML callbacks struct 69

5.12 Definition of XML callbacks struct

Data Structures

• struct fmi2_xml_callbacks_t

XML callbacks are used to process parts of XML that are not handled by the library.

Typedefs

• typedef struct fmi2_xml_callbacks_t fmi2_xml_callbacks_t

Variables

• fmi2_xml_element_start_handle_ft fmi2_xml_callbacks_t::startHandle• fmi2_xml_element_data_handle_ft fmi2_xml_callbacks_t::dataHandle

Handle start of an XML element within tool annotation in a SAX parser.

• fmi2_xml_element_end_handle_ft fmi2_xml_callbacks_t::endHandle

Handle data of an XML element within tool annotation in a SAX parser.

• void ∗ fmi2_xml_callbacks_t::context

Handle end of an XML element within tool annotation in a SAX parser.

XML handling callbacks

• typedef int(∗ fmi2_xml_element_start_handle_ft) (void ∗context, const char ∗toolName, void ∗parent, constchar ∗elm, const char ∗∗attr)

Handle start of an XML element within tool annotation in a SAX parser.

• typedef int(∗ fmi2_xml_element_data_handle_ft) (void ∗context, const char ∗s, int len)

Handle data of an XML element within tool annotation in a SAX parser.

• typedef int(∗ fmi2_xml_element_end_handle_ft) (void ∗context, const char ∗elm)

Handle end of an XML element within tool annotation in a SAX parser.

5.12.1 Detailed Description

5.12.2 Typedef Documentation

5.12.2.1 typedef struct fmi2_xml_callbacks_t fmi2_xml_callbacks_t

Definition at line 33 of file fmi2_xml_callbacks.h.

5.12.2.2 typedef int(∗ fmi2_xml_element_start_handle_ft) (void ∗context, const char ∗toolName, void ∗parent, const char∗elm, const char ∗∗attr)

Handle start of an XML element within tool annotation in a SAX parser.

Generated by Doxygen

Page 138: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

70 Module Documentation

Parameters

context as specified when setting up the callbacks,

parentName - tool name as given by name attibute to the Tool elelent,

parent - NULL for model level annotations; fmi2_import_variable_t ∗ variable pointer for variableannotations.

elm - name of the element,

attr - attributes (names and values). The function should return 0 on success or error code on exit(in which case parsing will be aborted).

Definition at line 47 of file fmi2_xml_callbacks.h.

5.12.2.3 typedef int(∗ fmi2_xml_element_data_handle_ft) (void ∗context, const char ∗s, int len)

Handle data of an XML element within tool annotation in a SAX parser.

Parameters

context as specified when setting up the callbacks

s - data string

len - length of the data. The function should return 0 on success or error code on exit (in which caseparsing will be aborted).

Definition at line 56 of file fmi2_xml_callbacks.h.

5.12.2.4 typedef int(∗ fmi2_xml_element_end_handle_ft) (void ∗context, const char ∗elm)

Handle end of an XML element within tool annotation in a SAX parser.

Parameters

context as specified when setting up the callbacks

elm - name of the element. The function should return 0 on success or error code on exit (in which caseparsing will be aborted).

Definition at line 64 of file fmi2_xml_callbacks.h.

5.12.3 Variable Documentation

5.12.3.1 fmi2_xml_element_start_handle_ft fmi2_xml_callbacks_t::startHandle

Definition at line 68 of file fmi2_xml_callbacks.h.

5.12.3.2 fmi2_xml_element_data_handle_ft fmi2_xml_callbacks_t::dataHandle

Handle start of an XML element within tool annotation in a SAX parser.

Definition at line 69 of file fmi2_xml_callbacks.h.

Generated by Doxygen

Page 139: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.12 Definition of XML callbacks struct 71

5.12.3.3 fmi2_xml_element_end_handle_ft fmi2_xml_callbacks_t::endHandle

Handle data of an XML element within tool annotation in a SAX parser.

Definition at line 70 of file fmi2_xml_callbacks.h.

5.12.3.4 void∗ fmi2_xml_callbacks_t::context

Handle end of an XML element within tool annotation in a SAX parser.

Definition at line 71 of file fmi2_xml_callbacks.h.

Generated by Doxygen

Page 140: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

72 Module Documentation

5.13 Definition of callbacks struct and supporting functions

Data Structures

• struct jm_callbacks

The callbacks struct is sent to all the modules in the library.

Macros

• #define JM_MAX_ERROR_MESSAGE_SIZE 2000

Maximum message size that can be stored in the jm_callbacks struct.

Typedefs

• typedef struct jm_callbacks jm_callbacks• typedef void(∗ jm_logger_f) (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string mes-

sage)

Logger callback type.

Functions

• static jm_string jm_get_last_error (jm_callbacks ∗cb)

Get the last log message produced by the library.

• static void jm_clear_last_error (jm_callbacks ∗cb)

Clear the last generated log message.

• FMILIB_EXPORT void jm_set_default_callbacks (jm_callbacks ∗c)

Set the structure to be returned by jm_get_default_callbacks().

• FMILIB_EXPORT jm_callbacks ∗ jm_get_default_callbacks (void)

Get default callbacks. The function never returns NULL.

• FMILIB_EXPORT void jm_default_logger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message)

The default logger implementation prints messages to stderr.

• FMILIB_EXPORT void jm_log (jm_callbacks ∗cb, const char ∗module, jm_log_level_enu_t log_level, constchar ∗fmt,...)

Send a message to the logger function.

• FMILIB_EXPORT void jm_log_v (jm_callbacks ∗cb, const char ∗module, jm_log_level_enu_t log_level, constchar ∗fmt, va_list ap)

Send a message to the logger function.

• FMILIB_EXPORT void jm_log_fatal_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a fatal error message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_fatal (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a fatal error message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_error_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a error message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_error (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a error message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_warning_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a warning message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_warning (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Generated by Doxygen

Page 141: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.13 Definition of callbacks struct and supporting functions 73

Send a warning message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_info_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send an info message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_info (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send an info message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_verbose_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a verbose message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_verbose (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a verbose message to the logger function. See jm_log() for details.

• static void jm_log_debug_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a debug message to the logger function. See jm_log() for details.

• static void jm_log_debug (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a debug message to the logger function. See jm_log() for details.

Memory management callbacks

jm_malloc_f, jm_realloc_f, jm_calloc_f, jm_free_f function types correspond to the standard C memory managementfunctions

• typedef jm_voidp(∗ jm_malloc_f) (size_t size)

Allocation function type.

• typedef jm_voidp(∗ jm_realloc_f) (void ∗ptr, size_t size)

Re-allocation function type.

• typedef jm_voidp(∗ jm_calloc_f) (size_t numitems, size_t itemsize)

Zero-initialized allocation function type.

• typedef void(∗ jm_free_f) (jm_voidp p)

Free memory function type.

5.13.1 Detailed Description

5.13.2 Macro Definition Documentation

5.13.2.1 #define JM_MAX_ERROR_MESSAGE_SIZE 2000

Maximum message size that can be stored in the jm_callbacks struct.

Definition at line 70 of file jm_callbacks.h.

5.13.3 Typedef Documentation

5.13.3.1 typedef struct jm_callbacks jm_callbacks

Definition at line 37 of file jm_callbacks.h.

Generated by Doxygen

Page 142: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

74 Module Documentation

5.13.3.2 typedef jm_voidp(∗ jm_malloc_f) (size_t size)

Allocation function type.

Definition at line 45 of file jm_callbacks.h.

5.13.3.3 typedef jm_voidp(∗ jm_realloc_f) (void ∗ptr, size_t size)

Re-allocation function type.

Definition at line 48 of file jm_callbacks.h.

5.13.3.4 typedef jm_voidp(∗ jm_calloc_f) (size_t numitems, size_t itemsize)

Zero-initialized allocation function type.

Definition at line 51 of file jm_callbacks.h.

5.13.3.5 typedef void(∗ jm_free_f) (jm_voidp p)

Free memory function type.

Definition at line 54 of file jm_callbacks.h.

5.13.3.6 typedef void(∗ jm_logger_f) (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_stringmessage)

Logger callback type.

The logger callback is used to report errors. Note that this function is by default only used in FMI standard inte-pendent code (e.g., fmi_import_get_fmi_version()). Since logging functions are different between different standardversions separate logging functions are necessary for each fmi implementation.Defaults are provided for each standard.

Definition at line 67 of file jm_callbacks.h.

5.13.4 Function Documentation

5.13.4.1 static jm_string jm_get_last_error ( jm_callbacks ∗ cb ) [static]

Get the last log message produced by the library.

An alternative way to get error information is to use jm_get_last_error(). This is only meaningful if logger function isnot present.

Definition at line 98 of file jm_callbacks.h.

5.13.4.2 static void jm_clear_last_error ( jm_callbacks ∗ cb ) [static]

Clear the last generated log message.

Definition at line 103 of file jm_callbacks.h.

5.13.4.3 FMILIB_EXPORT void jm_set_default_callbacks ( jm_callbacks ∗ c )

Set the structure to be returned by jm_get_default_callbacks().

Generated by Doxygen

Page 143: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.13 Definition of callbacks struct and supporting functions 75

Parameters

c - a pointer to initialized struct to be used as default later on. If this is NULL library default implementationwill be used.

5.13.4.4 FMILIB_EXPORT jm_callbacks∗ jm_get_default_callbacks ( void )

Get default callbacks. The function never returns NULL.

Returns

Default jm_callbacks struture. Either the one supplied by the library of the one set with jm_set_default_←↩

callbacks().

5.13.4.5 FMILIB_EXPORT void jm_default_logger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_tlog_level, jm_string message )

The default logger implementation prints messages to stderr.

5.13.4.6 FMILIB_EXPORT void jm_log ( jm_callbacks ∗ cb, const char ∗ module, jm_log_level_enu_t log_level,const char ∗ fmt, ... )

Send a message to the logger function.

Parameters

cb - callbacks to be used for reporting;

module - a name of reporting module;

log_level - message kind;

fmt - "printf" type of format followed by the arguments.

5.13.4.7 FMILIB_EXPORT void jm_log_v ( jm_callbacks ∗ cb, const char ∗ module, jm_log_level_enu_t log_level,const char ∗ fmt, va_list ap )

Send a message to the logger function.

Parameters

cb - callbacks to be used for reporting;

module - a name of reporting module;

log_level - message kind;

fmt - "printf" type of format followed by the arguments.

ap - variable size argument list.

Generated by Doxygen

Page 144: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

76 Module Documentation

5.13.4.8 FMILIB_EXPORT void jm_log_fatal_v ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, va_list ap )

Send a fatal error message to the logger function. See jm_log() for details.

5.13.4.9 FMILIB_EXPORT void jm_log_fatal ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, ... )

Send a fatal error message to the logger function. See jm_log() for details.

5.13.4.10 FMILIB_EXPORT void jm_log_error_v ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, va_list ap)

Send a error message to the logger function. See jm_log() for details.

5.13.4.11 FMILIB_EXPORT void jm_log_error ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, ... )

Send a error message to the logger function. See jm_log() for details.

5.13.4.12 FMILIB_EXPORT void jm_log_warning_v ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, va_listap )

Send a warning message to the logger function. See jm_log() for details.

5.13.4.13 FMILIB_EXPORT void jm_log_warning ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, ... )

Send a warning message to the logger function. See jm_log() for details.

5.13.4.14 FMILIB_EXPORT void jm_log_info_v ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, va_list ap )

Send an info message to the logger function. See jm_log() for details.

5.13.4.15 FMILIB_EXPORT void jm_log_info ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, ... )

Send an info message to the logger function. See jm_log() for details.

5.13.4.16 FMILIB_EXPORT void jm_log_verbose_v ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, va_listap )

Send a verbose message to the logger function. See jm_log() for details.

5.13.4.17 FMILIB_EXPORT void jm_log_verbose ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, ... )

Send a verbose message to the logger function. See jm_log() for details.

Generated by Doxygen

Page 145: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.13 Definition of callbacks struct and supporting functions 77

5.13.4.18 static void jm_log_debug_v ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, va_list ap )[static]

Send a debug message to the logger function. See jm_log() for details.

Note that the function is only active if the library is configure with FMILIB_ENABLE_LOG_LEVEL_DEBUG=ON

Definition at line 208 of file jm_callbacks.h.

5.13.4.19 static void jm_log_debug ( jm_callbacks ∗ cb, const char ∗ module, const char ∗ fmt, ... ) [static]

Send a debug message to the logger function. See jm_log() for details.

Note that the function is only active if the library is configure with FMILIB_ENABLE_LOG_LEVEL_DEBUG=ON

Definition at line 213 of file jm_callbacks.h.

Generated by Doxygen

Page 146: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

78 Module Documentation

5.14 Named objects

Data Structures

• struct jm_named_ptr

Name and object pointer pair.

Typedefs

• typedef struct jm_named_ptr jm_named_ptr

Name and object pointer pair.

Functions

• jm_named_ptr jm_named_alloc (jm_string name, size_t size, size_t nameoffset, jm_callbacks ∗c)

Allocate memory for the object and the name string and sets pointer to it packed together with the name pointer.

• jm_named_ptr jm_named_alloc_v (jm_vector(char)∗name, size_t size, size_t nameoffset, jm_callbacks ∗c)

Same as jm_named_alloc() but name is given as a jm_vector(char) pointer.

• static void jm_named_free (jm_named_ptr np, jm_callbacks ∗c)

Free the memory allocated for the object pointed by jm_named_ptr.

• jm_vector_declare_template (jm_named_ptr) jm_define_comp_f(jm_compare_named

Helper to construct comparison operation.

• static jm_diff_named void jm_named_vector_free_data (jm_vector(jm_named_ptr)∗v)

Release the data allocated by the items in a vector and then clears the memory used by the vector as well.

• static void jm_named_vector_free (jm_vector(jm_named_ptr)∗v)

Release the data allocated by the items in a vector and then clears the memory used by the vector as well.

5.14.1 Detailed Description

5.14.2 Typedef Documentation

5.14.2.1 jm_named_ptr

Name and object pointer pair.

Definition at line 36 of file jm_named_ptr.h.

5.14.3 Function Documentation

5.14.3.1 jm_named_ptr jm_named_alloc ( jm_string name, size_t size, size_t nameoffset, jm_callbacks ∗ c )

Allocate memory for the object and the name string and sets pointer to it packed together with the name pointer.

Parameters

name Name for the object.

size Size of the data structure.nameoffset Offset of the name field within the data structure.c Callbacks to be used for memory allocation.

Generated by Doxygen

Page 147: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.14 Named objects 79

The function jm_named_alloc() is intended for types defined as:

1 struct T {2 < some data fields>3 char name[1];4 }

The "name" is copied into the allocated memory.

5.14.3.2 jm_named_ptr jm_named_alloc_v ( jm_vector(char)∗ name, size_t size, size_t nameoffset, jm_callbacks ∗c )

Same as jm_named_alloc() but name is given as a jm_vector(char) pointer.

5.14.3.3 static void jm_named_free ( jm_named_ptr np, jm_callbacks ∗ c ) [static]

Free the memory allocated for the object pointed by jm_named_ptr.

Definition at line 66 of file jm_named_ptr.h.

5.14.3.4 jm_vector_declare_template ( jm_named_ptr )

Helper to construct comparison operation.

5.14.3.5 static jm_diff_named void jm_named_vector_free_data ( jm_vector(jm_named_ptr)∗ v ) [static]

Release the data allocated by the items in a vector and then clears the memory used by the vector as well.

This should be used for vectors initialized with jm_vector_init.

Definition at line 80 of file jm_named_ptr.h.

5.14.3.6 static void jm_named_vector_free ( jm_vector(jm_named_ptr)∗ v ) [static]

Release the data allocated by the items in a vector and then clears the memory used by the vector as well.

This should be used for vectors created with jm_vector_alloc.

Definition at line 90 of file jm_named_ptr.h.

Generated by Doxygen

Page 148: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

80 Module Documentation

5.15 Handling platform specific defines and functions

Typedefs

• typedef void ∗ jm_dll_function_ptr

A function pointer as returned when DLL symbol is loaded.

Functions

• DLL_HANDLE jm_portability_load_dll_handle (const char ∗dll_file_path)

Load a dll/so library into the process and return a handle.

• jm_status_enu_t jm_portability_free_dll_handle (DLL_HANDLE dll_handle)

Unload a Dll and release the handle.

• jm_status_enu_t jm_portability_load_dll_function (DLL_HANDLE dll_handle, char ∗dll_function_name, jm←↩

_dll_function_ptr ∗dll_function_ptrptr)

Find a function in the Dll and return a function pointer.

• char ∗ jm_portability_get_last_dll_error (void)

Return error associated with Dll handling.

• jm_status_enu_t jm_portability_get_current_working_directory (char ∗buffer, size_t len)

Get current working directory name.

• jm_status_enu_t jm_portability_set_current_working_directory (const char ∗cwd)

Set current working directory.

• const char ∗ jm_get_system_temp_dir ()

Get system-wide temporary directory.

• char ∗ jm_mkdtemp (jm_callbacks ∗cb, char ∗tmplt)

Create a uniquely named temporary directory.

• char ∗ jm_get_dir_abspath (jm_callbacks ∗cb, const char ∗dir, char ∗outPath, size_t len)

Get absolute path to an existing directory.

• char ∗ jm_mk_temp_dir (jm_callbacks ∗cb, const char ∗systemTempDir, const char ∗tempPrefix)

Create a unique temporary directory.

• char ∗ jm_create_URL_from_abs_path (jm_callbacks ∗cb, const char ∗absPath)

Create a file:// URL from absolute path.

• jm_status_enu_t jm_mkdir (jm_callbacks ∗cb, const char ∗dir)

Make a directory.

• jm_status_enu_t jm_rmdir (jm_callbacks ∗cb, const char ∗dir)

Remove directory and all it contents.

• FMILIB_EXPORT int jm_vsnprintf (char ∗str, size_t size, const char ∗fmt, va_list al)

C89 compatible implementation of C99 vsnprintf.

• FMILIB_EXPORT int jm_snprintf (char ∗str, size_t size, const char ∗fmt,...)

C89 compatible implementation of C99 snprintf.

5.15.1 Detailed Description

5.15.2 Typedef Documentation

5.15.2.1 typedef void∗ jm_dll_function_ptr

A function pointer as returned when DLL symbol is loaded.

Definition at line 52 of file jm_portability.h.

Generated by Doxygen

Page 149: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.15 Handling platform specific defines and functions 81

5.15.3 Function Documentation

5.15.3.1 DLL_HANDLE jm_portability_load_dll_handle ( const char ∗ dll_file_path )

Load a dll/so library into the process and return a handle.

5.15.3.2 jm_status_enu_t jm_portability_free_dll_handle ( DLL_HANDLE dll_handle )

Unload a Dll and release the handle.

5.15.3.3 jm_status_enu_t jm_portability_load_dll_function ( DLL_HANDLE dll_handle, char ∗ dll_function_name,jm_dll_function_ptr ∗ dll_function_ptrptr )

Find a function in the Dll and return a function pointer.

5.15.3.4 char∗ jm_portability_get_last_dll_error ( void )

Return error associated with Dll handling.

5.15.3.5 jm_status_enu_t jm_portability_get_current_working_directory ( char ∗ buffer, size_t len )

Get current working directory name.

5.15.3.6 jm_status_enu_t jm_portability_set_current_working_directory ( const char ∗ cwd )

Set current working directory.

5.15.3.7 const char∗ jm_get_system_temp_dir ( )

Get system-wide temporary directory.

5.15.3.8 char∗ jm_mkdtemp ( jm_callbacks ∗ cb, char ∗ tmplt )

Create a uniquely named temporary directory.

Parameters

cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.

tmplt Directory name template ending with XXXXXX. The template is modified by the call.

Generated by Doxygen

Page 150: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

82 Module Documentation

Returns

A pointer to the modified template. The function returns NULL if the template does not end with XXXXXX, orif the directory could not be created.

5.15.3.9 char∗ jm_get_dir_abspath ( jm_callbacks ∗ cb, const char ∗ dir, char ∗ outPath, size_t len )

Get absolute path to an existing directory.

Parameters

cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.

dir - path to a directory (relative or absolute).

outPath - buffer for storing the directory

len - of the buffer (if size is larger than FILENAME_MAX + 1 then the path will always fit in)

Returns

Pointer to outPath on success, 0 - on error in which case a message is send to the logger.

5.15.3.10 char∗ jm_mk_temp_dir ( jm_callbacks ∗ cb, const char ∗ systemTempDir, const char ∗ tempPrefix )

Create a unique temporary directory.

Parameters

cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter isNULL.

systemTempDir - directory where the temp dir should be located both absolute and relative path areaccepted. System-wide directory is used if this parameter is NULL.

tempPrefix - File name template prefix used when creating temporaty directories. "jm" is used if this isNULL.

Returns

A pointer to the temporary directory name (absolute path, no terminating '/'). Caller is responsible for freeingthe memory. The function returns NULL if there were errors in which case a message is send to the logger.

5.15.3.11 char∗ jm_create_URL_from_abs_path ( jm_callbacks ∗ cb, const char ∗ absPath )

Create a file:// URL from absolute path.

Parameters

cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.

absPath - absolute path to be converted into the URL

Generated by Doxygen

Page 151: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.15 Handling platform specific defines and functions 83

Returns

A pointer to the URL. Caller is responsible for freeing the memory. The function returns NULL if there wereerrors in which case a message is send to the logger.

5.15.3.12 jm_status_enu_t jm_mkdir ( jm_callbacks ∗ cb, const char ∗ dir )

Make a directory.

5.15.3.13 jm_status_enu_t jm_rmdir ( jm_callbacks ∗ cb, const char ∗ dir )

Remove directory and all it contents.

5.15.3.14 FMILIB_EXPORT int jm_vsnprintf ( char ∗ str, size_t size, const char ∗ fmt, va_list al )

C89 compatible implementation of C99 vsnprintf.

5.15.3.15 FMILIB_EXPORT int jm_snprintf ( char ∗ str, size_t size, const char ∗ fmt, ... )

C89 compatible implementation of C99 snprintf.

Generated by Doxygen

Page 152: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

84 Module Documentation

5.16 A set of strings

Typedefs

• typedef struct jm_vector_jm_string jm_string_set

Set of string is based on a vector.

Functions

• static jm_string jm_string_set_find (jm_string_set ∗s, jm_string str)

Find a string in a set.

• static size_t jm_string_set_find_index (jm_string_set ∗s, jm_string str)

Find index of a string in a set.

• static jm_string jm_string_set_put (jm_string_set ∗s, jm_string str)

Put an element in the set if it is not there yet.

5.16.1 Detailed Description

5.16.2 Typedef Documentation

5.16.2.1 typedef struct jm_vector_jm_string jm_string_set

Set of string is based on a vector.

Definition at line 43 of file jm_string_set.h.

5.16.3 Function Documentation

5.16.3.1 static jm_string jm_string_set_find ( jm_string_set ∗ s, jm_string str ) [static]

Find a string in a set.

Parameters

s A string set.

str Search string.

Returns

If found returns a pointer to the string saved in the set. If not found returns NULL.

Definition at line 52 of file jm_string_set.h.

5.16.3.2 static size_t jm_string_set_find_index ( jm_string_set ∗ s, jm_string str ) [static]

Find index of a string in a set.

Generated by Doxygen

Page 153: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.16 A set of strings 85

Parameters

s A string set.

str Search string.

Returns

If found returns the index to the string saved in the set. If not found returns the insertion index of the string.

Definition at line 65 of file jm_string_set.h.

5.16.3.3 static jm_string jm_string_set_put ( jm_string_set ∗ s, jm_string str ) [static]

Put an element in the set if it is not there yet.

Parameters

s A string set.

str String to put.

Returns

A pointer to the inserted (or found) element or zero pointer if failed.

Definition at line 94 of file jm_string_set.h.

Generated by Doxygen

Page 154: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

86 Module Documentation

5.17 A vector of items (dynamic array)

Macros

• #define jm_mangle_ex(name, type) name## _ ##type

jm_mange macro is used to construct names for the template instances Extra level (jm_mange_ex) is needed to forceargument expansion (pre-scan)

• #define jm_mangle(name, type) jm_mangle_ex(name,type)• #define jm_vector(T) jm_mangle(jm_vector, T)

jm_vector(T) is the type name (i.e., to be used as jm_vector(int) vi;)

• #define JM_VECTOR_MINIMAL_CAPACITY 16• #define JM_VECTOR_MAX_MEMORY_CHUNK 1024• #define jm_vector_declare_template(T)• #define jm_vector_ptr2index(T) jm_mangle(jm_vector_ptr2index, T)

Functions

• jm_vector_declare_template (char) static jm_string jm_vector_char2string(jm_vector(char)∗v)• jm_vector_declare_template (int) jm_vector_declare_template(double) jm_vector_declare_template(jm_←↩

voidp) jm_vector_declare_template(size_t) jm_vector_declare_template(jm_string) jm_vector_declare_←↩

template(jm_name_ID_map_t) jm_define_comp_f(jm_compare_voidp• int jm_diff jm_define_comp_f (jm_compare_int, int, jm_diff) jm_define_comp_f(jm_compare_char• int jm_diff jm_diff jm_define_comp_f (jm_compare_double, double, jm_diff) jm_define_comp_f(jm_compare←↩

_size_t• int jm_diff jm_diff jm_diff jm_define_comp_f (jm_compare_string, jm_string, strcmp) jm_define_comp_f(jm←↩

_compare_name• jm_vector (JM_TEMPLATE_INSTANCE_TYPE)∗jm_vector_alloc(JM_TEMPLATE_INSTANCE_TY←↩

PE)(size_t size• if (c) cc• if (reserve< size) reserve• if (reserve > JM_VECTOR_MINIMAL_CAPACITY)• if (!v) return 0• void jm_vector_free() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TY←↩

PE)∗a)• size_t jm_vector_init() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TY←↩

PE)∗a, size_t initSize, jm_callbacks ∗c)• size_t jm_vector_resize() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_T←↩

YPE)∗a, size_t size)• size_t jm_vector_copy() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TY←↩

PE)∗destination, jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗source)• JM_TEMPLATE_INSTANCE_TYPE ∗jm_vector_insert() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(J←↩

M_TEMPLATE_INSTANCE_TYPE)∗a, size_t index, JM_TEMPLATE_INSTANCE_TYPE item)• JM_TEMPLATE_INSTANCE_TYPE ∗jm_vector_push_back() JM_TEMPLATE_INSTANCE_TYPE (jm_←↩

vector(JM_TEMPLATE_INSTANCE_TYPE)∗a, JM_TEMPLATE_INSTANCE_TYPE item)• void jm_vector_foreach_c() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a, void(∗f)(JM_TEMPLATE_INSTANCE_TYPE, void ∗), void ∗data)• void jm_vector_foreach() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_T←↩

YPE)∗a, void(∗f)(JM_TEMPLATE_INSTANCE_TYPE))• void jm_vector_qsort() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TY←↩

PE)∗v, jm_compare_ft f)• static size_t jm_vector_ptr2index() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INST←↩

ANCE_TYPE)∗v, JM_TEMPLATE_INSTANCE_TYPE ∗itemp)• size_t jm_vector_bsearch_index() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INST←↩

ANCE_TYPE)∗v, JM_TEMPLATE_INSTANCE_TYPE ∗key, jm_compare_ft f)

Generated by Doxygen

Page 155: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.17 A vector of items (dynamic array) 87

Variables

• int jm_diff char• int jm_diff jm_diff size_t• int jm_diff jm_diff jm_diff jm_name_ID_map_t• int jm_diff jm_diff jm_diff jm_diff_name• size_t capacity = JM_VECTOR_MINIMAL_CAPACITY• size_t jm_callbacks ∗ c• jm_callbacks ∗ cc = jm_get_default_callbacks()• reserve = capacity• else• v callbacks = cc• v items = &(v->preallocated[0])• v size = size• return v

Vector handling functions.

Allocates a vector on heap with the specified size and specified number of preallocated items (can be larger thansize).

extern jm_vector(T)∗ jm_vector_alloc(T)(size_t size, size_t capacity, jm_callbacks∗c ); Note that there is no need tocall jm_vector_init for a vector allocated with this function.

Parameters

size - initial size of the vector, can be 0

capacity - initial capacity of the vector, can be 0. At least initSize elements are allocated.

c - jm_callbacks callbacks, can be zero

Returns

Newly allocated vector

• typedef int(∗ jm_compare_ft) (const void ∗, const void ∗)

Function type for item comparison. Can be generated with jm_define_comp_f.

• #define jm_vector_alloc(T) jm_mangle(jm_vector_alloc, T)• #define jm_vector_free(T) jm_mangle(jm_vector_free, T)• #define jm_vector_init(T) jm_mangle(jm_vector_init, T)

jm_vector_init initializes a vector allocated on stack.

• #define jm_vector_free_data(T) jm_mangle(jm_vector_free_data, T)• #define jm_vector_get_size(T) jm_mangle(jm_vector_get_size, T)• #define jm_vector_get_item(T) jm_mangle(jm_vector_get_item, T)• #define jm_vector_get_itemp(T) jm_mangle(jm_vector_get_itemp, T)• #define jm_vector_get_last(T) jm_mangle(jm_vector_get_last, T)• #define jm_vector_get_lastp(T) jm_mangle(jm_vector_get_lastp, T)• #define jm_define_comp_f(F, T, COMPAR_OP)

A conveniece macro for comparison function definition.

• #define jm_diff(first, second) (int)(first-second)• #define jm_vector_find(T) jm_mangle(jm_vector_find, T)

jm_vector_find functions use linear search to find items in a vector. JM_COMPAR_OP is used for comparison.

Generated by Doxygen

Page 156: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

88 Module Documentation

• #define jm_vector_find_index(T) jm_mangle(jm_vector_find_index, T)• #define jm_vector_qsort(T) jm_mangle(jm_vector_qsort, T)• #define jm_vector_bsearch(T) jm_mangle(jm_vector_bsearch, T)• #define jm_vector_bsearch_index(T) jm_mangle(jm_vector_bsearch_index, T)• #define jm_vector_set_item(T) jm_mangle(jm_vector_set_item, T)• #define jm_vector_zero(T) jm_mangle(jm_vector_zero, T)• #define jm_vector_resize(T) jm_mangle(jm_vector_resize, T)• #define jm_vector_reserve(T) jm_mangle(jm_vector_reserve, T)• #define jm_vector_copy(T) jm_mangle(jm_vector_copy, T)• #define jm_vector_clone(T) jm_mangle(jm_vector_clone, T)• #define jm_vector_append(T) jm_mangle(jm_vector_append, T)• #define jm_vector_insert(T) jm_mangle(jm_vector_insert, T)• #define jm_vector_remove_item(T) jm_mangle(jm_vector_remove_item, T)• #define jm_vector_resize1(T) jm_mangle(jm_vector_resize1, T)• #define jm_vector_push_back(T) jm_mangle(jm_vector_push_back, T)• #define jm_vector_foreach(T) jm_mangle(jm_vector_foreach, T)• #define jm_vector_foreach_c(T) jm_mangle(jm_vector_foreach_c, T)

5.17.1 Detailed Description

5.17.2 Macro Definition Documentation

5.17.2.1 #define jm_mangle_ex( name, type ) name## _ ##type

jm_mange macro is used to construct names for the template instances Extra level (jm_mange_ex) is needed toforce argument expansion (pre-scan)

Definition at line 44 of file jm_vector.h.

5.17.2.2 #define jm_mangle( name, type ) jm_mangle_ex(name,type)

Definition at line 45 of file jm_vector.h.

5.17.2.3 #define jm_vector( T ) jm_mangle(jm_vector, T)

jm_vector(T) is the type name (i.e., to be used as jm_vector(int) vi;)

Definition at line 48 of file jm_vector.h.

5.17.2.4 #define jm_vector_alloc( T ) jm_mangle(jm_vector_alloc, T)

Definition at line 62 of file jm_vector.h.

5.17.2.5 #define jm_vector_free( T ) jm_mangle(jm_vector_free, T)

jm_vector_free releases the memory allocated by jm_vector_alloc. extern void jm_vector_free(T)(jm_vector(T)∗ a);

Definition at line 68 of file jm_vector.h.

Generated by Doxygen

Page 157: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.17 A vector of items (dynamic array) 89

5.17.2.6 #define jm_vector_init( T ) jm_mangle(jm_vector_init, T)

jm_vector_init initializes a vector allocated on stack.

Input: a - pointer to the vector to be initialized; size - initial size of the vector, can be 0 c - jm_callbacks callbacks, canbe zero Returns: size of the vector (can be zero for non-zero size if memory allocation failed) Note that for initSize <JM_VECTOR_MINIMAL_CAPACITY no heap memory allocation is needed size_t jm_vector_init(T)(jm_vector(T)∗a, size_t initSize, jm_callbacks∗ c)

Definition at line 82 of file jm_vector.h.

5.17.2.7 #define jm_vector_free_data( T ) jm_mangle(jm_vector_free_data, T)

jm_vector_free_data releases memory allocated for vector data This only needs to be called for stack allocatedvectors (jm_vector_free does the job for heap vectors automatically) inline void jm_vector_free_data(T)(jm_vector(←↩

T)∗ a)

Definition at line 90 of file jm_vector.h.

5.17.2.8 #define jm_vector_get_size( T ) jm_mangle(jm_vector_get_size, T)

jm_vector_get_size get the vector size inline size_t jm_vector_get_size(T)(jm_vector(T)∗ a)

Definition at line 96 of file jm_vector.h.

5.17.2.9 #define jm_vector_get_item( T ) jm_mangle(jm_vector_get_item, T)

jm_vector_get_item returns the specified item. Range checking is done with an assert. inline T jm_vector_get_←↩

item(jm_vector(T)∗ a, size_t index)

Definition at line 102 of file jm_vector.h.

5.17.2.10 #define jm_vector_get_itemp( T ) jm_mangle(jm_vector_get_itemp, T)

jm_vector_get_itemp returns a pointer to the specified item. Range checking is done with an assert. inline T∗jm_vector_get_itemp(jm_vector(T)∗ a, size_t index)

Definition at line 108 of file jm_vector.h.

5.17.2.11 #define jm_vector_get_last( T ) jm_mangle(jm_vector_get_last, T)

jm_vector_get_lastp returns a pointer to the last item in the vector. It is an error to call this if size=0 inline Tjm_vector_get_last(jm_vector(T)∗ a)

Definition at line 115 of file jm_vector.h.

Generated by Doxygen

Page 158: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

90 Module Documentation

5.17.2.12 #define jm_vector_get_lastp( T ) jm_mangle(jm_vector_get_lastp, T)

jm_vector_get_lastp returns a pointer to the last item in the vector. Zero pointer is returned if size=0 inline T∗jm_vector_get_lastp(jm_vector(T)∗ a)

Definition at line 121 of file jm_vector.h.

5.17.2.13 #define jm_define_comp_f( F, T, COMPAR_OP )

Value:

static int F (const void* first, const void* second) { \return COMPAR_OP( (*(T*)first), (*(T*)second)); \

} \

A conveniece macro for comparison function definition.

#define jm_define_comp_f(F, T, COMPAR_OP) is a conveniece macro for comparison function definition to be usedin sort/search operations. Here F - is the defined function name; T - type of the argument; COMPAR_OP(A,B) isa macro that returns an integer less than, equal to, or greater than zero if the first argument is considered to berespectively less than, equal to, or greater than the second. If two members compare as equal, their order in thesorted array is undefined. Default definition below is jm_diff and is implemented as (int)(first-second)

Definition at line 140 of file jm_vector.h.

5.17.2.14 #define jm_diff( first, second ) (int)(first-second)

Definition at line 145 of file jm_vector.h.

5.17.2.15 #define jm_vector_find( T ) jm_mangle(jm_vector_find, T)

jm_vector_find functions use linear search to find items in a vector. JM_COMPAR_OP is used for comparison.

T∗ jm_vector_find(T)(jm_vector(T)∗ a, T item, jm_compare_ft f)

size_t jm_vector_find_index(T)(jm_vector(T)∗ a, T item, jm_compare_ft f)

Parameters

a - the vector;item - the searched item;

Return: T∗ jm_vector_find(T)(jm_vector(T)∗ a, T item, jm_compare_ft f) returns a pointer to the found item or NULLif not found size_t jm_vector_find_index(T)(jm_vector(T)∗ a, T item, jm_compare_ft f) return the index of the founditem or size of the vector if not found.

Definition at line 161 of file jm_vector.h.

Generated by Doxygen

Page 159: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.17 A vector of items (dynamic array) 91

5.17.2.16 #define jm_vector_find_index( T ) jm_mangle(jm_vector_find_index, T)

Definition at line 162 of file jm_vector.h.

5.17.2.17 #define jm_vector_qsort( T ) jm_mangle(jm_vector_qsort, T)

Definition at line 170 of file jm_vector.h.

5.17.2.18 #define jm_vector_bsearch( T ) jm_mangle(jm_vector_bsearch, T)

jm_vector_bsearch uses standard binary search (bsearch) to find elements in a sorted vector. It returns the indexof an item in the vector or vector's size if not found. JM_COMPAR_OP is used for comparison.

T∗ jm_vector_bsearch(T)(jm_vector(T)∗ v, T∗ key, jm_compare_ft f) size_t jm_vector_bsearch_index(T)(jm_←↩

vector(T)∗ v, T∗ key, jm_compare_ft f)

Definition at line 180 of file jm_vector.h.

5.17.2.19 #define jm_vector_bsearch_index( T ) jm_mangle(jm_vector_bsearch_index, T)

Definition at line 181 of file jm_vector.h.

5.17.2.20 #define jm_vector_set_item( T ) jm_mangle(jm_vector_set_item, T)

jm_vector_set_item sets the specified item. Range checking is done with an assert. void jm_vector_set_item(←↩

T)(jm_vector(T)∗ a, size_t index, T item)

Definition at line 187 of file jm_vector.h.

5.17.2.21 #define jm_vector_zero( T ) jm_mangle(jm_vector_zero, T)

jm_vector_zero sets all elements in the vector to zero void jm_vector_zero(T)(jm_vector(T)∗ a);

Definition at line 193 of file jm_vector.h.

5.17.2.22 #define jm_vector_resize( T ) jm_mangle(jm_vector_resize, T)

jm_vector_resize resizes the vector Input: a - the vector size - new size Return: size of the vector after operation.Can be less than size if memory allocation failed. Note: resizing to smaller vector does not release memory. size_tjm_vector_resize(T)(jm_vector(T)∗ a, size_t size)

Definition at line 205 of file jm_vector.h.

Generated by Doxygen

Page 160: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

92 Module Documentation

5.17.2.23 #define jm_vector_reserve( T ) jm_mangle(jm_vector_reserve, T)

jm_vector_reserve preallocates memory for the vector (to speed up consequent push_back) Returns: the actuallyreserved space. Can be smaller than requested "capacity" if memory allocation failed. Can be larger than "capacity"if more memory was previously allocated. size_t jm_vector_reserve(T)(jm_vector(T)∗ a, size_t capacity)

Definition at line 213 of file jm_vector.h.

5.17.2.24 #define jm_vector_copy( T ) jm_mangle(jm_vector_copy, T)

jm_vector_copy copies source vector into destination. Returns the number of elements actually copied (may be lessthan the source size if allocation failed). size_t jm_vector_copy(T)(jm_vector(T)∗ destination, jm_vector(T)∗ source)

Definition at line 220 of file jm_vector.h.

5.17.2.25 #define jm_vector_clone( T ) jm_mangle(jm_vector_clone, T)

jm_vector_clone creates a copy of the provided vector on heap and returns it. Allocated capacity matches the sizeof the given vector. Returns the vector pointer or zero if memory allocation failed. jm_vector(T)∗ jm_vector_clone(←↩

T)(jm_vector(T)∗ source)

Definition at line 227 of file jm_vector.h.

5.17.2.26 #define jm_vector_append( T ) jm_mangle(jm_vector_append, T)

jm_vector_append appends source vector into destination. Returns the number of elements actually appended(may be less than the source size if allocation failed). size_t jm_vector_append(T)(jm_vector(T)∗ destination, jm←↩

_vector(T)∗ source)

Definition at line 234 of file jm_vector.h.

5.17.2.27 #define jm_vector_insert( T ) jm_mangle(jm_vector_insert, T)

jm_vector_insert inserts an element at a given location. Returns a pointer to the inserted element or zero pointer iffailed T∗ jm_vector_insert(T)(jm_vector(T)∗ a, size_t index, T item)

Definition at line 241 of file jm_vector.h.

5.17.2.28 #define jm_vector_remove_item( T ) jm_mangle(jm_vector_remove_item, T)

jm_vector_remove_item removes an item from the vector. Vector size is reduced by 1. Supplying index > size givesassertion fault. void jm_vector_remove_item(T)(jm_vector(T)∗ v, size_t index)

Definition at line 248 of file jm_vector.h.

Generated by Doxygen

Page 161: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.17 A vector of items (dynamic array) 93

5.17.2.29 #define jm_vector_resize1( T ) jm_mangle(jm_vector_resize1, T)

T∗ jm_vector_resize1(jm_vector(T)∗ a) Increase the size of the vector by 1 and return a pointer to the last item.Return 0 if memory allocation failed.

Definition at line 255 of file jm_vector.h.

5.17.2.30 #define jm_vector_push_back( T ) jm_mangle(jm_vector_push_back, T)

jm_vector_push_back Returns a pointer to the inserted element or zero pointer if failed. T∗ jm_vector_push_←↩

back(jm_vector(T)∗ a, T item)

Definition at line 262 of file jm_vector.h.

5.17.2.31 #define jm_vector_foreach( T ) jm_mangle(jm_vector_foreach, T)

jm_vector_foreach calls f for each element in the vector. "contect" parameter is passed directly to the function as thesecond argument for the second version. void jm_vector_foreach(T)(jm_vector(T)∗ a, void (f)(T)) void jm_vector_←↩

foreach_c(T)(jm_vector(T) a, void (f)(T, void), void ∗ context)

Definition at line 270 of file jm_vector.h.

5.17.2.32 #define jm_vector_foreach_c( T ) jm_mangle(jm_vector_foreach_c, T)

Definition at line 271 of file jm_vector.h.

5.17.2.33 #define JM_VECTOR_MINIMAL_CAPACITY 16

number of items always allocated on the stack

Definition at line 276 of file jm_vector.h.

5.17.2.34 #define JM_VECTOR_MAX_MEMORY_CHUNK 1024

maximum memory chunk (in items) to be allocated in push_back.

Definition at line 279 of file jm_vector.h.

5.17.2.35 #define jm_vector_declare_template( T )

Declare the struct and functions for the specified type.

Definition at line 282 of file jm_vector.h.

Generated by Doxygen

Page 162: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

94 Module Documentation

5.17.2.36 #define jm_vector_ptr2index( T ) jm_mangle(jm_vector_ptr2index, T)

Definition at line 202 of file jm_vector_template.h.

5.17.3 Typedef Documentation

5.17.3.1 typedef int(∗ jm_compare_ft) (const void ∗, const void ∗)

Function type for item comparison. Can be generated with jm_define_comp_f.

Definition at line 127 of file jm_vector.h.

5.17.4 Function Documentation

5.17.4.1 jm_vector_declare_template ( char )

Definition at line 352 of file jm_vector.h.

5.17.4.2 jm_vector_declare_template ( int )

5.17.4.3 int jm_diff jm_define_comp_f ( jm_compare_int , int , jm_diff )

5.17.4.4 int jm_diff jm_diff jm_define_comp_f ( jm_compare_double , double , jm_diff )

5.17.4.5 int jm_diff jm_diff jm_diff jm_define_comp_f ( jm_compare_string , jm_string , strcmp )

5.17.4.6 jm_vector ( JM_TEMPLATE_INSTANCE_TYPE )

5.17.4.7 if ( c )

5.17.4.8 if ( )

5.17.4.9 if ( reserve , JM_VECTOR_MINIMAL_CAPACITY )

Definition at line 48 of file jm_vector_template.h.

5.17.4.10 if ( ! v )

5.17.4.11 void jm_vector_free() JM_TEMPLATE_INSTANCE_TYPE ( jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗ a )

Definition at line 66 of file jm_vector_template.h.

Generated by Doxygen

Page 163: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.17 A vector of items (dynamic array) 95

5.17.4.12 size_t jm_vector_init() JM_TEMPLATE_INSTANCE_TYPE ( jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗ a,size_t initSize, jm_callbacks ∗ c )

Definition at line 72 of file jm_vector_template.h.

5.17.4.13 size_t jm_vector_resize() JM_TEMPLATE_INSTANCE_TYPE ( jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗ a,size_t size )

Definition at line 86 of file jm_vector_template.h.

5.17.4.14 size_t jm_vector_copy() JM_TEMPLATE_INSTANCE_TYPE ( jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗destination, jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗ source )

Definition at line 109 of file jm_vector_template.h.

5.17.4.15 JM_TEMPLATE_INSTANCE_TYPE∗ jm_vector_insert() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗ a, size_t index, JM_TEMPLATE_INSTANCE_TYPE item )

Definition at line 125 of file jm_vector_template.h.

5.17.4.16 JM_TEMPLATE_INSTANCE_TYPE∗ jm_vector_push_back() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗ a, JM_TEMPLATE_INSTANCE_TYPE item )

Definition at line 160 of file jm_vector_template.h.

5.17.4.17 void jm_vector_foreach_c() JM_TEMPLATE_INSTANCE_TYPE ( jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗a, void(∗)(JM_TEMPLATE_INSTANCE_TYPE, void ∗) f, void ∗ data )

Definition at line 182 of file jm_vector_template.h.

5.17.4.18 void jm_vector_foreach() JM_TEMPLATE_INSTANCE_TYPE ( jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗ a,void(∗)(JM_TEMPLATE_INSTANCE_TYPE) f )

Definition at line 189 of file jm_vector_template.h.

5.17.4.19 void jm_vector_qsort() JM_TEMPLATE_INSTANCE_TYPE ( jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗ v,jm_compare_ft f )

Definition at line 196 of file jm_vector_template.h.

5.17.4.20 static size_t jm_vector_ptr2index() JM_TEMPLATE_INSTANCE_TYPE ( jm_←↩

vector(JM_TEMPLATE_INSTANCE_TYPE)∗ v, JM_TEMPLATE_INSTANCE_TYPE ∗ itemp )[static]

Definition at line 204 of file jm_vector_template.h.

Generated by Doxygen

Page 164: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

96 Module Documentation

5.17.4.21 size_t jm_vector_bsearch_index() JM_TEMPLATE_INSTANCE_TYPE ( jm_vector(JM_←↩

TEMPLATE_INSTANCE_TYPE)∗ v, JM_TEMPLATE_INSTANCE_TYPE ∗ key, jm_compare_ft f)

Definition at line 212 of file jm_vector_template.h.

5.17.5 Variable Documentation

5.17.5.1 int jm_diff char

Definition at line 369 of file jm_vector.h.

5.17.5.2 int jm_diff jm_diff size_t

Definition at line 371 of file jm_vector.h.

5.17.5.3 int jm_diff jm_diff jm_diff jm_name_ID_map_t

Definition at line 375 of file jm_vector.h.

5.17.5.4 int jm_diff jm_diff jm_diff jm_diff_name

Definition at line 375 of file jm_vector.h.

5.17.5.5 v capacity = JM_VECTOR_MINIMAL_CAPACITY

Definition at line 37 of file jm_vector_template.h.

5.17.5.6 size_t jm_callbacks∗ c

Initial value:

{size_t reserve

Definition at line 37 of file jm_vector_template.h.

5.17.5.7 else cc = jm_get_default_callbacks()

Definition at line 39 of file jm_vector_template.h.

Generated by Doxygen

Page 165: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.17 A vector of items (dynamic array) 97

5.17.5.8 reserve = capacity

Definition at line 46 of file jm_vector_template.h.

5.17.5.9 else

Initial value:

{v = (jm_vector(JM_TEMPLATE_INSTANCE_TYPE)*)

cc->malloc(sizeof(jm_vector(JM_TEMPLATE_INSTANCE_TYPE)))

Definition at line 55 of file jm_vector_template.h.

5.17.5.10 v callbacks = cc

Definition at line 60 of file jm_vector_template.h.

5.17.5.11 v items = &(v->preallocated[0])

Definition at line 61 of file jm_vector_template.h.

5.17.5.12 v size = size

Definition at line 62 of file jm_vector_template.h.

5.17.5.13 return v

Definition at line 63 of file jm_vector_template.h.

Generated by Doxygen

Page 166: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

98 Module Documentation

5.18 Library initialization

Macros

• #define FMI_IMPORT_NAME_CHECK 1

If this configuration option is set, the model description will be checked to follow the variable naming conventions.Variables not following the convention will be logged.

Typedefs

• typedef struct fmi_xml_context_t fmi_import_context_t

FMI version independent library context. Opaque struct returned from fmi_import_allocate_context()

• typedef struct fmi1_import_t fmi1_import_t

FMU version 1.0 object.

• typedef struct fmi2_import_t fmi2_import_t

FMU version 2.0 object.

Functions

• FMILIB_EXPORT fmi_import_context_t ∗ fmi_import_allocate_context (jm_callbacks ∗callbacks)

Create fmi_import_context_t structure.

• FMILIB_EXPORT void fmi_import_free_context (fmi_import_context_t ∗c)

Free memory allocated for the library context.

• FMILIB_EXPORT void fmi_import_set_configuration (fmi_import_context_t ∗c, int conf)

Sets advanced configuration, if zero is passed default configuration is set. Currently only one non default configurationis available: FMI_IMPORT_XML_NAME_CHECK.

• FMILIB_EXPORT fmi_version_enu_t fmi_import_get_fmi_version (fmi_import_context_t ∗c, const char∗fileName, const char ∗dirName)

Unzip an FMU specified by the fileName into directory dirName and parse XML to get FMI standard version.

• FMILIB_EXPORT fmi1_import_t ∗ fmi1_import_parse_xml (fmi_import_context_t ∗c, const char ∗dirName)

Parse FMI 1.0 XML file found in the directory dirName.

• FMILIB_EXPORT fmi2_import_t ∗ fmi2_import_parse_xml (fmi_import_context_t ∗context, const char ∗dir←↩

Path, fmi2_xml_callbacks_t ∗xml_callbacks)

Create fmi2_import_t structure and parse the FMI 2.0 XML file found in the directory dirName.

5.18.1 Detailed Description

Interaction with an FMU by means of the FMI Library starts with allocation of an fmi_import_context_t structure. Thisis done with a call to fmi_import_allocate_context(). The next step is detection of FMI standard used in the specificFMU. This is achieved by calling fmi_import_get_fmi_version() function. When the standard is known a standardspecific function for processing model description XML should be called to create an opaque FMU structure. This isdone by calling either fmi1_import_parse_xml() or fmi2_import_parse_xml(). With the FMU structure available onecan proceed by loading the FMU binary (fmi1_import_create_dllfmu() or fmi2_import_create_dllfmu()). After thatthe code is able to interact with the FMU by means of the methonds presented in Interface to the standard FMI 1.0"C" API and Interface to the standard FMI 2.0 "C" API.

Generated by Doxygen

Page 167: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.18 Library initialization 99

5.18.2 Macro Definition Documentation

5.18.2.1 #define FMI_IMPORT_NAME_CHECK 1

If this configuration option is set, the model description will be checked to follow the variable naming conventions.Variables not following the convention will be logged.

Definition at line 84 of file fmi_import_context.h.

5.18.3 Typedef Documentation

5.18.3.1 typedef struct fmi_xml_context_t fmi_import_context_t

FMI version independent library context. Opaque struct returned from fmi_import_allocate_context()

Definition at line 65 of file fmi_import_context.h.

5.18.3.2 typedef struct fmi1_import_t fmi1_import_t

FMU version 1.0 object.

Definition at line 105 of file fmi_import_context.h.

5.18.3.3 typedef struct fmi2_import_t fmi2_import_t

FMU version 2.0 object.

Definition at line 110 of file fmi_import_context.h.

5.18.4 Function Documentation

5.18.4.1 FMILIB_EXPORT fmi_import_context_t∗ fmi_import_allocate_context ( jm_callbacks ∗ callbacks )

Create fmi_import_context_t structure.

Parameters

callbacks - a pointer to the library callbacks for memory management and logging. May be NULL if defaultsare utilized.

Returns

A new structure if memory allocation was successful.

Generated by Doxygen

Page 168: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

100 Module Documentation

5.18.4.2 FMILIB_EXPORT void fmi_import_free_context ( fmi_import_context_t ∗ c )

Free memory allocated for the library context.

Parameters

c - library context allocated by fmi_import_allocate_context()

5.18.4.3 FMILIB_EXPORT void fmi_import_set_configuration ( fmi_import_context_t ∗ c, int conf )

Sets advanced configuration, if zero is passed default configuration is set. Currently only one non default configu-ration is available: FMI_IMPORT_XML_NAME_CHECK.

Parameters

conf - specifies the configuration to use

5.18.4.4 FMILIB_EXPORT fmi_version_enu_t fmi_import_get_fmi_version ( fmi_import_context_t ∗ c, const char∗ fileName, const char ∗ dirName )

Unzip an FMU specified by the fileName into directory dirName and parse XML to get FMI standard version.

Parameters

c - library context.

fileName - an FMU file name.dirName - a directory name where the FMU should be unpacked

5.18.4.5 FMILIB_EXPORT fmi1_import_t∗ fmi1_import_parse_xml ( fmi_import_context_t ∗ c, const char ∗dirName )

Parse FMI 1.0 XML file found in the directory dirName.

Parameters

c - library context.

dirName - a directory where the FMU was unpacked and XML file is present.

Returns

fmi1_import_t:: opaque object pointer

5.18.4.6 FMILIB_EXPORT fmi2_import_t∗ fmi2_import_parse_xml ( fmi_import_context_t ∗ context, const char ∗dirPath, fmi2_xml_callbacks_t ∗ xml_callbacks )

Create fmi2_import_t structure and parse the FMI 2.0 XML file found in the directory dirName.

Generated by Doxygen

Page 169: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.18 Library initialization 101

Parameters

context - library context.

dirPath - a directory where the FMU was unpacked and XML file is present.

xml_callbacks Callbacks to use for processing of annotations (may be NULL).

Returns

fmi2_import_t:: opaque object pointer

Generated by Doxygen

Page 170: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

102 Module Documentation

5.19 Utility functions supporting interactions with the library

Functions

• FMILIB_EXPORT char ∗ fmi_import_mk_temp_dir (jm_callbacks ∗cb, const char ∗systemTempDir, const char∗tempPrefix)

Create a unique temporary directory.

• FMILIB_EXPORT jm_status_enu_t fmi_import_rmdir (jm_callbacks ∗cb, const char ∗dir)

Remove directory and all it contents.

• FMILIB_EXPORT char ∗ fmi_import_create_URL_from_abs_path (jm_callbacks ∗cb, const char ∗absPath)

Create a file:// URL from absolute path.

• FMILIB_EXPORT char ∗ fmi_import_get_dll_path (const char ∗fmu_unzipped_path, const char ∗model_←↩

identifier, jm_callbacks ∗callBackFunctions)• FMILIB_EXPORT char ∗ fmi_import_get_model_description_path (const char ∗fmu_unzipped_path, jm_←↩

callbacks ∗callBackFunctions)

5.19.1 Detailed Description

5.19.2 Function Documentation

5.19.2.1 FMILIB_EXPORT char∗ fmi_import_mk_temp_dir ( jm_callbacks ∗ cb, const char ∗ systemTempDir, constchar ∗ tempPrefix )

Create a unique temporary directory.

Parameters

cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter isNULL.

systemTempDir - directory where the temp dir should be located both absolute and relative path areaccepted. System-wide directory is used if this parameter is NULL.

tempPrefix - File name template prefix used when creating temporaty directories. "fmil" is used if this isNULL.

Returns

A pointer to the temporary directory name (absolute path, no terminating '/'). Caller is responsible for freeingthe memory. The function returns NULL if there were errors in which case a message is send to the logger.

5.19.2.2 FMILIB_EXPORT jm_status_enu_t fmi_import_rmdir ( jm_callbacks ∗ cb, const char ∗ dir )

Remove directory and all it contents.

Parameters

cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.

dir - path to be removed.

Generated by Doxygen

Page 171: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.19 Utility functions supporting interactions with the library 103

Returns

Statuc success or error.

5.19.2.3 FMILIB_EXPORT char∗ fmi_import_create_URL_from_abs_path ( jm_callbacks ∗ cb, const char ∗ absPath )

Create a file:// URL from absolute path.

Parameters

cb - callbacks for memory allocation and logging. Default callbacks are used if this parameter is NULL.

absPath - absolute path to be converted into the URL

Returns

A pointer to the URL. Caller is responsible for freeing the memory. The function returns NULL if there wereerrors in which case a message is send to the logger.

5.19.2.4 FMILIB_EXPORT char∗ fmi_import_get_dll_path ( const char ∗ fmu_unzipped_path, const char ∗model_identifier, jm_callbacks ∗ callBackFunctions )

Given directory name fmu_unzipped_path and model identifier consturct Dll/so name

Returns

Pointer to a string with the file name. Caller is responsible for freeing the memory.

5.19.2.5 FMILIB_EXPORT char∗ fmi_import_get_model_description_path ( const char ∗ fmu_unzipped_path,jm_callbacks ∗ callBackFunctions )

Given directory name fmu_unzipped_path and model identifier consturct XML file name

Returns

Pointer to a string with the file name. Caller is responsible for freeing the memory.

Generated by Doxygen

Page 172: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

104 Module Documentation

5.20 Constuction, destruction and error handling

Functions

• FMILIB_EXPORT fmi1_import_t ∗ fmi1_import_parse_xml (fmi_import_context_t ∗context, const char ∗dir←↩

Path)

Create fmi1_import_t structure and parse the XML file.

• FMILIB_EXPORT const char ∗ fmi1_import_get_last_error (fmi1_import_t ∗fmu)

Retrieve the last error message.

• FMILIB_EXPORT int fmi1_import_clear_last_error (fmi1_import_t ∗fmu)

Clear the error message.

• FMILIB_EXPORT void fmi1_import_free (fmi1_import_t ∗fmu)

Release the memory allocated.

5.20.1 Detailed Description

5.20.2 Function Documentation

5.20.2.1 FMILIB_EXPORT fmi1_import_t∗ fmi1_import_parse_xml ( fmi_import_context_t ∗ context, const char ∗dirPath )

Create fmi1_import_t structure and parse the XML file.

Parameters

context A context data strucutre is used to propagate the callbacks for memory handling and logging.

dirPath A directory name (full path) of a directory where the FMU was unzipped.

Returns

The new structure if parsing was successfull. 0-pointer is returned on error.

5.20.2.2 FMILIB_EXPORT const char∗ fmi1_import_get_last_error ( fmi1_import_t ∗ fmu )

Retrieve the last error message.

Error handling:

Many functions in the library return pointers to struct. An error is indicated by returning NULL/0-pointer. If error isreturned than fmi1_import_get_last_error() functions can be used to retrieve the error message. If logging callbackswere specified then the same information is reported via logger. Memory for the error string is allocated anddeallocated in the module. Client code should not store the pointer to the string since it can become invalid.

Parameters

fmu An FMU object as returned by fmi1_import_parse_xml().

Generated by Doxygen

Page 173: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.20 Constuction, destruction and error handling 105

Returns

NULL-terminated string with an error message.

5.20.2.3 FMILIB_EXPORT int fmi1_import_clear_last_error ( fmi1_import_t ∗ fmu )

Clear the error message.

Parameters

fmu An FMU object as returned by fmi1_import_parse_xml().

Returns

0 if further processing is possible. If it returns 1 then the error was not recoverable. The fmu object shouldthen be freed and recreated.

5.20.2.4 FMILIB_EXPORT void fmi1_import_free ( fmi1_import_t ∗ fmu )

Release the memory allocated.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

Generated by Doxygen

Page 174: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

106 Module Documentation

5.21 General information retrieval

Functions for retrieving general model information. Memory for the strings is allocated and deallocated in the mod-ule. All the functions take an FMU object as returned by fmi1_import_parse_xml() as a parameter. The informationis retrieved from the XML file.

Functions

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_name (fmi1_import_t ∗fmu)

Get model name.

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_identifier (fmi1_import_t ∗fmu)

Get model identifier.

• FMILIB_EXPORT const char ∗ fmi1_import_get_GUID (fmi1_import_t ∗fmu)

Get FMU GUID.

• FMILIB_EXPORT const char ∗ fmi1_import_get_description (fmi1_import_t ∗fmu)

Get FMU description.

• FMILIB_EXPORT const char ∗ fmi1_import_get_author (fmi1_import_t ∗fmu)

Get FMU author.

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_version (fmi1_import_t ∗fmu)

Get FMU version.

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_standard_version (fmi1_import_t ∗fmu)

Get FMI standard version (always 1.0).

• FMILIB_EXPORT const char ∗ fmi1_import_get_generation_tool (fmi1_import_t ∗fmu)

Get FMU generation tool.

• FMILIB_EXPORT const char ∗ fmi1_import_get_generation_date_and_time (fmi1_import_t ∗fmu)

Get FMU generation date and time.

• FMILIB_EXPORT fmi1_variable_naming_convension_enu_t fmi1_import_get_naming_convention (fmi1_←↩

import_t ∗fmu)

Get variable naming convention used.

• FMILIB_EXPORT unsigned int fmi1_import_get_number_of_continuous_states (fmi1_import_t ∗fmu)

Get the number of contnuous states.

• FMILIB_EXPORT unsigned int fmi1_import_get_number_of_event_indicators (fmi1_import_t ∗fmu)

Get the number of event indicators.

• FMILIB_EXPORT double fmi1_import_get_default_experiment_start (fmi1_import_t ∗fmu)

Get the start time for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi1_import_get_default_experiment_stop (fmi1_import_t ∗fmu)

Get the stop time for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi1_import_get_default_experiment_tolerance (fmi1_import_t ∗fmu)

Get the tolerance default experiment as specified in the XML file.

• FMILIB_EXPORT fmi1_fmu_kind_enu_t fmi1_import_get_fmu_kind (fmi1_import_t ∗fmu)

Get the type of the FMU (model exchange or co-simulation)

• FMILIB_EXPORT fmi1_import_capabilities_t ∗ fmi1_import_get_capabilities (fmi1_import_t ∗fmu)

Get the structure with capability flags.

• FMILIB_EXPORT fmi1_import_type_definitions_t ∗ fmi1_import_get_type_definitions (fmi1_import_t ∗)

Get the list of all the type definitions in the model.

• FMILIB_EXPORT fmi1_import_unit_definitions_t ∗ fmi1_import_get_unit_definitions (fmi1_import_t ∗fmu)

Get a list of all the unit definitions in the model.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_direct_dependency (fmi1_import_t ∗fmu,fmi1_import_variable_t ∗)

Get the direct dependency information.

Generated by Doxygen

Page 175: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.21 General information retrieval 107

• FMILIB_EXPORT fmi1_import_variable_t ∗ fmi1_import_get_variable_alias_base (fmi1_import_t ∗fmu,fmi1_import_variable_t ∗)

Get the variable with the same value reference that is not an alias.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_variable_aliases (fmi1_import_t ∗fmu,fmi1_import_variable_t ∗)

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_variable_list (fmi1_import_t ∗fmu)

Get the list of all the variables in the model.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_variable_list_alphabetical_order (fmi1_←↩

import_t ∗fmu)

Get the list of all the variables in the model in alphabetical order.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_create_var_list (fmi1_import_t ∗fmu, fmi1_←↩

import_variable_t ∗v)

Create a variable list with a single variable.

5.21.1 Detailed Description

Functions for retrieving general model information. Memory for the strings is allocated and deallocated in the mod-ule. All the functions take an FMU object as returned by fmi1_import_parse_xml() as a parameter. The informationis retrieved from the XML file.

5.21.2 Function Documentation

5.21.2.1 FMILIB_EXPORT const char∗ fmi1_import_get_model_name ( fmi1_import_t ∗ fmu )

Get model name.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.2 FMILIB_EXPORT const char∗ fmi1_import_get_model_identifier ( fmi1_import_t ∗ fmu )

Get model identifier.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.3 FMILIB_EXPORT const char∗ fmi1_import_get_GUID ( fmi1_import_t ∗ fmu )

Get FMU GUID.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

Generated by Doxygen

Page 176: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

108 Module Documentation

5.21.2.4 FMILIB_EXPORT const char∗ fmi1_import_get_description ( fmi1_import_t ∗ fmu )

Get FMU description.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.5 FMILIB_EXPORT const char∗ fmi1_import_get_author ( fmi1_import_t ∗ fmu )

Get FMU author.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.6 FMILIB_EXPORT const char∗ fmi1_import_get_model_version ( fmi1_import_t ∗ fmu )

Get FMU version.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.7 FMILIB_EXPORT const char∗ fmi1_import_get_model_standard_version ( fmi1_import_t ∗ fmu )

Get FMI standard version (always 1.0).

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.8 FMILIB_EXPORT const char∗ fmi1_import_get_generation_tool ( fmi1_import_t ∗ fmu )

Get FMU generation tool.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.9 FMILIB_EXPORT const char∗ fmi1_import_get_generation_date_and_time ( fmi1_import_t ∗ fmu )

Get FMU generation date and time.

Generated by Doxygen

Page 177: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.21 General information retrieval 109

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.10 FMILIB_EXPORT fmi1_variable_naming_convension_enu_t fmi1_import_get_naming_convention (fmi1_import_t ∗ fmu )

Get variable naming convention used.

Parameters

fmu An fmu object as returned by fmi1_import_parse_xml().

5.21.2.11 FMILIB_EXPORT unsigned int fmi1_import_get_number_of_continuous_states ( fmi1_import_t ∗ fmu )

Get the number of contnuous states.

5.21.2.12 FMILIB_EXPORT unsigned int fmi1_import_get_number_of_event_indicators ( fmi1_import_t ∗ fmu )

Get the number of event indicators.

5.21.2.13 FMILIB_EXPORT double fmi1_import_get_default_experiment_start ( fmi1_import_t ∗ fmu )

Get the start time for default experiment as specified in the XML file.

5.21.2.14 FMILIB_EXPORT double fmi1_import_get_default_experiment_stop ( fmi1_import_t ∗ fmu )

Get the stop time for default experiment as specified in the XML file.

5.21.2.15 FMILIB_EXPORT double fmi1_import_get_default_experiment_tolerance ( fmi1_import_t ∗ fmu )

Get the tolerance default experiment as specified in the XML file.

5.21.2.16 FMILIB_EXPORT fmi1_fmu_kind_enu_t fmi1_import_get_fmu_kind ( fmi1_import_t ∗ fmu )

Get the type of the FMU (model exchange or co-simulation)

Generated by Doxygen

Page 178: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

110 Module Documentation

5.21.2.17 FMILIB_EXPORT fmi1_import_capabilities_t∗ fmi1_import_get_capabilities ( fmi1_import_t ∗ fmu )

Get the structure with capability flags.

Returns

A pointer to the fmi1_import_capabilities_t allocated within the library. Note that for model exchange FMUsthe values of all the flags are always default.

5.21.2.18 FMILIB_EXPORT fmi1_import_type_definitions_t∗ fmi1_import_get_type_definitions ( fmi1_import_t ∗ )

Get the list of all the type definitions in the model.

5.21.2.19 FMILIB_EXPORT fmi1_import_unit_definitions_t∗ fmi1_import_get_unit_definitions ( fmi1_import_t ∗fmu )

Get a list of all the unit definitions in the model.

5.21.2.20 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_get_direct_dependency ( fmi1_import_t ∗fmu, fmi1_import_variable_t ∗ )

Get the direct dependency information.

Returns

A variable list is returned for variables with causality Output. Null pointer for others.

5.21.2.21 FMILIB_EXPORT fmi1_import_variable_t∗ fmi1_import_get_variable_alias_base ( fmi1_import_t ∗ fmu,fmi1_import_variable_t ∗ )

Get the variable with the same value reference that is not an alias.

5.21.2.22 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_get_variable_aliases ( fmi1_import_t ∗ fmu,fmi1_import_variable_t ∗ )

Get the list of all the variables aliased to the given one (including the base one).

Note that the list is ordered: base variable, aliases, negated aliases.

5.21.2.23 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_get_variable_list ( fmi1_import_t ∗ fmu )

Get the list of all the variables in the model.

Generated by Doxygen

Page 179: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.21 General information retrieval 111

Parameters

fmu An FMU object as returned by fmi1_import_parse_xml().

Returns

a variable list with all the variables in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

5.21.2.24 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_get_variable_list_alphabetical_order (fmi1_import_t ∗ fmu )

Get the list of all the variables in the model in alphabetical order.

Parameters

fmu An FMU object as returned by fmi1_import_parse_xml().

Returns

a variable list with all the variables in the model sorted in alphabetical order.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

5.21.2.25 FMILIB_EXPORT fmi1_import_variable_list_t∗ fmi1_import_create_var_list ( fmi1_import_t ∗ fmu,fmi1_import_variable_t ∗ v )

Create a variable list with a single variable.

Parameters

fmu An FMU object that this variable list will reference.

v A variable.

Generated by Doxygen

Page 180: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

112 Module Documentation

5.22 Interface to the standard FMI 1.0 "C" API

Convenient functions for calling the FMI functions. This interface wrappes the "C" API.

Modules

• FMI 1.0 Constructor and Destructor

Functions for instantiating and freeing the container of the struct that is responsible for the FMI functions.

• FMI 1.0 (ME) Model Exchange functions

List of Model Exchange wrapper functions. Common functions are not listed.

• FMI 1.0 (CS) Co-Simulation functions

List of Co-Simulation wrapper functions. Common functions are not listed.

• FMI 1.0 (ME & CS) Common functions

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

5.22.1 Detailed Description

Convenient functions for calling the FMI functions. This interface wrappes the "C" API.

Generated by Doxygen

Page 181: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.23 Functions to retrieve capability flags. 113

5.23 Functions to retrieve capability flags.

Functions

• FMILIB_EXPORT int fmi1_import_get_canHandleVariableCommunicationStepSize (fmi1_import_←↩

capabilities_t ∗)

Retrieve canHandleVariableCommunicationStepSize flag.

• FMILIB_EXPORT int fmi1_import_get_canHandleEvents (fmi1_import_capabilities_t ∗)

Retrieve canHandleEvents flag.

• FMILIB_EXPORT int fmi1_import_get_canRejectSteps (fmi1_import_capabilities_t ∗)

Retrieve canRejectSteps flag.

• FMILIB_EXPORT int fmi1_import_get_canInterpolateInputs (fmi1_import_capabilities_t ∗)

Retrieve canInterpolateInputs flag.

• FMILIB_EXPORT unsigned int fmi1_import_get_maxOutputDerivativeOrder (fmi1_import_capabilities_t ∗)

Retrieve maxOutputDerivativeOrder.

• FMILIB_EXPORT int fmi1_import_get_canRunAsynchronuously (fmi1_import_capabilities_t ∗)

Retrieve canRunAsynchronuously flag.

• FMILIB_EXPORT int fmi1_import_get_canSignalEvents (fmi1_import_capabilities_t ∗)

Deprecated since 1.0.1, do not use.

• FMILIB_EXPORT int fmi1_import_get_canBeInstantiatedOnlyOncePerProcess (fmi1_import_capabilities_←↩

t ∗)

Retrieve canBeInstantiatedOnlyOncePerProcess flag.

• FMILIB_EXPORT int fmi1_import_get_canNotUseMemoryManagementFunctions (fmi1_import_capabilities←↩

_t ∗)

Retrieve canNotUseMemoryManagementFunctions flag.

FMU capabilities flags

• typedef struct fmi1_xml_capabilities_t fmi1_import_capabilities_t

A container for all the capability flags.

5.23.1 Detailed Description

The functions accept a pointer to fmi1_import_capabilities_t returned by fmi1_import_get_capabilities(). They returnthe flags as specified by the FMI 1.0 standard. Default values are returned for model-exachange FMUs.

5.23.2 Typedef Documentation

5.23.2.1 typedef struct fmi1_xml_capabilities_t fmi1_import_capabilities_t

A container for all the capability flags.

Definition at line 42 of file fmi1_import_capabilities.h.

Generated by Doxygen

Page 182: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

114 Module Documentation

5.23.3 Function Documentation

5.23.3.1 FMILIB_EXPORT int fmi1_import_get_canHandleVariableCommunicationStepSize (fmi1_import_capabilities_t ∗ )

Retrieve canHandleVariableCommunicationStepSize flag.

5.23.3.2 FMILIB_EXPORT int fmi1_import_get_canHandleEvents ( fmi1_import_capabilities_t ∗ )

Retrieve canHandleEvents flag.

5.23.3.3 FMILIB_EXPORT int fmi1_import_get_canRejectSteps ( fmi1_import_capabilities_t ∗ )

Retrieve canRejectSteps flag.

5.23.3.4 FMILIB_EXPORT int fmi1_import_get_canInterpolateInputs ( fmi1_import_capabilities_t ∗ )

Retrieve canInterpolateInputs flag.

5.23.3.5 FMILIB_EXPORT unsigned int fmi1_import_get_maxOutputDerivativeOrder ( fmi1_import_capabilities_t ∗ )

Retrieve maxOutputDerivativeOrder.

5.23.3.6 FMILIB_EXPORT int fmi1_import_get_canRunAsynchronuously ( fmi1_import_capabilities_t ∗ )

Retrieve canRunAsynchronuously flag.

5.23.3.7 FMILIB_EXPORT int fmi1_import_get_canSignalEvents ( fmi1_import_capabilities_t ∗ )

Deprecated since 1.0.1, do not use.

5.23.3.8 FMILIB_EXPORT int fmi1_import_get_canBeInstantiatedOnlyOncePerProcess ( fmi1_import_capabilities_t ∗)

Retrieve canBeInstantiatedOnlyOncePerProcess flag.

5.23.3.9 FMILIB_EXPORT int fmi1_import_get_canNotUseMemoryManagementFunctions (fmi1_import_capabilities_t ∗ )

Retrieve canNotUseMemoryManagementFunctions flag.

Generated by Doxygen

Page 183: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.24 FMI 1.0 Constructor and Destructor 115

5.24 FMI 1.0 Constructor and Destructor

Functions for instantiating and freeing the container of the struct that is responsible for the FMI functions.

Functions

• FMILIB_EXPORT jm_status_enu_t fmi1_import_create_dllfmu (fmi1_import_t ∗fmu, fmi1_callback_←↩

functions_t callBackFunctions, int registerGlobally)

Create a C-API struct. The C-API struct is a placeholder for the FMI DLL functions.

• FMILIB_EXPORT void fmi1_import_destroy_dllfmu (fmi1_import_t ∗fmu)

Free a C-API struct. All memory allocated since the struct was created is freed.

• FMILIB_EXPORT void fmi1_import_set_debug_mode (fmi1_import_t ∗fmu, int mode)

Set CAPI debug mode flag. Setting to non-zero prevents DLL unloading in fmi1_import_destroy_dllfmu while all thememory is deallocated. This is to support valgrind debugging.

5.24.1 Detailed Description

Functions for instantiating and freeing the container of the struct that is responsible for the FMI functions.

Before any of the FMI functions may be called, the construction function must instantiate a fmi_import_t module.After the fmi_import_t module has been succesfully instantiated, all the FMI functions can be called. To unload theFMI functions, the destroy functions shall be called.

5.24.2 Function Documentation

5.24.2.1 FMILIB_EXPORT jm_status_enu_t fmi1_import_create_dllfmu ( fmi1_import_t ∗ fmu,fmi1_callback_functions_t callBackFunctions, int registerGlobally )

Create a C-API struct. The C-API struct is a placeholder for the FMI DLL functions.

This function may only be called once if it returned succesfully. fmi1_import_destroy_dllfmu must be called beforethis function can be called again.

Parameters

fmu A model description object returned by fmi1_import_parse_xml().

callBackFunctions Callback functions used by the FMI functions internally.

registerGlobally Register the FMU globally to enable use of fmi1_log_forwarding(). If this parameter isnon-zero the code becomes non-thread safe.

Returns

Error status. If the function returns with an error, it is not allowed to call any of the other C-API functions.

5.24.2.2 FMILIB_EXPORT void fmi1_import_destroy_dllfmu ( fmi1_import_t ∗ fmu )

Free a C-API struct. All memory allocated since the struct was created is freed.

Generated by Doxygen

Page 184: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

116 Module Documentation

Parameters

fmu A model description object returned from fmi1_import_parse_xml().

5.24.2.3 FMILIB_EXPORT void fmi1_import_set_debug_mode ( fmi1_import_t ∗ fmu, int mode )

Set CAPI debug mode flag. Setting to non-zero prevents DLL unloading in fmi1_import_destroy_dllfmu while all thememory is deallocated. This is to support valgrind debugging.

Parameters

fmu C-API struct that has succesfully loaded the FMI function.

mode The debug mode to set.

Generated by Doxygen

Page 185: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.25 FMI 1.0 (ME) Model Exchange functions 117

5.25 FMI 1.0 (ME) Model Exchange functions

List of Model Exchange wrapper functions. Common functions are not listed.

Functions

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_types_platform (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiGetModelTypesPlatform(...)

• FMILIB_EXPORT jm_status_enu_t fmi1_import_instantiate_model (fmi1_import_t ∗fmu, fmi1_string_←↩

t instanceName)

Wrapper for the FMI function fmiInstantiateModel(...)

• FMILIB_EXPORT void fmi1_import_free_model_instance (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiFreeModelInstance(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_time (fmi1_import_t ∗fmu, fmi1_real_t time)

Wrapper for the FMI function fmiSetTime(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_continuous_states (fmi1_import_t ∗fmu, const fmi1_real←↩

_t x[ ], size_t nx)

Wrapper for the FMI function fmiSetContinuousStates(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_completed_integrator_step (fmi1_import_t ∗fmu, fmi1_←↩

boolean_t ∗callEventUpdate)

Wrapper for the FMI function fmiCompletedIntegratorStep(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_initialize (fmi1_import_t ∗fmu, fmi1_boolean_t tolerance←↩

Controlled, fmi1_real_t relativeTolerance, fmi1_event_info_t ∗eventInfo)

Wrapper for the FMI function fmiInitialize(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_derivatives (fmi1_import_t ∗fmu, fmi1_real_t derivatives[ ],size_t nx)

Wrapper for the FMI function fmiGetDerivatives(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_event_indicators (fmi1_import_t ∗fmu, fmi1_real_t event←↩

Indicators[ ], size_t ni)

Wrapper for the FMI function fmiGetEventIndicators(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_eventUpdate (fmi1_import_t ∗fmu, fmi1_boolean_←↩

t intermediateResults, fmi1_event_info_t ∗eventInfo)

Wrapper for the FMI function fmiEventUpdate(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_continuous_states (fmi1_import_t ∗fmu, fmi1_real_←↩

t states[ ], size_t nx)

Wrapper for the FMI function fmiGetContinuousStates(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_nominal_continuous_states (fmi1_import_t ∗fmu, fmi1_←↩

real_t x_nominal[ ], size_t nx)

Wrapper for the FMI function fmiGetNominalContinuousStates(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_state_value_references (fmi1_import_t ∗fmu, fmi1_value←↩

_reference_t vrx[ ], size_t nx)

Wrapper for the FMI function fmiGetStateValueReferences(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_terminate (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiTerminate(...)

5.25.1 Detailed Description

List of Model Exchange wrapper functions. Common functions are not listed.

Generated by Doxygen

Page 186: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

118 Module Documentation

5.25.2 Function Documentation

5.25.2.1 FMILIB_EXPORT const char∗ fmi1_import_get_model_types_platform ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiGetModelTypesPlatform(...)

Generated by Doxygen

Page 187: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.25 FMI 1.0 (ME) Model Exchange functions 119

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

Returns

The platform the FMU was compiled for.

5.25.2.2 FMILIB_EXPORT jm_status_enu_t fmi1_import_instantiate_model ( fmi1_import_t ∗ fmu, fmi1_string_tinstanceName )

Wrapper for the FMI function fmiInstantiateModel(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

instanceName The name of the instance.

Returns

Error status. Returnes jm_status_error if fmiInstantiateModel returned NULL, otherwise jm_status_success.

5.25.2.3 FMILIB_EXPORT void fmi1_import_free_model_instance ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiFreeModelInstance(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

5.25.2.4 FMILIB_EXPORT fmi1_status_t fmi1_import_set_time ( fmi1_import_t ∗ fmu, fmi1_real_t time )

Wrapper for the FMI function fmiSetTime(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

time Set the current time.

Generated by Doxygen

Page 188: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

120 Module Documentation

Returns

FMI status.

5.25.2.5 FMILIB_EXPORT fmi1_status_t fmi1_import_set_continuous_states ( fmi1_import_t ∗ fmu, constfmi1_real_t x[ ], size_t nx )

Wrapper for the FMI function fmiSetContinuousStates(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

x Array of state values.

nx Number of states.

Returns

FMI status.

5.25.2.6 FMILIB_EXPORT fmi1_status_t fmi1_import_completed_integrator_step ( fmi1_import_t ∗ fmu,fmi1_boolean_t ∗ callEventUpdate )

Wrapper for the FMI function fmiCompletedIntegratorStep(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

callEventUpdate (Output) Call fmiEventUpdate indicator.

Returns

FMI status.

5.25.2.7 FMILIB_EXPORT fmi1_status_t fmi1_import_initialize ( fmi1_import_t ∗ fmu, fmi1_boolean_ttoleranceControlled, fmi1_real_t relativeTolerance, fmi1_event_info_t ∗ eventInfo )

Wrapper for the FMI function fmiInitialize(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

toleranceControlled Enable or disable the use of relativeTolerance in the FMU.relativeTolerance A relative tolerance used in the FMU.eventInfo (Output) fmiEventInfo struct.

Generated by Doxygen

Page 189: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.25 FMI 1.0 (ME) Model Exchange functions 121

Returns

FMI status.

5.25.2.8 FMILIB_EXPORT fmi1_status_t fmi1_import_get_derivatives ( fmi1_import_t ∗ fmu, fmi1_real_t derivatives[ ],size_t nx )

Wrapper for the FMI function fmiGetDerivatives(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

derivatives (Output) Array of the derivatives.

nx Number of derivatives.

Returns

FMI status.

5.25.2.9 FMILIB_EXPORT fmi1_status_t fmi1_import_get_event_indicators ( fmi1_import_t ∗ fmu, fmi1_real_teventIndicators[ ], size_t ni )

Wrapper for the FMI function fmiGetEventIndicators(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

eventIndicators (Output) The event indicators.

ni Number of event indicators.

Returns

FMI status.

5.25.2.10 FMILIB_EXPORT fmi1_status_t fmi1_import_eventUpdate ( fmi1_import_t ∗ fmu, fmi1_boolean_tintermediateResults, fmi1_event_info_t ∗ eventInfo )

Wrapper for the FMI function fmiEventUpdate(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded theFMI functions, see fmi1_import_create_dllfmu().

intermediateResults Indicate whether or not the fmiEventUpdate shall return after every internal eventinteration.

eventInfo (Output) An fmiEventInfo struct.

Generated by Doxygen

Page 190: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

122 Module Documentation

Returns

FMI status.

5.25.2.11 FMILIB_EXPORT fmi1_status_t fmi1_import_get_continuous_states ( fmi1_import_t ∗ fmu, fmi1_real_tstates[ ], size_t nx )

Wrapper for the FMI function fmiGetContinuousStates(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

states (Output) Array of state values.

nx Number of states.

Returns

FMI status.

5.25.2.12 FMILIB_EXPORT fmi1_status_t fmi1_import_get_nominal_continuous_states ( fmi1_import_t ∗ fmu,fmi1_real_t x_nominal[ ], size_t nx )

Wrapper for the FMI function fmiGetNominalContinuousStates(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

x_nominal (Output) The nominal values.

nx Number of nominal values.

Returns

FMI status.

5.25.2.13 FMILIB_EXPORT fmi1_status_t fmi1_import_get_state_value_references ( fmi1_import_t ∗ fmu,fmi1_value_reference_t vrx[ ], size_t nx )

Wrapper for the FMI function fmiGetStateValueReferences(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vrx (Output) The value-references of the states.

nx Number of value-references.

Generated by Doxygen

Page 191: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.25 FMI 1.0 (ME) Model Exchange functions 123

Returns

FMI status.

5.25.2.14 FMILIB_EXPORT fmi1_status_t fmi1_import_terminate ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiTerminate(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

Returns

FMI status.

Generated by Doxygen

Page 192: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

124 Module Documentation

5.26 FMI 1.0 (CS) Co-Simulation functions

List of Co-Simulation wrapper functions. Common functions are not listed.

Functions

• FMILIB_EXPORT const char ∗ fmi1_import_get_types_platform (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiGetTypesPlatform(...)

• FMILIB_EXPORT jm_status_enu_t fmi1_import_instantiate_slave (fmi1_import_t ∗fmu, fmi1_string_←↩

t instanceName, fmi1_string_t fmuLocation, fmi1_string_t mimeType, fmi1_real_t timeout, fmi1_boolean_tvisible, fmi1_boolean_t interactive)

Wrapper for the FMI function fmiInstantiateSlave(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_initialize_slave (fmi1_import_t ∗fmu, fmi1_real_t tStart, fmi1←↩

_boolean_t StopTimeDefined, fmi1_real_t tStop)

Wrapper for the FMI function fmiInitializeSlave(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_terminate_slave (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiTerminateSlave(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_reset_slave (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiResetSlave(...)

• FMILIB_EXPORT void fmi1_import_free_slave_instance (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiFreeSlaveInstance(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_real_input_derivatives (fmi1_import_t ∗fmu, const fmi1_←↩

value_reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], const fmi1_real_t value[ ])

Wrapper for the FMI function fmiSetRealInputDerivatives(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_real_output_derivatives (fmi1_import_t ∗fmu, const fmi1←↩

_value_reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], fmi1_real_t value[ ])

Wrapper for the FMI function fmiGetOutputDerivatives(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_cancel_step (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiCancelStep(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_do_step (fmi1_import_t ∗fmu, fmi1_real_t current←↩

CommunicationPoint, fmi1_real_t communicationStepSize, fmi1_boolean_t newStep)

Wrapper for the FMI function fmiDoStep(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_status (fmi1_import_t ∗fmu, const fmi1_status_kind_t s,fmi1_status_t ∗value)

Wrapper for the FMI function fmiGetStatus(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_real_status (fmi1_import_t ∗fmu, const fmi1_status_kind←↩

_t s, fmi1_real_t ∗value)

Wrapper for the FMI function fmiGetRealStatus(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_integer_status (fmi1_import_t ∗fmu, const fmi1_status_←↩

kind_t s, fmi1_integer_t ∗value)

Wrapper for the FMI function fmiGetIntegerStatus(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_boolean_status (fmi1_import_t ∗fmu, const fmi1_status←↩

_kind_t s, fmi1_boolean_t ∗value)

Wrapper for the FMI function fmiGetBooleanStatus(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_string_status (fmi1_import_t ∗fmu, const fmi1_status_←↩

kind_t s, fmi1_string_t ∗value)

Wrapper for the FMI function fmiGetStringStatus(...)

5.26.1 Detailed Description

List of Co-Simulation wrapper functions. Common functions are not listed.

Generated by Doxygen

Page 193: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.26 FMI 1.0 (CS) Co-Simulation functions 125

5.26.2 Function Documentation

5.26.2.1 FMILIB_EXPORT const char∗ fmi1_import_get_types_platform ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiGetTypesPlatform(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

Returns

The platform the FMU was compiled for.

5.26.2.2 FMILIB_EXPORT jm_status_enu_t fmi1_import_instantiate_slave ( fmi1_import_t ∗ fmu, fmi1_string_tinstanceName, fmi1_string_t fmuLocation, fmi1_string_t mimeType, fmi1_real_t timeout, fmi1_boolean_t visible,fmi1_boolean_t interactive )

Wrapper for the FMI function fmiInstantiateSlave(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

instanceName The name of the instance.fmuLocation Access path to the FMU archive. If null FMU will get the path to the directory where it was

unpacked.

mimeType MIME type. If NULL the FMU will get "application/x-fmu-sharedlibrary".

timeout Communication timeout value in milli-seconds.visible Indicates whether or not the simulator application window shoule be visible.

interactive Indicates whether the simulator application must be manually started by the user.

Returns

Error status. Returnes jm_status_error if fmiInstantiateSlave returned NULL, otherwise jm_status_success.

5.26.2.3 FMILIB_EXPORT fmi1_status_t fmi1_import_initialize_slave ( fmi1_import_t ∗ fmu, fmi1_real_t tStart,fmi1_boolean_t StopTimeDefined, fmi1_real_t tStop )

Wrapper for the FMI function fmiInitializeSlave(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

tStart Start time of the simulationStopTimeDefined Indicates whether or not the stop time is used.

tStop The stop time of the simulation.Generated by Doxygen

Page 194: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

126 Module Documentation

Returns

FMI status.

5.26.2.4 FMILIB_EXPORT fmi1_status_t fmi1_import_terminate_slave ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiTerminateSlave(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

Returns

FMI status.

5.26.2.5 FMILIB_EXPORT fmi1_status_t fmi1_import_reset_slave ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiResetSlave(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

Returns

FMI status.

5.26.2.6 FMILIB_EXPORT void fmi1_import_free_slave_instance ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiFreeSlaveInstance(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

5.26.2.7 FMILIB_EXPORT fmi1_status_t fmi1_import_set_real_input_derivatives ( fmi1_import_t ∗ fmu, constfmi1_value_reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], const fmi1_real_t value[ ] )

Wrapper for the FMI function fmiSetRealInputDerivatives(...)

Generated by Doxygen

Page 195: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.26 FMI 1.0 (CS) Co-Simulation functions 127

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

order Array of derivative orders.

value Array of variable values.

Returns

FMI status.

5.26.2.8 FMILIB_EXPORT fmi1_status_t fmi1_import_get_real_output_derivatives ( fmi1_import_t ∗ fmu, constfmi1_value_reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], fmi1_real_t value[ ] )

Wrapper for the FMI function fmiGetOutputDerivatives(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

order Array of derivative orders.

value (Output) Array of variable values.

Returns

FMI status.

5.26.2.9 FMILIB_EXPORT fmi1_status_t fmi1_import_cancel_step ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiCancelStep(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

Returns

FMI status.

Generated by Doxygen

Page 196: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

128 Module Documentation

5.26.2.10 FMILIB_EXPORT fmi1_status_t fmi1_import_do_step ( fmi1_import_t ∗ fmu, fmi1_real_tcurrentCommunicationPoint, fmi1_real_t communicationStepSize, fmi1_boolean_t newStep )

Wrapper for the FMI function fmiDoStep(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loadedthe FMI functions, see fmi1_import_create_dllfmu().

currentCommunicationPoint Current communication point of the master.

communicationStepSize Communication step size.

newStep Indicates whether or not the last communication step was accepted by themaster.

Returns

FMI status.

5.26.2.11 FMILIB_EXPORT fmi1_status_t fmi1_import_get_status ( fmi1_import_t ∗ fmu, constfmi1_status_kind_t s, fmi1_status_t ∗ value )

Wrapper for the FMI function fmiGetStatus(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

s Kind of status to return the value for.value (Output) FMI status value.

Returns

FMI status.

5.26.2.12 FMILIB_EXPORT fmi1_status_t fmi1_import_get_real_status ( fmi1_import_t ∗ fmu, constfmi1_status_kind_t s, fmi1_real_t ∗ value )

Wrapper for the FMI function fmiGetRealStatus(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

s Kind of status to return the value for.value (Output) FMI real value.

Generated by Doxygen

Page 197: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.26 FMI 1.0 (CS) Co-Simulation functions 129

Returns

FMI status.

5.26.2.13 FMILIB_EXPORT fmi1_status_t fmi1_import_get_integer_status ( fmi1_import_t ∗ fmu, constfmi1_status_kind_t s, fmi1_integer_t ∗ value )

Wrapper for the FMI function fmiGetIntegerStatus(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

s Kind of status to return the value for.value (Output) FMI integer value.

Returns

FMI status.

5.26.2.14 FMILIB_EXPORT fmi1_status_t fmi1_import_get_boolean_status ( fmi1_import_t ∗ fmu, constfmi1_status_kind_t s, fmi1_boolean_t ∗ value )

Wrapper for the FMI function fmiGetBooleanStatus(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

s Kind of status to return the value for.value (Output) FMI boolean value.

Returns

FMI status.

5.26.2.15 FMILIB_EXPORT fmi1_status_t fmi1_import_get_string_status ( fmi1_import_t ∗ fmu, constfmi1_status_kind_t s, fmi1_string_t ∗ value )

Wrapper for the FMI function fmiGetStringStatus(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

s Kind of status to return the value for.value (Output) FMI string value.

Generated by Doxygen

Page 198: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

130 Module Documentation

Returns

FMI status.

Generated by Doxygen

Page 199: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.27 FMI 1.0 (ME & CS) Common functions 131

5.27 FMI 1.0 (ME & CS) Common functions

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

Functions

• FMILIB_EXPORT const char ∗ fmi1_import_get_version (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiGetVersion()

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_debug_logging (fmi1_import_t ∗fmu, fmi1_boolean_←↩

t loggingOn)

Wrapper for the FMI function fmiSetDebugLogging(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_real (fmi1_import_t ∗fmu, const fmi1_value_reference_←↩

t vr[ ], size_t nvr, const fmi1_real_t value[ ])

Wrapper for the FMI function fmiSetReal(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_integer (fmi1_import_t ∗fmu, const fmi1_value_reference←↩

_t vr[ ], size_t nvr, const fmi1_integer_t value[ ])

Wrapper for the FMI function fmiSetInteger(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_boolean (fmi1_import_t ∗fmu, const fmi1_value_←↩

reference_t vr[ ], size_t nvr, const fmi1_boolean_t value[ ])

Wrapper for the FMI function fmiSetBoolean(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_string (fmi1_import_t ∗fmu, const fmi1_value_reference_tvr[ ], size_t nvr, const fmi1_string_t value[ ])

Wrapper for the FMI function fmiSetString(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_real (fmi1_import_t ∗fmu, const fmi1_value_reference_←↩

t vr[ ], size_t nvr, fmi1_real_t value[ ])

Wrapper for the FMI function fmiGetReal(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_integer (fmi1_import_t ∗fmu, const fmi1_value_reference←↩

_t vr[ ], size_t nvr, fmi1_integer_t value[ ])

Wrapper for the FMI function fmiGetInteger(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_boolean (fmi1_import_t ∗fmu, const fmi1_value_←↩

reference_t vr[ ], size_t nvr, fmi1_boolean_t value[ ])

Wrapper for the FMI function fmiGetBoolean(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_string (fmi1_import_t ∗fmu, const fmi1_value_reference_tvr[ ], size_t nvr, fmi1_string_t value[ ])

Wrapper for the FMI function fmiGetString(...)

5.27.1 Detailed Description

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

5.27.2 Function Documentation

5.27.2.1 FMILIB_EXPORT const char∗ fmi1_import_get_version ( fmi1_import_t ∗ fmu )

Wrapper for the FMI function fmiGetVersion()

Generated by Doxygen

Page 200: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

132 Module Documentation

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

Returns

FMI version.

5.27.2.2 FMILIB_EXPORT fmi1_status_t fmi1_import_set_debug_logging ( fmi1_import_t ∗ fmu, fmi1_boolean_tloggingOn )

Wrapper for the FMI function fmiSetDebugLogging(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMIfunctions, see fmi1_import_create_dllfmu().

loggingOn Enable or disable the debug logger.

Returns

FMI status.

5.27.2.3 FMILIB_EXPORT fmi1_status_t fmi1_import_set_real ( fmi1_import_t ∗ fmu, const fmi1_value_reference_tvr[ ], size_t nvr, const fmi1_real_t value[ ] )

Wrapper for the FMI function fmiSetReal(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value Array of variable values.

Returns

FMI status.

5.27.2.4 FMILIB_EXPORT fmi1_status_t fmi1_import_set_integer ( fmi1_import_t ∗ fmu, constfmi1_value_reference_t vr[ ], size_t nvr, const fmi1_integer_t value[ ] )

Wrapper for the FMI function fmiSetInteger(...)

Generated by Doxygen

Page 201: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.27 FMI 1.0 (ME & CS) Common functions 133

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value Array of variable values.

Returns

FMI status.

5.27.2.5 FMILIB_EXPORT fmi1_status_t fmi1_import_set_boolean ( fmi1_import_t ∗ fmu, constfmi1_value_reference_t vr[ ], size_t nvr, const fmi1_boolean_t value[ ] )

Wrapper for the FMI function fmiSetBoolean(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value Array of variable values.

Returns

FMI status.

5.27.2.6 FMILIB_EXPORT fmi1_status_t fmi1_import_set_string ( fmi1_import_t ∗ fmu, const fmi1_value_reference_tvr[ ], size_t nvr, const fmi1_string_t value[ ] )

Wrapper for the FMI function fmiSetString(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value Array of variable values.

Returns

FMI status.

Generated by Doxygen

Page 202: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

134 Module Documentation

5.27.2.7 FMILIB_EXPORT fmi1_status_t fmi1_import_get_real ( fmi1_import_t ∗ fmu, const fmi1_value_reference_tvr[ ], size_t nvr, fmi1_real_t value[ ] )

Wrapper for the FMI function fmiGetReal(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value (Output)Array of variable values.

Returns

FMI status.

5.27.2.8 FMILIB_EXPORT fmi1_status_t fmi1_import_get_integer ( fmi1_import_t ∗ fmu, constfmi1_value_reference_t vr[ ], size_t nvr, fmi1_integer_t value[ ] )

Wrapper for the FMI function fmiGetInteger(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value (Output)Array of variable values.

Returns

FMI status.

5.27.2.9 FMILIB_EXPORT fmi1_status_t fmi1_import_get_boolean ( fmi1_import_t ∗ fmu, constfmi1_value_reference_t vr[ ], size_t nvr, fmi1_boolean_t value[ ] )

Wrapper for the FMI function fmiGetBoolean(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value (Output)Array of variable values.

Generated by Doxygen

Page 203: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.27 FMI 1.0 (ME & CS) Common functions 135

Returns

FMI status.

5.27.2.10 FMILIB_EXPORT fmi1_status_t fmi1_import_get_string ( fmi1_import_t ∗ fmu, constfmi1_value_reference_t vr[ ], size_t nvr, fmi1_string_t value[ ] )

Wrapper for the FMI function fmiGetString(...)

Parameters

fmu A model description object returned by fmi1_import_parse_xml() that has loaded the FMI functions, seefmi1_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value (Output)Array of variable values.

Returns

FMI status.

Generated by Doxygen

Page 204: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

136 Module Documentation

5.28 Convenience functions.

The functions in this module are provided for convenience. The functionality is already available via other lower levelfunctions.

Data Structures

• struct fmi1_import_model_counts_t

Collection of counters providing model information.

Functions

• FMILIB_EXPORT void fmi1_import_collect_model_counts (fmi1_import_t ∗fmu, fmi1_import_model_←↩

counts_t ∗counts)

Collect model information by counting the number of variables with specific properties and fillinf in fmi1_import_←↩

model_counts_t struct.

• FMILIB_EXPORT void fmi1_import_expand_variable_references (fmi1_import_t ∗fmu, const char ∗msgIn,char ∗msgOut, size_t maxMsgSize)

Print msgIn into msgOut by expanding variable references of the form #<Type><VR># into variable names andreplacing '##' with a single #.

• FMILIB_EXPORT void fmi1_log_forwarding (fmi1_component_t c, fmi1_string_t instanceName, fmi1_←↩

status_t status, fmi1_string_t category, fmi1_string_t message,...)

An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure.

• FMILIB_EXPORT void fmi1_log_forwarding_v (fmi1_component_t c, fmi1_string_t instanceName, fmi1_←↩

status_t status, fmi1_string_t category, fmi1_string_t message, va_list args)

An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure.

• FMILIB_EXPORT void fmi1_default_callback_logger (fmi1_component_t c, fmi1_string_t instanceName,fmi1_status_t status, fmi1_string_t category, fmi1_string_t message,...)

Default FMI 1.0 logger may be used when instantiating FMUs.

• FMILIB_EXPORT void fmi1_import_init_logger (jm_callbacks ∗cb, fmi1_callback_functions_t ∗fmiCallbacks)

Given fmi1_callback_functions_t logger (fmi1_logger), the jm_callbacks logger may be setup to redirect the messagesto the fmi1_logger.

5.28.1 Detailed Description

The functions in this module are provided for convenience. The functionality is already available via other lower levelfunctions.

5.28.2 Function Documentation

5.28.2.1 FMILIB_EXPORT void fmi1_import_collect_model_counts ( fmi1_import_t ∗ fmu,fmi1_import_model_counts_t ∗ counts )

Collect model information by counting the number of variables with specific properties and fillinf in fmi1_import_←↩

model_counts_t struct.

Generated by Doxygen

Page 205: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.28 Convenience functions. 137

Parameters

fmu - An fmu object as returned by fmi1_import_parse_xml().

counts - a pointer to a preallocated struct.

5.28.2.2 FMILIB_EXPORT void fmi1_import_expand_variable_references ( fmi1_import_t ∗ fmu, const char ∗ msgIn,char ∗ msgOut, size_t maxMsgSize )

Print msgIn into msgOut by expanding variable references of the form #<Type><VR># into variable names andreplacing '##' with a single #.

Parameters

fmu - An fmu object as returned by fmi1_import_parse_xml().

msgIn - Log message as produced by an FMU.

msgOut - Output message buffer.

maxMsgSize - maximum message size

5.28.2.3 FMILIB_EXPORT void fmi1_log_forwarding ( fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_tstatus, fmi1_string_t category, fmi1_string_t message, ... )

An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure.

The function is using a global array of active FMUs to find out which FMU is sending the log messege. It thenforwards the message to the logger connected to the particular fmi1_import_t struct. The function is called by theFMU. The FMU must be loaded with non-zero registerGlobally parameter of fmi1_import_create_dllfmu() in order towork. If no matching fmi1_import_t struct is found on the global list then jm_get_default_callbacks() is used to getthe default logger. Note that this function is not thread safe due to the use of the global list.

5.28.2.4 FMILIB_EXPORT void fmi1_log_forwarding_v ( fmi1_component_t c, fmi1_string_t instanceName,fmi1_status_t status, fmi1_string_t category, fmi1_string_t message, va_list args )

An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure.

See fmi1_log_forwarding() for more information.

5.28.2.5 FMILIB_EXPORT void fmi1_default_callback_logger ( fmi1_component_t c, fmi1_string_t instanceName,fmi1_status_t status, fmi1_string_t category, fmi1_string_t message, ... )

Default FMI 1.0 logger may be used when instantiating FMUs.

5.28.2.6 FMILIB_EXPORT void fmi1_import_init_logger ( jm_callbacks ∗ cb, fmi1_callback_functions_t ∗fmiCallbacks )

Given fmi1_callback_functions_t logger (fmi1_logger), the jm_callbacks logger may be setup to redirect the mes-sages to the fmi1_logger.

The functions sets up the redirection. Note that the context field in jm_callbacks is set to point to the providedfmi1_callback_functions_t.

Generated by Doxygen

Page 206: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

138 Module Documentation

Parameters

cb FMI Library callbacks

fmiCallbacks FMI 1.0 standard callbacks

Generated by Doxygen

Page 207: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.29 Functions to retrieve co-simulation related information. 139

5.29 Functions to retrieve co-simulation related information.

Functions

• FMILIB_EXPORT const char ∗ fmi1_import_get_entry_point (fmi1_import_t ∗)

Get the entry point.

• FMILIB_EXPORT const char ∗ fmi1_import_get_mime_type (fmi1_import_t ∗)

Get mime type.

• FMILIB_EXPORT int fmi1_import_get_manual_start (fmi1_import_t ∗)

Get manual start flag.

• FMILIB_EXPORT size_t fmi1_import_get_number_of_additional_models (fmi1_import_t ∗fmu)

Get the number of additional models specified.

• FMILIB_EXPORT const char ∗ fmi1_import_get_additional_model_name (fmi1_import_t ∗fmu, size_t index)

Get the name of an additional model.

5.29.1 Detailed Description

5.29.2 Function Documentation

5.29.2.1 FMILIB_EXPORT const char∗ fmi1_import_get_entry_point ( fmi1_import_t ∗ )

Get the entry point.

5.29.2.2 FMILIB_EXPORT const char∗ fmi1_import_get_mime_type ( fmi1_import_t ∗ )

Get mime type.

5.29.2.3 FMILIB_EXPORT int fmi1_import_get_manual_start ( fmi1_import_t ∗ )

Get manual start flag.

5.29.2.4 FMILIB_EXPORT size_t fmi1_import_get_number_of_additional_models ( fmi1_import_t ∗ fmu )

Get the number of additional models specified.

5.29.2.5 FMILIB_EXPORT const char∗ fmi1_import_get_additional_model_name ( fmi1_import_t ∗ fmu, size_t index )

Get the name of an additional model.

Parameters

fmu - the FMU processed

index - the index of an additional model (must be less than the number returned byfmi1_import_get_number_of_additional_models().

Generated by Doxygen

Page 208: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

140 Module Documentation

5.30 Support for processing variable types

Functions• FMILIB_EXPORT size_t fmi1_import_get_type_definition_number (fmi1_import_type_definitions_t ∗td)

Get the number of available type definitions.• FMILIB_EXPORT fmi1_import_variable_typedef_t ∗ fmi1_import_get_typedef (fmi1_import_type_←↩

definitions_t ∗td, unsigned int index)

Get a type definition specified by the index.• FMILIB_EXPORT fmi1_import_display_unit_t ∗ fmi1_import_get_type_display_unit (fmi1_import_real_←↩

typedef_t ∗)

Get associated display unit for a type defition if any.• FMILIB_EXPORT const char ∗ fmi1_import_get_type_name (fmi1_import_variable_typedef_t ∗)

Get the type name.• FMILIB_EXPORT const char ∗ fmi1_import_get_type_description (fmi1_import_variable_typedef_t ∗)

Get type description.• FMILIB_EXPORT fmi1_base_type_enu_t fmi1_import_get_base_type (fmi1_import_variable_typedef_t ∗)

Get base type used for the type definition.• FMILIB_EXPORT fmi1_import_real_typedef_t ∗ fmi1_import_get_type_as_real (fmi1_import_variable_←↩

typedef_t ∗)

Cast the general type definition object to an object with a specific base type.• FMILIB_EXPORT fmi1_import_integer_typedef_t ∗ fmi1_import_get_type_as_int (fmi1_import_variable_←↩

typedef_t ∗)

Cast the general type definition object to an object with a specific base type.• FMILIB_EXPORT fmi1_import_enumeration_typedef_t ∗ fmi1_import_get_type_as_enum (fmi1_import_←↩

variable_typedef_t ∗)

Cast the general type definition object to an object with a specific base type.• FMILIB_EXPORT const char ∗ fmi1_import_get_type_quantity (fmi1_import_variable_typedef_t ∗)

Get the quantity associated with the type definition.• FMILIB_EXPORT double fmi1_import_get_real_type_min (fmi1_import_real_typedef_t ∗)

Get minimal value for the type.• FMILIB_EXPORT double fmi1_import_get_real_type_max (fmi1_import_real_typedef_t ∗)

Get maximum value for the type.• FMILIB_EXPORT double fmi1_import_get_real_type_nominal (fmi1_import_real_typedef_t ∗)

Get the nominal value associated with the type definition.• FMILIB_EXPORT fmi1_import_unit_t ∗ fmi1_import_get_real_type_unit (fmi1_import_real_typedef_t ∗)

Get the unit object associated with the type definition if any.• FMILIB_EXPORT int fmi1_import_get_real_type_is_relative_quantity (fmi1_import_real_typedef_t ∗)

Get the relativeQuantity flag.• FMILIB_EXPORT int fmi1_import_get_integer_type_min (fmi1_import_integer_typedef_t ∗)

Get minimal value for the type.• FMILIB_EXPORT int fmi1_import_get_integer_type_max (fmi1_import_integer_typedef_t ∗)

Get maximum value for the type.• FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_min (fmi1_import_enumeration_typedef_t ∗)

Get minimal value for the type.• FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_max (fmi1_import_enumeration_typedef_t ∗)

Get maximum value for the type.• FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_size (fmi1_import_enumeration_typedef_t ∗)

Get the number of elements in the enum.• FMILIB_EXPORT const char ∗ fmi1_import_get_enum_type_item_name (fmi1_import_enumeration_←↩

typedef_t ∗, unsigned int item)

Get an enumeration item name by index.• FMILIB_EXPORT const char ∗ fmi1_import_get_enum_type_item_description (fmi1_import_enumeration_←↩

typedef_t ∗, unsigned int item)

Get an enumeration item description by index.

Generated by Doxygen

Page 209: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.30 Support for processing variable types 141

Type definitions supporting structures• typedef struct fmi1_xml_real_typedef_t fmi1_import_real_typedef_t

Opaque type definition object.• typedef struct fmi1_xml_integer_typedef_t fmi1_import_integer_typedef_t

Opaque integer type definition object.• typedef struct fmi1_xml_enumeration_typedef_t fmi1_import_enumeration_typedef_t

Opaque enumeration type definition object.• typedef struct fmi1_xml_variable_typedef_t fmi1_import_variable_typedef_t

Opaque general variable type definition object.• typedef struct fmi1_xml_type_definitions_t fmi1_import_type_definitions_t

Opaque list of the type definitions in the model.

5.30.1 Detailed Description

5.30.2 Typedef Documentation

5.30.2.1 typedef struct fmi1_xml_real_typedef_t fmi1_import_real_typedef_t

Opaque type definition object.

Definition at line 42 of file fmi1_import_type.h.

5.30.2.2 typedef struct fmi1_xml_integer_typedef_t fmi1_import_integer_typedef_t

Opaque integer type definition object.

Definition at line 44 of file fmi1_import_type.h.

5.30.2.3 typedef struct fmi1_xml_enumeration_typedef_t fmi1_import_enumeration_typedef_t

Opaque enumeration type definition object.

Definition at line 46 of file fmi1_import_type.h.

5.30.2.4 typedef struct fmi1_xml_variable_typedef_t fmi1_import_variable_typedef_t

Opaque general variable type definition object.

Definition at line 48 of file fmi1_import_type.h.

5.30.2.5 typedef struct fmi1_xml_type_definitions_t fmi1_import_type_definitions_t

Opaque list of the type definitions in the model.

Definition at line 50 of file fmi1_import_type.h.

5.30.3 Function Documentation

5.30.3.1 FMILIB_EXPORT size_t fmi1_import_get_type_definition_number ( fmi1_import_type_definitions_t ∗ td )

Get the number of available type definitions.

5.30.3.2 FMILIB_EXPORT fmi1_import_variable_typedef_t∗ fmi1_import_get_typedef (fmi1_import_type_definitions_t ∗ td, unsigned int index )

Get a type definition specified by the index.

Generated by Doxygen

Page 210: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

142 Module Documentation

Parameters

td the type definition list object

index the index of type definition. Must be less than the numbere returned byfmi1_import_get_type_definition_number()

Returns

A type definition object or NULL if index is out of range.

5.30.3.3 FMILIB_EXPORT fmi1_import_display_unit_t ∗ fmi1_import_get_type_display_unit (fmi1_import_real_typedef_t ∗ )

Get associated display unit for a type defition if any.

Get display unit associated with a real type definition.

Returns

Display unit object of NULL if none was given.

5.30.3.4 FMILIB_EXPORT const char∗ fmi1_import_get_type_name ( fmi1_import_variable_typedef_t ∗ )

Get the type name.

5.30.3.5 FMILIB_EXPORT const char∗ fmi1_import_get_type_description ( fmi1_import_variable_typedef_t ∗ )

Get type description.

Note that an empty string is returned if the attribute is not present in the XML.

5.30.3.6 FMILIB_EXPORT fmi1_base_type_enu_t fmi1_import_get_base_type ( fmi1_import_variable_typedef_t∗ )

Get base type used for the type definition.

5.30.3.7 FMILIB_EXPORT fmi1_import_real_typedef_t∗ fmi1_import_get_type_as_real (fmi1_import_variable_typedef_t ∗ )

Cast the general type definition object to an object with a specific base type.

Returns

Pointer to the specific type object or NULL if base type does not match.

Generated by Doxygen

Page 211: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.30 Support for processing variable types 143

5.30.3.8 FMILIB_EXPORT fmi1_import_integer_typedef_t∗ fmi1_import_get_type_as_int (fmi1_import_variable_typedef_t ∗ )

Cast the general type definition object to an object with a specific base type.

Returns

Pointer to the specific type object or NULL if base type does not match.

5.30.3.9 FMILIB_EXPORT fmi1_import_enumeration_typedef_t∗ fmi1_import_get_type_as_enum (fmi1_import_variable_typedef_t ∗ )

Cast the general type definition object to an object with a specific base type.

Returns

Pointer to the specific type object or NULL if base type does not match.

5.30.3.10 FMILIB_EXPORT const char∗ fmi1_import_get_type_quantity ( fmi1_import_variable_typedef_t ∗ )

Get the quantity associated with the type definition.

Returns

NULL-pointer is always returned for strings and booleans. Empty string is returned if attribute is not presentfor other types.

5.30.3.11 FMILIB_EXPORT double fmi1_import_get_real_type_min ( fmi1_import_real_typedef_t ∗ )

Get minimal value for the type.

Returns

Either the value specified in the XML file or negated DBL_MAX as defined in <float.h>

5.30.3.12 FMILIB_EXPORT double fmi1_import_get_real_type_max ( fmi1_import_real_typedef_t ∗ )

Get maximum value for the type.

Returns

Either the value specified in the XML file or DBL_MAX as defined in <float.h>

5.30.3.13 FMILIB_EXPORT double fmi1_import_get_real_type_nominal ( fmi1_import_real_typedef_t ∗ )

Get the nominal value associated with the type definition.

Generated by Doxygen

Page 212: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

144 Module Documentation

5.30.3.14 FMILIB_EXPORT fmi1_import_unit_t∗ fmi1_import_get_real_type_unit ( fmi1_import_real_typedef_t ∗ )

Get the unit object associated with the type definition if any.

5.30.3.15 FMILIB_EXPORT int fmi1_import_get_real_type_is_relative_quantity ( fmi1_import_real_typedef_t ∗ )

Get the relativeQuantity flag.

5.30.3.16 FMILIB_EXPORT int fmi1_import_get_integer_type_min ( fmi1_import_integer_typedef_t ∗ )

Get minimal value for the type.

Returns

Either the value specified in the XML file or INT_MIN as defined in <limits.h>

5.30.3.17 FMILIB_EXPORT int fmi1_import_get_integer_type_max ( fmi1_import_integer_typedef_t ∗ )

Get maximum value for the type.

Returns

Either the value specified in the XML file or INT_MAX as defined in <limits.h>

5.30.3.18 FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_min ( fmi1_import_enumeration_typedef_t ∗)

Get minimal value for the type.

Returns

Either the value specified in the XML file or 0

5.30.3.19 FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_max ( fmi1_import_enumeration_typedef_t ∗)

Get maximum value for the type.

Returns

Either the value specified in the XML file or INT_MAX as defined in <limits.h>

5.30.3.20 FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_size ( fmi1_import_enumeration_typedef_t ∗)

Get the number of elements in the enum.

5.30.3.21 FMILIB_EXPORT const char∗ fmi1_import_get_enum_type_item_name ( fmi1_import_enumeration_←↩

typedef_t ∗ , unsigned int item )

Get an enumeration item name by index.

5.30.3.22 FMILIB_EXPORT const char∗ fmi1_import_get_enum_type_item_description (fmi1_import_enumeration_typedef_t ∗ , unsigned int item )

Get an enumeration item description by index.

Generated by Doxygen

Page 213: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.31 Functions for handling unit definitions. 145

5.31 Functions for handling unit definitions.

Functions

• FMILIB_EXPORT unsigned int fmi1_import_get_unit_definitions_number (fmi1_import_unit_definitions_t ∗)

Get the number of unit definitions.

• FMILIB_EXPORT fmi1_import_unit_t ∗ fmi1_import_get_unit (fmi1_import_unit_definitions_t ∗, unsigned intindex)

Get a unit definition.

• FMILIB_EXPORT const char ∗ fmi1_import_get_unit_name (fmi1_import_unit_t ∗)

Get a unit name.

• FMILIB_EXPORT unsigned int fmi1_import_get_unit_display_unit_number (fmi1_import_unit_t ∗)

Get the number of display units associated with this unit.

• FMILIB_EXPORT fmi1_import_display_unit_t ∗ fmi1_import_get_unit_display_unit (fmi1_import_unit_t ∗,size_t index)

Get a display unit object by index.

• FMILIB_EXPORT fmi1_import_unit_t ∗ fmi1_import_get_base_unit (fmi1_import_display_unit_t ∗)

Get unit defition for a display unit.

• FMILIB_EXPORT const char ∗ fmi1_import_get_display_unit_name (fmi1_import_display_unit_t ∗)

Get display unit name.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_display_unit_gain (fmi1_import_display_unit_t ∗)

Get the "gain" associated with the display unit.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_display_unit_offset (fmi1_import_display_unit_t ∗)

Get the "offset" associated with the display unit.

• FMILIB_EXPORT fmi1_real_t fmi1_import_convert_to_display_unit (fmi1_real_t value, fmi1_import_←↩

display_unit_t ∗du, int isRelativeQuantity)

Convert a value measured in "units" to a value measured with "display units".

• FMILIB_EXPORT fmi1_real_t fmi1_import_convert_from_display_unit (fmi1_real_t value, fmi1_import_←↩

display_unit_t ∗du, int isRelativeQuantity)

Convert a value measured in "display units" to a value measured with "units".

Structures encapsulating unit information

• typedef struct fmi1_xml_unit_t fmi1_import_unit_t

A variable unit defined with a unit defition.

• typedef struct fmi1_xml_display_unit_t fmi1_import_display_unit_t

A display unit.

• typedef struct fmi1_xml_unit_definitions_t fmi1_import_unit_definitions_t

The list of all the unit definitions in the model.

5.31.1 Detailed Description

5.31.2 Typedef Documentation

5.31.2.1 typedef struct fmi1_xml_unit_t fmi1_import_unit_t

A variable unit defined with a unit defition.

Definition at line 41 of file fmi1_import_unit.h.

Generated by Doxygen

Page 214: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

146 Module Documentation

5.31.2.2 typedef struct fmi1_xml_display_unit_t fmi1_import_display_unit_t

A display unit.

Definition at line 43 of file fmi1_import_unit.h.

5.31.2.3 typedef struct fmi1_xml_unit_definitions_t fmi1_import_unit_definitions_t

The list of all the unit definitions in the model.

Definition at line 45 of file fmi1_import_unit.h.

5.31.3 Function Documentation

5.31.3.1 FMILIB_EXPORT unsigned int fmi1_import_get_unit_definitions_number ( fmi1_import_unit_definitions_t ∗)

Get the number of unit definitions.

5.31.3.2 FMILIB_EXPORT fmi1_import_unit_t∗ fmi1_import_get_unit ( fmi1_import_unit_definitions_t ∗ ,unsigned int index )

Get a unit definition.

5.31.3.3 FMILIB_EXPORT const char∗ fmi1_import_get_unit_name ( fmi1_import_unit_t ∗ )

Get a unit name.

5.31.3.4 FMILIB_EXPORT unsigned int fmi1_import_get_unit_display_unit_number ( fmi1_import_unit_t ∗ )

Get the number of display units associated with this unit.

5.31.3.5 FMILIB_EXPORT fmi1_import_display_unit_t∗ fmi1_import_get_unit_display_unit ( fmi1_import_unit_t ∗, size_t index )

Get a display unit object by index.

Parameters

index The index of display unit to be returned. Must be less than the number returned byfmi1_import_get_unit_display_unit_number()

Generated by Doxygen

Page 215: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.31 Functions for handling unit definitions. 147

5.31.3.6 FMILIB_EXPORT fmi1_import_unit_t∗ fmi1_import_get_base_unit ( fmi1_import_display_unit_t ∗ )

Get unit defition for a display unit.

5.31.3.7 FMILIB_EXPORT const char∗ fmi1_import_get_display_unit_name ( fmi1_import_display_unit_t ∗ )

Get display unit name.

5.31.3.8 FMILIB_EXPORT fmi1_real_t fmi1_import_get_display_unit_gain ( fmi1_import_display_unit_t ∗ )

Get the "gain" associated with the display unit.

5.31.3.9 FMILIB_EXPORT fmi1_real_t fmi1_import_get_display_unit_offset ( fmi1_import_display_unit_t ∗ )

Get the "offset" associated with the display unit.

5.31.3.10 FMILIB_EXPORT fmi1_real_t fmi1_import_convert_to_display_unit ( fmi1_real_t value,fmi1_import_display_unit_t ∗ du, int isRelativeQuantity )

Convert a value measured in "units" to a value measured with "display units".

Parameters

value The value to be converted.du The display unit object

isRelativeQuantity specifies if "offset" should be incorporated into conversion

5.31.3.11 FMILIB_EXPORT fmi1_real_t fmi1_import_convert_from_display_unit ( fmi1_real_t value,fmi1_import_display_unit_t ∗ du, int isRelativeQuantity )

Convert a value measured in "display units" to a value measured with "units".

Parameters

value The value to be converted.du The display unit object

isRelativeQuantity specifies if "offset" should be incorporated into conversion

Generated by Doxygen

Page 216: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

148 Module Documentation

5.32 Functions for handling variable definitions.

All the functions in this group take a pointer to fmi1_import_variable_t as a parameter. A variable pointer may beobtained via a Handling of variable lists module or via functions fmi1_import_get_variable_by_name() and fmi1_←↩

import_get_variable_by_vr().

Functions

• FMILIB_EXPORT fmi1_import_variable_t ∗ fmi1_import_get_variable_by_name (fmi1_import_t ∗fmu, constchar ∗name)

Get variable by variable name.

• FMILIB_EXPORT fmi1_import_variable_t ∗ fmi1_import_get_variable_by_vr (fmi1_import_t ∗fmu, fmi1_←↩

base_type_enu_t baseType, fmi1_value_reference_t vr)

Get variable by value reference.

• FMILIB_EXPORT const char ∗ fmi1_import_get_variable_name (fmi1_import_variable_t ∗)

Get the variable name.

• FMILIB_EXPORT const char ∗ fmi1_import_get_variable_description (fmi1_import_variable_t ∗)

Get variable description.

• FMILIB_EXPORT fmi1_value_reference_t fmi1_import_get_variable_vr (fmi1_import_variable_t ∗)

Get variable value reference.

• FMILIB_EXPORT fmi1_import_variable_typedef_t ∗ fmi1_import_get_variable_declared_type (fmi1_←↩

import_variable_t ∗)

For scalar variable gives the type definition is present.

• FMILIB_EXPORT fmi1_base_type_enu_t fmi1_import_get_variable_base_type (fmi1_import_variable_t ∗)

Get variable base type.

• FMILIB_EXPORT int fmi1_import_get_variable_has_start (fmi1_import_variable_t ∗)

Check if the variable has "start" attribute.

• FMILIB_EXPORT int fmi1_import_get_variable_is_fixed (fmi1_import_variable_t ∗)

Get the variable "fixed" attribute.

• FMILIB_EXPORT fmi1_variability_enu_t fmi1_import_get_variability (fmi1_import_variable_t ∗)

Get variability attribute.

• FMILIB_EXPORT fmi1_causality_enu_t fmi1_import_get_causality (fmi1_import_variable_t ∗)

Get causality attribute.

• FMILIB_EXPORT fmi1_import_real_variable_t ∗ fmi1_import_get_variable_as_real (fmi1_import_variable←↩

_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_import_integer_variable_t ∗ fmi1_import_get_variable_as_integer (fmi1_import_←↩

variable_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_import_enum_variable_t ∗ fmi1_import_get_variable_as_enum (fmi1_import_←↩

variable_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_import_string_variable_t ∗ fmi1_import_get_variable_as_string (fmi1_import_←↩

variable_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_import_bool_variable_t ∗ fmi1_import_get_variable_as_boolean (fmi1_import_←↩

variable_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_start (fmi1_import_real_variable_t ∗v)

Get the variable start attribute.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_max (fmi1_import_real_variable_t ∗v)

Generated by Doxygen

Page 217: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.32 Functions for handling variable definitions. 149

Get maximum value for the variable.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_min (fmi1_import_real_variable_t ∗v)

Get minimal value for the variable.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_nominal (fmi1_import_real_variable_t ∗v)

Get nominal value for the variable.

• FMILIB_EXPORT fmi1_import_unit_t ∗ fmi1_import_get_real_variable_unit (fmi1_import_real_variable_t ∗v)

Get associated "unit" object if any.

• FMILIB_EXPORT fmi1_import_display_unit_t ∗ fmi1_import_get_real_variable_display_unit (fmi1_import_←↩

real_variable_t ∗v)

Get associated "display unit" object if any.

• FMILIB_EXPORT const char ∗ fmi1_import_get_string_variable_start (fmi1_import_string_variable_t ∗v)

Get start value for the variable.

• FMILIB_EXPORT fmi1_boolean_t fmi1_import_get_boolean_variable_start (fmi1_import_bool_variable_t ∗v)

Get start value for the variable.

• FMILIB_EXPORT int fmi1_import_get_integer_variable_start (fmi1_import_integer_variable_t ∗v)

Get start value for the variable.

• FMILIB_EXPORT int fmi1_import_get_integer_variable_min (fmi1_import_integer_variable_t ∗v)

Get minimal value for the variable.

• FMILIB_EXPORT int fmi1_import_get_integer_variable_max (fmi1_import_integer_variable_t ∗v)

Get max value for the variable.

• FMILIB_EXPORT int fmi1_import_get_enum_variable_start (fmi1_import_enum_variable_t ∗v)

Get start value for the variable.

• FMILIB_EXPORT int fmi1_import_get_enum_variable_min (fmi1_import_enum_variable_t ∗v)

Get minimal value for the variable.

• FMILIB_EXPORT int fmi1_import_get_enum_variable_max (fmi1_import_enum_variable_t ∗v)

Get max value for the variable.

• FMILIB_EXPORT fmi1_variable_alias_kind_enu_t fmi1_import_get_variable_alias_kind (fmi1_import_←↩

variable_t ∗)

Get the variable alias kind.

• size_t fmi1_import_get_variable_original_order (fmi1_import_variable_t ∗v)

Get the original index in xml of the variable.

Scalar variable types

• typedef struct fmi1_xml_variable_t fmi1_import_variable_t

General variable type.

• typedef struct fmi1_xml_real_variable_t fmi1_import_real_variable_t

Opaque real variable.

• typedef struct fmi1_xml_integer_variable_t fmi1_import_integer_variable_t

Opaque integer variable.

• typedef struct fmi1_xml_string_variable_t fmi1_import_string_variable_t

Opaque string variable.

• typedef struct fmi1_xml_enum_variable_t fmi1_import_enum_variable_t

Opaque enumeration variable.

• typedef struct fmi1_xml_bool_variable_t fmi1_import_bool_variable_t

Opaque boolean variable.

• typedef struct fmi1_import_variable_list_t fmi1_import_variable_list_t

List of variables.

Generated by Doxygen

Page 218: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

150 Module Documentation

5.32.1 Detailed Description

All the functions in this group take a pointer to fmi1_import_variable_t as a parameter. A variable pointer may beobtained via a Handling of variable lists module or via functions fmi1_import_get_variable_by_name() and fmi1_←↩

import_get_variable_by_vr().

5.32.2 Typedef Documentation

5.32.2.1 typedef struct fmi1_xml_variable_t fmi1_import_variable_t

General variable type.

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

Definition at line 51 of file fmi1_import_variable.h.

5.32.2.2 typedef struct fmi1_xml_real_variable_t fmi1_import_real_variable_t

Opaque real variable.

Definition at line 53 of file fmi1_import_variable.h.

5.32.2.3 typedef struct fmi1_xml_integer_variable_t fmi1_import_integer_variable_t

Opaque integer variable.

Definition at line 55 of file fmi1_import_variable.h.

5.32.2.4 typedef struct fmi1_xml_string_variable_t fmi1_import_string_variable_t

Opaque string variable.

Definition at line 57 of file fmi1_import_variable.h.

5.32.2.5 typedef struct fmi1_xml_enum_variable_t fmi1_import_enum_variable_t

Opaque enumeration variable.

Definition at line 59 of file fmi1_import_variable.h.

5.32.2.6 typedef struct fmi1_xml_bool_variable_t fmi1_import_bool_variable_t

Opaque boolean variable.

Definition at line 61 of file fmi1_import_variable.h.

Generated by Doxygen

Page 219: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.32 Functions for handling variable definitions. 151

5.32.2.7 typedef struct fmi1_import_variable_list_t fmi1_import_variable_list_t

List of variables.

Definition at line 63 of file fmi1_import_variable.h.

5.32.3 Function Documentation

5.32.3.1 FMILIB_EXPORT fmi1_import_variable_t∗ fmi1_import_get_variable_by_name ( fmi1_import_t ∗ fmu,const char ∗ name )

Get variable by variable name.

Generated by Doxygen

Page 220: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

152 Module Documentation

Parameters

fmu - An fmu object as returned by fmi1_import_parse_xml().

name - variable name

Returns

variable pointer.

5.32.3.2 FMILIB_EXPORT fmi1_import_variable_t∗ fmi1_import_get_variable_by_vr ( fmi1_import_t ∗ fmu,fmi1_base_type_enu_t baseType, fmi1_value_reference_t vr )

Get variable by value reference.

Parameters

fmu - An fmu object as returned by fmi1_import_parse_xml().

baseType - basic data type

vr - value reference

Returns

variable pointer.

5.32.3.3 FMILIB_EXPORT const char∗ fmi1_import_get_variable_name ( fmi1_import_variable_t ∗ )

Get the variable name.

5.32.3.4 FMILIB_EXPORT const char∗ fmi1_import_get_variable_description ( fmi1_import_variable_t ∗ )

Get variable description.

Returns

Description string or empty string ("") if no description in the XML file was given.

5.32.3.5 FMILIB_EXPORT fmi1_value_reference_t fmi1_import_get_variable_vr ( fmi1_import_variable_t ∗ )

Get variable value reference.

5.32.3.6 FMILIB_EXPORT fmi1_import_variable_typedef_t∗ fmi1_import_get_variable_declared_type (fmi1_import_variable_t ∗ )

For scalar variable gives the type definition is present.

Returns

Pointer of a type fmi1_import_variable_typedef_t object or NULL of not present.

Generated by Doxygen

Page 221: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.32 Functions for handling variable definitions. 153

5.32.3.7 FMILIB_EXPORT fmi1_base_type_enu_t fmi1_import_get_variable_base_type ( fmi1_import_variable_t ∗)

Get variable base type.

5.32.3.8 FMILIB_EXPORT int fmi1_import_get_variable_has_start ( fmi1_import_variable_t ∗ )

Check if the variable has "start" attribute.

5.32.3.9 FMILIB_EXPORT int fmi1_import_get_variable_is_fixed ( fmi1_import_variable_t ∗ )

Get the variable "fixed" attribute.

5.32.3.10 FMILIB_EXPORT fmi1_variability_enu_t fmi1_import_get_variability ( fmi1_import_variable_t ∗ )

Get variability attribute.

5.32.3.11 FMILIB_EXPORT fmi1_causality_enu_t fmi1_import_get_causality ( fmi1_import_variable_t ∗ )

Get causality attribute.

5.32.3.12 FMILIB_EXPORT fmi1_import_real_variable_t∗ fmi1_import_get_variable_as_real (fmi1_import_variable_t ∗ )

Cast general variable to a one with the specific type.

Returns

Typed object or NULL if base type does not match

5.32.3.13 FMILIB_EXPORT fmi1_import_integer_variable_t∗ fmi1_import_get_variable_as_integer (fmi1_import_variable_t ∗ )

Cast general variable to a one with the specific type.

Returns

Typed object or NULL if base type does not match

5.32.3.14 FMILIB_EXPORT fmi1_import_enum_variable_t∗ fmi1_import_get_variable_as_enum (fmi1_import_variable_t ∗ )

Cast general variable to a one with the specific type.

Returns

Typed object or NULL if base type does not match

Generated by Doxygen

Page 222: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

154 Module Documentation

5.32.3.15 FMILIB_EXPORT fmi1_import_string_variable_t∗ fmi1_import_get_variable_as_string (fmi1_import_variable_t ∗ )

Cast general variable to a one with the specific type.

Returns

Typed object or NULL if base type does not match

5.32.3.16 FMILIB_EXPORT fmi1_import_bool_variable_t∗ fmi1_import_get_variable_as_boolean (fmi1_import_variable_t ∗ )

Cast general variable to a one with the specific type.

Returns

Typed object or NULL if base type does not match

5.32.3.17 FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_start ( fmi1_import_real_variable_t ∗ v )

Get the variable start attribute.

Returns

The "start" attriburte as specified in the XML file or variable nominal value.

5.32.3.18 FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_max ( fmi1_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>

5.32.3.19 FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_min ( fmi1_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>

5.32.3.20 FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_nominal ( fmi1_import_real_variable_t ∗ v )

Get nominal value for the variable.

Generated by Doxygen

Page 223: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.32 Functions for handling variable definitions. 155

5.32.3.21 FMILIB_EXPORT fmi1_import_unit_t∗ fmi1_import_get_real_variable_unit (fmi1_import_real_variable_t ∗ v )

Get associated "unit" object if any.

5.32.3.22 FMILIB_EXPORT fmi1_import_display_unit_t∗ fmi1_import_get_real_variable_display_unit (fmi1_import_real_variable_t ∗ v )

Get associated "display unit" object if any.

5.32.3.23 FMILIB_EXPORT const char∗ fmi1_import_get_string_variable_start ( fmi1_import_string_variable_t ∗ v )

Get start value for the variable.

5.32.3.24 FMILIB_EXPORT fmi1_boolean_t fmi1_import_get_boolean_variable_start ( fmi1_import_bool_variable_t ∗v )

Get start value for the variable.

5.32.3.25 FMILIB_EXPORT int fmi1_import_get_integer_variable_start ( fmi1_import_integer_variable_t ∗ v )

Get start value for the variable.

5.32.3.26 FMILIB_EXPORT int fmi1_import_get_integer_variable_min ( fmi1_import_integer_variable_t ∗ v )

Get minimal value for the variable.

5.32.3.27 FMILIB_EXPORT int fmi1_import_get_integer_variable_max ( fmi1_import_integer_variable_t ∗ v )

Get max value for the variable.

5.32.3.28 FMILIB_EXPORT int fmi1_import_get_enum_variable_start ( fmi1_import_enum_variable_t ∗ v )

Get start value for the variable.

5.32.3.29 FMILIB_EXPORT int fmi1_import_get_enum_variable_min ( fmi1_import_enum_variable_t ∗ v )

Get minimal value for the variable.

5.32.3.30 FMILIB_EXPORT int fmi1_import_get_enum_variable_max ( fmi1_import_enum_variable_t ∗ v )

Get max value for the variable.

5.32.3.31 FMILIB_EXPORT fmi1_variable_alias_kind_enu_t fmi1_import_get_variable_alias_kind (fmi1_import_variable_t ∗ )

Get the variable alias kind.

5.32.3.32 size_t fmi1_import_get_variable_original_order ( fmi1_import_variable_t ∗ v )

Get the original index in xml of the variable.

Generated by Doxygen

Page 224: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

156 Module Documentation

5.33 Basic support for vendor annotations.

Functions

• FMILIB_EXPORT unsigned int fmi1_import_get_number_of_vendors (fmi1_import_vendor_list_t ∗)

Get the number of different vendors.

• FMILIB_EXPORT fmi1_import_vendor_t ∗ fmi1_import_get_vendor (fmi1_import_vendor_list_t ∗, unsignedint index)

Get the annotations associated with vendor specified by the index.

• FMILIB_EXPORT const char ∗ fmi1_import_get_vendor_name (fmi1_import_vendor_t ∗)

Get the vendor name.

• FMILIB_EXPORT unsigned int fmi1_import_get_number_of_vendor_annotations (fmi1_import_vendor_t ∗)

Get the number of annotations provided for the vendor.

• FMILIB_EXPORT fmi1_import_annotation_t ∗ fmi1_import_get_vendor_annotation (fmi1_import_vendor_t ∗,unsigned int index)

Get an annotation object for the vendor by index.

• FMILIB_EXPORT const char ∗ fmi1_import_get_annotation_name (fmi1_import_annotation_t ∗)

Get the name of the annotation.

• FMILIB_EXPORT const char ∗ fmi1_import_get_annotation_value (fmi1_import_annotation_t ∗)

Get the value for the annotation.

• FMILIB_EXPORT fmi1_import_vendor_list_t ∗ fmi1_import_get_vendor_list (fmi1_import_t ∗fmu)

Get the list of all the vendor annotations present in the XML file.

Vendor annotation supporting structures

• typedef struct fmi1_xml_vendor_list_t fmi1_import_vendor_list_t

Opaque list of vendor annotations.

• typedef struct fmi1_xml_vendor_t fmi1_import_vendor_t

Opaque vendor object.

• typedef struct fmi1_xml_annotation_t fmi1_import_annotation_t

Opaque annotation object.

5.33.1 Detailed Description

5.33.2 Typedef Documentation

5.33.2.1 typedef struct fmi1_xml_vendor_list_t fmi1_import_vendor_list_t

Opaque list of vendor annotations.

Definition at line 43 of file fmi1_import_vendor_annotations.h.

5.33.2.2 typedef struct fmi1_xml_vendor_t fmi1_import_vendor_t

Opaque vendor object.

Definition at line 45 of file fmi1_import_vendor_annotations.h.

Generated by Doxygen

Page 225: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.33 Basic support for vendor annotations. 157

5.33.2.3 typedef struct fmi1_xml_annotation_t fmi1_import_annotation_t

Opaque annotation object.

Definition at line 47 of file fmi1_import_vendor_annotations.h.

5.33.3 Function Documentation

5.33.3.1 FMILIB_EXPORT unsigned int fmi1_import_get_number_of_vendors ( fmi1_import_vendor_list_t ∗ )

Get the number of different vendors.

5.33.3.2 FMILIB_EXPORT fmi1_import_vendor_t∗ fmi1_import_get_vendor ( fmi1_import_vendor_list_t ∗ ,unsigned int index )

Get the annotations associated with vendor specified by the index.

5.33.3.3 FMILIB_EXPORT const char∗ fmi1_import_get_vendor_name ( fmi1_import_vendor_t ∗ )

Get the vendor name.

5.33.3.4 FMILIB_EXPORT unsigned int fmi1_import_get_number_of_vendor_annotations ( fmi1_import_vendor_t ∗ )

Get the number of annotations provided for the vendor.

5.33.3.5 FMILIB_EXPORT fmi1_import_annotation_t∗ fmi1_import_get_vendor_annotation (fmi1_import_vendor_t ∗ , unsigned int index )

Get an annotation object for the vendor by index.

Note: Annotations may later be used in other places but have common interface name-value

5.33.3.6 FMILIB_EXPORT const char∗ fmi1_import_get_annotation_name ( fmi1_import_annotation_t ∗ )

Get the name of the annotation.

5.33.3.7 FMILIB_EXPORT const char∗ fmi1_import_get_annotation_value ( fmi1_import_annotation_t ∗ )

Get the value for the annotation.

5.33.3.8 FMILIB_EXPORT fmi1_import_vendor_list_t∗ fmi1_import_get_vendor_list ( fmi1_import_t ∗ fmu )

Get the list of all the vendor annotations present in the XML file.

Generated by Doxygen

Page 226: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

158 Module Documentation

5.34 Constuction, destruction and error handling

Functions

• FMILIB_EXPORT const char ∗ fmi2_import_get_last_error (fmi2_import_t ∗fmu)

Retrieve the last error message.

• FMILIB_EXPORT int fmi2_import_clear_last_error (fmi2_import_t ∗fmu)

Clear the error message.

• FMILIB_EXPORT void fmi2_import_free (fmi2_import_t ∗fmu)

Release the memory allocated.

5.34.1 Detailed Description

5.34.2 Function Documentation

5.34.2.1 FMILIB_EXPORT const char∗ fmi2_import_get_last_error ( fmi2_import_t ∗ fmu )

Retrieve the last error message.

Error handling:

Many functions in the library return pointers to struct. An error is indicated by returning NULL/0-pointer. If error isreturned than fmi2_import_get_last_error() functions can be used to retrieve the error message. If logging callbackswere specified then the same information is reported via logger. Memory for the error string is allocated anddeallocated in the module. Client code should not store the pointer to the string since it can become invalid.

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

Returns

NULL-terminated string with an error message.

5.34.2.2 FMILIB_EXPORT int fmi2_import_clear_last_error ( fmi2_import_t ∗ fmu )

Clear the error message.

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

Returns

0 if further processing is possible. If it returns 1 then the error was not recoverable. The fmu object shouldthen be freed and recreated.

Generated by Doxygen

Page 227: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.34 Constuction, destruction and error handling 159

5.34.2.3 FMILIB_EXPORT void fmi2_import_free ( fmi2_import_t ∗ fmu )

Release the memory allocated.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

Generated by Doxygen

Page 228: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

160 Module Documentation

5.35 General information retrieval

Functions for retrieving general model information. Memory for the strings is allocated and deallocated in the mod-ule. All the functions take an FMU object as returned by fmi2_import_parse_xml() as a parameter. The informationis retrieved from the XML file.

Functions

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_name (fmi2_import_t ∗fmu)

Get model name.

• FMILIB_EXPORT unsigned int fmi2_import_get_capability (fmi2_import_t ∗, fmi2_capabilities_enu_t id)

Retrieve capability flags by ID.

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_identifier_ME (fmi2_import_t ∗fmu)

Get model identifier for ModelExchange.

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_identifier_CS (fmi2_import_t ∗fmu)

Get model identifier for CoSimulation.

• FMILIB_EXPORT const char ∗ fmi2_import_get_GUID (fmi2_import_t ∗fmu)

Get FMU GUID.

• FMILIB_EXPORT const char ∗ fmi2_import_get_description (fmi2_import_t ∗fmu)

Get FMU description.

• FMILIB_EXPORT const char ∗ fmi2_import_get_author (fmi2_import_t ∗fmu)

Get FMU author.

• FMILIB_EXPORT const char ∗ fmi2_import_get_copyright (fmi2_import_t ∗fmu)

Get FMU copyright information.

• FMILIB_EXPORT const char ∗ fmi2_import_get_license (fmi2_import_t ∗fmu)

Get FMU license information.

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_version (fmi2_import_t ∗fmu)

Get FMU version.

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_standard_version (fmi2_import_t ∗fmu)

Get FMI standard version (always 2.0).

• FMILIB_EXPORT const char ∗ fmi2_import_get_generation_tool (fmi2_import_t ∗fmu)

Get FMU generation tool.

• FMILIB_EXPORT const char ∗ fmi2_import_get_generation_date_and_time (fmi2_import_t ∗fmu)

Get FMU generation date and time.

• FMILIB_EXPORT fmi2_variable_naming_convension_enu_t fmi2_import_get_naming_convention (fmi2_←↩

import_t ∗fmu)

Get variable naming convention used.

• FMILIB_EXPORT size_t fmi2_import_get_number_of_continuous_states (fmi2_import_t ∗fmu)

Get the number of continuous states.

• FMILIB_EXPORT size_t fmi2_import_get_number_of_event_indicators (fmi2_import_t ∗fmu)

Get the number of event indicators.

• FMILIB_EXPORT double fmi2_import_get_default_experiment_start (fmi2_import_t ∗fmu)

Get the start time for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi2_import_get_default_experiment_stop (fmi2_import_t ∗fmu)

Get the stop time for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi2_import_get_default_experiment_tolerance (fmi2_import_t ∗fmu)

Get the tolerance for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi2_import_get_default_experiment_step (fmi2_import_t ∗fmu)

Get the step size for default experiment as specified in the XML file.

• FMILIB_EXPORT fmi2_fmu_kind_enu_t fmi2_import_get_fmu_kind (fmi2_import_t ∗fmu)

Generated by Doxygen

Page 229: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.35 General information retrieval 161

Get the type of the FMU (model exchange or co-simulation)

• FMILIB_EXPORT fmi2_import_type_definitions_t ∗ fmi2_import_get_type_definitions (fmi2_import_t ∗)

Get the list of all the type definitions in the model.

• FMILIB_EXPORT fmi2_import_unit_definitions_t ∗ fmi2_import_get_unit_definitions (fmi2_import_t ∗fmu)

Get a list of all the unit definitions in the model.

• FMILIB_EXPORT fmi2_import_variable_t ∗ fmi2_import_get_variable_alias_base (fmi2_import_t ∗fmu,fmi2_import_variable_t ∗)

Get the variable with the same value reference that is not an alias.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_variable_aliases (fmi2_import_t ∗fmu,fmi2_import_variable_t ∗)

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_variable_list (fmi2_import_t ∗fmu, int sort←↩

Order)

Get the list of all the variables in the model.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_create_var_list (fmi2_import_t ∗fmu, fmi2_←↩

import_variable_t ∗v)

Create a variable list with a single variable.

• FMILIB_EXPORT size_t fmi2_import_get_vendors_num (fmi2_import_t ∗fmu)

Get the number of vendors that had annotations in the XML.

• FMILIB_EXPORT const char ∗ fmi2_import_get_vendor_name (fmi2_import_t ∗fmu, size_t index)

Get the name of the vendor with that had annotations in the XML by index.

• FMILIB_EXPORT size_t fmi2_import_get_log_categories_num (fmi2_import_t ∗fmu)

Get the number of log categories defined in the XML.

• FMILIB_EXPORT const char ∗ fmi2_import_get_log_category (fmi2_import_t ∗fmu, size_t index)

Get the log category by index.

• FMILIB_EXPORT const char ∗ fmi2_import_get_log_category_description (fmi2_import_t ∗fmu, size_t index)

Get the log category description by index.

• FMILIB_EXPORT size_t fmi2_import_get_source_files_me_num (fmi2_import_t ∗fmu)

Get the number of source files for ME defined in the XML.

• FMILIB_EXPORT const char ∗ fmi2_import_get_source_file_me (fmi2_import_t ∗fmu, size_t index)

Get the ME source file by index.

• FMILIB_EXPORT size_t fmi2_import_get_source_files_cs_num (fmi2_import_t ∗fmu)

Get the number of source files for CS defined in the XML.

• FMILIB_EXPORT const char ∗ fmi2_import_get_source_file_cs (fmi2_import_t ∗fmu, size_t index)

Get the CS source file by index.

• FMILIB_EXPORT fmi2_import_variable_t ∗ fmi2_import_get_variable_by_name (fmi2_import_t ∗fmu, constchar ∗name)

Get variable by variable name.

• FMILIB_EXPORT fmi2_import_variable_t ∗ fmi2_import_get_variable_by_vr (fmi2_import_t ∗fmu, fmi2_←↩

base_type_enu_t baseType, fmi2_value_reference_t vr)

Get variable by value reference.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_outputs_list (fmi2_import_t ∗fmu)

Get the list of all the output variables in the model.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_derivatives_list (fmi2_import_t ∗fmu)

Get the list of all the derivative variables in the model.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_discrete_states_list (fmi2_import_t ∗fmu)

Get the list of all the discrete state variables in the model.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_initial_unknowns_list (fmi2_import_t ∗fmu)

Get the list of all the initial unknown variables in the model.

• FMILIB_EXPORT void fmi2_import_get_outputs_dependencies (fmi2_import_t ∗fmu, size_t ∗∗startIndex,size_t ∗∗dependency, char ∗∗factorKind)

Get dependency information in row-compressed format.

Generated by Doxygen

Page 230: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

162 Module Documentation

• FMILIB_EXPORT void fmi2_import_get_derivatives_dependencies (fmi2_import_t ∗fmu, size_t ∗∗startIndex,size_t ∗∗dependency, char ∗∗factorKind)

Get dependency information in row-compressed format.

• FMILIB_EXPORT void fmi2_import_get_discrete_states_dependencies (fmi2_import_t ∗fmu, size_←↩

t ∗∗startIndex, size_t ∗∗dependency, char ∗∗factorKind)

Get dependency information in row-compressed format.

• FMILIB_EXPORT void fmi2_import_get_initial_unknowns_dependencies (fmi2_import_t ∗fmu, size_←↩

t ∗∗startIndex, size_t ∗∗dependency, char ∗∗factorKind)

Get dependency information in row-compressed format.

5.35.1 Detailed Description

Functions for retrieving general model information. Memory for the strings is allocated and deallocated in the mod-ule. All the functions take an FMU object as returned by fmi2_import_parse_xml() as a parameter. The informationis retrieved from the XML file.

5.35.2 Function Documentation

5.35.2.1 FMILIB_EXPORT const char∗ fmi2_import_get_model_name ( fmi2_import_t ∗ fmu )

Get model name.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.2 FMILIB_EXPORT unsigned int fmi2_import_get_capability ( fmi2_import_t ∗ , fmi2_capabilities_enu_t id )

Retrieve capability flags by ID.

5.35.2.3 FMILIB_EXPORT const char∗ fmi2_import_get_model_identifier_ME ( fmi2_import_t ∗ fmu )

Get model identifier for ModelExchange.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.4 FMILIB_EXPORT const char∗ fmi2_import_get_model_identifier_CS ( fmi2_import_t ∗ fmu )

Get model identifier for CoSimulation.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

Generated by Doxygen

Page 231: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.35 General information retrieval 163

5.35.2.5 FMILIB_EXPORT const char∗ fmi2_import_get_GUID ( fmi2_import_t ∗ fmu )

Get FMU GUID.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.6 FMILIB_EXPORT const char∗ fmi2_import_get_description ( fmi2_import_t ∗ fmu )

Get FMU description.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.7 FMILIB_EXPORT const char∗ fmi2_import_get_author ( fmi2_import_t ∗ fmu )

Get FMU author.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.8 FMILIB_EXPORT const char∗ fmi2_import_get_copyright ( fmi2_import_t ∗ fmu )

Get FMU copyright information.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.9 FMILIB_EXPORT const char∗ fmi2_import_get_license ( fmi2_import_t ∗ fmu )

Get FMU license information.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.10 FMILIB_EXPORT const char∗ fmi2_import_get_model_version ( fmi2_import_t ∗ fmu )

Get FMU version.

Generated by Doxygen

Page 232: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

164 Module Documentation

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.11 FMILIB_EXPORT const char∗ fmi2_import_get_model_standard_version ( fmi2_import_t ∗ fmu )

Get FMI standard version (always 2.0).

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.12 FMILIB_EXPORT const char∗ fmi2_import_get_generation_tool ( fmi2_import_t ∗ fmu )

Get FMU generation tool.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.13 FMILIB_EXPORT const char∗ fmi2_import_get_generation_date_and_time ( fmi2_import_t ∗ fmu )

Get FMU generation date and time.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.14 FMILIB_EXPORT fmi2_variable_naming_convension_enu_t fmi2_import_get_naming_convention (fmi2_import_t ∗ fmu )

Get variable naming convention used.

Parameters

fmu An fmu object as returned by fmi2_import_parse_xml().

5.35.2.15 FMILIB_EXPORT size_t fmi2_import_get_number_of_continuous_states ( fmi2_import_t ∗ fmu )

Get the number of continuous states.

Generated by Doxygen

Page 233: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.35 General information retrieval 165

5.35.2.16 FMILIB_EXPORT size_t fmi2_import_get_number_of_event_indicators ( fmi2_import_t ∗ fmu )

Get the number of event indicators.

5.35.2.17 FMILIB_EXPORT double fmi2_import_get_default_experiment_start ( fmi2_import_t ∗ fmu )

Get the start time for default experiment as specified in the XML file.

5.35.2.18 FMILIB_EXPORT double fmi2_import_get_default_experiment_stop ( fmi2_import_t ∗ fmu )

Get the stop time for default experiment as specified in the XML file.

5.35.2.19 FMILIB_EXPORT double fmi2_import_get_default_experiment_tolerance ( fmi2_import_t ∗ fmu )

Get the tolerance for default experiment as specified in the XML file.

5.35.2.20 FMILIB_EXPORT double fmi2_import_get_default_experiment_step ( fmi2_import_t ∗ fmu )

Get the step size for default experiment as specified in the XML file.

5.35.2.21 FMILIB_EXPORT fmi2_fmu_kind_enu_t fmi2_import_get_fmu_kind ( fmi2_import_t ∗ fmu )

Get the type of the FMU (model exchange or co-simulation)

5.35.2.22 FMILIB_EXPORT fmi2_import_type_definitions_t∗ fmi2_import_get_type_definitions ( fmi2_import_t ∗ )

Get the list of all the type definitions in the model.

5.35.2.23 FMILIB_EXPORT fmi2_import_unit_definitions_t∗ fmi2_import_get_unit_definitions ( fmi2_import_t ∗fmu )

Get a list of all the unit definitions in the model.

5.35.2.24 FMILIB_EXPORT fmi2_import_variable_t∗ fmi2_import_get_variable_alias_base ( fmi2_import_t ∗ fmu,fmi2_import_variable_t ∗ )

Get the variable with the same value reference that is not an alias.

5.35.2.25 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_get_variable_aliases ( fmi2_import_t ∗ fmu,fmi2_import_variable_t ∗ )

Get the list of all the variables aliased to the given one (including the base one).

Note that the list is ordered: base variable, aliases, negated aliases.

5.35.2.26 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_get_variable_list ( fmi2_import_t ∗ fmu, intsortOrder )

Get the list of all the variables in the model.

Generated by Doxygen

Page 234: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

166 Module Documentation

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

sortOrder Specifies the order of the variables in the list: 0 - original order as found in the XML file; 1 - sortedalfabetically by variable name; 2 sorted by types/value references.

Returns

a variable list with all the variables in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

5.35.2.27 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_create_var_list ( fmi2_import_t ∗ fmu,fmi2_import_variable_t ∗ v )

Create a variable list with a single variable.

Parameters

fmu An FMU object that this variable list will reference.

v A variable.

5.35.2.28 FMILIB_EXPORT size_t fmi2_import_get_vendors_num ( fmi2_import_t ∗ fmu )

Get the number of vendors that had annotations in the XML.

5.35.2.29 FMILIB_EXPORT const char∗ fmi2_import_get_vendor_name ( fmi2_import_t ∗ fmu, size_t index )

Get the name of the vendor with that had annotations in the XML by index.

5.35.2.30 FMILIB_EXPORT size_t fmi2_import_get_log_categories_num ( fmi2_import_t ∗ fmu )

Get the number of log categories defined in the XML.

5.35.2.31 FMILIB_EXPORT const char∗ fmi2_import_get_log_category ( fmi2_import_t ∗ fmu, size_t index )

Get the log category by index.

5.35.2.32 FMILIB_EXPORT const char∗ fmi2_import_get_log_category_description ( fmi2_import_t ∗ fmu, size_tindex )

Get the log category description by index.

Generated by Doxygen

Page 235: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.35 General information retrieval 167

5.35.2.33 FMILIB_EXPORT size_t fmi2_import_get_source_files_me_num ( fmi2_import_t ∗ fmu )

Get the number of source files for ME defined in the XML.

5.35.2.34 FMILIB_EXPORT const char∗ fmi2_import_get_source_file_me ( fmi2_import_t ∗ fmu, size_t index )

Get the ME source file by index.

5.35.2.35 FMILIB_EXPORT size_t fmi2_import_get_source_files_cs_num ( fmi2_import_t ∗ fmu )

Get the number of source files for CS defined in the XML.

5.35.2.36 FMILIB_EXPORT const char∗ fmi2_import_get_source_file_cs ( fmi2_import_t ∗ fmu, size_t index )

Get the CS source file by index.

5.35.2.37 FMILIB_EXPORT fmi2_import_variable_t∗ fmi2_import_get_variable_by_name ( fmi2_import_t ∗ fmu,const char ∗ name )

Get variable by variable name.

Parameters

fmu - An fmu object as returned by fmi2_import_parse_xml().

name - variable name

Returns

variable pointer.

5.35.2.38 FMILIB_EXPORT fmi2_import_variable_t∗ fmi2_import_get_variable_by_vr ( fmi2_import_t ∗ fmu,fmi2_base_type_enu_t baseType, fmi2_value_reference_t vr )

Get variable by value reference.

Parameters

fmu - An fmu object as returned by fmi2_import_parse_xml().

baseType - basic data type

vr - value reference

Returns

variable pointer.

Generated by Doxygen

Page 236: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

168 Module Documentation

5.35.2.39 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_get_outputs_list ( fmi2_import_t ∗ fmu )

Get the list of all the output variables in the model.

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

Returns

a variable list with all the output variables in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

5.35.2.40 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_get_derivatives_list ( fmi2_import_t ∗ fmu )

Get the list of all the derivative variables in the model.

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

Returns

a variable list with all the continuous state derivatives in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

5.35.2.41 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_get_discrete_states_list ( fmi2_import_t ∗fmu )

Get the list of all the discrete state variables in the model.

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

Returns

a variable list with all the discrete state variables in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

5.35.2.42 FMILIB_EXPORT fmi2_import_variable_list_t∗ fmi2_import_get_initial_unknowns_list ( fmi2_import_t ∗fmu )

Get the list of all the initial unknown variables in the model.

Generated by Doxygen

Page 237: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.35 General information retrieval 169

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

Returns

a variable list with all the initial unknowns in the model.

Note that variable lists are allocated dynamically and must be freed when not needed any longer.

5.35.2.43 FMILIB_EXPORT void fmi2_import_get_outputs_dependencies ( fmi2_import_t ∗ fmu, size_t ∗∗ startIndex,size_t ∗∗ dependency, char ∗∗ factorKind )

Get dependency information in row-compressed format.

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

startIndex - outputs a pointer to an array of start indices (size of array is number of outputs + 1). Firstelement is zero, last is equal to the number of elements in the dependency and factor arrays.NULL pointer is returned if no dependency information was provided in the XML.

dependency - outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zeromeans "depends on all" (no information in the XML).

factorKind - outputs a pointer to the factor kind data. The values can be converted tofmi2_dependency_factor_kind_enu_t

5.35.2.44 FMILIB_EXPORT void fmi2_import_get_derivatives_dependencies ( fmi2_import_t ∗ fmu, size_t ∗∗startIndex, size_t ∗∗ dependency, char ∗∗ factorKind )

Get dependency information in row-compressed format.

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

startIndex - outputs a pointer to an array of start indices (size of array is number of derivatives + 1). Firstelement is zero, last is equal to the number of elements in the dependency and factor arrays.NULL pointer is returned if no dependency information was provided in the XML.

dependency - outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zeromeans "depends on all" (no information in the XML).

factorKind - outputs a pointer to the factor kind data. The values can be converted tofmi2_dependency_factor_kind_enu_t

5.35.2.45 FMILIB_EXPORT void fmi2_import_get_discrete_states_dependencies ( fmi2_import_t ∗ fmu, size_t ∗∗startIndex, size_t ∗∗ dependency, char ∗∗ factorKind )

Get dependency information in row-compressed format.

Generated by Doxygen

Page 238: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

170 Module Documentation

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

startIndex - outputs a pointer to an array of start indices (size of array is number of discrete states + 1).First element is zero, last is equal to the number of elements in the dependency and factorarrays. NULL pointer is returned if no dependency information was provided in the XML.

dependency - outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zeromeans "depends on all" (no information in the XML).

factorKind - outputs a pointer to the factor kind data. The values can be converted tofmi2_dependency_factor_kind_enu_t

5.35.2.46 FMILIB_EXPORT void fmi2_import_get_initial_unknowns_dependencies ( fmi2_import_t ∗ fmu, size_t ∗∗startIndex, size_t ∗∗ dependency, char ∗∗ factorKind )

Get dependency information in row-compressed format.

Parameters

fmu An FMU object as returned by fmi2_import_parse_xml().

startIndex - outputs a pointer to an array of start indices (size of array is number of initial unknowns + 1).First element is zero, last is equal to the number of elements in the dependency and factorarrays. NULL pointer is returned if no dependency information was provided in the XML.

dependency - outputs a pointer to the dependency index data. Indices are 1-based. Index equals to zeromeans "depends on all" (no information in the XML).

factorKind - outputs a pointer to the factor kind data. The values can be converted tofmi2_dependency_factor_kind_enu_t

Generated by Doxygen

Page 239: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.36 Interface to the standard FMI 2.0 "C" API 171

5.36 Interface to the standard FMI 2.0 "C" API

Convenient functions for calling the FMI functions. This interface wrappes the "C" API.

Modules

• FMI 2.0 Constructor and Destructor

Functions for instantiating and freeing the container of the struct that is responsible for the FMI functions.

• FMI 2.0 (ME) Model Exchange functions

List of Model Exchange wrapper functions. Common functions are not listed.

• FMI 2.0 (CS) Co-Simulation functions

List of Co-Simulation wrapper functions. Common functions are not listed.

• FMI 2.0 (ME & CS) Common functions

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

5.36.1 Detailed Description

Convenient functions for calling the FMI functions. This interface wrappes the "C" API.

Generated by Doxygen

Page 240: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

172 Module Documentation

5.37 FMI 2.0 Constructor and Destructor

Functions for instantiating and freeing the container of the struct that is responsible for the FMI functions.

Functions

• FMILIB_EXPORT jm_status_enu_t fmi2_import_create_dllfmu (fmi2_import_t ∗fmu, fmi2_fmu_kind_enu_←↩

t fmuKind, const fmi2_callback_functions_t ∗callBackFunctions)

Create a C-API struct. The C-API struct is a placeholder for the FMI DLL functions.

• FMILIB_EXPORT void fmi2_import_destroy_dllfmu (fmi2_import_t ∗fmu)

Free a C-API struct. All memory allocated since the struct was created is freed.

• FMILIB_EXPORT void fmi2_import_set_debug_mode (fmi2_import_t ∗fmu, int mode)

Set CAPI debug mode flag. Setting to non-zero prevents DLL unloading in fmi2_import_destroy_dllfmu while all thememory is deallocated. This is to support valgrind debugging.

5.37.1 Detailed Description

Functions for instantiating and freeing the container of the struct that is responsible for the FMI functions.

Before any of the FMI functions may be called, the construction function must instantiate a fmi_import_t module.After the fmi_import_t module has been succesfully instantiated, all the FMI functions can be called. To unload theFMI functions, the destroy functions shall be called.

5.37.2 Function Documentation

5.37.2.1 FMILIB_EXPORT jm_status_enu_t fmi2_import_create_dllfmu ( fmi2_import_t ∗ fmu,fmi2_fmu_kind_enu_t fmuKind, const fmi2_callback_functions_t ∗ callBackFunctions )

Create a C-API struct. The C-API struct is a placeholder for the FMI DLL functions.

This function may only be called once if it returned succesfully. fmi2_import_destroy_dllfmu must be called beforethis function can be called again.

Parameters

fmu A model description object returned by fmi2_import_parse_xml().

fmuKind Specifies if ModelExchange or CoSimulation binary should be loaded.

callBackFunctions Callback functions to be used by the FMI functions internally. If this parameter is NULLthen the jm_callbacks:: and fmi2_log_forwarding are utitlized to fill in the default structure.

Returns

Error status. If the function returns with an error, it is not allowed to call any of the other C-API functions.

5.37.2.2 FMILIB_EXPORT void fmi2_import_destroy_dllfmu ( fmi2_import_t ∗ fmu )

Free a C-API struct. All memory allocated since the struct was created is freed.

Generated by Doxygen

Page 241: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.37 FMI 2.0 Constructor and Destructor 173

Parameters

fmu A model description object returned from fmi2_import_parse_xml().

5.37.2.3 FMILIB_EXPORT void fmi2_import_set_debug_mode ( fmi2_import_t ∗ fmu, int mode )

Set CAPI debug mode flag. Setting to non-zero prevents DLL unloading in fmi2_import_destroy_dllfmu while all thememory is deallocated. This is to support valgrind debugging.

Parameters

fmu C-API struct that has succesfully loaded the FMI function.

mode The debug mode to set.

Generated by Doxygen

Page 242: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

174 Module Documentation

5.38 FMI 2.0 (ME) Model Exchange functions

List of Model Exchange wrapper functions. Common functions are not listed.

Functions

• FMILIB_EXPORT fmi2_status_t fmi2_import_enter_event_mode (fmi2_import_t ∗fmu)

Calls the FMI function fmiEnterEventMode(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_new_discrete_states (fmi2_import_t ∗fmu, fmi2_event_info_←↩

t ∗eventInfo)

Calls the FMI function fmiNewDiscreteStates(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_enter_continuous_time_mode (fmi2_import_t ∗fmu)

Calls the FMI function fmiEnterContinuousTimeMode(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_set_time (fmi2_import_t ∗fmu, fmi2_real_t time)

Wrapper for the FMI function fmiSetTime(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_set_continuous_states (fmi2_import_t ∗fmu, const fmi2_real←↩

_t x[ ], size_t nx)

Wrapper for the FMI function fmiSetContinuousStates(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_completed_integrator_step (fmi2_import_t ∗fmu, fmi2←↩

_boolean_t noSetFMUStatePriorToCurrentPoint, fmi2_boolean_t ∗enterEventMode, fmi2_boolean_←↩

t ∗terminateSimulation)

Wrapper for the FMI function fmiCompletedIntegratorStep(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_derivatives (fmi2_import_t ∗fmu, fmi2_real_t derivatives[ ],size_t nx)

Wrapper for the FMI function fmiGetDerivatives(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_event_indicators (fmi2_import_t ∗fmu, fmi2_real_t event←↩

Indicators[ ], size_t ni)

Wrapper for the FMI function fmiGetEventIndicators(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_continuous_states (fmi2_import_t ∗fmu, fmi2_real_←↩

t states[ ], size_t nx)

Wrapper for the FMI function fmiGetContinuousStates(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_nominals_of_continuous_states (fmi2_import_t ∗fmu,fmi2_real_t x_nominal[ ], size_t nx)

Wrapper for the FMI function fmiGetNominalsOfContinuousStates(...)

5.38.1 Detailed Description

List of Model Exchange wrapper functions. Common functions are not listed.

5.38.2 Function Documentation

5.38.2.1 FMILIB_EXPORT fmi2_status_t fmi2_import_enter_event_mode ( fmi2_import_t ∗ fmu )

Calls the FMI function fmiEnterEventMode(...)

Generated by Doxygen

Page 243: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.38 FMI 2.0 (ME) Model Exchange functions 175

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

FMI status.

5.38.2.2 FMILIB_EXPORT fmi2_status_t fmi2_import_new_discrete_states ( fmi2_import_t ∗ fmu,fmi2_event_info_t ∗ eventInfo )

Calls the FMI function fmiNewDiscreteStates(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions,see fmi2_import_create_dllfmu().

eventInfo Pointer to fmi2_event_info_t structure that will be filled in.

Returns

FMI status.

5.38.2.3 FMILIB_EXPORT fmi2_status_t fmi2_import_enter_continuous_time_mode ( fmi2_import_t ∗ fmu )

Calls the FMI function fmiEnterContinuousTimeMode(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

FMI status.

5.38.2.4 FMILIB_EXPORT fmi2_status_t fmi2_import_set_time ( fmi2_import_t ∗ fmu, fmi2_real_t time )

Wrapper for the FMI function fmiSetTime(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

time Set the current time.

Generated by Doxygen

Page 244: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

176 Module Documentation

Returns

FMI status.

5.38.2.5 FMILIB_EXPORT fmi2_status_t fmi2_import_set_continuous_states ( fmi2_import_t ∗ fmu, constfmi2_real_t x[ ], size_t nx )

Wrapper for the FMI function fmiSetContinuousStates(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

x Array of state values.

nx Number of states.

Returns

FMI status.

5.38.2.6 FMILIB_EXPORT fmi2_status_t fmi2_import_completed_integrator_step ( fmi2_import_t ∗ fmu,fmi2_boolean_t noSetFMUStatePriorToCurrentPoint, fmi2_boolean_t ∗ enterEventMode, fmi2_boolean_t ∗terminateSimulation )

Wrapper for the FMI function fmiCompletedIntegratorStep(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() thathas loaded the FMI functions, see fmi2_import_create_dllfmu().

noSetFMUStatePriorToCurrentPoint True if fmiSetFMUState will no longer be called for time instants prior tocurrent time in this simulation run.

enterEventMode (Output) Call fmiEnterEventMode indicator.

terminateSimulation (Output) Terminate simulation indicator.

Returns

FMI status.

5.38.2.7 FMILIB_EXPORT fmi2_status_t fmi2_import_get_derivatives ( fmi2_import_t ∗ fmu, fmi2_real_t derivatives[ ],size_t nx )

Wrapper for the FMI function fmiGetDerivatives(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMIfunctions, see fmi2_import_create_dllfmu().

derivatives (Output) Array of the derivatives.

nx Number of derivatives. Generated by Doxygen

Page 245: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.38 FMI 2.0 (ME) Model Exchange functions 177

Returns

FMI status.

5.38.2.8 FMILIB_EXPORT fmi2_status_t fmi2_import_get_event_indicators ( fmi2_import_t ∗ fmu, fmi2_real_teventIndicators[ ], size_t ni )

Wrapper for the FMI function fmiGetEventIndicators(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMIfunctions, see fmi2_import_create_dllfmu().

eventIndicators (Output) The event indicators.

ni Number of event indicators.

Returns

FMI status.

5.38.2.9 FMILIB_EXPORT fmi2_status_t fmi2_import_get_continuous_states ( fmi2_import_t ∗ fmu, fmi2_real_tstates[ ], size_t nx )

Wrapper for the FMI function fmiGetContinuousStates(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

states (Output) Array of state values.

nx Number of states.

Returns

FMI status.

5.38.2.10 FMILIB_EXPORT fmi2_status_t fmi2_import_get_nominals_of_continuous_states ( fmi2_import_t ∗ fmu,fmi2_real_t x_nominal[ ], size_t nx )

Wrapper for the FMI function fmiGetNominalsOfContinuousStates(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMIfunctions, see fmi2_import_create_dllfmu().

x_nominal (Output) The nominal values.

nx Number of nominal values.

Generated by Doxygen

Page 246: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

178 Module Documentation

Returns

FMI status.

Generated by Doxygen

Page 247: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.39 FMI 2.0 (CS) Co-Simulation functions 179

5.39 FMI 2.0 (CS) Co-Simulation functions

List of Co-Simulation wrapper functions. Common functions are not listed.

Functions

• FMILIB_EXPORT fmi2_status_t fmi2_import_set_real_input_derivatives (fmi2_import_t ∗fmu, const fmi2_←↩

value_reference_t vr[ ], size_t nvr, const fmi2_integer_t order[ ], const fmi2_real_t value[ ])

Wrapper for the FMI function fmiSetRealInputDerivatives(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_real_output_derivatives (fmi2_import_t ∗fmu, const fmi2←↩

_value_reference_t vr[ ], size_t nvr, const fmi2_integer_t order[ ], fmi2_real_t value[ ])

Wrapper for the FMI function fmiGetOutputDerivatives(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_cancel_step (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiCancelStep(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_do_step (fmi2_import_t ∗fmu, fmi2_real_t current←↩

CommunicationPoint, fmi2_real_t communicationStepSize, fmi2_boolean_t newStep)

Wrapper for the FMI function fmiDoStep(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_status (fmi2_import_t ∗fmu, const fmi2_status_kind_t s,fmi2_status_t ∗value)

Wrapper for the FMI function fmiGetStatus(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_real_status (fmi2_import_t ∗fmu, const fmi2_status_kind←↩

_t s, fmi2_real_t ∗value)

Wrapper for the FMI function fmiGetRealStatus(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_integer_status (fmi2_import_t ∗fmu, const fmi2_status_←↩

kind_t s, fmi2_integer_t ∗value)

Wrapper for the FMI function fmiGetIntegerStatus(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_boolean_status (fmi2_import_t ∗fmu, const fmi2_status←↩

_kind_t s, fmi2_boolean_t ∗value)

Wrapper for the FMI function fmiGetBooleanStatus(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_string_status (fmi2_import_t ∗fmu, const fmi2_status_←↩

kind_t s, fmi2_string_t ∗value)

Wrapper for the FMI function fmiGetStringStatus(...)

5.39.1 Detailed Description

List of Co-Simulation wrapper functions. Common functions are not listed.

5.39.2 Function Documentation

5.39.2.1 FMILIB_EXPORT fmi2_status_t fmi2_import_set_real_input_derivatives ( fmi2_import_t ∗ fmu, constfmi2_value_reference_t vr[ ], size_t nvr, const fmi2_integer_t order[ ], const fmi2_real_t value[ ] )

Wrapper for the FMI function fmiSetRealInputDerivatives(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

order Array of derivative orders.

value Array of variable values.

Generated by Doxygen

Page 248: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

180 Module Documentation

Returns

FMI status.

5.39.2.2 FMILIB_EXPORT fmi2_status_t fmi2_import_get_real_output_derivatives ( fmi2_import_t ∗ fmu, constfmi2_value_reference_t vr[ ], size_t nvr, const fmi2_integer_t order[ ], fmi2_real_t value[ ] )

Wrapper for the FMI function fmiGetOutputDerivatives(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

order Array of derivative orders.

value (Output) Array of variable values.

Returns

FMI status.

5.39.2.3 FMILIB_EXPORT fmi2_status_t fmi2_import_cancel_step ( fmi2_import_t ∗ fmu )

Wrapper for the FMI function fmiCancelStep(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

FMI status.

5.39.2.4 FMILIB_EXPORT fmi2_status_t fmi2_import_do_step ( fmi2_import_t ∗ fmu, fmi2_real_tcurrentCommunicationPoint, fmi2_real_t communicationStepSize, fmi2_boolean_t newStep )

Wrapper for the FMI function fmiDoStep(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loadedthe FMI functions, see fmi2_import_create_dllfmu().

currentCommunicationPoint Current communication point of the master.

communicationStepSize Communication step size.

newStep Indicates whether or not the last communication step was accepted by themaster.

Generated by Doxygen

Page 249: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.39 FMI 2.0 (CS) Co-Simulation functions 181

Returns

FMI status.

5.39.2.5 FMILIB_EXPORT fmi2_status_t fmi2_import_get_status ( fmi2_import_t ∗ fmu, const fmi2_status_kind_ts, fmi2_status_t ∗ value )

Wrapper for the FMI function fmiGetStatus(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

s Kind of status to return the value for.value (Output) FMI status value.

Returns

FMI status.

5.39.2.6 FMILIB_EXPORT fmi2_status_t fmi2_import_get_real_status ( fmi2_import_t ∗ fmu, constfmi2_status_kind_t s, fmi2_real_t ∗ value )

Wrapper for the FMI function fmiGetRealStatus(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

s Kind of status to return the value for.value (Output) FMI real value.

Returns

FMI status.

5.39.2.7 FMILIB_EXPORT fmi2_status_t fmi2_import_get_integer_status ( fmi2_import_t ∗ fmu, constfmi2_status_kind_t s, fmi2_integer_t ∗ value )

Wrapper for the FMI function fmiGetIntegerStatus(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu.

s Kind of status to return the value for.value (Output) FMI integer value.

Generated by Doxygen

Page 250: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

182 Module Documentation

Returns

FMI status.

5.39.2.8 FMILIB_EXPORT fmi2_status_t fmi2_import_get_boolean_status ( fmi2_import_t ∗ fmu, constfmi2_status_kind_t s, fmi2_boolean_t ∗ value )

Wrapper for the FMI function fmiGetBooleanStatus(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu.

s Kind of status to return the value for.value (Output) FMI boolean value.

Returns

FMI status.

5.39.2.9 FMILIB_EXPORT fmi2_status_t fmi2_import_get_string_status ( fmi2_import_t ∗ fmu, constfmi2_status_kind_t s, fmi2_string_t ∗ value )

Wrapper for the FMI function fmiGetStringStatus(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

s Kind of status to return the value for.value (Output) FMI string value.

Returns

FMI status.

Generated by Doxygen

Page 251: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.40 FMI 2.0 (ME & CS) Common functions 183

5.40 FMI 2.0 (ME & CS) Common functions

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

Functions

• FMILIB_EXPORT const char ∗ fmi2_import_get_version (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiGetVersion()

• 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(...)

• FMILIB_EXPORT jm_status_enu_t fmi2_import_instantiate (fmi2_import_t ∗fmu, fmi2_string_t instance←↩

Name, fmi2_type_t fmuType, fmi2_string_t fmuResourceLocation, fmi2_boolean_t visible)

Wrapper for the FMI function fmiInstantiate(...)

• FMILIB_EXPORT void fmi2_import_free_instance (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiFreeInstance(...)

• 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(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_enter_initialization_mode (fmi2_import_t ∗fmu)

Calls the FMI function fmiEnterInitializationMode(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_exit_initialization_mode (fmi2_import_t ∗fmu)

Calls the FMI function fmiExitInitializationMode(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_terminate (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiTerminate(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_reset (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiReset(...)

• 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(...)

• 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(...)

• 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(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_set_string (fmi2_import_t ∗fmu, const fmi2_value_reference_tvr[ ], size_t nvr, const fmi2_string_t value[ ])

Wrapper for the FMI function fmiSetString(...)

• 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(...)

• 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(...)

• 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(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_string (fmi2_import_t ∗fmu, const fmi2_value_reference_tvr[ ], size_t nvr, fmi2_string_t value[ ])

Generated by Doxygen

Page 252: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

184 Module Documentation

Wrapper for the FMI function fmiGetString(...)

• FMILIB_EXPORT const char ∗ fmi2_import_get_types_platform (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiGetTypesPlatform(...)

• 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(...)

• 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(...)

• 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(...)

• 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(...)

• 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(...)

• 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(...)

• 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(...)

5.40.1 Detailed Description

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

5.40.2 Function Documentation

5.40.2.1 FMILIB_EXPORT const char∗ fmi2_import_get_version ( fmi2_import_t ∗ fmu )

Wrapper for the FMI function fmiGetVersion()

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

FMI version.

5.40.2.2 FMILIB_EXPORT fmi2_status_t fmi2_import_set_debug_logging ( fmi2_import_t ∗ fmu, fmi2_boolean_tloggingOn, size_t nCategories, fmi2_string_t categories[ ] )

Wrapper for the FMI function fmiSetDebugLogging(...)

Generated by Doxygen

Page 253: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.40 FMI 2.0 (ME & CS) Common functions 185

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMIfunctions, see fmi2_import_create_dllfmu().

loggingOn Enable or disable the debug logger.

nCategories Number of categories to log.

categories Which categories to log.

Returns

FMI status.

5.40.2.3 FMILIB_EXPORT jm_status_enu_t fmi2_import_instantiate ( fmi2_import_t ∗ fmu, fmi2_string_tinstanceName, fmi2_type_t fmuType, fmi2_string_t fmuResourceLocation, fmi2_boolean_t visible )

Wrapper for the FMI function fmiInstantiate(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded theFMI functions, see fmi2_import_create_dllfmu().

instanceName The name of the instance.fmuType fmi2_model_exchange or fmi2_cosimulation.

fmuResourceLocation Access path URI to the FMU archive resources. If this is NULL pointer the FMU willget the path to the unzipped location.

visible Indicates 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.

5.40.2.4 FMILIB_EXPORT void fmi2_import_free_instance ( fmi2_import_t ∗ fmu )

Wrapper for the FMI function fmiFreeInstance(...)

Parameters

fmu An fmu description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

5.40.2.5 FMILIB_EXPORT fmi2_status_t fmi2_import_setup_experiment ( fmi2_import_t ∗ fmu, fmi2_boolean_ttoleranceDefined, fmi2_real_t tolerance, fmi2_real_t startTime, fmi2_boolean_t stopTimeDefined, fmi2_real_tstopTime )

Calls the FMI function fmiSetupExperiment(...)

Generated by Doxygen

Page 254: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

186 Module Documentation

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMIfunctions, see fmi2_import_create_dllfmu().

tolerance_defined True if the tolerance argument is to be used

tolerance Solvers internal to the FMU should use this tolerance or finer, if tolerance_definedis true

start_time Start time of the experiment

stop_time_defined True if the stop_time argument is to be used

stop_time Stop time of the experiment, if stop_time_defined is true

Returns

FMI status.

5.40.2.6 FMILIB_EXPORT fmi2_status_t fmi2_import_enter_initialization_mode ( fmi2_import_t ∗ fmu )

Calls the FMI function fmiEnterInitializationMode(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

FMI status.

5.40.2.7 FMILIB_EXPORT fmi2_status_t fmi2_import_exit_initialization_mode ( fmi2_import_t ∗ fmu )

Calls the FMI function fmiExitInitializationMode(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

FMI status.

5.40.2.8 FMILIB_EXPORT fmi2_status_t fmi2_import_terminate ( fmi2_import_t ∗ fmu )

Wrapper for the FMI function fmiTerminate(...)

Generated by Doxygen

Page 255: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.40 FMI 2.0 (ME & CS) Common functions 187

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

FMI status.

5.40.2.9 FMILIB_EXPORT fmi2_status_t fmi2_import_reset ( fmi2_import_t ∗ fmu )

Wrapper for the FMI function fmiReset(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

FMI status.

5.40.2.10 FMILIB_EXPORT fmi2_status_t fmi2_import_set_real ( fmi2_import_t ∗ fmu, const fmi2_value_reference_tvr[ ], size_t nvr, const fmi2_real_t value[ ] )

Wrapper for the FMI function fmiSetReal(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value Array of variable values.

Returns

FMI status.

5.40.2.11 FMILIB_EXPORT fmi2_status_t fmi2_import_set_integer ( fmi2_import_t ∗ fmu, constfmi2_value_reference_t vr[ ], size_t nvr, const fmi2_integer_t value[ ] )

Wrapper for the FMI function fmiSetInteger(...)

Generated by Doxygen

Page 256: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

188 Module Documentation

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value Array of variable values.

Returns

FMI status.

5.40.2.12 FMILIB_EXPORT fmi2_status_t fmi2_import_set_boolean ( fmi2_import_t ∗ fmu, constfmi2_value_reference_t vr[ ], size_t nvr, const fmi2_boolean_t value[ ] )

Wrapper for the FMI function fmiSetBoolean(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value Array of variable values.

Returns

FMI status.

5.40.2.13 FMILIB_EXPORT fmi2_status_t fmi2_import_set_string ( fmi2_import_t ∗ fmu, constfmi2_value_reference_t vr[ ], size_t nvr, const fmi2_string_t value[ ] )

Wrapper for the FMI function fmiSetString(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value Array of variable values.

Returns

FMI status.

Generated by Doxygen

Page 257: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.40 FMI 2.0 (ME & CS) Common functions 189

5.40.2.14 FMILIB_EXPORT fmi2_status_t fmi2_import_get_real ( fmi2_import_t ∗ fmu, const fmi2_value_reference_tvr[ ], size_t nvr, fmi2_real_t value[ ] )

Wrapper for the FMI function fmiGetReal(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value (Output)Array of variable values.

Returns

FMI status.

5.40.2.15 FMILIB_EXPORT fmi2_status_t fmi2_import_get_integer ( fmi2_import_t ∗ fmu, constfmi2_value_reference_t vr[ ], size_t nvr, fmi2_integer_t value[ ] )

Wrapper for the FMI function fmiGetInteger(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value (Output)Array of variable values.

Returns

FMI status.

5.40.2.16 FMILIB_EXPORT fmi2_status_t fmi2_import_get_boolean ( fmi2_import_t ∗ fmu, constfmi2_value_reference_t vr[ ], size_t nvr, fmi2_boolean_t value[ ] )

Wrapper for the FMI function fmiGetBoolean(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value (Output)Array of variable values.

Generated by Doxygen

Page 258: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

190 Module Documentation

Returns

FMI status.

5.40.2.17 FMILIB_EXPORT fmi2_status_t fmi2_import_get_string ( fmi2_import_t ∗ fmu, constfmi2_value_reference_t vr[ ], size_t nvr, fmi2_string_t value[ ] )

Wrapper for the FMI function fmiGetString(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

vr Array of value references.

nvr Number of array elements.

value (Output)Array of variable values.

Returns

FMI status.

5.40.2.18 FMILIB_EXPORT const char∗ fmi2_import_get_types_platform ( fmi2_import_t ∗ fmu )

Wrapper for the FMI function fmiGetTypesPlatform(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Returns

The platform the FMU was compiled for.

5.40.2.19 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

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

s The state object to be set by the FMU

Generated by Doxygen

Page 259: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.40 FMI 2.0 (ME & CS) Common functions 191

Returns

FMI status.

5.40.2.20 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

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

s The FMU state object

Returns

FMI status.

5.40.2.21 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

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

s The FMU state object

Returns

FMI status.

5.40.2.22 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

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

s The FMU state object

sz The size of the serialized state in bytes

Generated by Doxygen

Page 260: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

192 Module Documentation

Returns

FMI status.

5.40.2.23 FMILIB_EXPORT fmi2_status_t fmi2_import_serialize_fmu_state ( fmi2_import_t ∗ fmu, fmi2_FMU_state_ts, fmi2_byte_t data[ ], size_t sz )

Wrapper for the FMI function fmiSerializeFMUstate(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

s The FMU state object

data The buffer that will receive serialized FMU statesz The size of the data buffer

Returns

FMI status.

5.40.2.24 FMILIB_EXPORT fmi2_status_t fmi2_import_de_serialize_fmu_state ( fmi2_import_t ∗ fmu, constfmi2_byte_t data[ ], size_t sz, fmi2_FMU_state_t ∗ s )

Wrapper for the FMI function fmiSerializeFMUstate(...)

Parameters

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

data The buffer that contains serialized FMU statesz The size of the data buffers The FMU state object to be created

Returns

FMI status.

5.40.2.25 FMILIB_EXPORT fmi2_status_t fmi2_import_get_directional_derivative ( fmi2_import_t ∗ fmu, constfmi2_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

fmu A model description object returned by fmi2_import_parse_xml() that has loaded the FMI functions, seefmi2_import_create_dllfmu().

Generated by Doxygen

Page 261: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.40 FMI 2.0 (ME & CS) Common functions 193

Parameters

v_ref Value references for the seed vectornv size of v_ref array

z_ref Value references for the derivatives/outputs to be processed

nz Size of z_ref array

dv The seed vector.dz Calculated directional derivative on output.

Returns

FMI status.

Generated by Doxygen

Page 262: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

194 Module Documentation

5.41 Convenience functions.

The functions in this module are provided for convenience. The functionality is already available via other lower levelfunctions.

Data Structures

• struct fmi2_import_model_counts_t

Collection of counters providing model information.

Functions

• FMILIB_EXPORT void fmi2_import_collect_model_counts (fmi2_import_t ∗fmu, fmi2_import_model_←↩

counts_t ∗counts)

Collect model information by counting the number of variables with specific properties and fillinf in fmi2_import_←↩

model_counts_t struct.

• FMILIB_EXPORT void fmi2_import_expand_variable_references (fmi2_import_t ∗fmu, const char ∗msgIn,char ∗msgOut, size_t maxMsgSize)

Print msgIn into msgOut by expanding variable references of the form #<Type><VR># into variable names andreplacing '##' with a single #.

• FMILIB_EXPORT void fmi2_log_forwarding (fmi2_component_t c, fmi2_string_t instanceName, fmi2_←↩

status_t status, fmi2_string_t category, fmi2_string_t message,...)

An implementation of FMI 2.0 logger that forwards the messages to logger function inside jm_callbacks structure.

• FMILIB_EXPORT void fmi2_log_forwarding_v (fmi2_component_t c, fmi2_string_t instanceName, fmi2_←↩

status_t status, fmi2_string_t category, fmi2_string_t message, va_list args)

An implementation of FMI 2.0 logger that forwards the messages to logger function inside jm_callbacks structure.

• FMILIB_EXPORT void fmi2_default_callback_logger (fmi2_component_t c, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...)

Default FMI 2.0 logger may be used when instantiating FMUs.

• FMILIB_EXPORT void fmi2_import_init_logger (jm_callbacks ∗cb, fmi2_callback_functions_t ∗fmiCallbacks)

Given fmi2_callback_functions_t logger (fmi2_logger), the jm_callbacks logger may be setup to redirect the messagesto the fmi2_logger.

5.41.1 Detailed Description

The functions in this module are provided for convenience. The functionality is already available via other lower levelfunctions.

5.41.2 Function Documentation

5.41.2.1 FMILIB_EXPORT void fmi2_import_collect_model_counts ( fmi2_import_t ∗ fmu,fmi2_import_model_counts_t ∗ counts )

Collect model information by counting the number of variables with specific properties and fillinf in fmi2_import_←↩

model_counts_t struct.

Generated by Doxygen

Page 263: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.41 Convenience functions. 195

Parameters

fmu - An fmu object as returned by fmi2_import_parse_xml().

counts - a pointer to a preallocated struct.

5.41.2.2 FMILIB_EXPORT void fmi2_import_expand_variable_references ( fmi2_import_t ∗ fmu, const char ∗ msgIn,char ∗ msgOut, size_t maxMsgSize )

Print msgIn into msgOut by expanding variable references of the form #<Type><VR># into variable names andreplacing '##' with a single #.

Parameters

fmu - An fmu object as returned by fmi2_import_parse_xml().

msgIn - Log message as produced by an FMU.

msgOut - Output message buffer.

maxMsgSize - maximum message size

5.41.2.3 FMILIB_EXPORT void fmi2_log_forwarding ( fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_tstatus, fmi2_string_t category, fmi2_string_t message, ... )

An implementation of FMI 2.0 logger that forwards the messages to logger function inside jm_callbacks structure.

The function is using a global array of active FMUs to find out which FMU is sending the log messege. It thenforwards the message to the logger connected to the particular fmi2_import_t struct. The function is called by theFMU. The FMU must be loaded with non-zero registerGlobally parameter of fmi2_import_create_dllfmu() in order towork. If no matching fmi2_import_t struct is found on the global list then jm_get_default_callbacks() is used to getthe default logger. Note that this function is not thread safe due to the use of the global list.

5.41.2.4 FMILIB_EXPORT void fmi2_log_forwarding_v ( fmi2_component_t c, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message, va_list args )

An implementation of FMI 2.0 logger that forwards the messages to logger function inside jm_callbacks structure.

See fmi2_log_forwarding() for more information.

5.41.2.5 FMILIB_EXPORT void fmi2_default_callback_logger ( fmi2_component_t c, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message, ... )

Default FMI 2.0 logger may be used when instantiating FMUs.

5.41.2.6 FMILIB_EXPORT void fmi2_import_init_logger ( jm_callbacks ∗ cb, fmi2_callback_functions_t ∗fmiCallbacks )

Given fmi2_callback_functions_t logger (fmi2_logger), the jm_callbacks logger may be setup to redirect the mes-sages to the fmi2_logger.

The functions sets up the redirection. Note that the context field in jm_callbacks is set to point to the providedfmi2_callback_functions_t.

Generated by Doxygen

Page 264: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

196 Module Documentation

Parameters

cb FMI Library callbacks

fmiCallbacks FMI 2.0 standard callbacks

Generated by Doxygen

Page 265: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.42 Support for processing variable types 197

5.42 Support for processing variable types

Functions

• FMILIB_EXPORT unsigned int fmi2_import_get_type_definition_number (fmi2_import_type_definitions_←↩

t ∗td)

Get the number of available type definitions.

• FMILIB_EXPORT fmi2_import_variable_typedef_t ∗ fmi2_import_get_typedef (fmi2_import_type_←↩

definitions_t ∗td, unsigned int index)

Get a type definition specified by the index.

• FMILIB_EXPORT fmi2_import_display_unit_t ∗ fmi2_import_get_type_display_unit (fmi2_import_real_←↩

typedef_t ∗)

Get associated display unit for a type defition if any.

• FMILIB_EXPORT const char ∗ fmi2_import_get_type_name (fmi2_import_variable_typedef_t ∗)

Get the type name.

• FMILIB_EXPORT const char ∗ fmi2_import_get_type_description (fmi2_import_variable_typedef_t ∗)

Get type description.

• FMILIB_EXPORT fmi2_base_type_enu_t fmi2_import_get_base_type (fmi2_import_variable_typedef_t ∗)

Get base type used for the type definition.

• FMILIB_EXPORT fmi2_import_real_typedef_t ∗ fmi2_import_get_type_as_real (fmi2_import_variable_←↩

typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT fmi2_import_integer_typedef_t ∗ fmi2_import_get_type_as_int (fmi2_import_variable_←↩

typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT fmi2_import_enumeration_typedef_t ∗ fmi2_import_get_type_as_enum (fmi2_import_←↩

variable_typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT const char ∗ fmi2_import_get_type_quantity (fmi2_import_variable_typedef_t ∗)

Get the quantity associated with the type definition.

• FMILIB_EXPORT double fmi2_import_get_real_type_min (fmi2_import_real_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT double fmi2_import_get_real_type_max (fmi2_import_real_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT double fmi2_import_get_real_type_nominal (fmi2_import_real_typedef_t ∗)

Get the nominal value associated with the type definition.

• FMILIB_EXPORT fmi2_import_unit_t ∗ fmi2_import_get_real_type_unit (fmi2_import_real_typedef_t ∗)

Get the unit object associated with the type definition if any.

• FMILIB_EXPORT int fmi2_import_get_real_type_is_relative_quantity (fmi2_import_real_typedef_t ∗)

Get the 'relativeQuantity' flag.

• FMILIB_EXPORT int fmi2_import_get_real_type_is_unbounded (fmi2_import_real_typedef_t ∗)

Get the 'unbounded' flag.

• FMILIB_EXPORT int fmi2_import_get_integer_type_min (fmi2_import_integer_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT int fmi2_import_get_integer_type_max (fmi2_import_integer_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_min (fmi2_import_enumeration_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_max (fmi2_import_enumeration_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_size (fmi2_import_enumeration_typedef_t ∗)

Generated by Doxygen

Page 266: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

198 Module Documentation

Get the number of elements in the enum.

• FMILIB_EXPORT const char ∗ fmi2_import_get_enum_type_item_name (fmi2_import_enumeration_←↩

typedef_t ∗, unsigned int item)

Get an enumeration item name by index.

• FMILIB_EXPORT int fmi2_import_get_enum_type_item_value (fmi2_import_enumeration_typedef_t ∗, un-signed int item)

Get an enumeration item value by index.

• FMILIB_EXPORT const char ∗ fmi2_import_get_enum_type_item_description (fmi2_import_enumeration_←↩

typedef_t ∗, unsigned int item)

Get an enumeration item description by index.

• FMILIB_EXPORT const char ∗ fmi2_import_get_enum_type_value_name (fmi2_import_enumeration_←↩

typedef_t ∗t, int value)

Get an enumeration item name for the given value.

Type definitions supporting structures

• typedef struct fmi2_xml_real_typedef_t fmi2_import_real_typedef_t

Opaque type definition object.

• typedef struct fmi2_xml_integer_typedef_t fmi2_import_integer_typedef_t

Opaque integer type definition object.

• typedef struct fmi2_xml_enumeration_typedef_t fmi2_import_enumeration_typedef_t

Opaque enumeration type definition object.

• typedef struct fmi2_xml_variable_typedef_t fmi2_import_variable_typedef_t

Opaque general variable type definition object.

• typedef struct fmi2_xml_type_definitions_t fmi2_import_type_definitions_t

Opaque list of the type definitions in the model.

5.42.1 Detailed Description

5.42.2 Typedef Documentation

5.42.2.1 typedef struct fmi2_xml_real_typedef_t fmi2_import_real_typedef_t

Opaque type definition object.

Definition at line 42 of file fmi2_import_type.h.

5.42.2.2 typedef struct fmi2_xml_integer_typedef_t fmi2_import_integer_typedef_t

Opaque integer type definition object.

Definition at line 44 of file fmi2_import_type.h.

5.42.2.3 typedef struct fmi2_xml_enumeration_typedef_t fmi2_import_enumeration_typedef_t

Opaque enumeration type definition object.

Definition at line 46 of file fmi2_import_type.h.

Generated by Doxygen

Page 267: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.42 Support for processing variable types 199

5.42.2.4 typedef struct fmi2_xml_variable_typedef_t fmi2_import_variable_typedef_t

Opaque general variable type definition object.

Definition at line 48 of file fmi2_import_type.h.

5.42.2.5 typedef struct fmi2_xml_type_definitions_t fmi2_import_type_definitions_t

Opaque list of the type definitions in the model.

Definition at line 50 of file fmi2_import_type.h.

5.42.3 Function Documentation

5.42.3.1 FMILIB_EXPORT unsigned int fmi2_import_get_type_definition_number ( fmi2_import_type_definitions_t ∗td )

Get the number of available type definitions.

5.42.3.2 FMILIB_EXPORT fmi2_import_variable_typedef_t∗ fmi2_import_get_typedef (fmi2_import_type_definitions_t ∗ td, unsigned int index )

Get a type definition specified by the index.

Parameters

td the type definition list object

index the index of type definition. Must be less than the numbere returned byfmi2_import_get_type_definition_number()

Returns

A type definition object or NULL if index is out of range.

5.42.3.3 FMILIB_EXPORT fmi2_import_display_unit_t ∗ fmi2_import_get_type_display_unit (fmi2_import_real_typedef_t ∗ )

Get associated display unit for a type defition if any.

Get display unit associated with a real type definition.

Returns

Display unit object of NULL if none was given.

Generated by Doxygen

Page 268: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

200 Module Documentation

5.42.3.4 FMILIB_EXPORT const char∗ fmi2_import_get_type_name ( fmi2_import_variable_typedef_t ∗ )

Get the type name.

5.42.3.5 FMILIB_EXPORT const char∗ fmi2_import_get_type_description ( fmi2_import_variable_typedef_t ∗ )

Get type description.

Note that an empty string is returned if the attribute is not present in the XML.

5.42.3.6 FMILIB_EXPORT fmi2_base_type_enu_t fmi2_import_get_base_type ( fmi2_import_variable_typedef_t∗ )

Get base type used for the type definition.

5.42.3.7 FMILIB_EXPORT fmi2_import_real_typedef_t∗ fmi2_import_get_type_as_real (fmi2_import_variable_typedef_t ∗ )

Cast the general type definition object to an object with a specific base type.

Returns

Pointer to the specific type object or NULL if base type does not match.

5.42.3.8 FMILIB_EXPORT fmi2_import_integer_typedef_t∗ fmi2_import_get_type_as_int (fmi2_import_variable_typedef_t ∗ )

Cast the general type definition object to an object with a specific base type.

Returns

Pointer to the specific type object or NULL if base type does not match.

5.42.3.9 FMILIB_EXPORT fmi2_import_enumeration_typedef_t∗ fmi2_import_get_type_as_enum (fmi2_import_variable_typedef_t ∗ )

Cast the general type definition object to an object with a specific base type.

Returns

Pointer to the specific type object or NULL if base type does not match.

Generated by Doxygen

Page 269: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.42 Support for processing variable types 201

5.42.3.10 FMILIB_EXPORT const char∗ fmi2_import_get_type_quantity ( fmi2_import_variable_typedef_t ∗ )

Get the quantity associated with the type definition.

Returns

NULL-pointer is always returned for strings and booleans. Empty string is returned if attribute is not presentfor other types.

5.42.3.11 FMILIB_EXPORT double fmi2_import_get_real_type_min ( fmi2_import_real_typedef_t ∗ )

Get minimal value for the type.

Returns

Either the value specified in the XML file or negated DBL_MAX as defined in <float.h>

5.42.3.12 FMILIB_EXPORT double fmi2_import_get_real_type_max ( fmi2_import_real_typedef_t ∗ )

Get maximum value for the type.

Returns

Either the value specified in the XML file or DBL_MAX as defined in <float.h>

5.42.3.13 FMILIB_EXPORT double fmi2_import_get_real_type_nominal ( fmi2_import_real_typedef_t ∗ )

Get the nominal value associated with the type definition.

5.42.3.14 FMILIB_EXPORT fmi2_import_unit_t∗ fmi2_import_get_real_type_unit ( fmi2_import_real_typedef_t ∗ )

Get the unit object associated with the type definition if any.

5.42.3.15 FMILIB_EXPORT int fmi2_import_get_real_type_is_relative_quantity ( fmi2_import_real_typedef_t ∗ )

Get the 'relativeQuantity' flag.

5.42.3.16 FMILIB_EXPORT int fmi2_import_get_real_type_is_unbounded ( fmi2_import_real_typedef_t ∗ )

Get the 'unbounded' flag.

Generated by Doxygen

Page 270: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

202 Module Documentation

5.42.3.17 FMILIB_EXPORT int fmi2_import_get_integer_type_min ( fmi2_import_integer_typedef_t ∗ )

Get minimal value for the type.

Returns

Either the value specified in the XML file or INT_MIN as defined in <limits.h>

5.42.3.18 FMILIB_EXPORT int fmi2_import_get_integer_type_max ( fmi2_import_integer_typedef_t ∗ )

Get maximum value for the type.

Returns

Either the value specified in the XML file or INT_MAX as defined in <limits.h>

5.42.3.19 FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_min ( fmi2_import_enumeration_typedef_t ∗)

Get minimal value for the type.

Returns

Either the value specified in the XML file or 0

5.42.3.20 FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_max ( fmi2_import_enumeration_typedef_t ∗)

Get maximum value for the type.

Returns

Either the value specified in the XML file or INT_MAX as defined in <limits.h>

5.42.3.21 FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_size ( fmi2_import_enumeration_typedef_t ∗)

Get the number of elements in the enum.

5.42.3.22 FMILIB_EXPORT const char∗ fmi2_import_get_enum_type_item_name ( fmi2_import_enumeration_←↩

typedef_t ∗ , unsigned int item )

Get an enumeration item name by index.

Generated by Doxygen

Page 271: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.42 Support for processing variable types 203

5.42.3.23 FMILIB_EXPORT int fmi2_import_get_enum_type_item_value ( fmi2_import_enumeration_typedef_t ∗ ,unsigned int item )

Get an enumeration item value by index.

5.42.3.24 FMILIB_EXPORT const char∗ fmi2_import_get_enum_type_item_description (fmi2_import_enumeration_typedef_t ∗ , unsigned int item )

Get an enumeration item description by index.

5.42.3.25 FMILIB_EXPORT const char∗ fmi2_import_get_enum_type_value_name ( fmi2_import_enumeration_←↩

typedef_t ∗ t, int value )

Get an enumeration item name for the given value.

Generated by Doxygen

Page 272: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

204 Module Documentation

5.43 Functions for handling unit definitions.

Functions

• FMILIB_EXPORT unsigned int fmi2_import_get_unit_definitions_number (fmi2_import_unit_definitions_t ∗)

Get the number of unit definitions.

• FMILIB_EXPORT fmi2_import_unit_t ∗ fmi2_import_get_unit (fmi2_import_unit_definitions_t ∗, unsigned intindex)

Get a unit definition.

• FMILIB_EXPORT const char ∗ fmi2_import_get_unit_name (fmi2_import_unit_t ∗)

Get a unit name.

• FMILIB_EXPORT unsigned int fmi2_import_get_unit_display_unit_number (fmi2_import_unit_t ∗)

Get the number of display units associated with this unit.

• FMILIB_EXPORT const int ∗ fmi2_import_get_SI_unit_exponents (fmi2_import_unit_t ∗)

Get fmi2_SI_base_units_Num SI base units exponents associated with the unit.

• FMILIB_EXPORT double fmi2_import_get_SI_unit_factor (fmi2_import_unit_t ∗)

Get factor to the corresponding SI base units.

• FMILIB_EXPORT double fmi2_import_get_SI_unit_offset (fmi2_import_unit_t ∗)

Get offset to the corresponding SI base units.

• FMILIB_EXPORT double fmi2_import_convert_to_SI_base_unit (double, fmi2_import_unit_t ∗)

Convert a value with respect to the unit to the value with respect to the SI base unit.

• FMILIB_EXPORT double fmi2_import_convert_from_SI_base_unit (double, fmi2_import_unit_t ∗)

Convert a value with respect to the SI base unit to the value with respect to the unit.

• FMILIB_EXPORT fmi2_import_display_unit_t ∗ fmi2_import_get_unit_display_unit (fmi2_import_unit_t ∗,size_t index)

Get a display unit object by index.

• FMILIB_EXPORT fmi2_import_unit_t ∗ fmi2_import_get_base_unit (fmi2_import_display_unit_t ∗)

Get unit defition for a display unit.

• FMILIB_EXPORT const char ∗ fmi2_import_get_display_unit_name (fmi2_import_display_unit_t ∗)

Get display unit name.

• FMILIB_EXPORT fmi2_real_t fmi2_import_get_display_unit_factor (fmi2_import_display_unit_t ∗)

Get the "factor" associated with the display unit.

• FMILIB_EXPORT fmi2_real_t fmi2_import_get_display_unit_offset (fmi2_import_display_unit_t ∗)

Get the "offset" associated with the display unit.

• FMILIB_EXPORT fmi2_real_t fmi2_import_convert_to_display_unit (fmi2_real_t value, fmi2_import_←↩

display_unit_t ∗du, int isRelativeQuantity)

Convert a value measured in "units" to a value measured with "display units".

• FMILIB_EXPORT fmi2_real_t fmi2_import_convert_from_display_unit (fmi2_real_t value, fmi2_import_←↩

display_unit_t ∗du, int isRelativeQuantity)

Convert a value measured in "display units" to a value measured with "units".

Structures encapsulating unit information

• typedef struct fmi2_xml_unit_t fmi2_import_unit_t

A variable unit defined with a unit defition.

• typedef struct fmi2_xml_display_unit_t fmi2_import_display_unit_t

A display unit.

• typedef struct fmi2_xml_unit_definitions_t fmi2_import_unit_definitions_t

The list of all the unit definitions in the model.

Generated by Doxygen

Page 273: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.43 Functions for handling unit definitions. 205

5.43.1 Detailed Description

5.43.2 Typedef Documentation

5.43.2.1 typedef struct fmi2_xml_unit_t fmi2_import_unit_t

A variable unit defined with a unit defition.

Definition at line 41 of file fmi2_import_unit.h.

5.43.2.2 typedef struct fmi2_xml_display_unit_t fmi2_import_display_unit_t

A display unit.

Definition at line 43 of file fmi2_import_unit.h.

5.43.2.3 typedef struct fmi2_xml_unit_definitions_t fmi2_import_unit_definitions_t

The list of all the unit definitions in the model.

Definition at line 45 of file fmi2_import_unit.h.

5.43.3 Function Documentation

5.43.3.1 FMILIB_EXPORT unsigned int fmi2_import_get_unit_definitions_number ( fmi2_import_unit_definitions_t ∗)

Get the number of unit definitions.

5.43.3.2 FMILIB_EXPORT fmi2_import_unit_t∗ fmi2_import_get_unit ( fmi2_import_unit_definitions_t ∗ ,unsigned int index )

Get a unit definition.

5.43.3.3 FMILIB_EXPORT const char∗ fmi2_import_get_unit_name ( fmi2_import_unit_t ∗ )

Get a unit name.

5.43.3.4 FMILIB_EXPORT unsigned int fmi2_import_get_unit_display_unit_number ( fmi2_import_unit_t ∗ )

Get the number of display units associated with this unit.

Generated by Doxygen

Page 274: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

206 Module Documentation

5.43.3.5 FMILIB_EXPORT const int∗ fmi2_import_get_SI_unit_exponents ( fmi2_import_unit_t ∗ )

Get fmi2_SI_base_units_Num SI base units exponents associated with the unit.

5.43.3.6 FMILIB_EXPORT double fmi2_import_get_SI_unit_factor ( fmi2_import_unit_t ∗ )

Get factor to the corresponding SI base units.

5.43.3.7 FMILIB_EXPORT double fmi2_import_get_SI_unit_offset ( fmi2_import_unit_t ∗ )

Get offset to the corresponding SI base units.

5.43.3.8 FMILIB_EXPORT double fmi2_import_convert_to_SI_base_unit ( double , fmi2_import_unit_t ∗ )

Convert a value with respect to the unit to the value with respect to the SI base unit.

5.43.3.9 FMILIB_EXPORT double fmi2_import_convert_from_SI_base_unit ( double , fmi2_import_unit_t ∗ )

Convert a value with respect to the SI base unit to the value with respect to the unit.

5.43.3.10 FMILIB_EXPORT fmi2_import_display_unit_t∗ fmi2_import_get_unit_display_unit ( fmi2_import_unit_t∗ , size_t index )

Get a display unit object by index.

Parameters

index The index of display unit to be returned. Must be less than the number returned byfmi2_import_get_unit_display_unit_number()

5.43.3.11 FMILIB_EXPORT fmi2_import_unit_t∗ fmi2_import_get_base_unit ( fmi2_import_display_unit_t ∗ )

Get unit defition for a display unit.

5.43.3.12 FMILIB_EXPORT const char∗ fmi2_import_get_display_unit_name ( fmi2_import_display_unit_t ∗ )

Get display unit name.

5.43.3.13 FMILIB_EXPORT fmi2_real_t fmi2_import_get_display_unit_factor ( fmi2_import_display_unit_t ∗ )

Get the "factor" associated with the display unit.

Generated by Doxygen

Page 275: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.43 Functions for handling unit definitions. 207

5.43.3.14 FMILIB_EXPORT fmi2_real_t fmi2_import_get_display_unit_offset ( fmi2_import_display_unit_t ∗ )

Get the "offset" associated with the display unit.

5.43.3.15 FMILIB_EXPORT fmi2_real_t fmi2_import_convert_to_display_unit ( fmi2_real_t value,fmi2_import_display_unit_t ∗ du, int isRelativeQuantity )

Convert a value measured in "units" to a value measured with "display units".

Parameters

value The value to be converted.du The display unit object

isRelativeQuantity specifies if "offset" should be incorporated into conversion

5.43.3.16 FMILIB_EXPORT fmi2_real_t fmi2_import_convert_from_display_unit ( fmi2_real_t value,fmi2_import_display_unit_t ∗ du, int isRelativeQuantity )

Convert a value measured in "display units" to a value measured with "units".

Parameters

value The value to be converted.du The display unit object

isRelativeQuantity specifies if "offset" should be incorporated into conversion

Generated by Doxygen

Page 276: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

208 Module Documentation

5.44 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 beobtained via a Handling of variable lists module or via functions fmi2_import_get_variable_by_name() and fmi2_←↩

import_get_variable_by_vr().

Functions

• 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.

• 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.

• 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.

• FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_canHandleMultipleSetPerTimeInstant (fmi2_import_←↩

variable_t ∗v)

Get the canHandleMultipleSetPerTimeInstant flag for a variable.

• 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.

• 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.

• 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.

• 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.

• 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.

• FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_start (fmi2_import_real_variable_t ∗v)

Get the variable start attribute.

• FMILIB_EXPORT fmi2_import_real_variable_t ∗ fmi2_import_get_real_variable_derivative_of (fmi2_←↩

import_real_variable_t ∗v)

Generated by Doxygen

Page 277: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.44 Functions for handling variable definitions. 209

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

• 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.

• FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_max (fmi2_import_real_variable_t ∗v)

Get maximum value for the variable.

• FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_min (fmi2_import_real_variable_t ∗v)

Get minimal value for the variable.

• 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.

Scalar variable types

• typedef struct fmi2_xml_variable_t fmi2_import_variable_t

General variable type.

• typedef struct fmi2_xml_real_variable_t fmi2_import_real_variable_t

Opaque real variable.

• typedef struct fmi2_xml_integer_variable_t fmi2_import_integer_variable_t

Opaque integer variable.

• typedef struct fmi2_xml_string_variable_t fmi2_import_string_variable_t

Opaque string variable.

• typedef struct fmi2_xml_enum_variable_t fmi2_import_enum_variable_t

Opaque enumeration variable.

• typedef struct fmi2_xml_bool_variable_t fmi2_import_bool_variable_t

Opaque boolean variable.

• typedef struct fmi2_import_variable_list_t fmi2_import_variable_list_t

List of variables.

Generated by Doxygen

Page 278: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

210 Module Documentation

5.44.1 Detailed Description

All the functions in this group take a pointer to fmi2_import_variable_t as a parameter. A variable pointer may beobtained via a Handling of variable lists module or via functions fmi2_import_get_variable_by_name() and fmi2_←↩

import_get_variable_by_vr().

5.44.2 Typedef Documentation

5.44.2.1 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 supportspecific attributes.

Definition at line 51 of file fmi2_import_variable.h.

5.44.2.2 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.

5.44.2.3 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.

5.44.2.4 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.

5.44.2.5 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.

5.44.2.6 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.

Generated by Doxygen

Page 279: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.44 Functions for handling variable definitions. 211

5.44.2.7 typedef struct fmi2_import_variable_list_t fmi2_import_variable_list_t

List of variables.

Definition at line 63 of file fmi2_import_variable.h.

5.44.3 Function Documentation

5.44.3.1 FMILIB_EXPORT const char∗ fmi2_import_get_variable_name ( fmi2_import_variable_t ∗ )

Get the variable name.

5.44.3.2 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.

5.44.3.3 FMILIB_EXPORT fmi2_value_reference_t fmi2_import_get_variable_vr ( fmi2_import_variable_t ∗ )

Get variable value reference.

5.44.3.4 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.

5.44.3.5 FMILIB_EXPORT fmi2_base_type_enu_t fmi2_import_get_variable_base_type ( fmi2_import_variable_t ∗)

Get variable base type.

5.44.3.6 FMILIB_EXPORT int fmi2_import_get_variable_has_start ( fmi2_import_variable_t ∗ )

Check if the variable has "start" attribute.

Generated by Doxygen

Page 280: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

212 Module Documentation

5.44.3.7 FMILIB_EXPORT fmi2_variability_enu_t fmi2_import_get_variability ( fmi2_import_variable_t ∗ )

Get variability attribute.

5.44.3.8 FMILIB_EXPORT fmi2_causality_enu_t fmi2_import_get_causality ( fmi2_import_variable_t ∗ )

Get causality attribute.

5.44.3.9 FMILIB_EXPORT fmi2_initial_enu_t fmi2_import_get_initial ( fmi2_import_variable_t ∗ )

Get initial attribute.

5.44.3.10 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.

5.44.3.11 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.

5.44.3.12 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

5.44.3.13 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

Generated by Doxygen

Page 281: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.44 Functions for handling variable definitions. 213

5.44.3.14 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

5.44.3.15 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

5.44.3.16 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

5.44.3.17 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.

5.44.3.18 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.

Generated by Doxygen

Page 282: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

214 Module Documentation

5.44.3.19 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.

5.44.3.20 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>

5.44.3.21 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>

5.44.3.22 FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_nominal ( fmi2_import_real_variable_t ∗ v )

Get nominal value for the variable.

5.44.3.23 FMILIB_EXPORT fmi2_import_unit_t∗ fmi2_import_get_real_variable_unit (fmi2_import_real_variable_t ∗ v )

Get associated "unit" object if any.

5.44.3.24 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.

5.44.3.25 FMILIB_EXPORT const char∗ fmi2_import_get_string_variable_start ( fmi2_import_string_variable_t ∗ v )

Get start value for the variable.

Generated by Doxygen

Page 283: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5.44 Functions for handling variable definitions. 215

5.44.3.26 FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_boolean_variable_start ( fmi2_import_bool_variable_t ∗v )

Get start value for the variable.

5.44.3.27 FMILIB_EXPORT int fmi2_import_get_integer_variable_start ( fmi2_import_integer_variable_t ∗ v )

Get start value for the variable.

5.44.3.28 FMILIB_EXPORT int fmi2_import_get_integer_variable_min ( fmi2_import_integer_variable_t ∗ v )

Get minimal value for the variable.

5.44.3.29 FMILIB_EXPORT int fmi2_import_get_integer_variable_max ( fmi2_import_integer_variable_t ∗ v )

Get max value for the variable.

5.44.3.30 FMILIB_EXPORT int fmi2_import_get_enum_variable_start ( fmi2_import_enum_variable_t ∗ v )

Get start value for the variable.

5.44.3.31 FMILIB_EXPORT int fmi2_import_get_enum_variable_min ( fmi2_import_enum_variable_t ∗ v )

Get minimal value for the variable.

5.44.3.32 FMILIB_EXPORT int fmi2_import_get_enum_variable_max ( fmi2_import_enum_variable_t ∗ v )

Get max value for the variable.

5.44.3.33 FMILIB_EXPORT fmi2_variable_alias_kind_enu_t fmi2_import_get_variable_alias_kind (fmi2_import_variable_t ∗ )

Get the variable alias kind.

5.44.3.34 FMILIB_EXPORT size_t fmi2_import_get_variable_original_order ( fmi2_import_variable_t ∗ v )

Get the original index in xml of the variable.

Generated by Doxygen

Page 284: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

216 Module Documentation

Generated by Doxygen

Page 285: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 6

Data Structure Documentation

6.1 component_t Struct Reference

#include <fmu1_model.h>

Data Fields

• fmiReal states [N_STATES]• fmiReal states_nom [N_STATES]• fmiValueReference states_vr [N_STATES]• fmiReal states_der [N_STATES]• fmiReal event_indicators [N_EVENT_INDICATORS]• fmiReal reals [N_REAL]• fmiInteger integers [N_INTEGER]• fmiBoolean booleans [N_BOOLEAN]• fmiString strings [N_STRING]• fmiBoolean loggingOn• char instanceName [BUFFER]• char GUID [BUFFER]• fmiCallbackFunctions functions• fmiReal fmitime• fmiBoolean callEventUpdate• fmiBoolean toleranceControlled• fmiReal relativeTolerance• fmiEventInfo eventInfo• fmiReal states_prev [N_STATES]• char fmuLocation [BUFFER]• char mimeType [BUFFER]• fmiReal timeout• fmiBoolean visible• fmiBoolean interactive• fmiReal tStart• fmiBoolean StopTimeDefined• fmiReal tStop• fmiReal input_real [N_INPUT_REAL][N_INPUT_REAL_MAX_ORDER+1]• fmiReal output_real [N_OUTPUT_REAL][N_OUTPUT_REAL_MAX_ORDER+1]• fmi2Real states [N_STATES]

Page 286: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

218 Data Structure Documentation

• fmi2Real states_nom [N_STATES]• fmi2Real states_der [N_STATES]• fmi2Real event_indicators [N_EVENT_INDICATORS]• fmi2Real reals [N_REAL]• fmi2Integer integers [N_INTEGER]• fmi2Boolean booleans [N_BOOLEAN]• fmi2String strings [N_STRING]• fmi2Boolean loggingOn• const fmi2CallbackFunctions ∗ functions• fmi2Real fmitime• fmi2Boolean toleranceControlled• fmi2Real relativeTolerance• fmi2EventInfo eventInfo• fmi2Real states_prev [N_STATES]• fmi2Boolean visible• fmi2Real tStart• fmi2Boolean StopTimeDefined• fmi2Real tStop• fmi2Real input_real [N_INPUT_REAL][N_INPUT_REAL_MAX_ORDER+1]• fmi2Real output_real [N_OUTPUT_REAL][N_OUTPUT_REAL_MAX_ORDER+1]

6.1.1 Detailed Description

Definition at line 23 of file fmu1_model.h.

6.1.2 Field Documentation

6.1.2.1 fmiReal component_t::states[N_STATES]

Definition at line 25 of file fmu1_model.h.

6.1.2.2 fmiReal component_t::states_nom[N_STATES]

Definition at line 26 of file fmu1_model.h.

6.1.2.3 fmiValueReference component_t::states_vr[N_STATES]

Definition at line 27 of file fmu1_model.h.

6.1.2.4 fmiReal component_t::states_der[N_STATES]

Definition at line 28 of file fmu1_model.h.

6.1.2.5 fmiReal component_t::event_indicators[N_EVENT_INDICATORS]

Definition at line 29 of file fmu1_model.h.

Generated by Doxygen

Page 287: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.1 component_t Struct Reference 219

6.1.2.6 fmiReal component_t::reals[N_REAL]

Definition at line 30 of file fmu1_model.h.

6.1.2.7 fmiInteger component_t::integers[N_INTEGER]

Definition at line 31 of file fmu1_model.h.

6.1.2.8 fmiBoolean component_t::booleans[N_BOOLEAN]

Definition at line 32 of file fmu1_model.h.

6.1.2.9 fmiString component_t::strings[N_STRING]

Definition at line 33 of file fmu1_model.h.

6.1.2.10 fmiBoolean component_t::loggingOn

Definition at line 36 of file fmu1_model.h.

6.1.2.11 char component_t::instanceName

Definition at line 37 of file fmu1_model.h.

6.1.2.12 char component_t::GUID

Definition at line 38 of file fmu1_model.h.

6.1.2.13 fmiCallbackFunctions component_t::functions

Definition at line 39 of file fmu1_model.h.

6.1.2.14 fmiReal component_t::fmitime

Definition at line 42 of file fmu1_model.h.

6.1.2.15 fmiBoolean component_t::callEventUpdate

Definition at line 45 of file fmu1_model.h.

Generated by Doxygen

Page 288: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

220 Data Structure Documentation

6.1.2.16 fmiBoolean component_t::toleranceControlled

Definition at line 48 of file fmu1_model.h.

6.1.2.17 fmiReal component_t::relativeTolerance

Definition at line 49 of file fmu1_model.h.

6.1.2.18 fmiEventInfo component_t::eventInfo

Definition at line 50 of file fmu1_model.h.

6.1.2.19 fmiReal component_t::states_prev[N_STATES]

Definition at line 53 of file fmu1_model.h.

6.1.2.20 char component_t::fmuLocation

Definition at line 56 of file fmu1_model.h.

6.1.2.21 char component_t::mimeType[BUFFER]

Definition at line 57 of file fmu1_model.h.

6.1.2.22 fmiReal component_t::timeout

Definition at line 58 of file fmu1_model.h.

6.1.2.23 fmiBoolean component_t::visible

Definition at line 59 of file fmu1_model.h.

6.1.2.24 fmiBoolean component_t::interactive

Definition at line 60 of file fmu1_model.h.

6.1.2.25 fmiReal component_t::tStart

Definition at line 63 of file fmu1_model.h.

Generated by Doxygen

Page 289: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.1 component_t Struct Reference 221

6.1.2.26 fmiBoolean component_t::StopTimeDefined

Definition at line 64 of file fmu1_model.h.

6.1.2.27 fmiReal component_t::tStop

Definition at line 65 of file fmu1_model.h.

6.1.2.28 fmiReal component_t::input_real[N_INPUT_REAL][N_INPUT_REAL_MAX_ORDER+1]

Definition at line 68 of file fmu1_model.h.

6.1.2.29 fmiReal component_t::output_real[N_OUTPUT_REAL][N_OUTPUT_REAL_MAX_ORDER+1]

Definition at line 71 of file fmu1_model.h.

6.1.2.30 fmi2Real component_t::states[N_STATES]

Definition at line 28 of file fmu2_model.h.

6.1.2.31 fmi2Real component_t::states_nom[N_STATES]

Definition at line 29 of file fmu2_model.h.

6.1.2.32 fmi2Real component_t::states_der[N_STATES]

Definition at line 30 of file fmu2_model.h.

6.1.2.33 fmi2Real component_t::event_indicators[N_EVENT_INDICATORS]

Definition at line 31 of file fmu2_model.h.

6.1.2.34 fmi2Real component_t::reals[N_REAL]

Definition at line 32 of file fmu2_model.h.

6.1.2.35 fmi2Integer component_t::integers[N_INTEGER]

Definition at line 33 of file fmu2_model.h.

Generated by Doxygen

Page 290: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

222 Data Structure Documentation

6.1.2.36 fmi2Boolean component_t::booleans[N_BOOLEAN]

Definition at line 34 of file fmu2_model.h.

6.1.2.37 fmi2String component_t::strings[N_STRING]

Definition at line 35 of file fmu2_model.h.

6.1.2.38 fmi2Boolean component_t::loggingOn

Definition at line 38 of file fmu2_model.h.

6.1.2.39 const fmi2CallbackFunctions∗ component_t::functions

Definition at line 41 of file fmu2_model.h.

6.1.2.40 fmi2Real component_t::fmitime

Definition at line 44 of file fmu2_model.h.

6.1.2.41 fmi2Boolean component_t::toleranceControlled

Definition at line 47 of file fmu2_model.h.

6.1.2.42 fmi2Real component_t::relativeTolerance

Definition at line 48 of file fmu2_model.h.

6.1.2.43 fmi2EventInfo component_t::eventInfo

Definition at line 49 of file fmu2_model.h.

6.1.2.44 fmi2Real component_t::states_prev[N_STATES]

Definition at line 52 of file fmu2_model.h.

6.1.2.45 fmi2Boolean component_t::visible

Definition at line 56 of file fmu2_model.h.

Generated by Doxygen

Page 291: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.2 fmi1_callback_functions_t Struct Reference 223

6.1.2.46 fmi2Real component_t::tStart

Definition at line 59 of file fmu2_model.h.

6.1.2.47 fmi2Boolean component_t::StopTimeDefined

Definition at line 60 of file fmu2_model.h.

6.1.2.48 fmi2Real component_t::tStop

Definition at line 61 of file fmu2_model.h.

6.1.2.49 fmi2Real component_t::input_real[N_INPUT_REAL][N_INPUT_REAL_MAX_ORDER+1]

Definition at line 64 of file fmu2_model.h.

6.1.2.50 fmi2Real component_t::output_real[N_OUTPUT_REAL][N_OUTPUT_REAL_MAX_ORDER+1]

Definition at line 67 of file fmu2_model.h.

The documentation for this struct was generated from the following files:

• Test/FMI1/fmu_dummy/fmu1_model.h• Test/FMI2/fmu_dummy/fmu2_model.h

6.2 fmi1_callback_functions_t Struct Reference

#include <fmi1_functions.h>

Data Fields

• fmi1_callback_logger_ft logger• fmi1_callback_allocate_memory_ft allocateMemory• fmi1_callback_free_memory_ft freeMemory• fmi1_step_finished_ft stepFinished

6.2.1 Detailed Description

The FMI 1.0 CS strcuture adds one field to the ME, otherwize compatible

Definition at line 60 of file fmi1_functions.h.

Generated by Doxygen

Page 292: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

224 Data Structure Documentation

6.2.2 Field Documentation

6.2.2.1 fmi1_callback_logger_ft fmi1_callback_functions_t::logger

Definition at line 61 of file fmi1_functions.h.

6.2.2.2 fmi1_callback_allocate_memory_ft fmi1_callback_functions_t::allocateMemory

Definition at line 62 of file fmi1_functions.h.

6.2.2.3 fmi1_callback_free_memory_ft fmi1_callback_functions_t::freeMemory

Definition at line 63 of file fmi1_functions.h.

6.2.2.4 fmi1_step_finished_ft fmi1_callback_functions_t::stepFinished

Definition at line 64 of file fmi1_functions.h.

The documentation for this struct was generated from the following file:

• src/Util/include/FMI1/fmi1_functions.h

6.3 fmi1_event_info_t Struct Reference

#include <fmi1_functions.h>

Data Fields

• fmi1_boolean_t iterationConverged• fmi1_boolean_t stateValueReferencesChanged• fmi1_boolean_t stateValuesChanged• fmi1_boolean_t terminateSimulation• fmi1_boolean_t upcomingTimeEvent• fmi1_real_t nextEventTime

6.3.1 Detailed Description

Event info structure as used in FMI 1.0 ME

Definition at line 68 of file fmi1_functions.h.

Generated by Doxygen

Page 293: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.4 fmi1_import_model_counts_t Struct Reference 225

6.3.2 Field Documentation

6.3.2.1 fmi1_boolean_t fmi1_event_info_t::iterationConverged

Definition at line 69 of file fmi1_functions.h.

6.3.2.2 fmi1_boolean_t fmi1_event_info_t::stateValueReferencesChanged

Definition at line 70 of file fmi1_functions.h.

6.3.2.3 fmi1_boolean_t fmi1_event_info_t::stateValuesChanged

Definition at line 71 of file fmi1_functions.h.

6.3.2.4 fmi1_boolean_t fmi1_event_info_t::terminateSimulation

Definition at line 72 of file fmi1_functions.h.

6.3.2.5 fmi1_boolean_t fmi1_event_info_t::upcomingTimeEvent

Definition at line 73 of file fmi1_functions.h.

6.3.2.6 fmi1_real_t fmi1_event_info_t::nextEventTime

Definition at line 74 of file fmi1_functions.h.

The documentation for this struct was generated from the following file:

• src/Util/include/FMI1/fmi1_functions.h

6.4 fmi1_import_model_counts_t Struct Reference

Collection of counters providing model information.

#include <fmi1_import_convenience.h>

Generated by Doxygen

Page 294: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

226 Data Structure Documentation

Data Fields

• unsigned int num_constants

Number of constants.

• unsigned int num_parameters

Number of parameters.

• unsigned int num_discrete

Number of discrete variables.

• unsigned int num_continuous

Number of continuous variables.

• unsigned int num_inputs

Number of inputs.

• unsigned int num_outputs

Number of outputs.

• unsigned int num_internal

Number of internal variables.

• unsigned int num_causality_none

Number of variables with causality 'none'.

• unsigned int num_real_vars

Number of real variables.

• unsigned int num_integer_vars

Number of integer variables.

• unsigned int num_enum_vars

Number of enumeration variables.

• unsigned int num_bool_vars

Number of boolean variables.

• unsigned int num_string_vars

Number of string variables.

6.4.1 Detailed Description

Collection of counters providing model information.

Definition at line 48 of file fmi1_import_convenience.h.

6.4.2 Field Documentation

6.4.2.1 unsigned int fmi1_import_model_counts_t::num_constants

Number of constants.

Definition at line 50 of file fmi1_import_convenience.h.

6.4.2.2 unsigned int fmi1_import_model_counts_t::num_parameters

Number of parameters.

Definition at line 52 of file fmi1_import_convenience.h.

Generated by Doxygen

Page 295: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.4 fmi1_import_model_counts_t Struct Reference 227

6.4.2.3 unsigned int fmi1_import_model_counts_t::num_discrete

Number of discrete variables.

Definition at line 55 of file fmi1_import_convenience.h.

6.4.2.4 unsigned int fmi1_import_model_counts_t::num_continuous

Number of continuous variables.

Definition at line 57 of file fmi1_import_convenience.h.

6.4.2.5 unsigned int fmi1_import_model_counts_t::num_inputs

Number of inputs.

Definition at line 60 of file fmi1_import_convenience.h.

6.4.2.6 unsigned int fmi1_import_model_counts_t::num_outputs

Number of outputs.

Definition at line 62 of file fmi1_import_convenience.h.

6.4.2.7 unsigned int fmi1_import_model_counts_t::num_internal

Number of internal variables.

Definition at line 64 of file fmi1_import_convenience.h.

6.4.2.8 unsigned int fmi1_import_model_counts_t::num_causality_none

Number of variables with causality 'none'.

Definition at line 66 of file fmi1_import_convenience.h.

6.4.2.9 unsigned int fmi1_import_model_counts_t::num_real_vars

Number of real variables.

Definition at line 69 of file fmi1_import_convenience.h.

6.4.2.10 unsigned int fmi1_import_model_counts_t::num_integer_vars

Number of integer variables.

Definition at line 71 of file fmi1_import_convenience.h.

Generated by Doxygen

Page 296: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

228 Data Structure Documentation

6.4.2.11 unsigned int fmi1_import_model_counts_t::num_enum_vars

Number of enumeration variables.

Definition at line 73 of file fmi1_import_convenience.h.

6.4.2.12 unsigned int fmi1_import_model_counts_t::num_bool_vars

Number of boolean variables.

Definition at line 75 of file fmi1_import_convenience.h.

6.4.2.13 unsigned int fmi1_import_model_counts_t::num_string_vars

Number of string variables.

Definition at line 77 of file fmi1_import_convenience.h.

The documentation for this struct was generated from the following file:

• src/Import/include/FMI1/fmi1_import_convenience.h

6.5 fmi1_me_callback_functions_t Struct Reference

#include <fmi1_functions.h>

Data Fields

• fmi1_callback_logger_ft logger• fmi1_callback_allocate_memory_ft allocateMemory• fmi1_callback_free_memory_ft freeMemory

6.5.1 Detailed Description

Functions for FMI 1.0 ME

Definition at line 53 of file fmi1_functions.h.

6.5.2 Field Documentation

6.5.2.1 fmi1_callback_logger_ft fmi1_me_callback_functions_t::logger

Definition at line 54 of file fmi1_functions.h.

Generated by Doxygen

Page 297: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.6 fmi2_callback_functions_t Struct Reference 229

6.5.2.2 fmi1_callback_allocate_memory_ft fmi1_me_callback_functions_t::allocateMemory

Definition at line 55 of file fmi1_functions.h.

6.5.2.3 fmi1_callback_free_memory_ft fmi1_me_callback_functions_t::freeMemory

Definition at line 56 of file fmi1_functions.h.

The documentation for this struct was generated from the following file:

• src/Util/include/FMI1/fmi1_functions.h

6.6 fmi2_callback_functions_t Struct Reference

#include <fmi2_functions.h>

Data Fields

• fmi2_callback_logger_ft logger• fmi2_callback_allocate_memory_ft allocateMemory• fmi2_callback_free_memory_ft freeMemory• fmi2_step_finished_ft stepFinished• fmi2_component_environment_t componentEnvironment

6.6.1 Detailed Description

The FMI 2.0 callbacks

Definition at line 70 of file fmi2_functions.h.

6.6.2 Field Documentation

6.6.2.1 fmi2_callback_logger_ft fmi2_callback_functions_t::logger

Definition at line 71 of file fmi2_functions.h.

6.6.2.2 fmi2_callback_allocate_memory_ft fmi2_callback_functions_t::allocateMemory

Definition at line 72 of file fmi2_functions.h.

6.6.2.3 fmi2_callback_free_memory_ft fmi2_callback_functions_t::freeMemory

Definition at line 73 of file fmi2_functions.h.

Generated by Doxygen

Page 298: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

230 Data Structure Documentation

6.6.2.4 fmi2_step_finished_ft fmi2_callback_functions_t::stepFinished

Definition at line 74 of file fmi2_functions.h.

6.6.2.5 fmi2_component_environment_t fmi2_callback_functions_t::componentEnvironment

Definition at line 75 of file fmi2_functions.h.

The documentation for this struct was generated from the following file:

• src/Util/include/FMI2/fmi2_functions.h

6.7 fmi2_event_info_t Struct Reference

#include <fmi2_functions.h>

Data Fields

• fmi2_boolean_t newDiscreteStatesNeeded• fmi2_boolean_t terminateSimulation• fmi2_boolean_t nominalsOfContinuousStatesChanged• fmi2_boolean_t valuesOfContinuousStatesChanged• fmi2_boolean_t nextEventTimeDefined• fmi2_real_t nextEventTime

6.7.1 Detailed Description

Event info structure as used in FMI 2.0 ME

Definition at line 80 of file fmi2_functions.h.

6.7.2 Field Documentation

6.7.2.1 fmi2_boolean_t fmi2_event_info_t::newDiscreteStatesNeeded

Definition at line 81 of file fmi2_functions.h.

6.7.2.2 fmi2_boolean_t fmi2_event_info_t::terminateSimulation

Definition at line 82 of file fmi2_functions.h.

6.7.2.3 fmi2_boolean_t fmi2_event_info_t::nominalsOfContinuousStatesChanged

Definition at line 83 of file fmi2_functions.h.

Generated by Doxygen

Page 299: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.8 fmi2_import_model_counts_t Struct Reference 231

6.7.2.4 fmi2_boolean_t fmi2_event_info_t::valuesOfContinuousStatesChanged

Definition at line 84 of file fmi2_functions.h.

6.7.2.5 fmi2_boolean_t fmi2_event_info_t::nextEventTimeDefined

Definition at line 85 of file fmi2_functions.h.

6.7.2.6 fmi2_real_t fmi2_event_info_t::nextEventTime

Definition at line 86 of file fmi2_functions.h.

The documentation for this struct was generated from the following file:

• src/Util/include/FMI2/fmi2_functions.h

6.8 fmi2_import_model_counts_t Struct Reference

Collection of counters providing model information.

#include <fmi2_import_convenience.h>

Data Fields

• unsigned int num_constants

Number of constants.

• unsigned int num_fixed

Number of fixed.

• unsigned int num_tunable

Number of tunable.

• unsigned int num_discrete

Number of discrete variables.

• unsigned int num_continuous

Number of continuous variables.

• unsigned int num_parameters

Number of parameters.

• unsigned int num_calculated_parameters

Number of calculated parameters.

• unsigned int num_inputs

Number of inputs.

• unsigned int num_outputs

Number of outputs.

• unsigned int num_local

Number of local variables.

• unsigned int num_independent

Number of independent variables.

Generated by Doxygen

Page 300: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

232 Data Structure Documentation

• unsigned int num_real_vars

Number of real variables.

• unsigned int num_integer_vars

Number of integer variables.

• unsigned int num_enum_vars

Number of enumeration variables.

• unsigned int num_bool_vars

Number of boolean variables.

• unsigned int num_string_vars

Number of string variables.

6.8.1 Detailed Description

Collection of counters providing model information.

Definition at line 48 of file fmi2_import_convenience.h.

6.8.2 Field Documentation

6.8.2.1 unsigned int fmi2_import_model_counts_t::num_constants

Number of constants.

Definition at line 50 of file fmi2_import_convenience.h.

6.8.2.2 unsigned int fmi2_import_model_counts_t::num_fixed

Number of fixed.

Definition at line 52 of file fmi2_import_convenience.h.

6.8.2.3 unsigned int fmi2_import_model_counts_t::num_tunable

Number of tunable.

Definition at line 54 of file fmi2_import_convenience.h.

6.8.2.4 unsigned int fmi2_import_model_counts_t::num_discrete

Number of discrete variables.

Definition at line 56 of file fmi2_import_convenience.h.

Generated by Doxygen

Page 301: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.8 fmi2_import_model_counts_t Struct Reference 233

6.8.2.5 unsigned int fmi2_import_model_counts_t::num_continuous

Number of continuous variables.

Definition at line 58 of file fmi2_import_convenience.h.

6.8.2.6 unsigned int fmi2_import_model_counts_t::num_parameters

Number of parameters.

Definition at line 61 of file fmi2_import_convenience.h.

6.8.2.7 unsigned int fmi2_import_model_counts_t::num_calculated_parameters

Number of calculated parameters.

Definition at line 63 of file fmi2_import_convenience.h.

6.8.2.8 unsigned int fmi2_import_model_counts_t::num_inputs

Number of inputs.

Definition at line 65 of file fmi2_import_convenience.h.

6.8.2.9 unsigned int fmi2_import_model_counts_t::num_outputs

Number of outputs.

Definition at line 67 of file fmi2_import_convenience.h.

6.8.2.10 unsigned int fmi2_import_model_counts_t::num_local

Number of local variables.

Definition at line 69 of file fmi2_import_convenience.h.

6.8.2.11 unsigned int fmi2_import_model_counts_t::num_independent

Number of independent variables.

Definition at line 71 of file fmi2_import_convenience.h.

6.8.2.12 unsigned int fmi2_import_model_counts_t::num_real_vars

Number of real variables.

Definition at line 74 of file fmi2_import_convenience.h.

Generated by Doxygen

Page 302: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

234 Data Structure Documentation

6.8.2.13 unsigned int fmi2_import_model_counts_t::num_integer_vars

Number of integer variables.

Definition at line 76 of file fmi2_import_convenience.h.

6.8.2.14 unsigned int fmi2_import_model_counts_t::num_enum_vars

Number of enumeration variables.

Definition at line 78 of file fmi2_import_convenience.h.

6.8.2.15 unsigned int fmi2_import_model_counts_t::num_bool_vars

Number of boolean variables.

Definition at line 80 of file fmi2_import_convenience.h.

6.8.2.16 unsigned int fmi2_import_model_counts_t::num_string_vars

Number of string variables.

Definition at line 82 of file fmi2_import_convenience.h.

The documentation for this struct was generated from the following file:

• src/Import/include/FMI2/fmi2_import_convenience.h

6.9 fmi2_xml_callbacks_t Struct Reference

XML callbacks are used to process parts of XML that are not handled by the library.

#include <fmi2_xml_callbacks.h>

Data Fields

• fmi2_xml_element_start_handle_ft startHandle• fmi2_xml_element_data_handle_ft dataHandle

Handle start of an XML element within tool annotation in a SAX parser.

• fmi2_xml_element_end_handle_ft endHandle

Handle data of an XML element within tool annotation in a SAX parser.

• void ∗ context

Handle end of an XML element within tool annotation in a SAX parser.

Generated by Doxygen

Page 303: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.10 fmul_t Struct Reference 235

6.9.1 Detailed Description

XML callbacks are used to process parts of XML that are not handled by the library.

Definition at line 67 of file fmi2_xml_callbacks.h.

The documentation for this struct was generated from the following file:

• src/Util/include/FMI2/fmi2_xml_callbacks.h

6.10 fmul_t Struct Reference

Data Fields

• fmi1_import_t ∗ fmu• fmi_import_context_t ∗ context• jm_callbacks ∗ callbacks• fmi1_callback_functions_t callBackFunctions

6.10.1 Detailed Description

Definition at line 167 of file fmi_import_me_test.c.

6.10.2 Field Documentation

6.10.2.1 fmi1_import_t∗ fmul_t::fmu

Definition at line 168 of file fmi_import_me_test.c.

6.10.2.2 fmi_import_context_t∗ fmul_t::context

Definition at line 169 of file fmi_import_me_test.c.

6.10.2.3 jm_callbacks∗ fmul_t::callbacks

Definition at line 170 of file fmi_import_me_test.c.

6.10.2.4 fmi1_callback_functions_t fmul_t::callBackFunctions

Definition at line 171 of file fmi_import_me_test.c.

The documentation for this struct was generated from the following file:

• Test/FMI1/fmi_import_me_test.c

Generated by Doxygen

Page 304: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

236 Data Structure Documentation

6.11 jm_callbacks Struct Reference

The callbacks struct is sent to all the modules in the library.

#include <jm_callbacks.h>

Data Fields

• jm_malloc_f malloc

Allocate non-initialized memory.

• jm_calloc_f calloc

Allocate zero initialized memory.

• jm_realloc_f realloc

Re-allocate memory.

• jm_free_f free

Free-allocated memory.

• jm_logger_f logger

Logging callback.

• jm_log_level_enu_t log_level

Logging level.

• jm_voidp context

Arbitrary context pointer passed to the logger function.

• char errMessageBuffer [JM_MAX_ERROR_MESSAGE_SIZE]

The buffer used along with jm_get_last_error()

6.11.1 Detailed Description

The callbacks struct is sent to all the modules in the library.

Definition at line 73 of file jm_callbacks.h.

6.11.2 Field Documentation

6.11.2.1 jm_malloc_f jm_callbacks::malloc

Allocate non-initialized memory.

Definition at line 75 of file jm_callbacks.h.

6.11.2.2 jm_calloc_f jm_callbacks::calloc

Allocate zero initialized memory.

Definition at line 77 of file jm_callbacks.h.

Generated by Doxygen

Page 305: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.12 jm_name_ID_map_t Struct Reference 237

6.11.2.3 jm_realloc_f jm_callbacks::realloc

Re-allocate memory.

Definition at line 79 of file jm_callbacks.h.

6.11.2.4 jm_free_f jm_callbacks::free

Free-allocated memory.

Definition at line 81 of file jm_callbacks.h.

6.11.2.5 jm_logger_f jm_callbacks::logger

Logging callback.

Definition at line 83 of file jm_callbacks.h.

6.11.2.6 jm_log_level_enu_t jm_callbacks::log_level

Logging level.

Definition at line 85 of file jm_callbacks.h.

6.11.2.7 jm_voidp jm_callbacks::context

Arbitrary context pointer passed to the logger function.

Definition at line 87 of file jm_callbacks.h.

6.11.2.8 char jm_callbacks::errMessageBuffer[JM_MAX_ERROR_MESSAGE_SIZE]

The buffer used along with jm_get_last_error()

Definition at line 89 of file jm_callbacks.h.

The documentation for this struct was generated from the following file:

• src/Util/include/JM/jm_callbacks.h

6.12 jm_name_ID_map_t Struct Reference

Mapping between a string and an integer ID.

#include <jm_types.h>

Generated by Doxygen

Page 306: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

238 Data Structure Documentation

Data Fields

• jm_string name• unsigned int ID

6.12.1 Detailed Description

Mapping between a string and an integer ID.

Definition at line 38 of file jm_types.h.

6.12.2 Field Documentation

6.12.2.1 jm_string jm_name_ID_map_t::name

Definition at line 39 of file jm_types.h.

6.12.2.2 unsigned int jm_name_ID_map_t::ID

Definition at line 40 of file jm_types.h.

The documentation for this struct was generated from the following file:

• src/Util/include/JM/jm_types.h

6.13 jm_named_ptr Struct Reference

Name and object pointer pair.

#include <jm_named_ptr.h>

Data Fields

• jm_voidp ptr• jm_string name

Object pointer.

6.13.1 Detailed Description

Name and object pointer pair.

Definition at line 39 of file jm_named_ptr.h.

Generated by Doxygen

Page 307: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

6.14 xml_test_files_t Struct Reference 239

6.13.2 Field Documentation

6.13.2.1 jm_voidp jm_named_ptr::ptr

Definition at line 40 of file jm_named_ptr.h.

6.13.2.2 jm_string jm_named_ptr::name

Object pointer.

Definition at line 41 of file jm_named_ptr.h.

The documentation for this struct was generated from the following file:

• src/Util/include/JM/jm_named_ptr.h

6.14 xml_test_files_t Struct Reference

Data Fields

• const char ∗ filename• int performTest• void(∗ fcn )(const char ∗xmlFileName, fmi1_import_t ∗fmu)

6.14.1 Detailed Description

Definition at line 158 of file fmi_import_cs_test.c.

6.14.2 Field Documentation

6.14.2.1 const char∗ xml_test_files_t::filename

Definition at line 159 of file fmi_import_cs_test.c.

6.14.2.2 int xml_test_files_t::performTest

Definition at line 160 of file fmi_import_cs_test.c.

6.14.2.3 void(∗ xml_test_files_t::fcn) (const char ∗xmlFileName, fmi1_import_t ∗fmu)

Definition at line 161 of file fmi_import_cs_test.c.

The documentation for this struct was generated from the following file:

• Test/FMI1/fmi_import_cs_test.c

Generated by Doxygen

Page 308: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

240 Data Structure Documentation

Generated by Doxygen

Page 309: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Chapter 7

File Documentation

7.1 src/Import/include/FMI/fmi_import_context.h File Reference

Import context is the entry point to the library. It is used to initialize, unzip, get FMI version and start parsing.

#include <stddef.h>#include <fmilib_config.h>#include <JM/jm_callbacks.h>#include <FMI2/fmi2_xml_callbacks.h>#include <FMI/fmi_version.h>#include <FMI1/fmi1_types.h>#include <FMI1/fmi1_enums.h>#include <FMI2/fmi2_types.h>#include <FMI2/fmi2_enums.h>

Macros

• #define FMI_IMPORT_NAME_CHECK 1

If this configuration option is set, the model description will be checked to follow the variable naming conventions.Variables not following the convention will be logged.

Typedefs

• typedef struct fmi_xml_context_t fmi_import_context_t

FMI version independent library context. Opaque struct returned from fmi_import_allocate_context()

• typedef struct fmi1_import_t fmi1_import_t

FMU version 1.0 object.

• typedef struct fmi2_import_t fmi2_import_t

FMU version 2.0 object.

Page 310: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

242 File Documentation

Functions

• FMILIB_EXPORT fmi_import_context_t ∗ fmi_import_allocate_context (jm_callbacks ∗callbacks)

Create fmi_import_context_t structure.

• FMILIB_EXPORT void fmi_import_free_context (fmi_import_context_t ∗c)

Free memory allocated for the library context.

• FMILIB_EXPORT void fmi_import_set_configuration (fmi_import_context_t ∗c, int conf)

Sets advanced configuration, if zero is passed default configuration is set. Currently only one non default configurationis available: FMI_IMPORT_XML_NAME_CHECK.

• FMILIB_EXPORT fmi_version_enu_t fmi_import_get_fmi_version (fmi_import_context_t ∗c, const char∗fileName, const char ∗dirName)

Unzip an FMU specified by the fileName into directory dirName and parse XML to get FMI standard version.

• FMILIB_EXPORT fmi1_import_t ∗ fmi1_import_parse_xml (fmi_import_context_t ∗c, const char ∗dirName)

Parse FMI 1.0 XML file found in the directory dirName.

• FMILIB_EXPORT fmi2_import_t ∗ fmi2_import_parse_xml (fmi_import_context_t ∗context, const char ∗dir←↩

Path, fmi2_xml_callbacks_t ∗xml_callbacks)

Create fmi2_import_t structure and parse the FMI 2.0 XML file found in the directory dirName.

7.1.1 Detailed Description

Import context is the entry point to the library. It is used to initialize, unzip, get FMI version and start parsing.

7.2 src/Import/include/FMI/fmi_import_util.h File Reference

#include <JM/jm_callbacks.h>

Functions

• FMILIB_EXPORT char ∗ fmi_import_mk_temp_dir (jm_callbacks ∗cb, const char ∗systemTempDir, const char∗tempPrefix)

Create a unique temporary directory.

• FMILIB_EXPORT jm_status_enu_t fmi_import_rmdir (jm_callbacks ∗cb, const char ∗dir)

Remove directory and all it contents.

• FMILIB_EXPORT char ∗ fmi_import_create_URL_from_abs_path (jm_callbacks ∗cb, const char ∗absPath)

Create a file:// URL from absolute path.

• FMILIB_EXPORT char ∗ fmi_import_get_dll_path (const char ∗fmu_unzipped_path, const char ∗model_←↩

identifier, jm_callbacks ∗callBackFunctions)

• FMILIB_EXPORT char ∗ fmi_import_get_model_description_path (const char ∗fmu_unzipped_path, jm_←↩

callbacks ∗callBackFunctions)

Generated by Doxygen

Page 311: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.3 src/Import/include/FMI1/fmi1_import.h File Reference 243

7.3 src/Import/include/FMI1/fmi1_import.h File Reference

Public interface to the FMI import C-library.

#include <stddef.h>#include <fmilib_config.h>#include <JM/jm_callbacks.h>#include <FMI/fmi_import_util.h>#include <FMI/fmi_import_context.h>#include <FMI1/fmi1_types.h>#include <FMI1/fmi1_functions.h>#include <FMI1/fmi1_enums.h>#include "fmi1_import_type.h"#include "fmi1_import_unit.h"#include "fmi1_import_variable.h"#include "fmi1_import_vendor_annotations.h"#include "fmi1_import_capabilities.h"#include "fmi1_import_variable_list.h"#include "fmi1_import_capi.h"#include "fmi1_import_convenience.h"#include "fmi1_import_cosim.h"

Functions

• FMILIB_EXPORT fmi1_import_t ∗ fmi1_import_parse_xml (fmi_import_context_t ∗context, const char ∗dir←↩

Path)

Create fmi1_import_t structure and parse the XML file.

• FMILIB_EXPORT const char ∗ fmi1_import_get_last_error (fmi1_import_t ∗fmu)

Retrieve the last error message.

• FMILIB_EXPORT int fmi1_import_clear_last_error (fmi1_import_t ∗fmu)

Clear the error message.

• FMILIB_EXPORT void fmi1_import_free (fmi1_import_t ∗fmu)

Release the memory allocated.

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_name (fmi1_import_t ∗fmu)

Get model name.

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_identifier (fmi1_import_t ∗fmu)

Get model identifier.

• FMILIB_EXPORT const char ∗ fmi1_import_get_GUID (fmi1_import_t ∗fmu)

Get FMU GUID.

• FMILIB_EXPORT const char ∗ fmi1_import_get_description (fmi1_import_t ∗fmu)

Get FMU description.

• FMILIB_EXPORT const char ∗ fmi1_import_get_author (fmi1_import_t ∗fmu)

Get FMU author.

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_version (fmi1_import_t ∗fmu)

Get FMU version.

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_standard_version (fmi1_import_t ∗fmu)

Get FMI standard version (always 1.0).

• FMILIB_EXPORT const char ∗ fmi1_import_get_generation_tool (fmi1_import_t ∗fmu)

Get FMU generation tool.

• FMILIB_EXPORT const char ∗ fmi1_import_get_generation_date_and_time (fmi1_import_t ∗fmu)

Get FMU generation date and time.

Generated by Doxygen

Page 312: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

244 File Documentation

• FMILIB_EXPORT fmi1_variable_naming_convension_enu_t fmi1_import_get_naming_convention (fmi1_←↩

import_t ∗fmu)

Get variable naming convention used.

• FMILIB_EXPORT unsigned int fmi1_import_get_number_of_continuous_states (fmi1_import_t ∗fmu)

Get the number of contnuous states.

• FMILIB_EXPORT unsigned int fmi1_import_get_number_of_event_indicators (fmi1_import_t ∗fmu)

Get the number of event indicators.

• FMILIB_EXPORT double fmi1_import_get_default_experiment_start (fmi1_import_t ∗fmu)

Get the start time for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi1_import_get_default_experiment_stop (fmi1_import_t ∗fmu)

Get the stop time for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi1_import_get_default_experiment_tolerance (fmi1_import_t ∗fmu)

Get the tolerance default experiment as specified in the XML file.

• FMILIB_EXPORT fmi1_fmu_kind_enu_t fmi1_import_get_fmu_kind (fmi1_import_t ∗fmu)

Get the type of the FMU (model exchange or co-simulation)

• FMILIB_EXPORT fmi1_import_capabilities_t ∗ fmi1_import_get_capabilities (fmi1_import_t ∗fmu)

Get the structure with capability flags.

• FMILIB_EXPORT fmi1_import_type_definitions_t ∗ fmi1_import_get_type_definitions (fmi1_import_t ∗)

Get the list of all the type definitions in the model.

• FMILIB_EXPORT fmi1_import_unit_definitions_t ∗ fmi1_import_get_unit_definitions (fmi1_import_t ∗fmu)

Get a list of all the unit definitions in the model.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_direct_dependency (fmi1_import_t ∗fmu,fmi1_import_variable_t ∗)

Get the direct dependency information.

• FMILIB_EXPORT fmi1_import_variable_t ∗ fmi1_import_get_variable_alias_base (fmi1_import_t ∗fmu,fmi1_import_variable_t ∗)

Get the variable with the same value reference that is not an alias.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_variable_aliases (fmi1_import_t ∗fmu,fmi1_import_variable_t ∗)

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_variable_list (fmi1_import_t ∗fmu)

Get the list of all the variables in the model.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_variable_list_alphabetical_order (fmi1_←↩

import_t ∗fmu)

Get the list of all the variables in the model in alphabetical order.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_create_var_list (fmi1_import_t ∗fmu, fmi1_←↩

import_variable_t ∗v)

Create a variable list with a single variable.

7.3.1 Detailed Description

Public interface to the FMI import C-library.

7.4 src/Import/include/FMI1/fmi1_import_capabilities.h File Reference

#include <fmilib_config.h>

Generated by Doxygen

Page 313: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.5 src/Import/include/FMI1/fmi1_import_capi.h File Reference 245

Typedefs

FMU capabilities flags

• typedef struct fmi1_xml_capabilities_t fmi1_import_capabilities_tA container for all the capability flags.

Functions

• FMILIB_EXPORT int fmi1_import_get_canHandleVariableCommunicationStepSize (fmi1_import_←↩

capabilities_t ∗)

Retrieve canHandleVariableCommunicationStepSize flag.

• FMILIB_EXPORT int fmi1_import_get_canHandleEvents (fmi1_import_capabilities_t ∗)

Retrieve canHandleEvents flag.

• FMILIB_EXPORT int fmi1_import_get_canRejectSteps (fmi1_import_capabilities_t ∗)

Retrieve canRejectSteps flag.

• FMILIB_EXPORT int fmi1_import_get_canInterpolateInputs (fmi1_import_capabilities_t ∗)

Retrieve canInterpolateInputs flag.

• FMILIB_EXPORT unsigned int fmi1_import_get_maxOutputDerivativeOrder (fmi1_import_capabilities_t ∗)

Retrieve maxOutputDerivativeOrder.

• FMILIB_EXPORT int fmi1_import_get_canRunAsynchronuously (fmi1_import_capabilities_t ∗)

Retrieve canRunAsynchronuously flag.

• FMILIB_EXPORT int fmi1_import_get_canSignalEvents (fmi1_import_capabilities_t ∗)

Deprecated since 1.0.1, do not use.

• FMILIB_EXPORT int fmi1_import_get_canBeInstantiatedOnlyOncePerProcess (fmi1_import_capabilities_←↩

t ∗)

Retrieve canBeInstantiatedOnlyOncePerProcess flag.

• FMILIB_EXPORT int fmi1_import_get_canNotUseMemoryManagementFunctions (fmi1_import_capabilities←↩

_t ∗)

Retrieve canNotUseMemoryManagementFunctions flag.

7.4.1 Detailed Description

Functions to retrieve capability flags.

7.5 src/Import/include/FMI1/fmi1_import_capi.h File Reference

#include <JM/jm_callbacks.h>#include <FMI/fmi_import_util.h>#include <FMI/fmi_import_context.h>#include <FMI1/fmi1_types.h>#include <FMI1/fmi1_functions.h>#include <FMI1/fmi1_enums.h>

Generated by Doxygen

Page 314: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

246 File Documentation

Functions

• FMILIB_EXPORT jm_status_enu_t fmi1_import_create_dllfmu (fmi1_import_t ∗fmu, fmi1_callback_←↩

functions_t callBackFunctions, int registerGlobally)

Create a C-API struct. The C-API struct is a placeholder for the FMI DLL functions.

• FMILIB_EXPORT void fmi1_import_destroy_dllfmu (fmi1_import_t ∗fmu)

Free a C-API struct. All memory allocated since the struct was created is freed.

• FMILIB_EXPORT void fmi1_import_set_debug_mode (fmi1_import_t ∗fmu, int mode)

Set CAPI debug mode flag. Setting to non-zero prevents DLL unloading in fmi1_import_destroy_dllfmu while all thememory is deallocated. This is to support valgrind debugging.

• FMILIB_EXPORT const char ∗ fmi1_import_get_version (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiGetVersion()

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_debug_logging (fmi1_import_t ∗fmu, fmi1_boolean_←↩

t loggingOn)

Wrapper for the FMI function fmiSetDebugLogging(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_real (fmi1_import_t ∗fmu, const fmi1_value_reference_←↩

t vr[ ], size_t nvr, const fmi1_real_t value[ ])

Wrapper for the FMI function fmiSetReal(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_integer (fmi1_import_t ∗fmu, const fmi1_value_reference←↩

_t vr[ ], size_t nvr, const fmi1_integer_t value[ ])

Wrapper for the FMI function fmiSetInteger(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_boolean (fmi1_import_t ∗fmu, const fmi1_value_←↩

reference_t vr[ ], size_t nvr, const fmi1_boolean_t value[ ])

Wrapper for the FMI function fmiSetBoolean(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_string (fmi1_import_t ∗fmu, const fmi1_value_reference_tvr[ ], size_t nvr, const fmi1_string_t value[ ])

Wrapper for the FMI function fmiSetString(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_real (fmi1_import_t ∗fmu, const fmi1_value_reference_←↩

t vr[ ], size_t nvr, fmi1_real_t value[ ])

Wrapper for the FMI function fmiGetReal(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_integer (fmi1_import_t ∗fmu, const fmi1_value_reference←↩

_t vr[ ], size_t nvr, fmi1_integer_t value[ ])

Wrapper for the FMI function fmiGetInteger(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_boolean (fmi1_import_t ∗fmu, const fmi1_value_←↩

reference_t vr[ ], size_t nvr, fmi1_boolean_t value[ ])

Wrapper for the FMI function fmiGetBoolean(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_string (fmi1_import_t ∗fmu, const fmi1_value_reference_tvr[ ], size_t nvr, fmi1_string_t value[ ])

Wrapper for the FMI function fmiGetString(...)

• FMILIB_EXPORT const char ∗ fmi1_import_get_model_types_platform (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiGetModelTypesPlatform(...)

• FMILIB_EXPORT jm_status_enu_t fmi1_import_instantiate_model (fmi1_import_t ∗fmu, fmi1_string_←↩

t instanceName)

Wrapper for the FMI function fmiInstantiateModel(...)

• FMILIB_EXPORT void fmi1_import_free_model_instance (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiFreeModelInstance(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_time (fmi1_import_t ∗fmu, fmi1_real_t time)

Wrapper for the FMI function fmiSetTime(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_continuous_states (fmi1_import_t ∗fmu, const fmi1_real←↩

_t x[ ], size_t nx)

Wrapper for the FMI function fmiSetContinuousStates(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_completed_integrator_step (fmi1_import_t ∗fmu, fmi1_←↩

boolean_t ∗callEventUpdate)

Generated by Doxygen

Page 315: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.5 src/Import/include/FMI1/fmi1_import_capi.h File Reference 247

Wrapper for the FMI function fmiCompletedIntegratorStep(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_initialize (fmi1_import_t ∗fmu, fmi1_boolean_t tolerance←↩

Controlled, fmi1_real_t relativeTolerance, fmi1_event_info_t ∗eventInfo)

Wrapper for the FMI function fmiInitialize(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_derivatives (fmi1_import_t ∗fmu, fmi1_real_t derivatives[ ],size_t nx)

Wrapper for the FMI function fmiGetDerivatives(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_event_indicators (fmi1_import_t ∗fmu, fmi1_real_t event←↩

Indicators[ ], size_t ni)

Wrapper for the FMI function fmiGetEventIndicators(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_eventUpdate (fmi1_import_t ∗fmu, fmi1_boolean_←↩

t intermediateResults, fmi1_event_info_t ∗eventInfo)

Wrapper for the FMI function fmiEventUpdate(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_continuous_states (fmi1_import_t ∗fmu, fmi1_real_←↩

t states[ ], size_t nx)

Wrapper for the FMI function fmiGetContinuousStates(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_nominal_continuous_states (fmi1_import_t ∗fmu, fmi1_←↩

real_t x_nominal[ ], size_t nx)

Wrapper for the FMI function fmiGetNominalContinuousStates(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_state_value_references (fmi1_import_t ∗fmu, fmi1_value←↩

_reference_t vrx[ ], size_t nx)

Wrapper for the FMI function fmiGetStateValueReferences(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_terminate (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiTerminate(...)

• FMILIB_EXPORT const char ∗ fmi1_import_get_types_platform (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiGetTypesPlatform(...)

• FMILIB_EXPORT jm_status_enu_t fmi1_import_instantiate_slave (fmi1_import_t ∗fmu, fmi1_string_←↩

t instanceName, fmi1_string_t fmuLocation, fmi1_string_t mimeType, fmi1_real_t timeout, fmi1_boolean_tvisible, fmi1_boolean_t interactive)

Wrapper for the FMI function fmiInstantiateSlave(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_initialize_slave (fmi1_import_t ∗fmu, fmi1_real_t tStart, fmi1←↩

_boolean_t StopTimeDefined, fmi1_real_t tStop)

Wrapper for the FMI function fmiInitializeSlave(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_terminate_slave (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiTerminateSlave(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_reset_slave (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiResetSlave(...)

• FMILIB_EXPORT void fmi1_import_free_slave_instance (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiFreeSlaveInstance(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_set_real_input_derivatives (fmi1_import_t ∗fmu, const fmi1_←↩

value_reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], const fmi1_real_t value[ ])

Wrapper for the FMI function fmiSetRealInputDerivatives(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_real_output_derivatives (fmi1_import_t ∗fmu, const fmi1←↩

_value_reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], fmi1_real_t value[ ])

Wrapper for the FMI function fmiGetOutputDerivatives(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_cancel_step (fmi1_import_t ∗fmu)

Wrapper for the FMI function fmiCancelStep(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_do_step (fmi1_import_t ∗fmu, fmi1_real_t current←↩

CommunicationPoint, fmi1_real_t communicationStepSize, fmi1_boolean_t newStep)

Wrapper for the FMI function fmiDoStep(...)

• FMILIB_EXPORT fmi1_status_t fmi1_import_get_status (fmi1_import_t ∗fmu, const fmi1_status_kind_t s,fmi1_status_t ∗value)

Generated by Doxygen

Page 316: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

248 File Documentation

Wrapper for the FMI function fmiGetStatus(...)• FMILIB_EXPORT fmi1_status_t fmi1_import_get_real_status (fmi1_import_t ∗fmu, const fmi1_status_kind←↩

_t s, fmi1_real_t ∗value)

Wrapper for the FMI function fmiGetRealStatus(...)• FMILIB_EXPORT fmi1_status_t fmi1_import_get_integer_status (fmi1_import_t ∗fmu, const fmi1_status_←↩

kind_t s, fmi1_integer_t ∗value)

Wrapper for the FMI function fmiGetIntegerStatus(...)• FMILIB_EXPORT fmi1_status_t fmi1_import_get_boolean_status (fmi1_import_t ∗fmu, const fmi1_status←↩

_kind_t s, fmi1_boolean_t ∗value)

Wrapper for the FMI function fmiGetBooleanStatus(...)• FMILIB_EXPORT fmi1_status_t fmi1_import_get_string_status (fmi1_import_t ∗fmu, const fmi1_status_←↩

kind_t s, fmi1_string_t ∗value)

Wrapper for the FMI function fmiGetStringStatus(...)

7.5.1 Detailed Description

Wrapper functions for the FMI 1.0 functions

7.6 src/Import/include/FMI1/fmi1_import_convenience.h File Reference

Public interface to the FMI import C-library. Convenience functions.

#include <FMI/fmi_import_context.h>

Data Structures

• struct fmi1_import_model_counts_t

Collection of counters providing model information.

Functions

• FMILIB_EXPORT void fmi1_import_collect_model_counts (fmi1_import_t ∗fmu, fmi1_import_model_←↩

counts_t ∗counts)

Collect model information by counting the number of variables with specific properties and fillinf in fmi1_import_←↩

model_counts_t struct.• FMILIB_EXPORT void fmi1_import_expand_variable_references (fmi1_import_t ∗fmu, const char ∗msgIn,

char ∗msgOut, size_t maxMsgSize)

Print msgIn into msgOut by expanding variable references of the form #<Type><VR># into variable names andreplacing '##' with a single #.

• FMILIB_EXPORT void fmi1_log_forwarding (fmi1_component_t c, fmi1_string_t instanceName, fmi1_←↩

status_t status, fmi1_string_t category, fmi1_string_t message,...)

An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure.• FMILIB_EXPORT void fmi1_log_forwarding_v (fmi1_component_t c, fmi1_string_t instanceName, fmi1_←↩

status_t status, fmi1_string_t category, fmi1_string_t message, va_list args)

An implementation of FMI 1.0 logger that forwards the messages to logger function inside jm_callbacks structure.• FMILIB_EXPORT void fmi1_default_callback_logger (fmi1_component_t c, fmi1_string_t instanceName,

fmi1_status_t status, fmi1_string_t category, fmi1_string_t message,...)

Default FMI 1.0 logger may be used when instantiating FMUs.• FMILIB_EXPORT void fmi1_import_init_logger (jm_callbacks ∗cb, fmi1_callback_functions_t ∗fmiCallbacks)

Given fmi1_callback_functions_t logger (fmi1_logger), the jm_callbacks logger may be setup to redirect the messagesto the fmi1_logger.

Generated by Doxygen

Page 317: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.7 src/Import/include/FMI1/fmi1_import_cosim.h File Reference 249

7.6.1 Detailed Description

Public interface to the FMI import C-library. Convenience functions.

The functions in this file are provided for convenience. The functionality is already available via other lower levelfunctions.

7.7 src/Import/include/FMI1/fmi1_import_cosim.h File Reference

#include <FMI/fmi_import_context.h>

Functions

• FMILIB_EXPORT const char ∗ fmi1_import_get_entry_point (fmi1_import_t ∗)

Get the entry point.

• FMILIB_EXPORT const char ∗ fmi1_import_get_mime_type (fmi1_import_t ∗)

Get mime type.

• FMILIB_EXPORT int fmi1_import_get_manual_start (fmi1_import_t ∗)

Get manual start flag.

• FMILIB_EXPORT size_t fmi1_import_get_number_of_additional_models (fmi1_import_t ∗fmu)

Get the number of additional models specified.

• FMILIB_EXPORT const char ∗ fmi1_import_get_additional_model_name (fmi1_import_t ∗fmu, size_t index)

Get the name of an additional model.

7.7.1 Detailed Description

Functions to retrieve co-simulation related information.

7.8 src/Import/include/FMI1/fmi1_import_type.h File Reference

Public interface to the FMI XML C-library: variable types handling.

#include "fmi1_import_unit.h"

Typedefs

Type definitions supporting structures

• typedef struct fmi1_xml_real_typedef_t fmi1_import_real_typedef_tOpaque type definition object.

• typedef struct fmi1_xml_integer_typedef_t fmi1_import_integer_typedef_tOpaque integer type definition object.

• typedef struct fmi1_xml_enumeration_typedef_t fmi1_import_enumeration_typedef_tOpaque enumeration type definition object.

• typedef struct fmi1_xml_variable_typedef_t fmi1_import_variable_typedef_tOpaque general variable type definition object.

• typedef struct fmi1_xml_type_definitions_t fmi1_import_type_definitions_tOpaque list of the type definitions in the model.

Generated by Doxygen

Page 318: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

250 File Documentation

Functions

• FMILIB_EXPORT size_t fmi1_import_get_type_definition_number (fmi1_import_type_definitions_t ∗td)

Get the number of available type definitions.

• FMILIB_EXPORT fmi1_import_variable_typedef_t ∗ fmi1_import_get_typedef (fmi1_import_type_←↩

definitions_t ∗td, unsigned int index)

Get a type definition specified by the index.

• FMILIB_EXPORT fmi1_import_display_unit_t ∗ fmi1_import_get_type_display_unit (fmi1_import_real_←↩

typedef_t ∗)

Get associated display unit for a type defition if any.

• FMILIB_EXPORT const char ∗ fmi1_import_get_type_name (fmi1_import_variable_typedef_t ∗)

Get the type name.

• FMILIB_EXPORT const char ∗ fmi1_import_get_type_description (fmi1_import_variable_typedef_t ∗)

Get type description.

• FMILIB_EXPORT fmi1_base_type_enu_t fmi1_import_get_base_type (fmi1_import_variable_typedef_t ∗)

Get base type used for the type definition.

• FMILIB_EXPORT fmi1_import_real_typedef_t ∗ fmi1_import_get_type_as_real (fmi1_import_variable_←↩

typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT fmi1_import_integer_typedef_t ∗ fmi1_import_get_type_as_int (fmi1_import_variable_←↩

typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT fmi1_import_enumeration_typedef_t ∗ fmi1_import_get_type_as_enum (fmi1_import_←↩

variable_typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT const char ∗ fmi1_import_get_type_quantity (fmi1_import_variable_typedef_t ∗)

Get the quantity associated with the type definition.

• FMILIB_EXPORT double fmi1_import_get_real_type_min (fmi1_import_real_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT double fmi1_import_get_real_type_max (fmi1_import_real_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT double fmi1_import_get_real_type_nominal (fmi1_import_real_typedef_t ∗)

Get the nominal value associated with the type definition.

• FMILIB_EXPORT fmi1_import_unit_t ∗ fmi1_import_get_real_type_unit (fmi1_import_real_typedef_t ∗)

Get the unit object associated with the type definition if any.

• FMILIB_EXPORT int fmi1_import_get_real_type_is_relative_quantity (fmi1_import_real_typedef_t ∗)

Get the relativeQuantity flag.

• FMILIB_EXPORT int fmi1_import_get_integer_type_min (fmi1_import_integer_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT int fmi1_import_get_integer_type_max (fmi1_import_integer_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_min (fmi1_import_enumeration_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_max (fmi1_import_enumeration_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT unsigned int fmi1_import_get_enum_type_size (fmi1_import_enumeration_typedef_t ∗)

Get the number of elements in the enum.

• FMILIB_EXPORT const char ∗ fmi1_import_get_enum_type_item_name (fmi1_import_enumeration_←↩

typedef_t ∗, unsigned int item)

Get an enumeration item name by index.

• FMILIB_EXPORT const char ∗ fmi1_import_get_enum_type_item_description (fmi1_import_enumeration_←↩

typedef_t ∗, unsigned int item)

Get an enumeration item description by index.

Generated by Doxygen

Page 319: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.9 src/Import/include/FMI1/fmi1_import_unit.h File Reference 251

7.8.1 Detailed Description

Public interface to the FMI XML C-library: variable types handling.

7.9 src/Import/include/FMI1/fmi1_import_unit.h File Reference

Public interface to the FMI import C-library. Handling of variable units.

#include <fmilib_config.h>

Typedefs

Structures encapsulating unit information

• typedef struct fmi1_xml_unit_t fmi1_import_unit_tA variable unit defined with a unit defition.

• typedef struct fmi1_xml_display_unit_t fmi1_import_display_unit_tA display unit.

• typedef struct fmi1_xml_unit_definitions_t fmi1_import_unit_definitions_tThe list of all the unit definitions in the model.

Functions

• FMILIB_EXPORT unsigned int fmi1_import_get_unit_definitions_number (fmi1_import_unit_definitions_t ∗)

Get the number of unit definitions.

• FMILIB_EXPORT fmi1_import_unit_t ∗ fmi1_import_get_unit (fmi1_import_unit_definitions_t ∗, unsigned intindex)

Get a unit definition.

• FMILIB_EXPORT const char ∗ fmi1_import_get_unit_name (fmi1_import_unit_t ∗)

Get a unit name.

• FMILIB_EXPORT unsigned int fmi1_import_get_unit_display_unit_number (fmi1_import_unit_t ∗)

Get the number of display units associated with this unit.

• FMILIB_EXPORT fmi1_import_display_unit_t ∗ fmi1_import_get_unit_display_unit (fmi1_import_unit_t ∗,size_t index)

Get a display unit object by index.

• FMILIB_EXPORT fmi1_import_unit_t ∗ fmi1_import_get_base_unit (fmi1_import_display_unit_t ∗)

Get unit defition for a display unit.

• FMILIB_EXPORT const char ∗ fmi1_import_get_display_unit_name (fmi1_import_display_unit_t ∗)

Get display unit name.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_display_unit_gain (fmi1_import_display_unit_t ∗)

Get the "gain" associated with the display unit.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_display_unit_offset (fmi1_import_display_unit_t ∗)

Get the "offset" associated with the display unit.

• FMILIB_EXPORT fmi1_real_t fmi1_import_convert_to_display_unit (fmi1_real_t value, fmi1_import_←↩

display_unit_t ∗du, int isRelativeQuantity)

Convert a value measured in "units" to a value measured with "display units".

• FMILIB_EXPORT fmi1_real_t fmi1_import_convert_from_display_unit (fmi1_real_t value, fmi1_import_←↩

display_unit_t ∗du, int isRelativeQuantity)

Convert a value measured in "display units" to a value measured with "units".

Generated by Doxygen

Page 320: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

252 File Documentation

7.9.1 Detailed Description

Public interface to the FMI import C-library. Handling of variable units.

7.10 src/Import/include/FMI1/fmi1_import_variable.h File Reference

Public interface to the FMI import C-library. Handling of model variables.

#include <FMI/fmi_import_context.h>#include "fmi1_import_type.h"#include "fmi1_import_unit.h"

Typedefs

Scalar variable types

• typedef struct fmi1_xml_variable_t fmi1_import_variable_tGeneral variable type.

• typedef struct fmi1_xml_real_variable_t fmi1_import_real_variable_tOpaque real variable.

• typedef struct fmi1_xml_integer_variable_t fmi1_import_integer_variable_tOpaque integer variable.

• typedef struct fmi1_xml_string_variable_t fmi1_import_string_variable_tOpaque string variable.

• typedef struct fmi1_xml_enum_variable_t fmi1_import_enum_variable_tOpaque enumeration variable.

• typedef struct fmi1_xml_bool_variable_t fmi1_import_bool_variable_tOpaque boolean variable.

• typedef struct fmi1_import_variable_list_t fmi1_import_variable_list_tList of variables.

Functions

• FMILIB_EXPORT fmi1_import_variable_t ∗ fmi1_import_get_variable_by_name (fmi1_import_t ∗fmu, constchar ∗name)

Get variable by variable name.

• FMILIB_EXPORT fmi1_import_variable_t ∗ fmi1_import_get_variable_by_vr (fmi1_import_t ∗fmu, fmi1_←↩

base_type_enu_t baseType, fmi1_value_reference_t vr)

Get variable by value reference.

• FMILIB_EXPORT const char ∗ fmi1_import_get_variable_name (fmi1_import_variable_t ∗)

Get the variable name.

• FMILIB_EXPORT const char ∗ fmi1_import_get_variable_description (fmi1_import_variable_t ∗)

Get variable description.

• FMILIB_EXPORT fmi1_value_reference_t fmi1_import_get_variable_vr (fmi1_import_variable_t ∗)

Get variable value reference.

• FMILIB_EXPORT fmi1_import_variable_typedef_t ∗ fmi1_import_get_variable_declared_type (fmi1_←↩

import_variable_t ∗)

For scalar variable gives the type definition is present.

• FMILIB_EXPORT fmi1_base_type_enu_t fmi1_import_get_variable_base_type (fmi1_import_variable_t ∗)

Get variable base type.

Generated by Doxygen

Page 321: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.10 src/Import/include/FMI1/fmi1_import_variable.h File Reference 253

• FMILIB_EXPORT int fmi1_import_get_variable_has_start (fmi1_import_variable_t ∗)

Check if the variable has "start" attribute.

• FMILIB_EXPORT int fmi1_import_get_variable_is_fixed (fmi1_import_variable_t ∗)

Get the variable "fixed" attribute.

• FMILIB_EXPORT fmi1_variability_enu_t fmi1_import_get_variability (fmi1_import_variable_t ∗)

Get variability attribute.

• FMILIB_EXPORT fmi1_causality_enu_t fmi1_import_get_causality (fmi1_import_variable_t ∗)

Get causality attribute.

• FMILIB_EXPORT fmi1_import_real_variable_t ∗ fmi1_import_get_variable_as_real (fmi1_import_variable←↩

_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_import_integer_variable_t ∗ fmi1_import_get_variable_as_integer (fmi1_import_←↩

variable_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_import_enum_variable_t ∗ fmi1_import_get_variable_as_enum (fmi1_import_←↩

variable_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_import_string_variable_t ∗ fmi1_import_get_variable_as_string (fmi1_import_←↩

variable_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_import_bool_variable_t ∗ fmi1_import_get_variable_as_boolean (fmi1_import_←↩

variable_t ∗)

Cast general variable to a one with the specific type.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_start (fmi1_import_real_variable_t ∗v)

Get the variable start attribute.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_max (fmi1_import_real_variable_t ∗v)

Get maximum value for the variable.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_min (fmi1_import_real_variable_t ∗v)

Get minimal value for the variable.

• FMILIB_EXPORT fmi1_real_t fmi1_import_get_real_variable_nominal (fmi1_import_real_variable_t ∗v)

Get nominal value for the variable.

• FMILIB_EXPORT fmi1_import_unit_t ∗ fmi1_import_get_real_variable_unit (fmi1_import_real_variable_t ∗v)

Get associated "unit" object if any.

• FMILIB_EXPORT fmi1_import_display_unit_t ∗ fmi1_import_get_real_variable_display_unit (fmi1_import_←↩

real_variable_t ∗v)

Get associated "display unit" object if any.

• FMILIB_EXPORT const char ∗ fmi1_import_get_string_variable_start (fmi1_import_string_variable_t ∗v)

Get start value for the variable.

• FMILIB_EXPORT fmi1_boolean_t fmi1_import_get_boolean_variable_start (fmi1_import_bool_variable_t ∗v)

Get start value for the variable.

• FMILIB_EXPORT int fmi1_import_get_integer_variable_start (fmi1_import_integer_variable_t ∗v)

Get start value for the variable.

• FMILIB_EXPORT int fmi1_import_get_integer_variable_min (fmi1_import_integer_variable_t ∗v)

Get minimal value for the variable.

• FMILIB_EXPORT int fmi1_import_get_integer_variable_max (fmi1_import_integer_variable_t ∗v)

Get max value for the variable.

• FMILIB_EXPORT int fmi1_import_get_enum_variable_start (fmi1_import_enum_variable_t ∗v)

Get start value for the variable.

• FMILIB_EXPORT int fmi1_import_get_enum_variable_min (fmi1_import_enum_variable_t ∗v)

Get minimal value for the variable.

• FMILIB_EXPORT int fmi1_import_get_enum_variable_max (fmi1_import_enum_variable_t ∗v)

Generated by Doxygen

Page 322: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

254 File Documentation

Get max value for the variable.

• FMILIB_EXPORT fmi1_variable_alias_kind_enu_t fmi1_import_get_variable_alias_kind (fmi1_import_←↩

variable_t ∗)

Get the variable alias kind.

• size_t fmi1_import_get_variable_original_order (fmi1_import_variable_t ∗v)

Get the original index in xml of the variable.

7.10.1 Detailed Description

Public interface to the FMI import C-library. Handling of model variables.

7.11 src/Import/include/FMI1/fmi1_import_variable_list.h File Reference

Public interface to the FMI XML C-library. Handling of variable lists.

#include "fmi1_import_variable.h"

Functions

• fmi1_import_variable_list_t ∗ fmi1_import_alloc_variable_list (fmi1_import_t ∗fmu, size_t size)• FMILIB_EXPORT void fmi1_import_free_variable_list (fmi1_import_variable_list_t ∗vl)

Free a variable list. Note that variable lists are allocated dynamically and must be freed when not needed any longer.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_clone_variable_list (fmi1_import_variable_list←↩

_t ∗vl)

Make a copy of the list.

• FMILIB_EXPORT size_t fmi1_import_get_variable_list_size (fmi1_import_variable_list_t ∗vl)

Get number of variables in a list.

• FMILIB_EXPORT const fmi1_value_reference_t ∗ fmi1_import_get_value_referece_list (fmi1_import_←↩

variable_list_t ∗vl)

Get a pointer to the list of the value references for all the variables.

• FMILIB_EXPORT fmi1_import_variable_t ∗ fmi1_import_get_variable (fmi1_import_variable_list_t ∗vl, un-signed int index)

Get a single variable from the list.

Operations on variable lists. Every operation creates a new list.

• typedef int(∗ fmi1_import_variable_filter_function_ft) (fmi1_import_variable_t ∗vl, void ∗data)

Callback function typedef for the fmiFilterVariables.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_get_sublist (fmi1_import_variable_list_t ∗vl, un-signed int fromIndex, unsigned int toIndex)

Select sub-lists.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_filter_variables (fmi1_import_variable_list_t ∗vl,fmi1_import_variable_filter_function_ft filter, void ∗context)

Call the provided 'filter' function on every variable in the list and create a new list.

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_join_var_list (fmi1_import_variable_list_t ∗a,fmi1_import_variable_list_t ∗b)

Create a new variable list by concatenating two lists.

Generated by Doxygen

Page 323: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.12 src/Import/include/FMI1/fmi1_import_vendor_annotations.h File Reference 255

• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_append_to_var_list (fmi1_import_variable_←↩

list_t ∗vl, fmi1_import_variable_t ∗v)

Append a variable to the variable list.• FMILIB_EXPORT fmi1_import_variable_list_t ∗ fmi1_import_prepend_to_var_list (fmi1_import_variable_←↩

list_t ∗vl, fmi1_import_variable_t ∗v)

Prepend a variable to the variable list.• FMILIB_EXPORT jm_status_enu_t fmi1_import_var_list_push_back (fmi1_import_variable_list_t ∗vl, fmi1←↩

_import_variable_t ∗v)

Add a variable to a variable list.

7.11.1 Detailed Description

Public interface to the FMI XML C-library. Handling of variable lists.

7.12 src/Import/include/FMI1/fmi1_import_vendor_annotations.h File Reference

Public interface to the FMI XML C-library. Handling of vendor annotations.

#include <fmilib_config.h>

Typedefs

Vendor annotation supporting structures

• typedef struct fmi1_xml_vendor_list_t fmi1_import_vendor_list_tOpaque list of vendor annotations.

• typedef struct fmi1_xml_vendor_t fmi1_import_vendor_tOpaque vendor object.

• typedef struct fmi1_xml_annotation_t fmi1_import_annotation_tOpaque annotation object.

Functions

• FMILIB_EXPORT unsigned int fmi1_import_get_number_of_vendors (fmi1_import_vendor_list_t ∗)

Get the number of different vendors.• FMILIB_EXPORT fmi1_import_vendor_t ∗ fmi1_import_get_vendor (fmi1_import_vendor_list_t ∗, unsigned

int index)

Get the annotations associated with vendor specified by the index.• FMILIB_EXPORT const char ∗ fmi1_import_get_vendor_name (fmi1_import_vendor_t ∗)

Get the vendor name.• FMILIB_EXPORT unsigned int fmi1_import_get_number_of_vendor_annotations (fmi1_import_vendor_t ∗)

Get the number of annotations provided for the vendor.• FMILIB_EXPORT fmi1_import_annotation_t ∗ fmi1_import_get_vendor_annotation (fmi1_import_vendor_t ∗,

unsigned int index)

Get an annotation object for the vendor by index.• FMILIB_EXPORT const char ∗ fmi1_import_get_annotation_name (fmi1_import_annotation_t ∗)

Get the name of the annotation.• FMILIB_EXPORT const char ∗ fmi1_import_get_annotation_value (fmi1_import_annotation_t ∗)

Get the value for the annotation.• FMILIB_EXPORT fmi1_import_vendor_list_t ∗ fmi1_import_get_vendor_list (fmi1_import_t ∗fmu)

Get the list of all the vendor annotations present in the XML file.

Generated by Doxygen

Page 324: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

256 File Documentation

7.12.1 Detailed Description

Public interface to the FMI XML C-library. Handling of vendor annotations.

7.13 src/Import/include/FMI2/fmi2_import.h File Reference

Public interface to the FMI import C-library.

#include <stddef.h>#include <fmilib_config.h>#include <JM/jm_callbacks.h>#include <FMI/fmi_import_util.h>#include <FMI/fmi_import_context.h>#include <FMI2/fmi2_types.h>#include <FMI2/fmi2_functions.h>#include <FMI2/fmi2_enums.h>#include "fmi2_import_type.h"#include "fmi2_import_unit.h"#include "fmi2_import_variable.h"#include "fmi2_import_variable_list.h"#include "fmi2_import_capi.h"#include "fmi2_import_convenience.h"

Functions

• FMILIB_EXPORT const char ∗ fmi2_import_get_last_error (fmi2_import_t ∗fmu)

Retrieve the last error message.

• FMILIB_EXPORT int fmi2_import_clear_last_error (fmi2_import_t ∗fmu)

Clear the error message.

• FMILIB_EXPORT void fmi2_import_free (fmi2_import_t ∗fmu)

Release the memory allocated.

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_name (fmi2_import_t ∗fmu)

Get model name.

• FMILIB_EXPORT unsigned int fmi2_import_get_capability (fmi2_import_t ∗, fmi2_capabilities_enu_t id)

Retrieve capability flags by ID.

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_identifier_ME (fmi2_import_t ∗fmu)

Get model identifier for ModelExchange.

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_identifier_CS (fmi2_import_t ∗fmu)

Get model identifier for CoSimulation.

• FMILIB_EXPORT const char ∗ fmi2_import_get_GUID (fmi2_import_t ∗fmu)

Get FMU GUID.

• FMILIB_EXPORT const char ∗ fmi2_import_get_description (fmi2_import_t ∗fmu)

Get FMU description.

• FMILIB_EXPORT const char ∗ fmi2_import_get_author (fmi2_import_t ∗fmu)

Get FMU author.

• FMILIB_EXPORT const char ∗ fmi2_import_get_copyright (fmi2_import_t ∗fmu)

Get FMU copyright information.

• FMILIB_EXPORT const char ∗ fmi2_import_get_license (fmi2_import_t ∗fmu)

Get FMU license information.

Generated by Doxygen

Page 325: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.13 src/Import/include/FMI2/fmi2_import.h File Reference 257

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_version (fmi2_import_t ∗fmu)

Get FMU version.

• FMILIB_EXPORT const char ∗ fmi2_import_get_model_standard_version (fmi2_import_t ∗fmu)

Get FMI standard version (always 2.0).

• FMILIB_EXPORT const char ∗ fmi2_import_get_generation_tool (fmi2_import_t ∗fmu)

Get FMU generation tool.

• FMILIB_EXPORT const char ∗ fmi2_import_get_generation_date_and_time (fmi2_import_t ∗fmu)

Get FMU generation date and time.

• FMILIB_EXPORT fmi2_variable_naming_convension_enu_t fmi2_import_get_naming_convention (fmi2_←↩

import_t ∗fmu)

Get variable naming convention used.

• FMILIB_EXPORT size_t fmi2_import_get_number_of_continuous_states (fmi2_import_t ∗fmu)

Get the number of continuous states.

• FMILIB_EXPORT size_t fmi2_import_get_number_of_event_indicators (fmi2_import_t ∗fmu)

Get the number of event indicators.

• FMILIB_EXPORT double fmi2_import_get_default_experiment_start (fmi2_import_t ∗fmu)

Get the start time for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi2_import_get_default_experiment_stop (fmi2_import_t ∗fmu)

Get the stop time for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi2_import_get_default_experiment_tolerance (fmi2_import_t ∗fmu)

Get the tolerance for default experiment as specified in the XML file.

• FMILIB_EXPORT double fmi2_import_get_default_experiment_step (fmi2_import_t ∗fmu)

Get the step size for default experiment as specified in the XML file.

• FMILIB_EXPORT fmi2_fmu_kind_enu_t fmi2_import_get_fmu_kind (fmi2_import_t ∗fmu)

Get the type of the FMU (model exchange or co-simulation)

• FMILIB_EXPORT fmi2_import_type_definitions_t ∗ fmi2_import_get_type_definitions (fmi2_import_t ∗)

Get the list of all the type definitions in the model.

• FMILIB_EXPORT fmi2_import_unit_definitions_t ∗ fmi2_import_get_unit_definitions (fmi2_import_t ∗fmu)

Get a list of all the unit definitions in the model.

• FMILIB_EXPORT fmi2_import_variable_t ∗ fmi2_import_get_variable_alias_base (fmi2_import_t ∗fmu,fmi2_import_variable_t ∗)

Get the variable with the same value reference that is not an alias.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_variable_aliases (fmi2_import_t ∗fmu,fmi2_import_variable_t ∗)

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_variable_list (fmi2_import_t ∗fmu, int sort←↩

Order)

Get the list of all the variables in the model.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_create_var_list (fmi2_import_t ∗fmu, fmi2_←↩

import_variable_t ∗v)

Create a variable list with a single variable.

• FMILIB_EXPORT size_t fmi2_import_get_vendors_num (fmi2_import_t ∗fmu)

Get the number of vendors that had annotations in the XML.

• FMILIB_EXPORT const char ∗ fmi2_import_get_vendor_name (fmi2_import_t ∗fmu, size_t index)

Get the name of the vendor with that had annotations in the XML by index.

• FMILIB_EXPORT size_t fmi2_import_get_log_categories_num (fmi2_import_t ∗fmu)

Get the number of log categories defined in the XML.

• FMILIB_EXPORT const char ∗ fmi2_import_get_log_category (fmi2_import_t ∗fmu, size_t index)

Get the log category by index.

• FMILIB_EXPORT const char ∗ fmi2_import_get_log_category_description (fmi2_import_t ∗fmu, size_t index)

Get the log category description by index.

• FMILIB_EXPORT size_t fmi2_import_get_source_files_me_num (fmi2_import_t ∗fmu)

Generated by Doxygen

Page 326: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

258 File Documentation

Get the number of source files for ME defined in the XML.

• FMILIB_EXPORT const char ∗ fmi2_import_get_source_file_me (fmi2_import_t ∗fmu, size_t index)

Get the ME source file by index.

• FMILIB_EXPORT size_t fmi2_import_get_source_files_cs_num (fmi2_import_t ∗fmu)

Get the number of source files for CS defined in the XML.

• FMILIB_EXPORT const char ∗ fmi2_import_get_source_file_cs (fmi2_import_t ∗fmu, size_t index)

Get the CS source file by index.

• FMILIB_EXPORT fmi2_import_variable_t ∗ fmi2_import_get_variable_by_name (fmi2_import_t ∗fmu, constchar ∗name)

Get variable by variable name.

• FMILIB_EXPORT fmi2_import_variable_t ∗ fmi2_import_get_variable_by_vr (fmi2_import_t ∗fmu, fmi2_←↩

base_type_enu_t baseType, fmi2_value_reference_t vr)

Get variable by value reference.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_outputs_list (fmi2_import_t ∗fmu)

Get the list of all the output variables in the model.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_derivatives_list (fmi2_import_t ∗fmu)

Get the list of all the derivative variables in the model.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_discrete_states_list (fmi2_import_t ∗fmu)

Get the list of all the discrete state variables in the model.

• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_initial_unknowns_list (fmi2_import_t ∗fmu)

Get the list of all the initial unknown variables in the model.

• FMILIB_EXPORT void fmi2_import_get_outputs_dependencies (fmi2_import_t ∗fmu, size_t ∗∗startIndex,size_t ∗∗dependency, char ∗∗factorKind)

Get dependency information in row-compressed format.

• FMILIB_EXPORT void fmi2_import_get_derivatives_dependencies (fmi2_import_t ∗fmu, size_t ∗∗startIndex,size_t ∗∗dependency, char ∗∗factorKind)

Get dependency information in row-compressed format.

• FMILIB_EXPORT void fmi2_import_get_discrete_states_dependencies (fmi2_import_t ∗fmu, size_←↩

t ∗∗startIndex, size_t ∗∗dependency, char ∗∗factorKind)

Get dependency information in row-compressed format.

• FMILIB_EXPORT void fmi2_import_get_initial_unknowns_dependencies (fmi2_import_t ∗fmu, size_←↩

t ∗∗startIndex, size_t ∗∗dependency, char ∗∗factorKind)

Get dependency information in row-compressed format.

7.13.1 Detailed Description

Public interface to the FMI import C-library.

7.14 src/Import/include/FMI2/fmi2_import_capi.h File Reference

#include <JM/jm_callbacks.h>#include <FMI/fmi_import_util.h>#include <FMI/fmi_import_context.h>#include <FMI2/fmi2_types.h>#include <FMI2/fmi2_functions.h>#include <FMI2/fmi2_enums.h>

Generated by Doxygen

Page 327: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.14 src/Import/include/FMI2/fmi2_import_capi.h File Reference 259

Functions

• FMILIB_EXPORT jm_status_enu_t fmi2_import_create_dllfmu (fmi2_import_t ∗fmu, fmi2_fmu_kind_enu_←↩

t fmuKind, const fmi2_callback_functions_t ∗callBackFunctions)

Create a C-API struct. The C-API struct is a placeholder for the FMI DLL functions.

• FMILIB_EXPORT void fmi2_import_destroy_dllfmu (fmi2_import_t ∗fmu)

Free a C-API struct. All memory allocated since the struct was created is freed.

• FMILIB_EXPORT void fmi2_import_set_debug_mode (fmi2_import_t ∗fmu, int mode)

Set CAPI debug mode flag. Setting to non-zero prevents DLL unloading in fmi2_import_destroy_dllfmu while all thememory is deallocated. This is to support valgrind debugging.

• FMILIB_EXPORT const char ∗ fmi2_import_get_version (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiGetVersion()

• 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(...)

• FMILIB_EXPORT jm_status_enu_t fmi2_import_instantiate (fmi2_import_t ∗fmu, fmi2_string_t instance←↩

Name, fmi2_type_t fmuType, fmi2_string_t fmuResourceLocation, fmi2_boolean_t visible)

Wrapper for the FMI function fmiInstantiate(...)

• FMILIB_EXPORT void fmi2_import_free_instance (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiFreeInstance(...)

• 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(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_enter_initialization_mode (fmi2_import_t ∗fmu)

Calls the FMI function fmiEnterInitializationMode(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_exit_initialization_mode (fmi2_import_t ∗fmu)

Calls the FMI function fmiExitInitializationMode(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_terminate (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiTerminate(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_reset (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiReset(...)

• 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(...)

• 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(...)

• 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(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_set_string (fmi2_import_t ∗fmu, const fmi2_value_reference_tvr[ ], size_t nvr, const fmi2_string_t value[ ])

Wrapper for the FMI function fmiSetString(...)

• 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(...)

• 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(...)

• 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(...)

Generated by Doxygen

Page 328: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

260 File Documentation

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_string (fmi2_import_t ∗fmu, const fmi2_value_reference_tvr[ ], size_t nvr, fmi2_string_t value[ ])

Wrapper for the FMI function fmiGetString(...)

• FMILIB_EXPORT const char ∗ fmi2_import_get_types_platform (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiGetTypesPlatform(...)

• 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(...)

• 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(...)

• 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(...)

• 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(...)

• 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(...)

• 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(...)

• 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(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_enter_event_mode (fmi2_import_t ∗fmu)

Calls the FMI function fmiEnterEventMode(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_new_discrete_states (fmi2_import_t ∗fmu, fmi2_event_info_←↩

t ∗eventInfo)

Calls the FMI function fmiNewDiscreteStates(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_enter_continuous_time_mode (fmi2_import_t ∗fmu)

Calls the FMI function fmiEnterContinuousTimeMode(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_set_time (fmi2_import_t ∗fmu, fmi2_real_t time)

Wrapper for the FMI function fmiSetTime(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_set_continuous_states (fmi2_import_t ∗fmu, const fmi2_real←↩

_t x[ ], size_t nx)

Wrapper for the FMI function fmiSetContinuousStates(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_completed_integrator_step (fmi2_import_t ∗fmu, fmi2←↩

_boolean_t noSetFMUStatePriorToCurrentPoint, fmi2_boolean_t ∗enterEventMode, fmi2_boolean_←↩

t ∗terminateSimulation)

Wrapper for the FMI function fmiCompletedIntegratorStep(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_derivatives (fmi2_import_t ∗fmu, fmi2_real_t derivatives[ ],size_t nx)

Wrapper for the FMI function fmiGetDerivatives(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_event_indicators (fmi2_import_t ∗fmu, fmi2_real_t event←↩

Indicators[ ], size_t ni)

Wrapper for the FMI function fmiGetEventIndicators(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_continuous_states (fmi2_import_t ∗fmu, fmi2_real_←↩

t states[ ], size_t nx)

Wrapper for the FMI function fmiGetContinuousStates(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_nominals_of_continuous_states (fmi2_import_t ∗fmu,fmi2_real_t x_nominal[ ], size_t nx)

Wrapper for the FMI function fmiGetNominalsOfContinuousStates(...)

Generated by Doxygen

Page 329: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.15 src/Import/include/FMI2/fmi2_import_convenience.h File Reference 261

• FMILIB_EXPORT fmi2_status_t fmi2_import_set_real_input_derivatives (fmi2_import_t ∗fmu, const fmi2_←↩

value_reference_t vr[ ], size_t nvr, const fmi2_integer_t order[ ], const fmi2_real_t value[ ])

Wrapper for the FMI function fmiSetRealInputDerivatives(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_real_output_derivatives (fmi2_import_t ∗fmu, const fmi2←↩

_value_reference_t vr[ ], size_t nvr, const fmi2_integer_t order[ ], fmi2_real_t value[ ])

Wrapper for the FMI function fmiGetOutputDerivatives(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_cancel_step (fmi2_import_t ∗fmu)

Wrapper for the FMI function fmiCancelStep(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_do_step (fmi2_import_t ∗fmu, fmi2_real_t current←↩

CommunicationPoint, fmi2_real_t communicationStepSize, fmi2_boolean_t newStep)

Wrapper for the FMI function fmiDoStep(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_status (fmi2_import_t ∗fmu, const fmi2_status_kind_t s,fmi2_status_t ∗value)

Wrapper for the FMI function fmiGetStatus(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_real_status (fmi2_import_t ∗fmu, const fmi2_status_kind←↩

_t s, fmi2_real_t ∗value)

Wrapper for the FMI function fmiGetRealStatus(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_integer_status (fmi2_import_t ∗fmu, const fmi2_status_←↩

kind_t s, fmi2_integer_t ∗value)

Wrapper for the FMI function fmiGetIntegerStatus(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_boolean_status (fmi2_import_t ∗fmu, const fmi2_status←↩

_kind_t s, fmi2_boolean_t ∗value)

Wrapper for the FMI function fmiGetBooleanStatus(...)

• FMILIB_EXPORT fmi2_status_t fmi2_import_get_string_status (fmi2_import_t ∗fmu, const fmi2_status_←↩

kind_t s, fmi2_string_t ∗value)

Wrapper for the FMI function fmiGetStringStatus(...)

7.14.1 Detailed Description

Wrapper functions for the FMI 2.0 functions

7.15 src/Import/include/FMI2/fmi2_import_convenience.h File Reference

Public interface to the FMI import C-library. Convenience functions.

#include <FMI/fmi_import_context.h>#include <FMI2/fmi2_functions.h>

Data Structures

• struct fmi2_import_model_counts_t

Collection of counters providing model information.

Generated by Doxygen

Page 330: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

262 File Documentation

Functions

• FMILIB_EXPORT void fmi2_import_collect_model_counts (fmi2_import_t ∗fmu, fmi2_import_model_←↩

counts_t ∗counts)

Collect model information by counting the number of variables with specific properties and fillinf in fmi2_import_←↩

model_counts_t struct.

• FMILIB_EXPORT void fmi2_import_expand_variable_references (fmi2_import_t ∗fmu, const char ∗msgIn,char ∗msgOut, size_t maxMsgSize)

Print msgIn into msgOut by expanding variable references of the form #<Type><VR># into variable names andreplacing '##' with a single #.

• FMILIB_EXPORT void fmi2_log_forwarding (fmi2_component_t c, fmi2_string_t instanceName, fmi2_←↩

status_t status, fmi2_string_t category, fmi2_string_t message,...)

An implementation of FMI 2.0 logger that forwards the messages to logger function inside jm_callbacks structure.

• FMILIB_EXPORT void fmi2_log_forwarding_v (fmi2_component_t c, fmi2_string_t instanceName, fmi2_←↩

status_t status, fmi2_string_t category, fmi2_string_t message, va_list args)

An implementation of FMI 2.0 logger that forwards the messages to logger function inside jm_callbacks structure.

• FMILIB_EXPORT void fmi2_default_callback_logger (fmi2_component_t c, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...)

Default FMI 2.0 logger may be used when instantiating FMUs.

• FMILIB_EXPORT void fmi2_import_init_logger (jm_callbacks ∗cb, fmi2_callback_functions_t ∗fmiCallbacks)

Given fmi2_callback_functions_t logger (fmi2_logger), the jm_callbacks logger may be setup to redirect the messagesto the fmi2_logger.

7.15.1 Detailed Description

Public interface to the FMI import C-library. Convenience functions.

The functions in this file are provided for convenience. The functionality is already available via other lower levelfunctions.

7.16 src/Import/include/FMI2/fmi2_import_type.h File Reference

Public interface to the FMI XML C-library: variable types handling.

#include "fmi2_import_unit.h"

Typedefs

Type definitions supporting structures

• typedef struct fmi2_xml_real_typedef_t fmi2_import_real_typedef_tOpaque type definition object.

• typedef struct fmi2_xml_integer_typedef_t fmi2_import_integer_typedef_tOpaque integer type definition object.

• typedef struct fmi2_xml_enumeration_typedef_t fmi2_import_enumeration_typedef_tOpaque enumeration type definition object.

• typedef struct fmi2_xml_variable_typedef_t fmi2_import_variable_typedef_tOpaque general variable type definition object.

• typedef struct fmi2_xml_type_definitions_t fmi2_import_type_definitions_tOpaque list of the type definitions in the model.

Generated by Doxygen

Page 331: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.16 src/Import/include/FMI2/fmi2_import_type.h File Reference 263

Functions

• FMILIB_EXPORT unsigned int fmi2_import_get_type_definition_number (fmi2_import_type_definitions_←↩

t ∗td)

Get the number of available type definitions.

• FMILIB_EXPORT fmi2_import_variable_typedef_t ∗ fmi2_import_get_typedef (fmi2_import_type_←↩

definitions_t ∗td, unsigned int index)

Get a type definition specified by the index.

• FMILIB_EXPORT fmi2_import_display_unit_t ∗ fmi2_import_get_type_display_unit (fmi2_import_real_←↩

typedef_t ∗)

Get associated display unit for a type defition if any.

• FMILIB_EXPORT const char ∗ fmi2_import_get_type_name (fmi2_import_variable_typedef_t ∗)

Get the type name.

• FMILIB_EXPORT const char ∗ fmi2_import_get_type_description (fmi2_import_variable_typedef_t ∗)

Get type description.

• FMILIB_EXPORT fmi2_base_type_enu_t fmi2_import_get_base_type (fmi2_import_variable_typedef_t ∗)

Get base type used for the type definition.

• FMILIB_EXPORT fmi2_import_real_typedef_t ∗ fmi2_import_get_type_as_real (fmi2_import_variable_←↩

typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT fmi2_import_integer_typedef_t ∗ fmi2_import_get_type_as_int (fmi2_import_variable_←↩

typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT fmi2_import_enumeration_typedef_t ∗ fmi2_import_get_type_as_enum (fmi2_import_←↩

variable_typedef_t ∗)

Cast the general type definition object to an object with a specific base type.

• FMILIB_EXPORT const char ∗ fmi2_import_get_type_quantity (fmi2_import_variable_typedef_t ∗)

Get the quantity associated with the type definition.

• FMILIB_EXPORT double fmi2_import_get_real_type_min (fmi2_import_real_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT double fmi2_import_get_real_type_max (fmi2_import_real_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT double fmi2_import_get_real_type_nominal (fmi2_import_real_typedef_t ∗)

Get the nominal value associated with the type definition.

• FMILIB_EXPORT fmi2_import_unit_t ∗ fmi2_import_get_real_type_unit (fmi2_import_real_typedef_t ∗)

Get the unit object associated with the type definition if any.

• FMILIB_EXPORT int fmi2_import_get_real_type_is_relative_quantity (fmi2_import_real_typedef_t ∗)

Get the 'relativeQuantity' flag.

• FMILIB_EXPORT int fmi2_import_get_real_type_is_unbounded (fmi2_import_real_typedef_t ∗)

Get the 'unbounded' flag.

• FMILIB_EXPORT int fmi2_import_get_integer_type_min (fmi2_import_integer_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT int fmi2_import_get_integer_type_max (fmi2_import_integer_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_min (fmi2_import_enumeration_typedef_t ∗)

Get minimal value for the type.

• FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_max (fmi2_import_enumeration_typedef_t ∗)

Get maximum value for the type.

• FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_size (fmi2_import_enumeration_typedef_t ∗)

Get the number of elements in the enum.

• FMILIB_EXPORT const char ∗ fmi2_import_get_enum_type_item_name (fmi2_import_enumeration_←↩

typedef_t ∗, unsigned int item)

Generated by Doxygen

Page 332: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

264 File Documentation

Get an enumeration item name by index.

• FMILIB_EXPORT int fmi2_import_get_enum_type_item_value (fmi2_import_enumeration_typedef_t ∗, un-signed int item)

Get an enumeration item value by index.

• FMILIB_EXPORT const char ∗ fmi2_import_get_enum_type_item_description (fmi2_import_enumeration_←↩

typedef_t ∗, unsigned int item)

Get an enumeration item description by index.

• FMILIB_EXPORT const char ∗ fmi2_import_get_enum_type_value_name (fmi2_import_enumeration_←↩

typedef_t ∗t, int value)

Get an enumeration item name for the given value.

7.16.1 Detailed Description

Public interface to the FMI XML C-library: variable types handling.

7.17 src/Import/include/FMI2/fmi2_import_unit.h File Reference

Public interface to the FMI import C-library. Handling of variable units.

#include <fmilib_config.h>

Typedefs

Structures encapsulating unit information

• typedef struct fmi2_xml_unit_t fmi2_import_unit_tA variable unit defined with a unit defition.

• typedef struct fmi2_xml_display_unit_t fmi2_import_display_unit_tA display unit.

• typedef struct fmi2_xml_unit_definitions_t fmi2_import_unit_definitions_tThe list of all the unit definitions in the model.

Functions

• FMILIB_EXPORT unsigned int fmi2_import_get_unit_definitions_number (fmi2_import_unit_definitions_t ∗)

Get the number of unit definitions.

• FMILIB_EXPORT fmi2_import_unit_t ∗ fmi2_import_get_unit (fmi2_import_unit_definitions_t ∗, unsigned intindex)

Get a unit definition.

• FMILIB_EXPORT const char ∗ fmi2_import_get_unit_name (fmi2_import_unit_t ∗)

Get a unit name.

• FMILIB_EXPORT unsigned int fmi2_import_get_unit_display_unit_number (fmi2_import_unit_t ∗)

Get the number of display units associated with this unit.

• FMILIB_EXPORT const int ∗ fmi2_import_get_SI_unit_exponents (fmi2_import_unit_t ∗)

Get fmi2_SI_base_units_Num SI base units exponents associated with the unit.

• FMILIB_EXPORT double fmi2_import_get_SI_unit_factor (fmi2_import_unit_t ∗)

Get factor to the corresponding SI base units.

Generated by Doxygen

Page 333: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.18 src/Import/include/FMI2/fmi2_import_variable.h File Reference 265

• FMILIB_EXPORT double fmi2_import_get_SI_unit_offset (fmi2_import_unit_t ∗)

Get offset to the corresponding SI base units.• FMILIB_EXPORT double fmi2_import_convert_to_SI_base_unit (double, fmi2_import_unit_t ∗)

Convert a value with respect to the unit to the value with respect to the SI base unit.• FMILIB_EXPORT double fmi2_import_convert_from_SI_base_unit (double, fmi2_import_unit_t ∗)

Convert a value with respect to the SI base unit to the value with respect to the unit.• FMILIB_EXPORT fmi2_import_display_unit_t ∗ fmi2_import_get_unit_display_unit (fmi2_import_unit_t ∗,

size_t index)

Get a display unit object by index.• FMILIB_EXPORT fmi2_import_unit_t ∗ fmi2_import_get_base_unit (fmi2_import_display_unit_t ∗)

Get unit defition for a display unit.• FMILIB_EXPORT const char ∗ fmi2_import_get_display_unit_name (fmi2_import_display_unit_t ∗)

Get display unit name.• FMILIB_EXPORT fmi2_real_t fmi2_import_get_display_unit_factor (fmi2_import_display_unit_t ∗)

Get the "factor" associated with the display unit.• FMILIB_EXPORT fmi2_real_t fmi2_import_get_display_unit_offset (fmi2_import_display_unit_t ∗)

Get the "offset" associated with the display unit.• FMILIB_EXPORT fmi2_real_t fmi2_import_convert_to_display_unit (fmi2_real_t value, fmi2_import_←↩

display_unit_t ∗du, int isRelativeQuantity)

Convert a value measured in "units" to a value measured with "display units".• FMILIB_EXPORT fmi2_real_t fmi2_import_convert_from_display_unit (fmi2_real_t value, fmi2_import_←↩

display_unit_t ∗du, int isRelativeQuantity)

Convert a value measured in "display units" to a value measured with "units".

7.17.1 Detailed Description

Public interface to the FMI import C-library. Handling of variable units.

7.18 src/Import/include/FMI2/fmi2_import_variable.h File Reference

Public interface to the FMI import C-library. Handling of model variables.

#include <FMI/fmi_import_context.h>#include "fmi2_import_type.h"#include "fmi2_import_unit.h"

Typedefs

Scalar variable types

• typedef struct fmi2_xml_variable_t fmi2_import_variable_tGeneral variable type.

• typedef struct fmi2_xml_real_variable_t fmi2_import_real_variable_tOpaque real variable.

• typedef struct fmi2_xml_integer_variable_t fmi2_import_integer_variable_tOpaque integer variable.

• typedef struct fmi2_xml_string_variable_t fmi2_import_string_variable_tOpaque string variable.

• typedef struct fmi2_xml_enum_variable_t fmi2_import_enum_variable_tOpaque enumeration variable.

• typedef struct fmi2_xml_bool_variable_t fmi2_import_bool_variable_tOpaque boolean variable.

• typedef struct fmi2_import_variable_list_t fmi2_import_variable_list_tList of variables.

Generated by Doxygen

Page 334: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

266 File Documentation

Functions

• 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.

• 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.

• 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.

• FMILIB_EXPORT fmi2_boolean_t fmi2_import_get_canHandleMultipleSetPerTimeInstant (fmi2_import_←↩

variable_t ∗v)

Get the canHandleMultipleSetPerTimeInstant flag for a variable.

• 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.

• 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.

• 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.

• 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.

• 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.

• FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_start (fmi2_import_real_variable_t ∗v)

Get the variable start attribute.

• 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.

• 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.

• FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_max (fmi2_import_real_variable_t ∗v)

Get maximum value for the variable.

• FMILIB_EXPORT fmi2_real_t fmi2_import_get_real_variable_min (fmi2_import_real_variable_t ∗v)

Get minimal value for the variable.

Generated by Doxygen

Page 335: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.19 src/Import/include/FMI2/fmi2_import_variable_list.h File Reference 267

• 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.

7.18.1 Detailed Description

Public interface to the FMI import C-library. Handling of model variables.

7.19 src/Import/include/FMI2/fmi2_import_variable_list.h File Reference

Public interface to the FMI XML C-library. Handling of variable lists.

#include "fmi2_import_variable.h"

Generated by Doxygen

Page 336: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

268 File Documentation

Functions

• fmi2_import_variable_list_t ∗ fmi2_import_alloc_variable_list (fmi2_import_t ∗fmu, size_t size)

Allocate an empty list.• FMILIB_EXPORT void fmi2_import_free_variable_list (fmi2_import_variable_list_t ∗vl)

Free a variable list. Note that variable lists are allocated dynamically and must be freed when not needed any longer.• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_clone_variable_list (fmi2_import_variable_list←↩

_t ∗vl)

Make a copy of the list.• FMILIB_EXPORT size_t fmi2_import_get_variable_list_size (fmi2_import_variable_list_t ∗vl)

Get number of variables in a list.• FMILIB_EXPORT const fmi2_value_reference_t ∗ fmi2_import_get_value_referece_list (fmi2_import_←↩

variable_list_t ∗vl)

Get a pointer to the list of the value references for all the variables.• FMILIB_EXPORT fmi2_import_variable_t ∗ fmi2_import_get_variable (fmi2_import_variable_list_t ∗vl, size←↩

_t index)

Get a single variable from the list.

Operations on variable lists. Every operation creates a new list.

• typedef int(∗ fmi2_import_variable_filter_function_ft) (fmi2_import_variable_t ∗vl, void ∗data)

Callback function typedef for the fmiFilterVariables.• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_get_sublist (fmi2_import_variable_list_t ∗vl,

size_t fromIndex, size_t toIndex)

Select sub-lists.• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_filter_variables (fmi2_import_variable_list_t ∗vl,

fmi2_import_variable_filter_function_ft filter, void ∗context)

Call the provided 'filter' function on every variable in the list and create a new list.• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_join_var_list (fmi2_import_variable_list_t ∗a,

fmi2_import_variable_list_t ∗b)

Create a new variable list by concatenating two lists.• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_append_to_var_list (fmi2_import_variable_←↩

list_t ∗vl, fmi2_import_variable_t ∗v)

Append a variable to the variable list.• FMILIB_EXPORT fmi2_import_variable_list_t ∗ fmi2_import_prepend_to_var_list (fmi2_import_variable_←↩

list_t ∗vl, fmi2_import_variable_t ∗v)

Prepend a variable to the variable list.• FMILIB_EXPORT jm_status_enu_t fmi2_import_var_list_push_back (fmi2_import_variable_list_t ∗vl, fmi2←↩

_import_variable_t ∗v)

Add a variable to a variable list.

7.19.1 Detailed Description

Public interface to the FMI XML C-library. Handling of variable lists.

7.20 src/Util/include/FMI/fmi_util.h File Reference

Some low-level utility functions suitable for all standards.

#include <fmilib_config.h>#include <JM/jm_callbacks.h>

Generated by Doxygen

Page 337: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.21 src/Util/include/FMI/fmi_version.h File Reference 269

Functions

• FMILIB_EXPORT char ∗ fmi_construct_dll_dir_name (jm_callbacks ∗callbacks, const char ∗fmu_unzipped←↩

_path)

Given directory name fmu_unzipped_path and construct the directory path for Dll/so.

• FMILIB_EXPORT char ∗ fmi_construct_dll_file_name (jm_callbacks ∗callbacks, const char ∗dll_dir_name,const char ∗model_identifier)

Given model_identifier construct the dll/so name by adding platform suffix.

7.20.1 Detailed Description

Some low-level utility functions suitable for all standards.

7.21 src/Util/include/FMI/fmi_version.h File Reference

Enum defining supported FMI versions.

#include <fmilib_config.h>

Enumerations

• enum fmi_version_enu_t { fmi_version_unknown_enu = 0, fmi_version_1_enu, fmi_version_2_0_enu, fmi_←↩

version_unsupported_enu }

Suported versions of FMI standard.

Functions

• FMILIB_EXPORT const char ∗ fmi_version_to_string (fmi_version_enu_t v)

7.21.1 Detailed Description

Enum defining supported FMI versions.

7.22 src/Util/include/FMI1/fmi1_enums.h File Reference

Definions the enum types used with FMI 1.0 libs.

#include <fmilib_config.h>

Generated by Doxygen

Page 338: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

270 File Documentation

Typedefs

• typedef enum fmi1_variable_naming_convension_enu_t fmi1_variable_naming_convension_enu_t

Naming convention for the variables in XML file.• typedef enum fmi1_fmu_kind_enu_t fmi1_fmu_kind_enu_t

FMU 1.0 kinds.• typedef enum fmi1_variability_enu_t fmi1_variability_enu_t

Variability property for variables.• typedef enum fmi1_causality_enu_t fmi1_causality_enu_t

Causality property for variables.• typedef enum fmi1_variable_alias_kind_enu_t fmi1_variable_alias_kind_enu_t

Alias property for variables.• typedef enum fmi1_base_type_enu_t fmi1_base_type_enu_t

Base types used in type definitions.

Enumerations

• enum fmi1_variable_naming_convension_enu_t { fmi1_naming_enu_flat, fmi1_naming_enu_structured,fmi1_naming_enu_unknown }

Naming convention for the variables in XML file.• enum fmi1_fmu_kind_enu_t { fmi1_fmu_kind_enu_me = 0, fmi1_fmu_kind_enu_cs_standalone, fmi1_fmu←↩

_kind_enu_cs_tool, fmi1_fmu_kind_enu_unknown }

FMU 1.0 kinds.• enum fmi1_variability_enu_t {

fmi1_variability_enu_constant, fmi1_variability_enu_parameter, fmi1_variability_enu_discrete, fmi1_←↩

variability_enu_continuous,fmi1_variability_enu_unknown }

Variability property for variables.• enum fmi1_causality_enu_t {

fmi1_causality_enu_input, fmi1_causality_enu_output, fmi1_causality_enu_internal, fmi1_causality_enu_←↩

none,fmi1_causality_enu_unknown }

Causality property for variables.• enum fmi1_variable_alias_kind_enu_t { fmi1_variable_is_negated_alias = -1, fmi1_variable_is_not_alias = 0,

fmi1_variable_is_alias = 1 }

Alias property for variables.• enum fmi1_base_type_enu_t {

fmi1_base_type_real, fmi1_base_type_int, fmi1_base_type_bool, fmi1_base_type_str,fmi1_base_type_enum }

Base types used in type definitions.

Functions

• FMILIB_EXPORT const char ∗ fmi1_naming_convention_to_string (fmi1_variable_naming_convension_←↩

enu_t convention)

Convert a fmi1_variable_naming_convension_enu_t constant into string.• FMILIB_EXPORT const char ∗ fmi1_fmu_kind_to_string (fmi1_fmu_kind_enu_t kind)

Convert a fmi1_fmu_kind_enu_t constant into string.• FMILIB_EXPORT const char ∗ fmi1_variability_to_string (fmi1_variability_enu_t v)

Convert a fmi1_variability_enu_t constant into string.• FMILIB_EXPORT const char ∗ fmi1_causality_to_string (fmi1_causality_enu_t c)

Convert a fmi1_causality_enu_t constant into string.• FMILIB_EXPORT const char ∗ fmi1_base_type_to_string (fmi1_base_type_enu_t bt)

Convert base type constant to string.

Generated by Doxygen

Page 339: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.23 src/Util/include/FMI1/fmi1_functions.h File Reference 271

7.22.1 Detailed Description

Definions the enum types used with FMI 1.0 libs.

7.23 src/Util/include/FMI1/fmi1_functions.h File Reference

#include <fmilib_config.h>#include "fmi1_types.h"#include <string.h>

Data Structures

• struct fmi1_me_callback_functions_t• struct fmi1_callback_functions_t• struct fmi1_event_info_t

Typedefs

• typedef void(∗ fmi1_callback_logger_ft) (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_←↩

t status, fmi1_string_t category, fmi1_string_t message,...)• typedef void ∗(∗ fmi1_callback_allocate_memory_ft) (size_t nobj, size_t size)• typedef void(∗ fmi1_callback_free_memory_ft) (void ∗obj)• typedef void(∗ fmi1_step_finished_ft) (fmi1_component_t c, fmi1_status_t status)• typedef const char ∗(∗ fmi1_get_version_ft) (void)• typedef fmi1_status_t(∗ fmi1_set_debug_logging_ft) (fmi1_component_t c, fmi1_boolean_t loggingOn)• typedef fmi1_status_t(∗ fmi1_set_real_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,

const fmi1_real_t value[ ])• typedef fmi1_status_t(∗ fmi1_set_integer_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size←↩

_t nvr, const fmi1_integer_t value[ ])• typedef fmi1_status_t(∗ fmi1_set_boolean_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ],

size_t nvr, const fmi1_boolean_t value[ ])• typedef fmi1_status_t(∗ fmi1_set_string_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t

nvr, const fmi1_string_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_real_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t nvr,

fmi1_real_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_integer_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size←↩

_t nvr, fmi1_integer_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_boolean_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ],

size_t nvr, fmi1_boolean_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_string_ft) (fmi1_component_t c, const fmi1_value_reference_t vr[ ], size_t

nvr, fmi1_string_t value[ ])• typedef const char ∗(∗ fmi1_get_model_typesPlatform_ft) (void)• typedef fmi1_component_t(∗ fmi1_instantiate_model_ft) (fmi1_string_t instanceName, fmi1_string_t GUID,

fmi1_me_callback_functions_t functions, fmi1_boolean_t loggingOn)• typedef void(∗ fmi1_free_model_instance_ft) (fmi1_component_t c)• typedef fmi1_status_t(∗ fmi1_set_time_ft) (fmi1_component_t c, fmi1_real_t time)• typedef fmi1_status_t(∗ fmi1_set_continuous_states_ft) (fmi1_component_t c, const fmi1_real_t x[ ], size_t

nx)• typedef fmi1_status_t(∗ fmi1_completed_integrator_step_ft) (fmi1_component_t c, fmi1_boolean_t ∗call←↩

EventUpdate)

Generated by Doxygen

Page 340: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

272 File Documentation

• typedef fmi1_status_t(∗ fmi1_initialize_ft) (fmi1_component_t c, fmi1_boolean_t toleranceControlled, fmi1←↩

_real_t relativeTolerance, fmi1_event_info_t ∗eventInfo)• typedef fmi1_status_t(∗ fmi1_get_derivatives_ft) (fmi1_component_t c, fmi1_real_t derivatives[ ], size_t nx)• typedef fmi1_status_t(∗ fmi1_get_event_indicators_ft) (fmi1_component_t c, fmi1_real_t eventIndicators[ ],

size_t ni)• typedef fmi1_status_t(∗ fmi1_event_update_ft) (fmi1_component_t c, fmi1_boolean_t intermediateResults,

fmi1_event_info_t ∗eventInfo)• typedef fmi1_status_t(∗ fmi1_get_continuous_states_ft) (fmi1_component_t c, fmi1_real_t states[ ], size_t nx)• typedef fmi1_status_t(∗ fmi1_get_nominal_continuousStates_ft) (fmi1_component_t c, fmi1_real_t x_←↩

nominal[ ], size_t nx)• typedef fmi1_status_t(∗ fmi1_get_state_valueReferences_ft) (fmi1_component_t c, fmi1_value_reference_t

vrx[ ], size_t nx)• typedef fmi1_status_t(∗ fmi1_terminate_ft) (fmi1_component_t c)• typedef const char ∗(∗ fmi1_get_types_platform_ft) (void)• typedef fmi1_component_t(∗ fmi1_instantiate_slave_ft) (fmi1_string_t instanceName, fmi1_string_t fmuGU←↩

ID, fmi1_string_t fmuLocation, fmi1_string_t mimeType, fmi1_real_t timeout, fmi1_boolean_t visible, fmi1_←↩

boolean_t interactive, fmi1_callback_functions_t functions, fmi1_boolean_t loggingOn)• typedef fmi1_status_t(∗ fmi1_initialize_slave_ft) (fmi1_component_t c, fmi1_real_t tStart, fmi1_boolean_←↩

t StopTimeDefined, fmi1_real_t tStop)• typedef fmi1_status_t(∗ fmi1_terminate_slave_ft) (fmi1_component_t c)• typedef fmi1_status_t(∗ fmi1_reset_slave_ft) (fmi1_component_t c)• typedef void(∗ fmi1_free_slave_instance_ft) (fmi1_component_t c)• typedef fmi1_status_t(∗ fmi1_set_real_inputDerivatives_ft) (fmi1_component_t c, const fmi1_value_←↩

reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], const fmi1_real_t value[ ])• typedef fmi1_status_t(∗ fmi1_get_real_outputDerivatives_ft) (fmi1_component_t c, const fmi1_value_←↩

reference_t vr[ ], size_t nvr, const fmi1_integer_t order[ ], fmi1_real_t value[ ])• typedef fmi1_status_t(∗ fmi1_cancel_step_ft) (fmi1_component_t c)• typedef fmi1_status_t(∗ fmi1_do_step_ft) (fmi1_component_t c, fmi1_real_t currentCommunicationPoint,

fmi1_real_t communicationStepSize, fmi1_boolean_t newStep)• typedef fmi1_status_t(∗ fmi1_get_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1_status←↩

_t ∗value)• typedef fmi1_status_t(∗ fmi1_get_real_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1_←↩

real_t ∗value)• typedef fmi1_status_t(∗ fmi1_get_integer_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1←↩

_integer_t ∗value)• typedef fmi1_status_t(∗ fmi1_get_boolean_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s,

fmi1_boolean_t ∗value)• typedef fmi1_status_t(∗ fmi1_get_string_status_ft) (fmi1_component_t c, const fmi1_status_kind_t s, fmi1←↩

_string_t ∗value)

Enumerations

• enum fmi1_status_t {fmi1_status_ok, fmi1_status_warning, fmi1_status_discard, fmi1_status_error,fmi1_status_fatal, fmi1_status_pending }

• enum fmi1_status_kind_t { fmi1_do_step_status, fmi1_pending_status, fmi1_last_successful_time }

Functions

• FMILIB_EXPORT const char ∗ fmi1_status_to_string (fmi1_status_t status)

7.23.1 Detailed Description

Mapping for the standard FMI 1.0 functions into fmi1_ namespace.

Generated by Doxygen

Page 341: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.24 src/Util/include/FMI1/fmi1_types.h File Reference 273

7.24 src/Util/include/FMI1/fmi1_types.h File Reference

#include <FMI1/fmiPlatformTypes.h>

Macros

Renaming of typedefs

• #define fmiComponent fmi1_component_t• #define fmiValueReference fmi1_value_reference_t• #define fmiReal fmi1_real_t• #define fmiInteger fmi1_integer_t• #define fmiBoolean fmi1_boolean_t• #define fmiString fmi1_string_t

Typedefs

• typedef enum fmi1_value_reference_enu_t fmi1_value_reference_enu_t

Enumerations

• enum fmi1_boolean_enu_t { fmi1_true =fmiTrue, fmi1_false =fmiFalse }• enum fmi1_value_reference_enu_t { fmi1_undefined_value_reference = (int)fmiUndefinedValueReference }

Functions

• static const char ∗ fmi1_get_platform (void)

7.24.1 Detailed Description

Transformation of the standard FMI type names into fmi1_ prefixed.

7.25 src/Util/include/FMI2/fmi2_enums.h File Reference

Definions the enum types used with FMI 2.0 libs.

#include <fmilib_config.h>

Macros

• #define FMI2_ME_CAPABILITIES(H)

List of capability flags for ModelExchange.• #define FMI2_CS_CAPABILITIES(H)

List of capability flags for CoSimulation.• #define FMI2_EXPAND_ME_CAPABILITIES_ENU(c) fmi2_me_ ## c,• #define FMI2_EXPAND_CS_CAPABILITIES_ENU(c) fmi2_cs_ ## c,• #define FMI2_SI_BASE_UNITS(H) H(kg) H(m) H(s) H(A) H(K) H(mol) H(cd) H(rad)

List of SI base units used in Unit defitions.• #define FMI2_EXPAND_SI_BASE_UNIT_ENU(c) fmi2_SI_base_unit_ ## c,

Generated by Doxygen

Page 342: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

274 File Documentation

Typedefs

• typedef enum fmi2_variable_naming_convension_enu_t fmi2_variable_naming_convension_enu_t

Naming convention for the variables in XML file.

• typedef enum fmi2_fmu_kind_enu_t fmi2_fmu_kind_enu_t

FMU 2.0 kinds.

• typedef enum fmi2_variability_enu_t fmi2_variability_enu_t

Variability property for variables.

• typedef enum fmi2_causality_enu_t fmi2_causality_enu_t

Causality property for variables.

• typedef enum fmi2_initial_enu_t fmi2_initial_enu_t

Initial property for variables.

• typedef enum fmi2_variable_alias_kind_enu_t fmi2_variable_alias_kind_enu_t

Alias property for variables.

• typedef enum fmi2_base_type_enu_t fmi2_base_type_enu_t

Base types used in type definitions.

• typedef enum fmi2_capabilities_enu_t fmi2_capabilities_enu_t

Capability flags for ModelExchange and CoSimulation.

• typedef enum fmi2_SI_base_units_enu_t fmi2_SI_base_units_enu_t

SI base units used in Unit defitions.

• typedef enum fmi2_dependency_factor_kind_enu_t fmi2_dependency_factor_kind_enu_t

Dependency factor kinds are used as part of ModelStructure definition.

Enumerations

• enum fmi2_variable_naming_convension_enu_t { fmi2_naming_enu_flat, fmi2_naming_enu_structured,fmi2_naming_enu_unknown }

Naming convention for the variables in XML file.

• enum fmi2_fmu_kind_enu_t { fmi2_fmu_kind_unknown = 0, fmi2_fmu_kind_me = 1, fmi2_fmu_kind_cs = 2,fmi2_fmu_kind_me_and_cs = 3 }

FMU 2.0 kinds.

• enum fmi2_variability_enu_t {fmi2_variability_enu_constant = 0, fmi2_variability_enu_fixed = 1, fmi2_variability_enu_tunable = 2, fmi2_←↩

variability_enu_discrete = 3,fmi2_variability_enu_continuous = 4, fmi2_variability_enu_unknown = 5 }

Variability property for variables.

• enum fmi2_causality_enu_t {fmi2_causality_enu_parameter = 0, fmi2_causality_enu_calculated_parameter = 1, fmi2_causality_enu_←↩

input = 2, fmi2_causality_enu_output = 3,fmi2_causality_enu_local = 4, fmi2_causality_enu_independent = 5, fmi2_causality_enu_unknown = 6 }

Causality property for variables.

• enum fmi2_initial_enu_t { fmi2_initial_enu_exact, fmi2_initial_enu_approx, fmi2_initial_enu_calculated,fmi2_initial_enu_unknown }

Initial property for variables.

• enum fmi2_variable_alias_kind_enu_t { fmi2_variable_is_not_alias = 0, fmi2_variable_is_alias = 1 }

Alias property for variables.

• enum fmi2_base_type_enu_t {fmi2_base_type_real, fmi2_base_type_int, fmi2_base_type_bool, fmi2_base_type_str,fmi2_base_type_enum }

Base types used in type definitions.

• enum fmi2_capabilities_enu_t { fmi2_capabilities_Num }

Capability flags for ModelExchange and CoSimulation.

Generated by Doxygen

Page 343: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.25 src/Util/include/FMI2/fmi2_enums.h File Reference 275

• enum fmi2_SI_base_units_enu_t { fmi2_SI_base_units_Num }

SI base units used in Unit defitions.

• enum fmi2_dependency_factor_kind_enu_t {fmi2_dependency_factor_kind_dependent = 0, fmi2_dependency_factor_kind_constant, fmi2_dependency←↩

_factor_kind_fixed, fmi2_dependency_factor_kind_tunable,fmi2_dependency_factor_kind_discrete, fmi2_dependency_factor_kind_num }

Dependency factor kinds are used as part of ModelStructure definition.

Functions

• FMILIB_EXPORT const char ∗ fmi2_naming_convention_to_string (fmi2_variable_naming_convension_←↩

enu_t convention)

Convert a fmi2_variable_naming_convension_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi2_fmu_kind_to_string (fmi2_fmu_kind_enu_t kind)

Convert a fmi2_fmu_kind_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi2_variability_to_string (fmi2_variability_enu_t v)

Convert a fmi2_variability_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi2_causality_to_string (fmi2_causality_enu_t c)

Convert a fmi2_causality_enu_t constant into string.

• FMILIB_EXPORT const char ∗ fmi2_initial_to_string (fmi2_initial_enu_t c)

Convert a fmi2_initial_enu_t constant into string.

• FMILIB_EXPORT fmi2_initial_enu_t fmi2_get_default_initial (fmi2_variability_enu_t v, fmi2_causality_enu_tc)

Get default initial attribute value for the given variability and causality combination.

• FMILIB_EXPORT fmi2_initial_enu_t fmi2_get_valid_initial (fmi2_variability_enu_t v, fmi2_causality_enu_t c,fmi2_initial_enu_t i)

Check if the combination of variability, causality and initial is valid.

• FMILIB_EXPORT const char ∗ fmi2_base_type_to_string (fmi2_base_type_enu_t bt)

Convert base type constant to string.

• FMILIB_EXPORT const char ∗ fmi2_capability_to_string (fmi2_capabilities_enu_t id)

Convert capability flag to a string.

• FMILIB_EXPORT const char ∗ fmi2_SI_base_unit_to_string (fmi2_SI_base_units_enu_t id)

Convert SI base unit ID a string.

• FMILIB_EXPORT size_t fmi2_SI_base_unit_exp_to_string (const int exp[fmi2_SI_base_units_Num], size_tbufSize, char buf[ ])

Convert a list of SI base unit exponents (corresponding to the IDs from fmi2_SI_base_units_enu_t) to a string of theform kg∗m∧2/s∧2. Prints '-' if all the exponents are zero.

• FMILIB_EXPORT const char ∗ fmi2_dependency_factor_kind_to_string (fmi2_dependency_factor_kind_←↩

enu_t fc)

Convert dependency factor kind constant to string.

7.25.1 Detailed Description

Definions the enum types used with FMI 2.0 libs.

7.25.2 Macro Definition Documentation

7.25.2.1 #define FMI2_EXPAND_ME_CAPABILITIES_ENU( c ) fmi2_me_ ## c,

Definition at line 159 of file fmi2_enums.h.

Generated by Doxygen

Page 344: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

276 File Documentation

7.25.2.2 #define FMI2_EXPAND_CS_CAPABILITIES_ENU( c ) fmi2_cs_ ## c,

Definition at line 160 of file fmi2_enums.h.

7.25.2.3 #define FMI2_EXPAND_SI_BASE_UNIT_ENU( c ) fmi2_SI_base_unit_ ## c,

Definition at line 178 of file fmi2_enums.h.

7.26 src/Util/include/FMI2/fmi2_functions.h File Reference

#include <string.h>#include <fmilib_config.h>#include "fmi2_types.h"

Data Structures

• struct fmi2_callback_functions_t• struct fmi2_event_info_t

Typedefs

• typedef void(∗ fmi2_callback_logger_ft) (fmi2_component_environment_t env, fmi2_string_t instanceName,fmi2_status_t status, fmi2_string_t category, fmi2_string_t message,...)

• typedef void ∗(∗ fmi2_callback_allocate_memory_ft) (size_t nobj, size_t size)• typedef void(∗ fmi2_callback_free_memory_ft) (void ∗obj)• typedef void(∗ fmi2_step_finished_ft) (fmi2_component_environment_t env, fmi2_status_t status)• typedef const char ∗(∗ fmi2_get_types_platform_ft) ()• typedef const char ∗(∗ fmi2_get_version_ft) ()• typedef fmi2_status_t(∗ fmi2_set_debug_logging_ft) (fmi2_component_t, fmi2_boolean_t, size_t n←↩

Categories, const fmi2_string_t categories[ ])• typedef fmi2_component_t(∗ fmi2_instantiate_ft) (fmi2_string_t, fmi2_type_t, fmi2_string_t, fmi2_string_←↩

t, const fmi2_callback_functions_t ∗, fmi2_boolean_t, fmi2_boolean_t)• typedef void(∗ fmi2_free_instance_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_setup_experiment_ft) (fmi2_component_t, fmi2_boolean_t, fmi2_real_t, fmi2←↩

_real_t, fmi2_boolean_t, fmi2_real_t)• typedef fmi2_status_t(∗ fmi2_enter_initialization_mode_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_exit_initialization_mode_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_terminate_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_reset_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_get_real_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, fmi2←↩

_real_t[ ])• typedef fmi2_status_t(∗ fmi2_get_integer_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, fmi2_integer_t[ ])• typedef fmi2_status_t(∗ fmi2_get_boolean_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, fmi2_boolean_t[ ])• typedef fmi2_status_t(∗ fmi2_get_string_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, fmi2_string_t[ ])

Generated by Doxygen

Page 345: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.26 src/Util/include/FMI2/fmi2_functions.h File Reference 277

• typedef fmi2_status_t(∗ fmi2_set_real_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, constfmi2_real_t[ ])

• typedef fmi2_status_t(∗ fmi2_set_integer_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, const fmi2_integer_t[ ])• typedef fmi2_status_t(∗ fmi2_set_boolean_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_←↩

t, const fmi2_boolean_t[ ])• typedef fmi2_status_t(∗ fmi2_set_string_ft) (fmi2_component_t, const fmi2_value_reference_t[ ], size_t, const

fmi2_string_t[ ])• typedef fmi2_status_t(∗ fmi2_get_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t ∗)• typedef fmi2_status_t(∗ fmi2_set_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t)• typedef fmi2_status_t(∗ fmi2_free_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t ∗)• typedef fmi2_status_t(∗ fmi2_serialized_fmu_state_size_ft) (fmi2_component_t, fmi2_FMU_state_t, size_t ∗)• typedef fmi2_status_t(∗ fmi2_serialize_fmu_state_ft) (fmi2_component_t, fmi2_FMU_state_t, fmi2_byte_t[ ],

size_t)• typedef fmi2_status_t(∗ fmi2_de_serialize_fmu_state_ft) (fmi2_component_t, const fmi2_byte_t[ ], size_←↩

t, fmi2_FMU_state_t ∗)• typedef fmi2_status_t(∗ fmi2_get_directional_derivative_ft) (fmi2_component_t, const fmi2_value_←↩

reference_t[ ], size_t, const fmi2_value_reference_t[ ], size_t, const fmi2_real_t[ ], fmi2_real_t[ ])• typedef fmi2_status_t(∗ fmi2_enter_event_mode_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_new_discrete_states_ft) (fmi2_component_t, fmi2_event_info_t ∗)• typedef fmi2_status_t(∗ fmi2_enter_continuous_time_mode_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_completed_integrator_step_ft) (fmi2_component_t, fmi2_boolean_t, fmi2_←↩

boolean_t ∗, fmi2_boolean_t ∗)• typedef fmi2_status_t(∗ fmi2_set_time_ft) (fmi2_component_t, fmi2_real_t)• typedef fmi2_status_t(∗ fmi2_set_continuous_states_ft) (fmi2_component_t, const fmi2_real_t[ ], size_t)• typedef fmi2_status_t(∗ fmi2_get_derivatives_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)• typedef fmi2_status_t(∗ fmi2_get_event_indicators_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)• typedef fmi2_status_t(∗ fmi2_get_continuous_states_ft) (fmi2_component_t, fmi2_real_t[ ], size_t)• typedef fmi2_status_t(∗ fmi2_get_nominals_of_continuous_states_ft) (fmi2_component_t, fmi2_real_t[ ],

size_t)• typedef fmi2_status_t(∗ fmi2_set_real_input_derivatives_ft) (fmi2_component_t, const fmi2_value_←↩

reference_t[ ], size_t, const fmi2_integer_t[ ], const fmi2_real_t[ ])• typedef fmi2_status_t(∗ fmi2_get_real_output_derivatives_ft) (fmi2_component_t, const fmi2_value_←↩

reference_t[ ], size_t, const fmi2_integer_t[ ], fmi2_real_t[ ])• typedef fmi2_status_t(∗ fmi2_do_step_ft) (fmi2_component_t, fmi2_real_t, fmi2_real_t, fmi2_boolean_t)• typedef fmi2_status_t(∗ fmi2_cancel_step_ft) (fmi2_component_t)• typedef fmi2_status_t(∗ fmi2_get_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_status_t ∗)• typedef fmi2_status_t(∗ fmi2_get_real_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_real_t∗)

• typedef fmi2_status_t(∗ fmi2_get_integer_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_←↩

integer_t ∗)• typedef fmi2_status_t(∗ fmi2_get_boolean_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_←↩

boolean_t ∗)• typedef fmi2_status_t(∗ fmi2_get_string_status_ft) (fmi2_component_t, const fmi2_status_kind_t, fmi2_←↩

string_t ∗)

Enumerations

• enum fmi2_status_t {fmi2_status_ok, fmi2_status_warning, fmi2_status_discard, fmi2_status_error,fmi2_status_fatal, fmi2_status_pending }

• enum fmi2_type_t { fmi2_model_exchange, fmi2_cosimulation }• enum fmi2_status_kind_t { fmi2_do_step_status, fmi2_pending_status, fmi2_last_successful_time, fmi2_←↩

terminated }

Generated by Doxygen

Page 346: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

278 File Documentation

Functions

• FMILIB_EXPORT const char ∗ fmi2_status_to_string (fmi2_status_t status)

7.26.1 Detailed Description

Mapping for the standard FMI 2.0 functions into fmi2_ namespace.

7.27 src/Util/include/FMI2/fmi2_types.h File Reference

#include <FMI2/fmi2TypesPlatform.h>

Macros

Renaming of typedefs

• #define fmi2Component fmi2_component_t• #define fmi2ComponentEnvironment fmi2_component_environment_t• #define fmi2FMUstate fmi2_FMU_state_t• #define fmi2ValueReference fmi2_value_reference_t• #define fmi2Real fmi2_real_t• #define fmi2Integer fmi2_integer_t• #define fmi2Boolean fmi2_boolean_t• #define fmi2Char fmi2_char_t• #define fmi2String fmi2_string_t• #define fmi2Byte fmi2_byte_t

Enumerations

• enum fmi2_boolean_enu_t { fmi2_true =fmi2True, fmi2_false =fmi2False }

Functions

• static const char ∗ fmi2_get_types_platform (void)

7.27.1 Detailed Description

Transformation of the standard FMI type names into fmi2_ prefixed.

7.28 src/Util/include/FMI2/fmi2_xml_callbacks.h File Reference

#include <fmilib_config.h>

Generated by Doxygen

Page 347: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.29 src/Util/include/JM/jm_callbacks.h File Reference 279

Data Structures

• struct fmi2_xml_callbacks_t

XML callbacks are used to process parts of XML that are not handled by the library.

Typedefs

• typedef struct fmi2_xml_callbacks_t fmi2_xml_callbacks_t

XML handling callbacks

• typedef int(∗ fmi2_xml_element_start_handle_ft) (void ∗context, const char ∗toolName, void ∗parent, constchar ∗elm, const char ∗∗attr)

Handle start of an XML element within tool annotation in a SAX parser.• typedef int(∗ fmi2_xml_element_data_handle_ft) (void ∗context, const char ∗s, int len)

Handle data of an XML element within tool annotation in a SAX parser.• typedef int(∗ fmi2_xml_element_end_handle_ft) (void ∗context, const char ∗elm)

Handle end of an XML element within tool annotation in a SAX parser.

7.28.1 Detailed Description

Definition of fmi2_xml_callbacks_t and supporting functions

7.29 src/Util/include/JM/jm_callbacks.h File Reference

#include <stddef.h>#include <stdarg.h>#include <fmilib_config.h>#include "jm_types.h"

Data Structures

• struct jm_callbacks

The callbacks struct is sent to all the modules in the library.

Macros

• #define JM_MAX_ERROR_MESSAGE_SIZE 2000

Maximum message size that can be stored in the jm_callbacks struct.

Generated by Doxygen

Page 348: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

280 File Documentation

Typedefs

• typedef struct jm_callbacks jm_callbacks• typedef void(∗ jm_logger_f) (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string mes-

sage)

Logger callback type.

Memory management callbacks

jm_malloc_f, jm_realloc_f, jm_calloc_f, jm_free_f function types correspond to the standard C memory manage-ment functions

• typedef jm_voidp(∗ jm_malloc_f) (size_t size)Allocation function type.

• typedef jm_voidp(∗ jm_realloc_f) (void ∗ptr, size_t size)Re-allocation function type.

• typedef jm_voidp(∗ jm_calloc_f) (size_t numitems, size_t itemsize)Zero-initialized allocation function type.

• typedef void(∗ jm_free_f) (jm_voidp p)Free memory function type.

Functions

• static jm_string jm_get_last_error (jm_callbacks ∗cb)

Get the last log message produced by the library.

• static void jm_clear_last_error (jm_callbacks ∗cb)

Clear the last generated log message.

• FMILIB_EXPORT void jm_set_default_callbacks (jm_callbacks ∗c)

Set the structure to be returned by jm_get_default_callbacks().

• FMILIB_EXPORT jm_callbacks ∗ jm_get_default_callbacks (void)

Get default callbacks. The function never returns NULL.

• FMILIB_EXPORT void jm_default_logger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level,jm_string message)

The default logger implementation prints messages to stderr.

• FMILIB_EXPORT void jm_log (jm_callbacks ∗cb, const char ∗module, jm_log_level_enu_t log_level, constchar ∗fmt,...)

Send a message to the logger function.

• FMILIB_EXPORT void jm_log_v (jm_callbacks ∗cb, const char ∗module, jm_log_level_enu_t log_level, constchar ∗fmt, va_list ap)

Send a message to the logger function.

• FMILIB_EXPORT void jm_log_fatal_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a fatal error message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_fatal (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a fatal error message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_error_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a error message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_error (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a error message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_warning_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a warning message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_warning (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a warning message to the logger function. See jm_log() for details.

• FMILIB_EXPORT void jm_log_info_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Generated by Doxygen

Page 349: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.30 src/Util/include/JM/jm_named_ptr.h File Reference 281

Send an info message to the logger function. See jm_log() for details.• FMILIB_EXPORT void jm_log_info (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send an info message to the logger function. See jm_log() for details.• FMILIB_EXPORT void jm_log_verbose_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a verbose message to the logger function. See jm_log() for details.• FMILIB_EXPORT void jm_log_verbose (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a verbose message to the logger function. See jm_log() for details.• static void jm_log_debug_v (jm_callbacks ∗cb, const char ∗module, const char ∗fmt, va_list ap)

Send a debug message to the logger function. See jm_log() for details.• static void jm_log_debug (jm_callbacks ∗cb, const char ∗module, const char ∗fmt,...)

Send a debug message to the logger function. See jm_log() for details.

7.29.1 Detailed Description

Definition of jm_callbacks and supporting functions

7.30 src/Util/include/JM/jm_named_ptr.h File Reference

#include "jm_vector.h"#include "jm_callbacks.h"

Data Structures

• struct jm_named_ptr

Name and object pointer pair.

Macros

• #define jm_diff_named(a, b) strcmp(a.name,b.name)

Typedefs

• typedef struct jm_named_ptr jm_named_ptr

Name and object pointer pair.

Functions

• jm_named_ptr jm_named_alloc (jm_string name, size_t size, size_t nameoffset, jm_callbacks ∗c)

Allocate memory for the object and the name string and sets pointer to it packed together with the name pointer.• jm_named_ptr jm_named_alloc_v (jm_vector(char)∗name, size_t size, size_t nameoffset, jm_callbacks ∗c)

Same as jm_named_alloc() but name is given as a jm_vector(char) pointer.• static void jm_named_free (jm_named_ptr np, jm_callbacks ∗c)

Free the memory allocated for the object pointed by jm_named_ptr.• jm_vector_declare_template (jm_named_ptr) jm_define_comp_f(jm_compare_named

Helper to construct comparison operation.• static jm_diff_named void jm_named_vector_free_data (jm_vector(jm_named_ptr)∗v)

Release the data allocated by the items in a vector and then clears the memory used by the vector as well.• static void jm_named_vector_free (jm_vector(jm_named_ptr)∗v)

Release the data allocated by the items in a vector and then clears the memory used by the vector as well.

Generated by Doxygen

Page 350: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

282 File Documentation

7.30.1 Detailed Description

Definition of jm_named_ptr and supporting functions

7.30.2 Macro Definition Documentation

7.30.2.1 #define jm_diff_named( a, b ) strcmp(a.name,b.name)

7.31 src/Util/include/JM/jm_portability.h File Reference

#include <fmilib_config.h>#include "jm_callbacks.h"#include <dlfcn.h>#include "jm_types.h"

Macros

• #define DLL_HANDLE void∗

Typedefs

• typedef void ∗ jm_dll_function_ptr

A function pointer as returned when DLL symbol is loaded.

Functions

• DLL_HANDLE jm_portability_load_dll_handle (const char ∗dll_file_path)

Load a dll/so library into the process and return a handle.

• jm_status_enu_t jm_portability_free_dll_handle (DLL_HANDLE dll_handle)

Unload a Dll and release the handle.

• jm_status_enu_t jm_portability_load_dll_function (DLL_HANDLE dll_handle, char ∗dll_function_name, jm←↩

_dll_function_ptr ∗dll_function_ptrptr)

Find a function in the Dll and return a function pointer.

• char ∗ jm_portability_get_last_dll_error (void)

Return error associated with Dll handling.

• jm_status_enu_t jm_portability_get_current_working_directory (char ∗buffer, size_t len)

Get current working directory name.

• jm_status_enu_t jm_portability_set_current_working_directory (const char ∗cwd)

Set current working directory.

• const char ∗ jm_get_system_temp_dir ()

Get system-wide temporary directory.

• char ∗ jm_mkdtemp (jm_callbacks ∗cb, char ∗tmplt)

Create a uniquely named temporary directory.

• char ∗ jm_get_dir_abspath (jm_callbacks ∗cb, const char ∗dir, char ∗outPath, size_t len)

Get absolute path to an existing directory.

• char ∗ jm_mk_temp_dir (jm_callbacks ∗cb, const char ∗systemTempDir, const char ∗tempPrefix)

Generated by Doxygen

Page 351: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.32 src/Util/include/JM/jm_stack.h File Reference 283

Create a unique temporary directory.• char ∗ jm_create_URL_from_abs_path (jm_callbacks ∗cb, const char ∗absPath)

Create a file:// URL from absolute path.• jm_status_enu_t jm_mkdir (jm_callbacks ∗cb, const char ∗dir)

Make a directory.• jm_status_enu_t jm_rmdir (jm_callbacks ∗cb, const char ∗dir)

Remove directory and all it contents.• FMILIB_EXPORT int jm_vsnprintf (char ∗str, size_t size, const char ∗fmt, va_list al)

C89 compatible implementation of C99 vsnprintf.• FMILIB_EXPORT int jm_snprintf (char ∗str, size_t size, const char ∗fmt,...)

C89 compatible implementation of C99 snprintf.

7.31.1 Detailed Description

Handling platform specific defines and functions.

7.31.2 Macro Definition Documentation

7.31.2.1 #define DLL_HANDLE void∗

Definition at line 26 of file jm_portability.h.

7.32 src/Util/include/JM/jm_stack.h File Reference

#include "jm_vector.h"

Macros

• #define jm_stack(T) jm_mangle(jm_stack, T)

A basic stack of items.• #define jm_stack_alloc(T) jm_mangle(jm_stack_alloc, T)

Allocates a stack with the given reserved memory.• #define jm_stack_free(T) jm_mangle(jm_stack_free, T)

Release memory allocated for a stack.• #define jm_stack_init(T) jm_mangle(jm_stack_init, T)

Initializes a jm_stack allocated on stack.• #define jm_stack_free_data(T) jm_mangle(jm_stack_free_data, T)

Releases memory allocated for stack data.• #define jm_stack_get_size(T) jm_mangle(jm_stack_get_size, T)

Get the number of elements in the stack.• #define jm_stack_reserve(T) jm_mangle(jm_stack_reserve, T)

Preallocate memory for the stack (to speed up consequent push).• #define jm_stack_push(T) jm_mangle(jm_stack_push, T)

Put an element on the stack.• #define jm_stack_is_empty(T) jm_mangle(jm_stack_is_empty, T)• #define jm_stack_pop(T) jm_mangle(jm_stack_pop, T)• #define jm_stack_top(T) jm_mangle(jm_stack_top, T)• #define jm_stack_foreach(T) jm_mangle(jm_stack_foreach, T)• #define JM_STACK_MINIMAL_CAPACITY JM_VECTOR_MINIMAL_CAPACITY• #define JM_STACK_MAX_MEMORY_CHUNK JM_VECTOR_MAX_MEMORY_CHUNK• #define jm_stack_declare_template(T)

Generated by Doxygen

Page 352: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

284 File Documentation

7.33 src/Util/include/JM/jm_string_set.h File Reference

#include <string.h>#include <stdio.h>#include "jm_types.h"#include "jm_vector.h"

Typedefs

• typedef struct jm_vector_jm_string jm_string_set

Set of string is based on a vector.

Functions

• static jm_string jm_string_set_find (jm_string_set ∗s, jm_string str)

Find a string in a set.

• static size_t jm_string_set_find_index (jm_string_set ∗s, jm_string str)

Find index of a string in a set.

• static jm_string jm_string_set_put (jm_string_set ∗s, jm_string str)

Put an element in the set if it is not there yet.

7.33.1 Detailed Description

Definition of jm_string_set and supporting functions

7.34 src/Util/include/JM/jm_types.h File Reference

#include <fmilib_config.h>

Data Structures

• struct jm_name_ID_map_t

Mapping between a string and an integer ID.

Typedefs

• typedef const char ∗ jm_string

A constant string.

• typedef void ∗ jm_voidp

A void pointer.

• typedef struct jm_name_ID_map_t jm_name_ID_map_t

Mapping between a string and an integer ID.

Generated by Doxygen

Page 353: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.35 src/Util/include/JM/jm_vector.h File Reference 285

Enumerations

• enum jm_status_enu_t { jm_status_error = -1, jm_status_success = 0, jm_status_warning = 1 }

Return status codes.

• enum jm_log_level_enu_t {jm_log_level_nothing = 0, jm_log_level_fatal, jm_log_level_error, jm_log_level_warning,jm_log_level_info, jm_log_level_verbose, jm_log_level_debug, jm_log_level_all }

Log levels supported via the logger functions in jm_callbacks.

Functions

• FMILIB_EXPORT const char ∗ jm_log_level_to_string (jm_log_level_enu_t level)

Convert log level into a string.

7.34.1 Detailed Description

Types used in the Utils module.

7.35 src/Util/include/JM/jm_vector.h File Reference

#include <assert.h>#include <string.h>#include "jm_callbacks.h"

Macros

• #define jm_mangle_ex(name, type) name## _ ##type

jm_mange macro is used to construct names for the template instances Extra level (jm_mange_ex) is needed to forceargument expansion (pre-scan)

• #define jm_mangle(name, type) jm_mangle_ex(name,type)• #define jm_vector(T) jm_mangle(jm_vector, T)

jm_vector(T) is the type name (i.e., to be used as jm_vector(int) vi;)

• #define JM_VECTOR_MINIMAL_CAPACITY 16• #define JM_VECTOR_MAX_MEMORY_CHUNK 1024• #define jm_vector_declare_template(T)• #define jm_diff_name(a, b) strcmp(a.name,b.name)

Functions

• jm_vector_declare_template (char) static jm_string jm_vector_char2string(jm_vector(char)∗v)• jm_vector_declare_template (int) jm_vector_declare_template(double) jm_vector_declare_template(jm_←↩

voidp) jm_vector_declare_template(size_t) jm_vector_declare_template(jm_string) jm_vector_declare_←↩

template(jm_name_ID_map_t) jm_define_comp_f(jm_compare_voidp• int jm_diff jm_define_comp_f (jm_compare_int, int, jm_diff) jm_define_comp_f(jm_compare_char• int jm_diff jm_diff jm_define_comp_f (jm_compare_double, double, jm_diff) jm_define_comp_f(jm_compare←↩

_size_t• int jm_diff jm_diff jm_diff jm_define_comp_f (jm_compare_string, jm_string, strcmp) jm_define_comp_f(jm←↩

_compare_name

Generated by Doxygen

Page 354: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

286 File Documentation

Variables

• int jm_diff char• int jm_diff jm_diff size_t• int jm_diff jm_diff jm_diff jm_name_ID_map_t• int jm_diff jm_diff jm_diff jm_diff_name

Vector handling functions.

Allocates a vector on heap with the specified size and specified number of preallocated items (can be larger thansize).

extern jm_vector(T)∗ jm_vector_alloc(T)(size_t size, size_t capacity, jm_callbacks∗c ); Note that there is no need tocall jm_vector_init for a vector allocated with this function.

Parameters

size - initial size of the vector, can be 0

capacity - initial capacity of the vector, can be 0. At least initSize elements are allocated.

c - jm_callbacks callbacks, can be zero

Returns

Newly allocated vector

• #define jm_vector_alloc(T) jm_mangle(jm_vector_alloc, T)• #define jm_vector_free(T) jm_mangle(jm_vector_free, T)• #define jm_vector_init(T) jm_mangle(jm_vector_init, T)

jm_vector_init initializes a vector allocated on stack.

• #define jm_vector_free_data(T) jm_mangle(jm_vector_free_data, T)• #define jm_vector_get_size(T) jm_mangle(jm_vector_get_size, T)• #define jm_vector_get_item(T) jm_mangle(jm_vector_get_item, T)• #define jm_vector_get_itemp(T) jm_mangle(jm_vector_get_itemp, T)• #define jm_vector_get_last(T) jm_mangle(jm_vector_get_last, T)• #define jm_vector_get_lastp(T) jm_mangle(jm_vector_get_lastp, T)• #define jm_define_comp_f(F, T, COMPAR_OP)

A conveniece macro for comparison function definition.

• #define jm_diff(first, second) (int)(first-second)• #define jm_vector_find(T) jm_mangle(jm_vector_find, T)

jm_vector_find functions use linear search to find items in a vector. JM_COMPAR_OP is used for comparison.

• #define jm_vector_find_index(T) jm_mangle(jm_vector_find_index, T)• #define jm_vector_qsort(T) jm_mangle(jm_vector_qsort, T)• #define jm_vector_bsearch(T) jm_mangle(jm_vector_bsearch, T)• #define jm_vector_bsearch_index(T) jm_mangle(jm_vector_bsearch_index, T)• #define jm_vector_set_item(T) jm_mangle(jm_vector_set_item, T)• #define jm_vector_zero(T) jm_mangle(jm_vector_zero, T)• #define jm_vector_resize(T) jm_mangle(jm_vector_resize, T)• #define jm_vector_reserve(T) jm_mangle(jm_vector_reserve, T)• #define jm_vector_copy(T) jm_mangle(jm_vector_copy, T)• #define jm_vector_clone(T) jm_mangle(jm_vector_clone, T)• #define jm_vector_append(T) jm_mangle(jm_vector_append, T)

Generated by Doxygen

Page 355: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.36 src/Util/include/JM/jm_vector_template.h File Reference 287

• #define jm_vector_insert(T) jm_mangle(jm_vector_insert, T)• #define jm_vector_remove_item(T) jm_mangle(jm_vector_remove_item, T)• #define jm_vector_resize1(T) jm_mangle(jm_vector_resize1, T)• #define jm_vector_push_back(T) jm_mangle(jm_vector_push_back, T)• #define jm_vector_foreach(T) jm_mangle(jm_vector_foreach, T)• #define jm_vector_foreach_c(T) jm_mangle(jm_vector_foreach_c, T)• typedef int(∗ jm_compare_ft) (const void ∗, const void ∗)

Function type for item comparison. Can be generated with jm_define_comp_f.

7.35.1 Detailed Description

Definition of jm_vector and supporting functions

7.35.2 Macro Definition Documentation

7.35.2.1 #define jm_diff_name( a, b ) strcmp(a.name,b.name)

7.36 src/Util/include/JM/jm_vector_template.h File Reference

Vector template definition.

#include <stdlib.h>#include <string.h>#include "jm_vector.h"

Macros

• #define jm_vector_ptr2index(T) jm_mangle(jm_vector_ptr2index, T)

Functions

• jm_vector (JM_TEMPLATE_INSTANCE_TYPE)∗jm_vector_alloc(JM_TEMPLATE_INSTANCE_TY←↩

PE)(size_t size• if (c) cc• if (reserve< size) reserve• if (reserve > JM_VECTOR_MINIMAL_CAPACITY)• if (!v) return 0• void jm_vector_free() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TY←↩

PE)∗a)• size_t jm_vector_init() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TY←↩

PE)∗a, size_t initSize, jm_callbacks ∗c)• size_t jm_vector_resize() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_T←↩

YPE)∗a, size_t size)• size_t jm_vector_copy() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TY←↩

PE)∗destination, jm_vector(JM_TEMPLATE_INSTANCE_TYPE)∗source)• JM_TEMPLATE_INSTANCE_TYPE ∗jm_vector_insert() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(J←↩

M_TEMPLATE_INSTANCE_TYPE)∗a, size_t index, JM_TEMPLATE_INSTANCE_TYPE item)

Generated by Doxygen

Page 356: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

288 File Documentation

• JM_TEMPLATE_INSTANCE_TYPE ∗jm_vector_push_back() JM_TEMPLATE_INSTANCE_TYPE (jm_←↩

vector(JM_TEMPLATE_INSTANCE_TYPE)∗a, JM_TEMPLATE_INSTANCE_TYPE item)• void jm_vector_foreach_c() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_←↩

TYPE)∗a, void(∗f)(JM_TEMPLATE_INSTANCE_TYPE, void ∗), void ∗data)• void jm_vector_foreach() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_T←↩

YPE)∗a, void(∗f)(JM_TEMPLATE_INSTANCE_TYPE))• void jm_vector_qsort() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INSTANCE_TY←↩

PE)∗v, jm_compare_ft f)• static size_t jm_vector_ptr2index() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INST←↩

ANCE_TYPE)∗v, JM_TEMPLATE_INSTANCE_TYPE ∗itemp)• size_t jm_vector_bsearch_index() JM_TEMPLATE_INSTANCE_TYPE (jm_vector(JM_TEMPLATE_INST←↩

ANCE_TYPE)∗v, JM_TEMPLATE_INSTANCE_TYPE ∗key, jm_compare_ft f)

Variables

• size_t capacity = JM_VECTOR_MINIMAL_CAPACITY• size_t jm_callbacks ∗ c• jm_callbacks ∗ cc = jm_get_default_callbacks()• reserve = capacity• else• v callbacks = cc• v items = &(v->preallocated[0])• v size = size• return v

7.36.1 Detailed Description

Vector template definition.

This file is supposed to be included into a C-file that instantiate the template. jm_vector.h must be included beforethis file. It expects JM_TEMPLATE_INSTANCE_TYPE to be defined to the template type to be instantiated.

7.37 Test/compress_test_fmu_zip.c File Reference

#include <stdio.h>#include <stdlib.h>#include <JM/jm_types.h>#include <JM/jm_callbacks.h>#include <FMI/fmi_zip_zip.h>

Functions

• static void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string mes-sage)

• int main (int argc, char ∗argv[ ])

Generated by Doxygen

Page 357: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.38 Test/FMI1/compress_test_fmu_zip.c File Reference 289

7.37.1 Function Documentation

7.37.1.1 static void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_stringmessage ) [static]

Definition at line 22 of file compress_test_fmu_zip.c.

7.37.1.2 int main ( int argc, char ∗ argv[ ] )

Definition at line 27 of file compress_test_fmu_zip.c.

7.38 Test/FMI1/compress_test_fmu_zip.c File Reference

#include <stdio.h>#include <stdlib.h>#include <JM/jm_types.h>#include <JM/jm_callbacks.h>#include <FMI/fmi_zip_zip.h>

Functions

• static void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string mes-sage)

• int main (int argc, char ∗argv[ ])

7.38.1 Function Documentation

7.38.1.1 static void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_stringmessage ) [static]

Definition at line 22 of file compress_test_fmu_zip.c.

7.38.1.2 int main ( int argc, char ∗ argv[ ] )

Definition at line 27 of file compress_test_fmu_zip.c.

Generated by Doxygen

Page 358: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

290 File Documentation

7.39 Test/FMI1/fmi1_capi_cs_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <errno.h>#include <JM/jm_types.h>#include <JM/jm_portability.h>#include <FMI1/fmi1_types.h>#include <FMI1/fmi1_functions.h>#include <FMI1/fmi1_capi.h>#include <JM/jm_callbacks.h>#include <fmu_dummy/fmu1_model_defines.h>#include "config_test.h"

Macros

• #define MODEL_IDENTIFIER FMU_DUMMY_CS_MODEL_IDENTIFIER• #define INSTANCE_NAME "Test Model"

Functions

• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void fmilogger (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t cate-

gory, fmi1_string_t message,...)• void do_exit (int code)• int test_create_dllfmu ()

Tests fmi1_capi_create_dllfmu.

• int test_load_dll ()

Tests fmi1_capi_load_dll.

• int test_load_dll_fcn ()

Tests fmi1_capi_load_fcn.

• int test_fmi_get_version ()

Tests fmi1_capi_get_version.

• int test_get_types_platform ()

Tests fmi1_capi_get_types_platform.

• int test_instantiate_slave ()

Tests fmi1_capi_instantiate_slave.

• int test_initialize_slave ()

Tests fmi1_capi_initialize_slave.

• int test_set_debug_logging ()

Tests fmi1_capi_set_debug_logging.

• int test_cancel_step ()

Tests fmi1_capi_cancel_step.

• int test_do_step ()

Tests fmi1_capi_do_step.

• int test_get_status ()

Tests fmi1_capi_get_status.

• int test_get_real_status ()

Generated by Doxygen

Page 359: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.39 Test/FMI1/fmi1_capi_cs_test.c File Reference 291

Tests fmi1_capi_get_real_status.

• int test_get_integer_status ()

Tests fmi1_capi_get_integer_status.

• int test_get_boolean_status ()

Tests fmi1_capi_get_boolean_status.

• int test_get_string_status ()

Tests fmi1_capi_get_string_status.

• int test_set_get_string ()

Tests fmi1_capi_set_string and fmi1_capi_get_string Some values are set with fmi1_capi_set_string. The samevalues are retrived with fmi1_capi_get_string and tested to be the same as thoughs that were set.

• int test_set_get_integer ()

Tests fmi1_capi_set_integer and fmi1_capi_get_integer Some values are set with fmi1_capi_set_integer. The samevalues are retrived with fmi1_capi_get_integer and tested to be the same as thoughs that were set.

• int test_set_get_boolean ()

Tests fmi1_capi_set_boolean and fmi1_capi_get_boolean Some values are set with fmi1_capi_set_boolean. Thesame values are retrived with fmi1_capi_get_boolean and tested to be the same as thoughs that were set.

• int test_set_get_real ()

Tests fmi1_capi_set_real and fmi1_capi_get_real Some values are set with fmi1_capi_set_real. The same values areretrived with fmi1_capi_get_real and tested to be the same as thoughs that were set.

• int test_reset_slave ()

Tests fmi1_capi_reset_slave.

• int test_set_real_input_derivatives ()

Tests fmi1_capi_set_real_input_derivatives fmi1_capi_set_real_input_derivatives returns fmiError if wrong values areset. The values that are set are tested inside the DLL.

• int test_get_real_output_derivatives ()

Tests fmi1_capi_get_real_output_derivatives The output values from fmi1_capi_get_real_output_derivatives is ex-pected to have a special value that is coded in the DLL.

• int test_terminate_slave ()

Tests fmi1_capi_terminate_slave.

• int test_free_slave_instance ()

Tests fmi1_capi_free_slave_instance.

• int test_free_dll ()

Tests fmi1_capi_free_dll.

• int test_destroy_dllfmu ()

Tests fmi1_capi_destroy_dllfmu.

• int main (int argc, char ∗argv[ ])

Tests the C-API for FMI 1.0 Co-Simulation. The tests are performed using a test-dll. The functions are called and thevalues are set or returned are validated either in the test function(output functions) or inside the dll(input functions). Ifany error occures, the program exits.

Variables

• fmi1_capi_t ∗ fmu• jm_callbacks ∗ callbacks = 0

7.39.1 Macro Definition Documentation

7.39.1.1 #define MODEL_IDENTIFIER FMU_DUMMY_CS_MODEL_IDENTIFIER

Definition at line 32 of file fmi1_capi_cs_test.c.

Generated by Doxygen

Page 360: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

292 File Documentation

7.39.1.2 #define INSTANCE_NAME "Test Model"

Definition at line 35 of file fmi1_capi_cs_test.c.

7.39.2 Function Documentation

7.39.2.1 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 40 of file fmi1_capi_cs_test.c.

7.39.2.2 void fmilogger ( fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t category,fmi1_string_t message, ... )

Definition at line 46 of file fmi1_capi_cs_test.c.

7.39.2.3 void do_exit ( int code )

Definition at line 60 of file fmi1_capi_cs_test.c.

7.39.2.4 int test_create_dllfmu ( )

Tests fmi1_capi_create_dllfmu.

Definition at line 73 of file fmi1_capi_cs_test.c.

7.39.2.5 int test_load_dll ( )

Tests fmi1_capi_load_dll.

Definition at line 107 of file fmi1_capi_cs_test.c.

7.39.2.6 int test_load_dll_fcn ( )

Tests fmi1_capi_load_fcn.

Definition at line 126 of file fmi1_capi_cs_test.c.

7.39.2.7 int test_fmi_get_version ( )

Tests fmi1_capi_get_version.

Definition at line 146 of file fmi1_capi_cs_test.c.

Generated by Doxygen

Page 361: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.39 Test/FMI1/fmi1_capi_cs_test.c File Reference 293

7.39.2.8 int test_get_types_platform ( )

Tests fmi1_capi_get_types_platform.

Definition at line 164 of file fmi1_capi_cs_test.c.

7.39.2.9 int test_instantiate_slave ( )

Tests fmi1_capi_instantiate_slave.

Definition at line 182 of file fmi1_capi_cs_test.c.

7.39.2.10 int test_initialize_slave ( )

Tests fmi1_capi_initialize_slave.

Definition at line 211 of file fmi1_capi_cs_test.c.

7.39.2.11 int test_set_debug_logging ( )

Tests fmi1_capi_set_debug_logging.

Definition at line 236 of file fmi1_capi_cs_test.c.

7.39.2.12 int test_cancel_step ( )

Tests fmi1_capi_cancel_step.

Definition at line 253 of file fmi1_capi_cs_test.c.

7.39.2.13 int test_do_step ( )

Tests fmi1_capi_do_step.

Definition at line 270 of file fmi1_capi_cs_test.c.

7.39.2.14 int test_get_status ( )

Tests fmi1_capi_get_status.

Definition at line 294 of file fmi1_capi_cs_test.c.

7.39.2.15 int test_get_real_status ( )

Tests fmi1_capi_get_real_status.

Definition at line 315 of file fmi1_capi_cs_test.c.

Generated by Doxygen

Page 362: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

294 File Documentation

7.39.2.16 int test_get_integer_status ( )

Tests fmi1_capi_get_integer_status.

Definition at line 335 of file fmi1_capi_cs_test.c.

7.39.2.17 int test_get_boolean_status ( )

Tests fmi1_capi_get_boolean_status.

Definition at line 355 of file fmi1_capi_cs_test.c.

7.39.2.18 int test_get_string_status ( )

Tests fmi1_capi_get_string_status.

Definition at line 375 of file fmi1_capi_cs_test.c.

7.39.2.19 int test_set_get_string ( )

Tests fmi1_capi_set_string and fmi1_capi_get_string Some values are set with fmi1_capi_set_string. The samevalues are retrived with fmi1_capi_get_string and tested to be the same as thoughs that were set.

Definition at line 395 of file fmi1_capi_cs_test.c.

7.39.2.20 int test_set_get_integer ( )

Tests fmi1_capi_set_integer and fmi1_capi_get_integer Some values are set with fmi1_capi_set_integer. The samevalues are retrived with fmi1_capi_get_integer and tested to be the same as thoughs that were set.

Definition at line 440 of file fmi1_capi_cs_test.c.

7.39.2.21 int test_set_get_boolean ( )

Tests fmi1_capi_set_boolean and fmi1_capi_get_boolean Some values are set with fmi1_capi_set_boolean. Thesame values are retrived with fmi1_capi_get_boolean and tested to be the same as thoughs that were set.

Definition at line 485 of file fmi1_capi_cs_test.c.

7.39.2.22 int test_set_get_real ( )

Tests fmi1_capi_set_real and fmi1_capi_get_real Some values are set with fmi1_capi_set_real. The same valuesare retrived with fmi1_capi_get_real and tested to be the same as thoughs that were set.

Definition at line 530 of file fmi1_capi_cs_test.c.

Generated by Doxygen

Page 363: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.39 Test/FMI1/fmi1_capi_cs_test.c File Reference 295

7.39.2.23 int test_reset_slave ( )

Tests fmi1_capi_reset_slave.

Definition at line 575 of file fmi1_capi_cs_test.c.

7.39.2.24 int test_set_real_input_derivatives ( )

Tests fmi1_capi_set_real_input_derivatives fmi1_capi_set_real_input_derivatives returns fmiError if wrong valuesare set. The values that are set are tested inside the DLL.

Definition at line 592 of file fmi1_capi_cs_test.c.

7.39.2.25 int test_get_real_output_derivatives ( )

Tests fmi1_capi_get_real_output_derivatives The output values from fmi1_capi_get_real_output_derivatives is ex-pected to have a special value that is coded in the DLL.

Definition at line 623 of file fmi1_capi_cs_test.c.

7.39.2.26 int test_terminate_slave ( )

Tests fmi1_capi_terminate_slave.

Definition at line 670 of file fmi1_capi_cs_test.c.

7.39.2.27 int test_free_slave_instance ( )

Tests fmi1_capi_free_slave_instance.

Definition at line 687 of file fmi1_capi_cs_test.c.

7.39.2.28 int test_free_dll ( )

Tests fmi1_capi_free_dll.

Definition at line 698 of file fmi1_capi_cs_test.c.

7.39.2.29 int test_destroy_dllfmu ( )

Tests fmi1_capi_destroy_dllfmu.

Definition at line 709 of file fmi1_capi_cs_test.c.

Generated by Doxygen

Page 364: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

296 File Documentation

7.39.2.30 int main ( int argc, char ∗ argv[ ] )

Tests the C-API for FMI 1.0 Co-Simulation. The tests are performed using a test-dll. The functions are called and thevalues are set or returned are validated either in the test function(output functions) or inside the dll(input functions).If any error occures, the program exits.

Definition at line 721 of file fmi1_capi_cs_test.c.

7.39.3 Variable Documentation

7.39.3.1 fmi1_capi_t∗ fmu

Definition at line 37 of file fmi1_capi_cs_test.c.

7.39.3.2 jm_callbacks∗ callbacks = 0

Definition at line 67 of file fmi1_capi_cs_test.c.

7.40 Test/FMI1/fmi1_capi_me_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <errno.h>#include <fmilib.h>#include "config_test.h"#include <FMI1/fmi1_capi.h>#include <fmu_dummy/fmu1_model_defines.h>

Macros

• #define MODEL_IDENTIFIER FMU_DUMMY_ME_MODEL_IDENTIFIER

• #define INSTANCE_NAME "Test Model"

Generated by Doxygen

Page 365: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.40 Test/FMI1/fmi1_capi_me_test.c File Reference 297

Functions

• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void fmilogger (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t cate-

gory, fmi1_string_t message,...)• void do_exit (int code)• int test_create_dllfmu ()

Tests fmi1_capi_create_dllfmu.

• int test_load_dll ()

Tests fmi1_capi_load_dll.

• int test_load_dll_fcn ()

Tests fmi1_capi_load_fcn.

• int test_fmi_get_version ()

Tests fmi1_capi_get_version.

• int test_fmi_get_model_types_platform ()

Tests fmi1_capi_get_model_types_platform.

• int test_instantiate_model ()

Tests fmi1_capi_instantiate_model.

• int test_fmi_set_time ()

Tests fmi1_capi_set_time.

• int test_set_continuous_states ()

Tests fmi1_capi_set_continuous_states.

• int test_initialize ()

Tests fmi1_capi_initialize.

• int test_completed_integrator_step ()

Tests fmi1_capi_completed_integrator_step.

• int test_get_derivatives ()

Tests fmi1_capi_get_derivatives.

• int test_get_event_indicators ()• int test_event_update ()

Tests fmi1_capi_eventUpdate.

• int test_get_continuous_states ()

Tests fmi1_capi_get_continuous_states.

• int test_get_nominal_continuous_states ()

Tests fmi1_capi_get_nominal_continuous_states.

• int test_get_state_value_references ()

Tests fmi1_capi_get_state_value_references.

• int test_set_debug_logging ()

Tests fmi1_capi_set_debug_logging.

• int test_set_get_string ()

Tests fmi1_capi_set_string and fmi1_capi_get_string Some values are set with fmi1_capi_set_string. The samevalues are retrived with fmi1_capi_get_string and tested to be the same as thoughs that were set.

• int test_set_get_integer ()

Tests fmi1_capi_set_integer and fmi1_capi_get_integer Some values are set with fmi1_capi_set_integer. The samevalues are retrived with fmi1_capi_get_integer and tested to be the same as thoughs that were set.

• int test_set_get_boolean ()

Tests fmi1_capi_set_boolean and fmi1_capi_get_boolean Some values are set with fmi1_capi_set_boolean. Thesame values are retrived with fmi1_capi_get_boolean and tested to be the same as thoughs that were set.

• int test_set_get_real ()

Tests fmi1_capi_set_real and fmi1_capi_get_real Some values are set with fmi1_capi_set_real. The same values areretrived with fmi1_capi_get_real and tested to be the same as thoughs that were set.

• int test_terminate ()

Generated by Doxygen

Page 366: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

298 File Documentation

Tests fmi1_capi_terminate.

• int test_free_model_instance ()

Tests fmi1_capi_free_model_instance.

• int test_free_dll ()

Tests fmi1_capi_free_dll.

• int test_destroy_dllfmu ()

Tests fmi1_capi_destroy_dllfmu.

• int main (int argc, char ∗argv[ ])

Tests the C-API for FMI 1.0 Model Exchange. The tests are performed using a test-dll. The functions are calledand the values are set or returned are validated either in the test function(output functions) or inside the dll(inputfunctions). If any error occures, the program exits.

Variables

• fmi1_capi_t ∗ fmu• jm_callbacks ∗ callbacks

7.40.1 Macro Definition Documentation

7.40.1.1 #define MODEL_IDENTIFIER FMU_DUMMY_ME_MODEL_IDENTIFIER

Definition at line 34 of file fmi1_capi_me_test.c.

7.40.1.2 #define INSTANCE_NAME "Test Model"

Definition at line 37 of file fmi1_capi_me_test.c.

7.40.2 Function Documentation

7.40.2.1 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 42 of file fmi1_capi_me_test.c.

7.40.2.2 void fmilogger ( fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t category,fmi1_string_t message, ... )

Definition at line 48 of file fmi1_capi_me_test.c.

7.40.2.3 void do_exit ( int code )

Definition at line 62 of file fmi1_capi_me_test.c.

Generated by Doxygen

Page 367: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.40 Test/FMI1/fmi1_capi_me_test.c File Reference 299

7.40.2.4 int test_create_dllfmu ( )

Tests fmi1_capi_create_dllfmu.

Definition at line 75 of file fmi1_capi_me_test.c.

7.40.2.5 int test_load_dll ( )

Tests fmi1_capi_load_dll.

Definition at line 108 of file fmi1_capi_me_test.c.

7.40.2.6 int test_load_dll_fcn ( )

Tests fmi1_capi_load_fcn.

Definition at line 127 of file fmi1_capi_me_test.c.

7.40.2.7 int test_fmi_get_version ( )

Tests fmi1_capi_get_version.

Definition at line 147 of file fmi1_capi_me_test.c.

7.40.2.8 int test_fmi_get_model_types_platform ( )

Tests fmi1_capi_get_model_types_platform.

Definition at line 165 of file fmi1_capi_me_test.c.

7.40.2.9 int test_instantiate_model ( )

Tests fmi1_capi_instantiate_model.

Definition at line 183 of file fmi1_capi_me_test.c.

7.40.2.10 int test_fmi_set_time ( )

Tests fmi1_capi_set_time.

Definition at line 200 of file fmi1_capi_me_test.c.

7.40.2.11 int test_set_continuous_states ( )

Tests fmi1_capi_set_continuous_states.

Definition at line 217 of file fmi1_capi_me_test.c.

Generated by Doxygen

Page 368: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

300 File Documentation

7.40.2.12 int test_initialize ( )

Tests fmi1_capi_initialize.

Definition at line 246 of file fmi1_capi_me_test.c.

7.40.2.13 int test_completed_integrator_step ( )

Tests fmi1_capi_completed_integrator_step.

Definition at line 277 of file fmi1_capi_me_test.c.

7.40.2.14 int test_get_derivatives ( )

Tests fmi1_capi_get_derivatives.

Definition at line 299 of file fmi1_capi_me_test.c.

7.40.2.15 int test_get_event_indicators ( )

Definition at line 320 of file fmi1_capi_me_test.c.

7.40.2.16 int test_event_update ( )

Tests fmi1_capi_eventUpdate.

Definition at line 345 of file fmi1_capi_me_test.c.

7.40.2.17 int test_get_continuous_states ( )

Tests fmi1_capi_get_continuous_states.

Definition at line 373 of file fmi1_capi_me_test.c.

7.40.2.18 int test_get_nominal_continuous_states ( )

Tests fmi1_capi_get_nominal_continuous_states.

Definition at line 398 of file fmi1_capi_me_test.c.

7.40.2.19 int test_get_state_value_references ( )

Tests fmi1_capi_get_state_value_references.

Definition at line 423 of file fmi1_capi_me_test.c.

Generated by Doxygen

Page 369: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.40 Test/FMI1/fmi1_capi_me_test.c File Reference 301

7.40.2.20 int test_set_debug_logging ( )

Tests fmi1_capi_set_debug_logging.

Definition at line 448 of file fmi1_capi_me_test.c.

7.40.2.21 int test_set_get_string ( )

Tests fmi1_capi_set_string and fmi1_capi_get_string Some values are set with fmi1_capi_set_string. The samevalues are retrived with fmi1_capi_get_string and tested to be the same as thoughs that were set.

Definition at line 465 of file fmi1_capi_me_test.c.

7.40.2.22 int test_set_get_integer ( )

Tests fmi1_capi_set_integer and fmi1_capi_get_integer Some values are set with fmi1_capi_set_integer. The samevalues are retrived with fmi1_capi_get_integer and tested to be the same as thoughs that were set.

Definition at line 510 of file fmi1_capi_me_test.c.

7.40.2.23 int test_set_get_boolean ( )

Tests fmi1_capi_set_boolean and fmi1_capi_get_boolean Some values are set with fmi1_capi_set_boolean. Thesame values are retrived with fmi1_capi_get_boolean and tested to be the same as thoughs that were set.

Definition at line 555 of file fmi1_capi_me_test.c.

7.40.2.24 int test_set_get_real ( )

Tests fmi1_capi_set_real and fmi1_capi_get_real Some values are set with fmi1_capi_set_real. The same valuesare retrived with fmi1_capi_get_real and tested to be the same as thoughs that were set.

Definition at line 600 of file fmi1_capi_me_test.c.

7.40.2.25 int test_terminate ( )

Tests fmi1_capi_terminate.

Definition at line 646 of file fmi1_capi_me_test.c.

7.40.2.26 int test_free_model_instance ( )

Tests fmi1_capi_free_model_instance.

Definition at line 664 of file fmi1_capi_me_test.c.

Generated by Doxygen

Page 370: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

302 File Documentation

7.40.2.27 int test_free_dll ( )

Tests fmi1_capi_free_dll.

Definition at line 675 of file fmi1_capi_me_test.c.

7.40.2.28 int test_destroy_dllfmu ( )

Tests fmi1_capi_destroy_dllfmu.

Definition at line 686 of file fmi1_capi_me_test.c.

7.40.2.29 int main ( int argc, char ∗ argv[ ] )

Tests the C-API for FMI 1.0 Model Exchange. The tests are performed using a test-dll. The functions are calledand the values are set or returned are validated either in the test function(output functions) or inside the dll(inputfunctions). If any error occures, the program exits.

Definition at line 698 of file fmi1_capi_me_test.c.

7.40.3 Variable Documentation

7.40.3.1 fmi1_capi_t∗ fmu

Definition at line 39 of file fmi1_capi_me_test.c.

7.40.3.2 jm_callbacks∗ callbacks

Definition at line 69 of file fmi1_capi_me_test.c.

7.41 Test/FMI1/fmi1_import_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <config_test.h>#include <fmilib.h>#include <JM/jm_portability.h>

Macros

• #define BUFFER 1000

Generated by Doxygen

Page 371: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.42 Test/FMI1/fmi1_logger_test.c File Reference 303

Functions

• static void fmi1logger (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string←↩

_t category, fmi1_string_t message,...)• int fmi1_test (fmi_import_context_t ∗context, const char ∗dirPath)

7.41.1 Macro Definition Documentation

7.41.1.1 #define BUFFER 1000

Definition at line 24 of file fmi1_import_test.c.

7.41.2 Function Documentation

7.41.2.1 static void fmi1logger ( fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_tcategory, fmi1_string_t message, ... ) [static]

Definition at line 27 of file fmi1_import_test.c.

7.41.2.2 int fmi1_test ( fmi_import_context_t ∗ context, const char ∗ dirPath )

Definition at line 38 of file fmi1_import_test.c.

7.42 Test/FMI1/fmi1_logger_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <assert.h>#include "config_test.h"#include <fmilib.h>#include <fmu_dummy/fmu1_model_defines.h>#include <JM/jm_portability.h>

Macros

• #define MESSAGE_SIZE_TO_EXPAND_AND_PRINT 3000 /∗ Using fixed size since the log message isprinted to a file and compared ∗/

Functions

• void logger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void do_exit (int code)• int test_logger (fmi1_import_t ∗fmu)• int main (int argc, char ∗argv[ ])

Generated by Doxygen

Page 372: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

304 File Documentation

Variables

• FILE ∗ logFile

7.42.1 Macro Definition Documentation

7.42.1.1 #define MESSAGE_SIZE_TO_EXPAND_AND_PRINT 3000 /∗ Using fixed size since the log message is printed to a fileand compared ∗/

7.42.2 Function Documentation

7.42.2.1 void logger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message )

Definition at line 28 of file fmi1_logger_test.c.

7.42.2.2 void do_exit ( int code )

Definition at line 45 of file fmi1_logger_test.c.

7.42.2.3 int test_logger ( fmi1_import_t ∗ fmu )

Definition at line 51 of file fmi1_logger_test.c.

7.42.2.4 int main ( int argc, char ∗ argv[ ] )

Definition at line 142 of file fmi1_logger_test.c.

7.42.3 Variable Documentation

7.42.3.1 FILE∗ logFile

Definition at line 26 of file fmi1_logger_test.c.

7.43 Test/FMI1/fmi1_xml_parsing_test.c File Reference

#include <stdlib.h>#include <fmilib.h>#include <stdio.h>#include "config_test.h"

Generated by Doxygen

Page 373: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.43 Test/FMI1/fmi1_xml_parsing_test.c File Reference 305

Typedefs

• typedef int(∗ fmu_test_f) (fmi1_import_t ∗fmu)

Functions

• char ∗ concat (char ∗s1, char ∗s2)• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void destroy_parse_test_callbacks (jm_callbacks ∗cb)• jm_callbacks ∗ create_parse_test_callbacks (void)• fmi1_import_t ∗ test_parser (jm_callbacks ∗cb, char ∗xml_dir, int should_log_expected_msg, int configura-

tion)• void test_parser_with_cleanup (char ∗xml_dir, int should_log_expected_msg, int configuration)• void fail_name_check (char ∗xml_dir)• void pass_name_check (char ∗xml_dir)• void parser_log_expected_message (char ∗xml_dir)• void parser_no_log_expected_message (char ∗xml_dir)• void test_parsing_and_fmu (char ∗xml_dir, fmu_test_f fmu_test, int should_log_expected_msg)• void test_parsing_fail_and_fmu (char ∗xml_dir, fmu_test_f fmu_test)• void test_parsing_pass_and_fmu (char ∗xml_dir, fmu_test_f fmu_test)• void test_variable_naming_conventions (void)• int should_have_no_vars (fmi1_import_t ∗fmu)• int should_have_1_no_alias_var (fmi1_import_t ∗fmu)• int should_have_size_2_alias_group (fmi1_import_t ∗fmu)• int should_have_size_2_no_alis (fmi1_import_t ∗fmu)• int should_have_size_3_alias_group (fmi1_import_t ∗fmu)• void test_alias_set_error_handling (void)• void test_deprecation_errors (void)• int main (int argc, char ∗argv[ ])

Variables

• static const int NO_LOG_EXPECTED_MSG = 0• static const int DO_LOG_EXPECTED_MSG = 1• static int did_log_expected_msg• static char ∗ expected_message = "Invalid structured ScalarVariable name"• static char ∗ name_check_test_directory

7.43.1 Typedef Documentation

7.43.1.1 typedef int(∗ fmu_test_f) (fmi1_import_t ∗fmu)

Definition at line 109 of file fmi1_xml_parsing_test.c.

7.43.2 Function Documentation

7.43.2.1 char∗ concat ( char ∗ s1, char ∗ s2 )

Definition at line 13 of file fmi1_xml_parsing_test.c.

Generated by Doxygen

Page 374: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

306 File Documentation

7.43.2.2 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 27 of file fmi1_xml_parsing_test.c.

7.43.2.3 void destroy_parse_test_callbacks ( jm_callbacks ∗ cb )

Definition at line 36 of file fmi1_xml_parsing_test.c.

7.43.2.4 jm_callbacks∗ create_parse_test_callbacks ( void )

Definition at line 41 of file fmi1_xml_parsing_test.c.

7.43.2.5 fmi1_import_t∗ test_parser ( jm_callbacks ∗ cb, char ∗ xml_dir, int should_log_expected_msg, intconfiguration )

Definition at line 56 of file fmi1_xml_parsing_test.c.

7.43.2.6 void test_parser_with_cleanup ( char ∗ xml_dir, int should_log_expected_msg, int configuration )

Definition at line 80 of file fmi1_xml_parsing_test.c.

7.43.2.7 void fail_name_check ( char ∗ xml_dir )

Definition at line 88 of file fmi1_xml_parsing_test.c.

7.43.2.8 void pass_name_check ( char ∗ xml_dir )

Definition at line 94 of file fmi1_xml_parsing_test.c.

7.43.2.9 void parser_log_expected_message ( char ∗ xml_dir )

Definition at line 99 of file fmi1_xml_parsing_test.c.

7.43.2.10 void parser_no_log_expected_message ( char ∗ xml_dir )

Definition at line 104 of file fmi1_xml_parsing_test.c.

7.43.2.11 void test_parsing_and_fmu ( char ∗ xml_dir, fmu_test_f fmu_test, int should_log_expected_msg )

Definition at line 111 of file fmi1_xml_parsing_test.c.

Generated by Doxygen

Page 375: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.43 Test/FMI1/fmi1_xml_parsing_test.c File Reference 307

7.43.2.12 void test_parsing_fail_and_fmu ( char ∗ xml_dir, fmu_test_f fmu_test )

Definition at line 124 of file fmi1_xml_parsing_test.c.

7.43.2.13 void test_parsing_pass_and_fmu ( char ∗ xml_dir, fmu_test_f fmu_test )

Definition at line 129 of file fmi1_xml_parsing_test.c.

7.43.2.14 void test_variable_naming_conventions ( void )

Definition at line 134 of file fmi1_xml_parsing_test.c.

7.43.2.15 int should_have_no_vars ( fmi1_import_t ∗ fmu )

Definition at line 209 of file fmi1_xml_parsing_test.c.

7.43.2.16 int should_have_1_no_alias_var ( fmi1_import_t ∗ fmu )

Definition at line 216 of file fmi1_xml_parsing_test.c.

7.43.2.17 int should_have_size_2_alias_group ( fmi1_import_t ∗ fmu )

Definition at line 229 of file fmi1_xml_parsing_test.c.

7.43.2.18 int should_have_size_2_no_alis ( fmi1_import_t ∗ fmu )

Definition at line 248 of file fmi1_xml_parsing_test.c.

7.43.2.19 int should_have_size_3_alias_group ( fmi1_import_t ∗ fmu )

Definition at line 267 of file fmi1_xml_parsing_test.c.

7.43.2.20 void test_alias_set_error_handling ( void )

Definition at line 291 of file fmi1_xml_parsing_test.c.

7.43.2.21 void test_deprecation_errors ( void )

Definition at line 413 of file fmi1_xml_parsing_test.c.

Generated by Doxygen

Page 376: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

308 File Documentation

7.43.2.22 int main ( int argc, char ∗ argv[ ] )

Definition at line 427 of file fmi1_xml_parsing_test.c.

7.43.3 Variable Documentation

7.43.3.1 const int NO_LOG_EXPECTED_MSG = 0 [static]

Definition at line 6 of file fmi1_xml_parsing_test.c.

7.43.3.2 const int DO_LOG_EXPECTED_MSG = 1 [static]

Definition at line 7 of file fmi1_xml_parsing_test.c.

7.43.3.3 int did_log_expected_msg [static]

Definition at line 9 of file fmi1_xml_parsing_test.c.

7.43.3.4 char∗ expected_message = "Invalid structured ScalarVariable name" [static]

Definition at line 10 of file fmi1_xml_parsing_test.c.

7.43.3.5 char∗ name_check_test_directory [static]

Definition at line 11 of file fmi1_xml_parsing_test.c.

7.44 Test/FMI1/fmi_import_cs_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include "config_test.h"#include <fmilib.h>

Data Structures

• struct xml_test_files_t

Macros

• #define BUFFER 1000

Generated by Doxygen

Page 377: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.44 Test/FMI1/fmi_import_cs_test.c File Reference 309

Functions

• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void fmilogger (fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t cate-

gory, fmi1_string_t message,...)• void do_exit (int code)• void test_xml_modelDescription_cs_tc (const char ∗xmlFileName, fmi1_import_t ∗fmu)• void test_xml (const char ∗xmlFileName, fmi1_import_t ∗fmu)• int test_simulate_cs (fmi1_import_t ∗fmu)• int main (int argc, char ∗argv[ ])

Variables

• xml_test_files_t xml_test_files [ ]

7.44.1 Macro Definition Documentation

7.44.1.1 #define BUFFER 1000

Definition at line 26 of file fmi_import_cs_test.c.

7.44.2 Function Documentation

7.44.2.1 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 28 of file fmi_import_cs_test.c.

7.44.2.2 void fmilogger ( fmi1_component_t c, fmi1_string_t instanceName, fmi1_status_t status, fmi1_string_t category,fmi1_string_t message, ... )

Definition at line 35 of file fmi_import_cs_test.c.

7.44.2.3 void do_exit ( int code )

Definition at line 45 of file fmi_import_cs_test.c.

7.44.2.4 void test_xml_modelDescription_cs_tc ( const char ∗ xmlFileName, fmi1_import_t ∗ fmu )

Definition at line 53 of file fmi_import_cs_test.c.

7.44.2.5 void test_xml ( const char ∗ xmlFileName, fmi1_import_t ∗ fmu )

Definition at line 169 of file fmi_import_cs_test.c.

Generated by Doxygen

Page 378: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

310 File Documentation

7.44.2.6 int test_simulate_cs ( fmi1_import_t ∗ fmu )

Definition at line 191 of file fmi_import_cs_test.c.

7.44.2.7 int main ( int argc, char ∗ argv[ ] )

Definition at line 292 of file fmi_import_cs_test.c.

7.44.3 Variable Documentation

7.44.3.1 xml_test_files_t xml_test_files[ ]

Initial value:

= {{"modelDescription_cs_tc.xml", 1, test_xml_modelDescription_cs_tc},{"modelDescription_cs.xml", 0, NULL}

}

Definition at line 164 of file fmi_import_cs_test.c.

7.45 Test/FMI1/fmi_import_me_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include "config_test.h"#include <fmilib.h>

Data Structures

• struct fmul_t

Macros

• #define BUFFER 1000• #define NUMBER_OF_TESTS 150

Functions

• void do_exit (int code)• int test_simulate_me (fmi1_import_t ∗fmu)• fmul_t load (int argc, char ∗argv[ ])• void destroy (fmul_t ∗fmus)• int main (int argc, char ∗argv[ ])

Generated by Doxygen

Page 379: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.46 Test/FMI1/fmi_import_xml_test.c File Reference 311

7.45.1 Macro Definition Documentation

7.45.1.1 #define BUFFER 1000

Definition at line 23 of file fmi_import_me_test.c.

7.45.1.2 #define NUMBER_OF_TESTS 150

Definition at line 260 of file fmi_import_me_test.c.

7.45.2 Function Documentation

7.45.2.1 void do_exit ( int code )

Definition at line 25 of file fmi_import_me_test.c.

7.45.2.2 int test_simulate_me ( fmi1_import_t ∗ fmu )

Definition at line 32 of file fmi_import_me_test.c.

7.45.2.3 fmul_t load ( int argc, char ∗ argv[ ] )

Definition at line 174 of file fmi_import_me_test.c.

7.45.2.4 void destroy ( fmul_t ∗ fmus )

Definition at line 251 of file fmi_import_me_test.c.

7.45.2.5 int main ( int argc, char ∗ argv[ ] )

Definition at line 261 of file fmi_import_me_test.c.

7.46 Test/FMI1/fmi_import_xml_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <assert.h>#include <time.h>#include "config_test.h"#include <FMI/fmi_import_context.h>#include <FMI1/fmi1_import.h>

Generated by Doxygen

Page 380: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

312 File Documentation

Functions

• void mylogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void do_exit (int code)• void print_int (int i, void ∗data)• void print_dbl (double d, void ∗data)• void printTypeInfo (fmi1_import_variable_typedef_t ∗vt)• void testVariableSearch (fmi1_import_t ∗fmu, fmi1_import_variable_t ∗v)• void printVariableInfo (fmi1_import_t ∗fmu, fmi1_import_variable_t ∗v)• void printCapabilitiesInfo (fmi1_import_capabilities_t ∗capabilities)• int main (int argc, char ∗argv[ ])

7.46.1 Function Documentation

7.46.1.1 void mylogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message )

Definition at line 29 of file fmi_import_xml_test.c.

7.46.1.2 void do_exit ( int code )

Definition at line 34 of file fmi_import_xml_test.c.

7.46.1.3 void print_int ( int i, void ∗ data )

Definition at line 41 of file fmi_import_xml_test.c.

7.46.1.4 void print_dbl ( double d, void ∗ data )

Definition at line 45 of file fmi_import_xml_test.c.

7.46.1.5 void printTypeInfo ( fmi1_import_variable_typedef_t ∗ vt )

Definition at line 49 of file fmi_import_xml_test.c.

7.46.1.6 void testVariableSearch ( fmi1_import_t ∗ fmu, fmi1_import_variable_t ∗ v )

Definition at line 128 of file fmi_import_xml_test.c.

7.46.1.7 void printVariableInfo ( fmi1_import_t ∗ fmu, fmi1_import_variable_t ∗ v )

Definition at line 158 of file fmi_import_xml_test.c.

Generated by Doxygen

Page 381: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.47 Test/FMI1/fmi_total_test.c File Reference 313

7.46.1.8 void printCapabilitiesInfo ( fmi1_import_capabilities_t ∗ capabilities )

Definition at line 243 of file fmi_import_xml_test.c.

7.46.1.9 int main ( int argc, char ∗ argv[ ] )

Definition at line 256 of file fmi_import_xml_test.c.

7.47 Test/FMI1/fmi_total_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include "fmi_dll_1_0_cs.h"#include "fmi_dll_1_0_me.h"#include "fmi_dll_common.h"#include "jm_types.h"#include "fmi_zip_unzip.h"#include <FMI1/fmi1_xml_model_description.h>#include "fmi_import_util.h"

Macros

• #define PRINT_MY_DEBUG printf("Line: %d \t File: %s \n",__LINE__, __FILE__)

Functions

• void mylogger (fmiComponent c, fmiString instanceName, fmiStatus status, fmiString category, fmiStringmessage,...)

• void do_pause ()• int main (int argc, char ∗argv[ ])

7.47.1 Macro Definition Documentation

7.47.1.1 #define PRINT_MY_DEBUG printf("Line: %d \t File: %s \n",__LINE__, __FILE__)

Definition at line 27 of file fmi_total_test.c.

7.47.2 Function Documentation

7.47.2.1 void mylogger ( fmiComponent c, fmiString instanceName, fmiStatus status, fmiString category, fmiStringmessage, ... )

Definition at line 29 of file fmi_total_test.c.

Generated by Doxygen

Page 382: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

314 File Documentation

7.47.2.2 void do_pause ( )

Definition at line 40 of file fmi_total_test.c.

7.47.2.3 int main ( int argc, char ∗ argv[ ] )

Definition at line 48 of file fmi_total_test.c.

7.48 Test/FMI1/fmi_zip_unzip_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <errno.h>#include <JM/jm_types.h>#include <JM/jm_callbacks.h>#include <FMI/fmi_zip_unzip.h>#include "config_test.h"

Functions

• void do_exit (int code)• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• int main (int argc, char ∗argv[ ])

Unzip test. Tests the fmi_zip_unzip function by uncompressing some file.

7.48.1 Function Documentation

7.48.1.1 void do_exit ( int code )

Definition at line 28 of file fmi_zip_unzip_test.c.

7.48.1.2 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 36 of file fmi_zip_unzip_test.c.

7.48.1.3 int main ( int argc, char ∗ argv[ ] )

Unzip test. Tests the fmi_zip_unzip function by uncompressing some file.

Definition at line 45 of file fmi_zip_unzip_test.c.

Generated by Doxygen

Page 383: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.49 Test/fmi_zip_unzip_test.c File Reference 315

7.49 Test/fmi_zip_unzip_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <string.h>#include <errno.h>#include <JM/jm_types.h>#include <JM/jm_callbacks.h>#include <FMI/fmi_zip_unzip.h>#include "config_test.h"

Functions

• void do_exit (int code)• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• int main (int argc, char ∗argv[ ])

Unzip test. Tests the fmi_zip_unzip function by uncompressing some file.

7.49.1 Function Documentation

7.49.1.1 void do_exit ( int code )

Definition at line 28 of file fmi_zip_unzip_test.c.

7.49.1.2 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 36 of file fmi_zip_unzip_test.c.

7.49.1.3 int main ( int argc, char ∗ argv[ ] )

Unzip test. Tests the fmi_zip_unzip function by uncompressing some file.

Definition at line 45 of file fmi_zip_unzip_test.c.

7.50 Test/FMI1/fmi_zip_zip_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <JM/jm_types.h>#include <JM/jm_callbacks.h>#include <FMI/fmi_zip_zip.h>#include "config_test.h"

Generated by Doxygen

Page 384: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

316 File Documentation

Macros

• #define PRINT_MY_DEBUG printf("Line: %d \t File: %s \n",__LINE__, __FILE__)

Functions

• void do_exit (int code)• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• int main (int argc, char ∗argv[ ])

Zip test. Tests the fmi_zip_zip function by compressing some file.

7.50.1 Macro Definition Documentation

7.50.1.1 #define PRINT_MY_DEBUG printf("Line: %d \t File: %s \n",__LINE__, __FILE__)

Definition at line 24 of file fmi_zip_zip_test.c.

7.50.2 Function Documentation

7.50.2.1 void do_exit ( int code )

Definition at line 28 of file fmi_zip_zip_test.c.

7.50.2.2 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 36 of file fmi_zip_zip_test.c.

7.50.2.3 int main ( int argc, char ∗ argv[ ] )

Zip test. Tests the fmi_zip_zip function by compressing some file.

Definition at line 45 of file fmi_zip_zip_test.c.

7.51 Test/fmi_zip_zip_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <JM/jm_types.h>#include <JM/jm_callbacks.h>#include <FMI/fmi_zip_zip.h>#include "config_test.h"

Generated by Doxygen

Page 385: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.52 Test/FMI1/fmu_dummy/fmu1_model.c File Reference 317

Macros

• #define PRINT_MY_DEBUG printf("Line: %d \t File: %s \n",__LINE__, __FILE__)

Functions

• void do_exit (int code)• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• int main (int argc, char ∗argv[ ])

Zip test. Tests the fmi_zip_zip function by compressing some file.

7.51.1 Macro Definition Documentation

7.51.1.1 #define PRINT_MY_DEBUG printf("Line: %d \t File: %s \n",__LINE__, __FILE__)

Definition at line 24 of file fmi_zip_zip_test.c.

7.51.2 Function Documentation

7.51.2.1 void do_exit ( int code )

Definition at line 28 of file fmi_zip_zip_test.c.

7.51.2.2 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 36 of file fmi_zip_zip_test.c.

7.51.2.3 int main ( int argc, char ∗ argv[ ] )

Zip test. Tests the fmi_zip_zip function by compressing some file.

Definition at line 45 of file fmi_zip_zip_test.c.

7.52 Test/FMI1/fmu_dummy/fmu1_model.c File Reference

#include <stdio.h>#include <string.h>#include <fmu_dummy/fmu1_model.h>

Generated by Doxygen

Page 386: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

318 File Documentation

Macros

• #define FMI_TEST_LOGGER_TEST_RESULT_FILE "C:\\P510-JModelica\\FMIToolbox\\trunk\\external\\F←↩

MIL\\build\\testfolder\\"• #define FMI_TEST_LOGGER_TEST_SOURCE_FILE "C:\\P510-JModelica\\FMIToolbox\\trunk\\external\\←↩

FMIL\\build\\testfolder\\"

Functions

• static int calc_initialize (component_ptr_t comp)• static int calc_get_derivatives (component_ptr_t comp)• static int calc_get_event_indicators (component_ptr_t comp)• static int calc_event_update (component_ptr_t comp)• const char ∗ fmi_get_version ()• fmiStatus fmi_set_debug_logging (fmiComponent c, fmiBoolean loggingOn)• fmiStatus fmi_get_real (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiReal value[ ])• fmiStatus fmi_get_integer (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiInteger value[ ])• fmiStatus fmi_get_boolean (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiBoolean value[ ])• fmiStatus fmi_get_string (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiString value[ ])• fmiStatus fmi_set_real (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiReal value[ ])• fmiStatus fmi_set_integer (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiInteger

value[ ])• fmiStatus fmi_set_boolean (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiBoolean

value[ ])• fmiStatus fmi_set_string (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiString value[ ])• const char ∗ fmi_get_model_types_platform ()• fmiComponent fmi_instantiate_model (fmiString instanceName, fmiString GUID, fmiCallbackFunctions func-

tions, fmiBoolean loggingOn)• void fmi_free_model_instance (fmiComponent c)• fmiStatus fmi_set_time (fmiComponent c, fmiReal fmitime)• fmiStatus fmi_set_continuous_states (fmiComponent c, const fmiReal x[ ], size_t nx)• fmiStatus fmi_completed_integrator_step (fmiComponent c, fmiBoolean ∗callEventUpdate)• fmiStatus fmi_initialize (fmiComponent c, fmiBoolean toleranceControlled, fmiReal relativeTolerance, fmi←↩

EventInfo ∗eventInfo)• fmiStatus fmi_get_derivatives (fmiComponent c, fmiReal derivatives[ ], size_t nx)• fmiStatus fmi_get_event_indicators (fmiComponent c, fmiReal eventIndicators[ ], size_t ni)• fmiStatus fmi_event_update (fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo ∗eventInfo)• fmiStatus fmi_get_continuous_states (fmiComponent c, fmiReal states[ ], size_t nx)• fmiStatus fmi_get_nominal_continuousstates (fmiComponent c, fmiReal x_nominal[ ], size_t nx)• fmiStatus fmi_get_state_value_references (fmiComponent c, fmiValueReference vrx[ ], size_t nx)• fmiStatus fmi_terminate (fmiComponent c)• const char ∗ fmi_get_types_platform ()• fmiComponent fmi_instantiate_slave (fmiString instanceName, fmiString fmuGUID, fmiString fmuLocation,

fmiString mimeType, fmiReal timeout, fmiBoolean visible, fmiBoolean interactive, fmiCallbackFunctions func-tions, fmiBoolean loggingOn)

• fmiStatus fmi_initialize_slave (fmiComponent c, fmiReal tStart, fmiBoolean StopTimeDefined, fmiReal tStop)• fmiStatus fmi_terminate_slave (fmiComponent c)• fmiStatus fmi_reset_slave (fmiComponent c)• void fmi_free_slave_instance (fmiComponent c)• fmiStatus fmi_set_real_input_derivatives (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const

fmiInteger order[ ], const fmiReal value[ ])• fmiStatus fmi_get_real_output_derivatives (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const

fmiInteger order[ ], fmiReal value[ ])• fmiStatus fmi_cancel_step (fmiComponent c)

Generated by Doxygen

Page 387: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.52 Test/FMI1/fmu_dummy/fmu1_model.c File Reference 319

• fmiStatus fmi_do_step (fmiComponent c, fmiReal currentCommunicationPoint, fmiReal communication←↩

StepSize, fmiBoolean newStep)• fmiStatus fmi_get_status (fmiComponent c, const fmiStatusKind s, fmiStatus ∗value)• fmiStatus fmi_get_real_status (fmiComponent c, const fmiStatusKind s, fmiReal ∗value)• fmiStatus fmi_get_integer_status (fmiComponent c, const fmiStatusKind s, fmiInteger ∗value)• fmiStatus fmi_get_boolean_status (fmiComponent c, const fmiStatusKind s, fmiBoolean ∗value)• fmiStatus fmi_get_string_status (fmiComponent c, const fmiStatusKind s, fmiString ∗value)

7.52.1 Macro Definition Documentation

7.52.1.1 #define FMI_TEST_LOGGER_TEST_RESULT_FILE "C:\\P510-JModelica\\FMIToolbox\\trunk\\external\\FMI←↩

L\\build\\testfolder\\"

Definition at line 247 of file fmu1_model.c.

7.52.1.2 #define FMI_TEST_LOGGER_TEST_SOURCE_FILE "C:\\P510-JModelica\\FMIToolbox\\trunk\\external\\FMI←↩

L\\build\\testfolder\\"

Definition at line 248 of file fmu1_model.c.

7.52.2 Function Documentation

7.52.2.1 static int calc_initialize ( component_ptr_t comp ) [static]

Definition at line 23 of file fmu1_model.c.

7.52.2.2 static int calc_get_derivatives ( component_ptr_t comp ) [static]

Definition at line 43 of file fmu1_model.c.

7.52.2.3 static int calc_get_event_indicators ( component_ptr_t comp ) [static]

Definition at line 50 of file fmu1_model.c.

7.52.2.4 static int calc_event_update ( component_ptr_t comp ) [static]

Definition at line 57 of file fmu1_model.c.

7.52.2.5 const char∗ fmi_get_version ( )

Definition at line 77 of file fmu1_model.c.

Generated by Doxygen

Page 388: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

320 File Documentation

7.52.2.6 fmiStatus fmi_set_debug_logging ( fmiComponent c, fmiBoolean loggingOn )

Definition at line 82 of file fmu1_model.c.

7.52.2.7 fmiStatus fmi_get_real ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiReal value[ ] )

Definition at line 93 of file fmu1_model.c.

7.52.2.8 fmiStatus fmi_get_integer ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiInteger value[ ] )

Definition at line 113 of file fmu1_model.c.

7.52.2.9 fmiStatus fmi_get_boolean ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiBooleanvalue[ ] )

Definition at line 127 of file fmu1_model.c.

7.52.2.10 fmiStatus fmi_get_string ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiString value[ ] )

Definition at line 141 of file fmu1_model.c.

7.52.2.11 fmiStatus fmi_set_real ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiReal value[ ])

Definition at line 155 of file fmu1_model.c.

7.52.2.12 fmiStatus fmi_set_integer ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiIntegervalue[ ] )

Definition at line 175 of file fmu1_model.c.

7.52.2.13 fmiStatus fmi_set_boolean ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiBooleanvalue[ ] )

Definition at line 189 of file fmu1_model.c.

7.52.2.14 fmiStatus fmi_set_string ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiStringvalue[ ] )

Definition at line 203 of file fmu1_model.c.

Generated by Doxygen

Page 389: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.52 Test/FMI1/fmu_dummy/fmu1_model.c File Reference 321

7.52.2.15 const char∗ fmi_get_model_types_platform ( )

Definition at line 242 of file fmu1_model.c.

7.52.2.16 fmiComponent fmi_instantiate_model ( fmiString instanceName, fmiString GUID, fmiCallbackFunctionsfunctions, fmiBoolean loggingOn )

Definition at line 254 of file fmu1_model.c.

7.52.2.17 void fmi_free_model_instance ( fmiComponent c )

Definition at line 302 of file fmu1_model.c.

7.52.2.18 fmiStatus fmi_set_time ( fmiComponent c, fmiReal fmitime )

Definition at line 313 of file fmu1_model.c.

7.52.2.19 fmiStatus fmi_set_continuous_states ( fmiComponent c, const fmiReal x[ ], size_t nx )

Definition at line 324 of file fmu1_model.c.

7.52.2.20 fmiStatus fmi_completed_integrator_step ( fmiComponent c, fmiBoolean ∗ callEventUpdate )

Definition at line 338 of file fmu1_model.c.

7.52.2.21 fmiStatus fmi_initialize ( fmiComponent c, fmiBoolean toleranceControlled, fmiReal relativeTolerance,fmiEventInfo ∗ eventInfo )

Definition at line 349 of file fmu1_model.c.

7.52.2.22 fmiStatus fmi_get_derivatives ( fmiComponent c, fmiReal derivatives[ ], size_t nx )

Definition at line 374 of file fmu1_model.c.

7.52.2.23 fmiStatus fmi_get_event_indicators ( fmiComponent c, fmiReal eventIndicators[ ], size_t ni )

Definition at line 391 of file fmu1_model.c.

7.52.2.24 fmiStatus fmi_event_update ( fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo ∗ eventInfo )

Definition at line 408 of file fmu1_model.c.

Generated by Doxygen

Page 390: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

322 File Documentation

7.52.2.25 fmiStatus fmi_get_continuous_states ( fmiComponent c, fmiReal states[ ], size_t nx )

Definition at line 421 of file fmu1_model.c.

7.52.2.26 fmiStatus fmi_get_nominal_continuousstates ( fmiComponent c, fmiReal x_nominal[ ], size_t nx )

Definition at line 436 of file fmu1_model.c.

7.52.2.27 fmiStatus fmi_get_state_value_references ( fmiComponent c, fmiValueReference vrx[ ], size_t nx )

Definition at line 450 of file fmu1_model.c.

7.52.2.28 fmiStatus fmi_terminate ( fmiComponent c )

Definition at line 464 of file fmu1_model.c.

7.52.2.29 const char∗ fmi_get_types_platform ( )

Definition at line 475 of file fmu1_model.c.

7.52.2.30 fmiComponent fmi_instantiate_slave ( fmiString instanceName, fmiString fmuGUID, fmiString fmuLocation,fmiString mimeType, fmiReal timeout, fmiBoolean visible, fmiBoolean interactive, fmiCallbackFunctionsfunctions, fmiBoolean loggingOn )

Definition at line 480 of file fmu1_model.c.

7.52.2.31 fmiStatus fmi_initialize_slave ( fmiComponent c, fmiReal tStart, fmiBoolean StopTimeDefined, fmiRealtStop )

Definition at line 499 of file fmu1_model.c.

7.52.2.32 fmiStatus fmi_terminate_slave ( fmiComponent c )

Definition at line 517 of file fmu1_model.c.

7.52.2.33 fmiStatus fmi_reset_slave ( fmiComponent c )

Definition at line 522 of file fmu1_model.c.

7.52.2.34 void fmi_free_slave_instance ( fmiComponent c )

Definition at line 527 of file fmu1_model.c.

Generated by Doxygen

Page 391: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.52 Test/FMI1/fmu_dummy/fmu1_model.c File Reference 323

7.52.2.35 fmiStatus fmi_set_real_input_derivatives ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, constfmiInteger order[ ], const fmiReal value[ ] )

Definition at line 532 of file fmu1_model.c.

7.52.2.36 fmiStatus fmi_get_real_output_derivatives ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr,const fmiInteger order[ ], fmiReal value[ ] )

Definition at line 548 of file fmu1_model.c.

7.52.2.37 fmiStatus fmi_cancel_step ( fmiComponent c )

Definition at line 560 of file fmu1_model.c.

7.52.2.38 fmiStatus fmi_do_step ( fmiComponent c, fmiReal currentCommunicationPoint, fmiRealcommunicationStepSize, fmiBoolean newStep )

Definition at line 565 of file fmu1_model.c.

7.52.2.39 fmiStatus fmi_get_status ( fmiComponent c, const fmiStatusKind s, fmiStatus ∗ value )

Definition at line 662 of file fmu1_model.c.

7.52.2.40 fmiStatus fmi_get_real_status ( fmiComponent c, const fmiStatusKind s, fmiReal ∗ value )

Definition at line 674 of file fmu1_model.c.

7.52.2.41 fmiStatus fmi_get_integer_status ( fmiComponent c, const fmiStatusKind s, fmiInteger ∗ value )

Definition at line 686 of file fmu1_model.c.

7.52.2.42 fmiStatus fmi_get_boolean_status ( fmiComponent c, const fmiStatusKind s, fmiBoolean ∗ value )

Definition at line 694 of file fmu1_model.c.

7.52.2.43 fmiStatus fmi_get_string_status ( fmiComponent c, const fmiStatusKind s, fmiString ∗ value )

Definition at line 702 of file fmu1_model.c.

Generated by Doxygen

Page 392: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

324 File Documentation

7.53 Test/FMI1/fmu_dummy/fmu1_model.h File Reference

#include <fmu_dummy/fmu1_model_defines.h>

Data Structures

• struct component_t

Typedefs

• typedef component_t ∗ component_ptr_t

Functions

• const char ∗ fmi_get_version ()• fmiStatus fmi_set_debug_logging (fmiComponent c, fmiBoolean loggingOn)• fmiStatus fmi_get_real (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiReal value[ ])• fmiStatus fmi_get_integer (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiInteger value[ ])• fmiStatus fmi_get_boolean (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiBoolean value[ ])• fmiStatus fmi_get_string (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiString value[ ])• fmiStatus fmi_set_real (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiReal value[ ])• fmiStatus fmi_set_integer (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiInteger

value[ ])• fmiStatus fmi_set_boolean (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiBoolean

value[ ])• fmiStatus fmi_set_string (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiString value[ ])• const char ∗ fmi_get_model_types_platform ()• fmiComponent fmi_instantiate_model (fmiString instanceName, fmiString GUID, fmiCallbackFunctions func-

tions, fmiBoolean loggingOn)• void fmi_free_model_instance (fmiComponent c)• fmiStatus fmi_set_time (fmiComponent c, fmiReal fmitime)• fmiStatus fmi_set_continuous_states (fmiComponent c, const fmiReal x[ ], size_t nx)• fmiStatus fmi_completed_integrator_step (fmiComponent c, fmiBoolean ∗callEventUpdate)• fmiStatus fmi_initialize (fmiComponent c, fmiBoolean toleranceControlled, fmiReal relativeTolerance, fmi←↩

EventInfo ∗eventInfo)• fmiStatus fmi_get_derivatives (fmiComponent c, fmiReal derivatives[ ], size_t nx)• fmiStatus fmi_get_event_indicators (fmiComponent c, fmiReal eventIndicators[ ], size_t ni)• fmiStatus fmi_event_update (fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo ∗eventInfo)• fmiStatus fmi_get_continuous_states (fmiComponent c, fmiReal states[ ], size_t nx)• fmiStatus fmi_get_nominal_continuousstates (fmiComponent c, fmiReal x_nominal[ ], size_t nx)• fmiStatus fmi_get_state_value_references (fmiComponent c, fmiValueReference vrx[ ], size_t nx)• fmiStatus fmi_terminate (fmiComponent c)

7.53.1 Typedef Documentation

7.53.1.1 typedef component_t∗ component_ptr_t

Definition at line 75 of file fmu1_model.h.

Generated by Doxygen

Page 393: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.53 Test/FMI1/fmu_dummy/fmu1_model.h File Reference 325

7.53.2 Function Documentation

7.53.2.1 const char∗ fmi_get_version ( )

Definition at line 77 of file fmu1_model.c.

7.53.2.2 fmiStatus fmi_set_debug_logging ( fmiComponent c, fmiBoolean loggingOn )

Definition at line 82 of file fmu1_model.c.

7.53.2.3 fmiStatus fmi_get_real ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiReal value[ ] )

Definition at line 93 of file fmu1_model.c.

7.53.2.4 fmiStatus fmi_get_integer ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiInteger value[ ] )

Definition at line 113 of file fmu1_model.c.

7.53.2.5 fmiStatus fmi_get_boolean ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiBooleanvalue[ ] )

Definition at line 127 of file fmu1_model.c.

7.53.2.6 fmiStatus fmi_get_string ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiString value[ ] )

Definition at line 141 of file fmu1_model.c.

7.53.2.7 fmiStatus fmi_set_real ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiReal value[ ] )

Definition at line 155 of file fmu1_model.c.

7.53.2.8 fmiStatus fmi_set_integer ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiIntegervalue[ ] )

Definition at line 175 of file fmu1_model.c.

7.53.2.9 fmiStatus fmi_set_boolean ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiBooleanvalue[ ] )

Definition at line 189 of file fmu1_model.c.

Generated by Doxygen

Page 394: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

326 File Documentation

7.53.2.10 fmiStatus fmi_set_string ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiStringvalue[ ] )

Definition at line 203 of file fmu1_model.c.

7.53.2.11 const char∗ fmi_get_model_types_platform ( )

Definition at line 242 of file fmu1_model.c.

7.53.2.12 fmiComponent fmi_instantiate_model ( fmiString instanceName, fmiString GUID, fmiCallbackFunctionsfunctions, fmiBoolean loggingOn )

Definition at line 254 of file fmu1_model.c.

7.53.2.13 void fmi_free_model_instance ( fmiComponent c )

Definition at line 302 of file fmu1_model.c.

7.53.2.14 fmiStatus fmi_set_time ( fmiComponent c, fmiReal fmitime )

Definition at line 313 of file fmu1_model.c.

7.53.2.15 fmiStatus fmi_set_continuous_states ( fmiComponent c, const fmiReal x[ ], size_t nx )

Definition at line 324 of file fmu1_model.c.

7.53.2.16 fmiStatus fmi_completed_integrator_step ( fmiComponent c, fmiBoolean ∗ callEventUpdate )

Definition at line 338 of file fmu1_model.c.

7.53.2.17 fmiStatus fmi_initialize ( fmiComponent c, fmiBoolean toleranceControlled, fmiReal relativeTolerance,fmiEventInfo ∗ eventInfo )

Definition at line 349 of file fmu1_model.c.

7.53.2.18 fmiStatus fmi_get_derivatives ( fmiComponent c, fmiReal derivatives[ ], size_t nx )

Definition at line 374 of file fmu1_model.c.

7.53.2.19 fmiStatus fmi_get_event_indicators ( fmiComponent c, fmiReal eventIndicators[ ], size_t ni )

Definition at line 391 of file fmu1_model.c.

Generated by Doxygen

Page 395: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.54 Test/FMI1/fmu_dummy/fmu1_model_cs.c File Reference 327

7.53.2.20 fmiStatus fmi_event_update ( fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo ∗ eventInfo )

Definition at line 408 of file fmu1_model.c.

7.53.2.21 fmiStatus fmi_get_continuous_states ( fmiComponent c, fmiReal states[ ], size_t nx )

Definition at line 421 of file fmu1_model.c.

7.53.2.22 fmiStatus fmi_get_nominal_continuousstates ( fmiComponent c, fmiReal x_nominal[ ], size_t nx )

Definition at line 436 of file fmu1_model.c.

7.53.2.23 fmiStatus fmi_get_state_value_references ( fmiComponent c, fmiValueReference vrx[ ], size_t nx )

Definition at line 450 of file fmu1_model.c.

7.53.2.24 fmiStatus fmi_terminate ( fmiComponent c )

Definition at line 464 of file fmu1_model.c.

7.54 Test/FMI1/fmu_dummy/fmu1_model_cs.c File Reference

#include <string.h>#include <FMI1/fmiPlatformTypes.h>#include <FMI1/fmiFunctions.h>#include <fmu_dummy/fmu1_model.h>#include "config_test.h"#include "fmu1_model.c"

Macros

• #define MODEL_IDENTIFIER FMU_DUMMY_CS_MODEL_IDENTIFIER

Generated by Doxygen

Page 396: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

328 File Documentation

Functions

• DllExport const char ∗ fmiGetVersion ()• DllExport fmiStatus fmiSetDebugLogging (fmiComponent c, fmiBoolean loggingOn)• DllExport fmiStatus fmiGetReal (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiReal value[ ])• DllExport fmiStatus fmiGetInteger (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiInteger

value[ ])• DllExport fmiStatus fmiGetBoolean (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiBoolean

value[ ])• DllExport fmiStatus fmiGetString (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiString

value[ ])• DllExport fmiStatus fmiSetReal (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiReal

value[ ])• DllExport fmiStatus fmiSetInteger (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmi←↩

Integer value[ ])• DllExport fmiStatus fmiSetBoolean (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmi←↩

Boolean value[ ])• DllExport fmiStatus fmiSetString (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiString

value[ ])• DllExport const char ∗ fmiGetTypesPlatform ()• DllExport fmiComponent fmiInstantiateSlave (fmiString instanceName, fmiString fmuGUID, fmiString fmu←↩

Location, fmiString mimeType, fmiReal timeout, fmiBoolean visible, fmiBoolean interactive, fmiCallback←↩

Functions functions, fmiBoolean loggingOn)• DllExport fmiStatus fmiInitializeSlave (fmiComponent c, fmiReal tStart, fmiBoolean StopTimeDefined, fmiReal

tStop)• DllExport fmiStatus fmiTerminateSlave (fmiComponent c)• DllExport fmiStatus fmiResetSlave (fmiComponent c)• DllExport void fmiFreeSlaveInstance (fmiComponent c)• DllExport fmiStatus fmiSetRealInputDerivatives (fmiComponent c, const fmiValueReference vr[ ], size_t nvr,

const fmiInteger order[ ], const fmiReal value[ ])• DllExport fmiStatus fmiGetRealOutputDerivatives (fmiComponent c, const fmiValueReference vr[ ], size_t nvr,

const fmiInteger order[ ], fmiReal value[ ])• DllExport fmiStatus fmiCancelStep (fmiComponent c)• DllExport fmiStatus fmiDoStep (fmiComponent c, fmiReal currentCommunicationPoint, fmiReal communication←↩

StepSize, fmiBoolean newStep)• DllExport fmiStatus fmiGetStatus (fmiComponent c, const fmiStatusKind s, fmiStatus ∗value)• DllExport fmiStatus fmiGetRealStatus (fmiComponent c, const fmiStatusKind s, fmiReal ∗value)• DllExport fmiStatus fmiGetIntegerStatus (fmiComponent c, const fmiStatusKind s, fmiInteger ∗value)• DllExport fmiStatus fmiGetBooleanStatus (fmiComponent c, const fmiStatusKind s, fmiBoolean ∗value)• DllExport fmiStatus fmiGetStringStatus (fmiComponent c, const fmiStatusKind s, fmiString ∗value)

7.54.1 Macro Definition Documentation

7.54.1.1 #define MODEL_IDENTIFIER FMU_DUMMY_CS_MODEL_IDENTIFIER

Definition at line 32 of file fmu1_model_cs.c.

7.54.2 Function Documentation

7.54.2.1 DllExport const char∗ fmiGetVersion ( )

Definition at line 39 of file fmu1_model_cs.c.

Generated by Doxygen

Page 397: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.54 Test/FMI1/fmu_dummy/fmu1_model_cs.c File Reference 329

7.54.2.2 DllExport fmiStatus fmiSetDebugLogging ( fmiComponent c, fmiBoolean loggingOn )

Definition at line 44 of file fmu1_model_cs.c.

7.54.2.3 DllExport fmiStatus fmiGetReal ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiRealvalue[ ] )

Definition at line 49 of file fmu1_model_cs.c.

7.54.2.4 DllExport fmiStatus fmiGetInteger ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiIntegervalue[ ] )

Definition at line 54 of file fmu1_model_cs.c.

7.54.2.5 DllExport fmiStatus fmiGetBoolean ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr,fmiBoolean value[ ] )

Definition at line 59 of file fmu1_model_cs.c.

7.54.2.6 DllExport fmiStatus fmiGetString ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiStringvalue[ ] )

Definition at line 64 of file fmu1_model_cs.c.

7.54.2.7 DllExport fmiStatus fmiSetReal ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiRealvalue[ ] )

Definition at line 69 of file fmu1_model_cs.c.

7.54.2.8 DllExport fmiStatus fmiSetInteger ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, constfmiInteger value[ ] )

Definition at line 74 of file fmu1_model_cs.c.

7.54.2.9 DllExport fmiStatus fmiSetBoolean ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, constfmiBoolean value[ ] )

Definition at line 79 of file fmu1_model_cs.c.

7.54.2.10 DllExport fmiStatus fmiSetString ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, constfmiString value[ ] )

Definition at line 84 of file fmu1_model_cs.c.

Generated by Doxygen

Page 398: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

330 File Documentation

7.54.2.11 DllExport const char∗ fmiGetTypesPlatform ( )

Definition at line 90 of file fmu1_model_cs.c.

7.54.2.12 DllExport fmiComponent fmiInstantiateSlave ( fmiString instanceName, fmiString fmuGUID, fmiStringfmuLocation, fmiString mimeType, fmiReal timeout, fmiBoolean visible, fmiBoolean interactive,fmiCallbackFunctions functions, fmiBoolean loggingOn )

Definition at line 95 of file fmu1_model_cs.c.

7.54.2.13 DllExport fmiStatus fmiInitializeSlave ( fmiComponent c, fmiReal tStart, fmiBoolean StopTimeDefined,fmiReal tStop )

Definition at line 100 of file fmu1_model_cs.c.

7.54.2.14 DllExport fmiStatus fmiTerminateSlave ( fmiComponent c )

Definition at line 105 of file fmu1_model_cs.c.

7.54.2.15 DllExport fmiStatus fmiResetSlave ( fmiComponent c )

Definition at line 110 of file fmu1_model_cs.c.

7.54.2.16 DllExport void fmiFreeSlaveInstance ( fmiComponent c )

Definition at line 115 of file fmu1_model_cs.c.

7.54.2.17 DllExport fmiStatus fmiSetRealInputDerivatives ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr,const fmiInteger order[ ], const fmiReal value[ ] )

Definition at line 120 of file fmu1_model_cs.c.

7.54.2.18 DllExport fmiStatus fmiGetRealOutputDerivatives ( fmiComponent c, const fmiValueReference vr[ ], size_tnvr, const fmiInteger order[ ], fmiReal value[ ] )

Definition at line 125 of file fmu1_model_cs.c.

7.54.2.19 DllExport fmiStatus fmiCancelStep ( fmiComponent c )

Definition at line 130 of file fmu1_model_cs.c.

Generated by Doxygen

Page 399: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.55 Test/FMI1/fmu_dummy/fmu1_model_defines.h File Reference 331

7.54.2.20 DllExport fmiStatus fmiDoStep ( fmiComponent c, fmiReal currentCommunicationPoint, fmiRealcommunicationStepSize, fmiBoolean newStep )

Definition at line 135 of file fmu1_model_cs.c.

7.54.2.21 DllExport fmiStatus fmiGetStatus ( fmiComponent c, const fmiStatusKind s, fmiStatus ∗ value )

Definition at line 140 of file fmu1_model_cs.c.

7.54.2.22 DllExport fmiStatus fmiGetRealStatus ( fmiComponent c, const fmiStatusKind s, fmiReal ∗ value )

Definition at line 145 of file fmu1_model_cs.c.

7.54.2.23 DllExport fmiStatus fmiGetIntegerStatus ( fmiComponent c, const fmiStatusKind s, fmiInteger ∗ value )

Definition at line 150 of file fmu1_model_cs.c.

7.54.2.24 DllExport fmiStatus fmiGetBooleanStatus ( fmiComponent c, const fmiStatusKind s, fmiBoolean ∗ value )

Definition at line 155 of file fmu1_model_cs.c.

7.54.2.25 DllExport fmiStatus fmiGetStringStatus ( fmiComponent c, const fmiStatusKind s, fmiString ∗ value )

Definition at line 160 of file fmu1_model_cs.c.

7.55 Test/FMI1/fmu_dummy/fmu1_model_defines.h File Reference

Macros

• #define STRINGIFY(a) #a• #define STRINGIFY2(a) STRINGIFY(a)• #define MODEL_IDENTIFIER_STR STRINGIFY2(MODEL_IDENTIFIER)• #define BUFFER 1024• #define MAGIC_TEST_VALUE 13.0 /∗ A test value for some functions ∗/• #define VAR_R_HIGHT 0• #define VAR_R_HIGHT_SPEED 1• #define VAR_R_GRATIVY 2• #define VAR_R_BOUNCE_CONF 3• #define EVENT_HIGHT 0• #define VAR_S_LOGGER_TEST 0• #define N_STATES 2• #define N_EVENT_INDICATORS 1• #define N_REAL 4• #define N_INTEGER 4• #define N_BOOLEAN 4• #define N_STRING 4• #define N_INPUT_REAL 2 /∗ CS only ∗/• #define N_INPUT_REAL_MAX_ORDER 2 /∗ CS only ∗/• #define N_OUTPUT_REAL 2 /∗ CS only ∗/• #define N_OUTPUT_REAL_MAX_ORDER 2 /∗ CS only ∗/• #define FMI_VERSION "1.0"• #define FMI_GUID "123"

Generated by Doxygen

Page 400: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

332 File Documentation

7.55.1 Macro Definition Documentation

7.55.1.1 #define STRINGIFY( a ) #a

Definition at line 21 of file fmu1_model_defines.h.

7.55.1.2 #define STRINGIFY2( a ) STRINGIFY(a)

Definition at line 22 of file fmu1_model_defines.h.

7.55.1.3 #define MODEL_IDENTIFIER_STR STRINGIFY2(MODEL_IDENTIFIER)

Definition at line 23 of file fmu1_model_defines.h.

7.55.1.4 #define BUFFER 1024

Definition at line 25 of file fmu1_model_defines.h.

7.55.1.5 #define MAGIC_TEST_VALUE 13.0 /∗ A test value for some functions ∗/

Definition at line 26 of file fmu1_model_defines.h.

7.55.1.6 #define VAR_R_HIGHT 0

Definition at line 31 of file fmu1_model_defines.h.

7.55.1.7 #define VAR_R_HIGHT_SPEED 1

Definition at line 32 of file fmu1_model_defines.h.

7.55.1.8 #define VAR_R_GRATIVY 2

Definition at line 34 of file fmu1_model_defines.h.

7.55.1.9 #define VAR_R_BOUNCE_CONF 3

Definition at line 35 of file fmu1_model_defines.h.

7.55.1.10 #define EVENT_HIGHT 0

Definition at line 38 of file fmu1_model_defines.h.

Generated by Doxygen

Page 401: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.55 Test/FMI1/fmu_dummy/fmu1_model_defines.h File Reference 333

7.55.1.11 #define VAR_S_LOGGER_TEST 0

Definition at line 41 of file fmu1_model_defines.h.

7.55.1.12 #define N_STATES 2

Definition at line 44 of file fmu1_model_defines.h.

7.55.1.13 #define N_EVENT_INDICATORS 1

Definition at line 45 of file fmu1_model_defines.h.

7.55.1.14 #define N_REAL 4

Definition at line 46 of file fmu1_model_defines.h.

7.55.1.15 #define N_INTEGER 4

Definition at line 47 of file fmu1_model_defines.h.

7.55.1.16 #define N_BOOLEAN 4

Definition at line 48 of file fmu1_model_defines.h.

7.55.1.17 #define N_STRING 4

Definition at line 49 of file fmu1_model_defines.h.

7.55.1.18 #define N_INPUT_REAL 2 /∗ CS only ∗/

Definition at line 51 of file fmu1_model_defines.h.

7.55.1.19 #define N_INPUT_REAL_MAX_ORDER 2 /∗ CS only ∗/

Definition at line 52 of file fmu1_model_defines.h.

7.55.1.20 #define N_OUTPUT_REAL 2 /∗ CS only ∗/

Definition at line 53 of file fmu1_model_defines.h.

Generated by Doxygen

Page 402: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

334 File Documentation

7.55.1.21 #define N_OUTPUT_REAL_MAX_ORDER 2 /∗ CS only ∗/

Definition at line 54 of file fmu1_model_defines.h.

7.55.1.22 #define FMI_VERSION "1.0"

Definition at line 57 of file fmu1_model_defines.h.

7.55.1.23 #define FMI_GUID "123"

Definition at line 67 of file fmu1_model_defines.h.

7.56 Test/FMI1/fmu_dummy/fmu1_model_me.c File Reference

#include <string.h>#include <FMI1/fmiModelTypes.h>#include <FMI1/fmiModelFunctions.h>#include <fmu_dummy/fmu1_model.h>#include "config_test.h"#include "fmu1_model.c"

Macros

• #define MODEL_IDENTIFIER FMU_DUMMY_ME_MODEL_IDENTIFIER

Enumerations

• enum fmiStatusKind { fmiDoStepStatus, fmiPendingStatus, fmiLastSuccessfulTime }

Functions

• DllExport const char ∗ fmiGetVersion ()• DllExport fmiStatus fmiSetDebugLogging (fmiComponent c, fmiBoolean loggingOn)• DllExport fmiStatus fmiGetReal (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiReal value[ ])• DllExport fmiStatus fmiGetInteger (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiInteger

value[ ])• DllExport fmiStatus fmiGetBoolean (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiBoolean

value[ ])• DllExport fmiStatus fmiGetString (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiString

value[ ])• DllExport fmiStatus fmiSetReal (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiReal

value[ ])• DllExport fmiStatus fmiSetInteger (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmi←↩

Integer value[ ])• DllExport fmiStatus fmiSetBoolean (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmi←↩

Boolean value[ ])

Generated by Doxygen

Page 403: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.56 Test/FMI1/fmu_dummy/fmu1_model_me.c File Reference 335

• DllExport fmiStatus fmiSetString (fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiStringvalue[ ])

• DllExport const char ∗ fmiGetModelTypesPlatform ()• DllExport fmiComponent fmiInstantiateModel (fmiString instanceName, fmiString GUID, fmiCallback←↩

Functions functions, fmiBoolean loggingOn)• DllExport void fmiFreeModelInstance (fmiComponent c)• DllExport fmiStatus fmiSetTime (fmiComponent c, fmiReal fmitime)• DllExport fmiStatus fmiSetContinuousStates (fmiComponent c, const fmiReal x[ ], size_t nx)• DllExport fmiStatus fmiCompletedIntegratorStep (fmiComponent c, fmiBoolean ∗callEventUpdate)• DllExport fmiStatus fmiInitialize (fmiComponent c, fmiBoolean toleranceControlled, fmiReal relativeTolerance,

fmiEventInfo ∗eventInfo)• DllExport fmiStatus fmiGetDerivatives (fmiComponent c, fmiReal derivatives[ ], size_t nx)• DllExport fmiStatus fmiGetEventIndicators (fmiComponent c, fmiReal eventIndicators[ ], size_t ni)• DllExport fmiStatus fmiEventUpdate (fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo∗eventInfo)

• DllExport fmiStatus fmiGetContinuousStates (fmiComponent c, fmiReal states[ ], size_t nx)• DllExport fmiStatus fmiGetNominalContinuousStates (fmiComponent c, fmiReal x_nominal[ ], size_t nx)• DllExport fmiStatus fmiGetStateValueReferences (fmiComponent c, fmiValueReference vrx[ ], size_t nx)• DllExport fmiStatus fmiTerminate (fmiComponent c)

7.56.1 Macro Definition Documentation

7.56.1.1 #define MODEL_IDENTIFIER FMU_DUMMY_ME_MODEL_IDENTIFIER

Definition at line 36 of file fmu1_model_me.c.

7.56.2 Enumeration Type Documentation

7.56.2.1 enum fmiStatusKind

Enumerator

fmiDoStepStatus

fmiPendingStatus

fmiLastSuccessfulTime

Definition at line 30 of file fmu1_model_me.c.

7.56.3 Function Documentation

7.56.3.1 DllExport const char∗ fmiGetVersion ( )

Definition at line 39 of file fmu1_model_me.c.

7.56.3.2 DllExport fmiStatus fmiSetDebugLogging ( fmiComponent c, fmiBoolean loggingOn )

Definition at line 44 of file fmu1_model_me.c.

Generated by Doxygen

Page 404: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

336 File Documentation

7.56.3.3 DllExport fmiStatus fmiGetReal ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiRealvalue[ ] )

Definition at line 49 of file fmu1_model_me.c.

7.56.3.4 DllExport fmiStatus fmiGetInteger ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiIntegervalue[ ] )

Definition at line 54 of file fmu1_model_me.c.

7.56.3.5 DllExport fmiStatus fmiGetBoolean ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr,fmiBoolean value[ ] )

Definition at line 59 of file fmu1_model_me.c.

7.56.3.6 DllExport fmiStatus fmiGetString ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, fmiStringvalue[ ] )

Definition at line 64 of file fmu1_model_me.c.

7.56.3.7 DllExport fmiStatus fmiSetReal ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, const fmiRealvalue[ ] )

Definition at line 69 of file fmu1_model_me.c.

7.56.3.8 DllExport fmiStatus fmiSetInteger ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, constfmiInteger value[ ] )

Definition at line 74 of file fmu1_model_me.c.

7.56.3.9 DllExport fmiStatus fmiSetBoolean ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, constfmiBoolean value[ ] )

Definition at line 79 of file fmu1_model_me.c.

7.56.3.10 DllExport fmiStatus fmiSetString ( fmiComponent c, const fmiValueReference vr[ ], size_t nvr, constfmiString value[ ] )

Definition at line 84 of file fmu1_model_me.c.

7.56.3.11 DllExport const char∗ fmiGetModelTypesPlatform ( )

Definition at line 90 of file fmu1_model_me.c.

Generated by Doxygen

Page 405: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.56 Test/FMI1/fmu_dummy/fmu1_model_me.c File Reference 337

7.56.3.12 DllExport fmiComponent fmiInstantiateModel ( fmiString instanceName, fmiString GUID,fmiCallbackFunctions functions, fmiBoolean loggingOn )

Definition at line 95 of file fmu1_model_me.c.

7.56.3.13 DllExport void fmiFreeModelInstance ( fmiComponent c )

Definition at line 100 of file fmu1_model_me.c.

7.56.3.14 DllExport fmiStatus fmiSetTime ( fmiComponent c, fmiReal fmitime )

Definition at line 105 of file fmu1_model_me.c.

7.56.3.15 DllExport fmiStatus fmiSetContinuousStates ( fmiComponent c, const fmiReal x[ ], size_t nx )

Definition at line 110 of file fmu1_model_me.c.

7.56.3.16 DllExport fmiStatus fmiCompletedIntegratorStep ( fmiComponent c, fmiBoolean ∗ callEventUpdate )

Definition at line 115 of file fmu1_model_me.c.

7.56.3.17 DllExport fmiStatus fmiInitialize ( fmiComponent c, fmiBoolean toleranceControlled, fmiRealrelativeTolerance, fmiEventInfo ∗ eventInfo )

Definition at line 120 of file fmu1_model_me.c.

7.56.3.18 DllExport fmiStatus fmiGetDerivatives ( fmiComponent c, fmiReal derivatives[ ], size_t nx )

Definition at line 125 of file fmu1_model_me.c.

7.56.3.19 DllExport fmiStatus fmiGetEventIndicators ( fmiComponent c, fmiReal eventIndicators[ ], size_t ni )

Definition at line 130 of file fmu1_model_me.c.

7.56.3.20 DllExport fmiStatus fmiEventUpdate ( fmiComponent c, fmiBoolean intermediateResults, fmiEventInfo ∗eventInfo )

Definition at line 135 of file fmu1_model_me.c.

7.56.3.21 DllExport fmiStatus fmiGetContinuousStates ( fmiComponent c, fmiReal states[ ], size_t nx )

Definition at line 140 of file fmu1_model_me.c.

Generated by Doxygen

Page 406: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

338 File Documentation

7.56.3.22 DllExport fmiStatus fmiGetNominalContinuousStates ( fmiComponent c, fmiReal x_nominal[ ], size_t nx )

Definition at line 145 of file fmu1_model_me.c.

7.56.3.23 DllExport fmiStatus fmiGetStateValueReferences ( fmiComponent c, fmiValueReference vrx[ ], size_t nx )

Definition at line 150 of file fmu1_model_me.c.

7.56.3.24 DllExport fmiStatus fmiTerminate ( fmiComponent c )

Definition at line 155 of file fmu1_model_me.c.

7.57 Test/FMI1/jm_vector_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include "config_test.h"#include <JM/jm_vector.h>#include <JM/jm_stack.h>

Macros

• #define TESTVAL 49• #define VINIT_SIZE 5

Functions

• void print_int (int i, void ∗data)• void print_dbl (double d, void ∗data)• int compar_int (int ∗a, int ∗b)• void log_error (const char ∗fmt,...)• int main ()

Variables

• int return_code = CTEST_RETURN_SUCCESS

7.57.1 Macro Definition Documentation

7.57.1.1 #define TESTVAL 49

Definition at line 31 of file jm_vector_test.c.

Generated by Doxygen

Page 407: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.58 Test/jm_vector_test.c File Reference 339

7.57.1.2 #define VINIT_SIZE 5

7.57.2 Function Documentation

7.57.2.1 void print_int ( int i, void ∗ data )

Definition at line 9 of file jm_vector_test.c.

7.57.2.2 void print_dbl ( double d, void ∗ data )

Definition at line 13 of file jm_vector_test.c.

7.57.2.3 int compar_int ( int ∗ a, int ∗ b )

Definition at line 17 of file jm_vector_test.c.

7.57.2.4 void log_error ( const char ∗ fmt, ... )

Definition at line 23 of file jm_vector_test.c.

7.57.2.5 int main ( )

Definition at line 33 of file jm_vector_test.c.

7.57.3 Variable Documentation

7.57.3.1 int return_code = CTEST_RETURN_SUCCESS

Definition at line 21 of file jm_vector_test.c.

7.58 Test/jm_vector_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include "config_test.h"#include <JM/jm_vector.h>#include <JM/jm_stack.h>

Macros

• #define TESTVAL 49• #define VINIT_SIZE 5

Generated by Doxygen

Page 408: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

340 File Documentation

Functions

• void print_int (int i, void ∗data)• void print_dbl (double d, void ∗data)• int compar_int (int ∗a, int ∗b)• void log_error (const char ∗fmt,...)• int main ()

Variables

• int return_code = CTEST_RETURN_SUCCESS

7.58.1 Macro Definition Documentation

7.58.1.1 #define TESTVAL 49

Definition at line 31 of file jm_vector_test.c.

7.58.1.2 #define VINIT_SIZE 5

7.58.2 Function Documentation

7.58.2.1 void print_int ( int i, void ∗ data )

Definition at line 9 of file jm_vector_test.c.

7.58.2.2 void print_dbl ( double d, void ∗ data )

Definition at line 13 of file jm_vector_test.c.

7.58.2.3 int compar_int ( int ∗ a, int ∗ b )

Definition at line 17 of file jm_vector_test.c.

7.58.2.4 void log_error ( const char ∗ fmt, ... )

Definition at line 23 of file jm_vector_test.c.

7.58.2.5 int main ( )

Definition at line 33 of file jm_vector_test.c.

Generated by Doxygen

Page 409: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.59 Test/FMI2/fmi2_import_cs_test.c File Reference 341

7.58.3 Variable Documentation

7.58.3.1 int return_code = CTEST_RETURN_SUCCESS

Definition at line 21 of file jm_vector_test.c.

7.59 Test/FMI2/fmi2_import_cs_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include "config_test.h"#include <fmilib.h>#include <JM/jm_portability.h>

Macros

• #define BUFFER 1000

Functions

• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void fmilogger (fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t cate-

gory, fmi2_string_t message,...)• void do_exit (int code)• int test_simulate_cs (fmi2_import_t ∗fmu)• int main (int argc, char ∗argv[ ])

7.59.1 Macro Definition Documentation

7.59.1.1 #define BUFFER 1000

Definition at line 26 of file fmi2_import_cs_test.c.

7.59.2 Function Documentation

7.59.2.1 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 28 of file fmi2_import_cs_test.c.

7.59.2.2 void fmilogger ( fmi2_component_t c, fmi2_string_t instanceName, fmi2_status_t status, fmi2_string_t category,fmi2_string_t message, ... )

Definition at line 35 of file fmi2_import_cs_test.c.

Generated by Doxygen

Page 410: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

342 File Documentation

7.59.2.3 void do_exit ( int code )

Definition at line 46 of file fmi2_import_cs_test.c.

7.59.2.4 int test_simulate_cs ( fmi2_import_t ∗ fmu )

Definition at line 53 of file fmi2_import_cs_test.c.

7.59.2.5 int main ( int argc, char ∗ argv[ ] )

Definition at line 165 of file fmi2_import_cs_test.c.

7.60 Test/FMI2/fmi2_import_me_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include "config_test.h"#include <fmilib.h>

Macros

• #define BUFFER 1000

Functions

• void do_exit (int code)• void do_event_iteration (fmi2_import_t ∗fmu, fmi2_event_info_t ∗eventInfo)• int test_parsed_all_varialbes (fmi2_import_t ∗fmu)• int test_simulate_me (fmi2_import_t ∗fmu)• int main (int argc, char ∗argv[ ])

7.60.1 Macro Definition Documentation

7.60.1.1 #define BUFFER 1000

Definition at line 23 of file fmi2_import_me_test.c.

7.60.2 Function Documentation

7.60.2.1 void do_exit ( int code )

Definition at line 25 of file fmi2_import_me_test.c.

Generated by Doxygen

Page 411: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.61 Test/FMI2/fmi2_import_test.c File Reference 343

7.60.2.2 void do_event_iteration ( fmi2_import_t ∗ fmu, fmi2_event_info_t ∗ eventInfo )

Definition at line 32 of file fmi2_import_me_test.c.

7.60.2.3 int test_parsed_all_varialbes ( fmi2_import_t ∗ fmu )

Definition at line 41 of file fmi2_import_me_test.c.

7.60.2.4 int test_simulate_me ( fmi2_import_t ∗ fmu )

Definition at line 60 of file fmi2_import_me_test.c.

7.60.2.5 int main ( int argc, char ∗ argv[ ] )

Definition at line 215 of file fmi2_import_me_test.c.

7.61 Test/FMI2/fmi2_import_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <config_test.h>#include <fmilib.h>#include <JM/jm_portability.h>

Macros

• #define BUFFER 1000

Functions

• static void fmi2logger (fmi2_component_environment_t env, fmi2_string_t instanceName, fmi2_status_t sta-tus, fmi2_string_t category, fmi2_string_t message,...)

• static void stepFinished (fmi2_component_environment_t env, fmi2_status_t status)• int fmi2_test (fmi_import_context_t ∗context, const char ∗dirPath)

7.61.1 Macro Definition Documentation

7.61.1.1 #define BUFFER 1000

Definition at line 24 of file fmi2_import_test.c.

Generated by Doxygen

Page 412: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

344 File Documentation

7.61.2 Function Documentation

7.61.2.1 static void fmi2logger ( fmi2_component_environment_t env, fmi2_string_t instanceName, fmi2_status_t status,fmi2_string_t category, fmi2_string_t message, ... ) [static]

Definition at line 27 of file fmi2_import_test.c.

7.61.2.2 static void stepFinished ( fmi2_component_environment_t env, fmi2_status_t status ) [static]

Definition at line 37 of file fmi2_import_test.c.

7.61.2.3 int fmi2_test ( fmi_import_context_t ∗ context, const char ∗ dirPath )

Definition at line 41 of file fmi2_import_test.c.

7.62 Test/FMI2/fmi2_import_xml_test.cc File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <assert.h>#include <time.h>#include "config_test.h"#include <FMI/fmi_import_context.h>#include <FMI2/fmi2_import.h>

Functions

• int annotation_start_handle (void ∗context, const char ∗parentName, void ∗parent, const char ∗elm, constchar ∗∗attr)

• int annotation_data_handle (void ∗context, const char ∗s, int len)• int annotation_end_handle (void ∗context, const char ∗elm)• void do_exit (int code)• void mylogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void print_int (int i, void ∗data)• void print_dbl (double d, void ∗data)• void printTypeInfo (fmi2_import_variable_typedef_t ∗vt)• void testVariableSearch (fmi2_import_t ∗fmu, fmi2_import_variable_t ∗v)• void printVariableInfo (fmi2_import_t ∗fmu, fmi2_import_variable_t ∗v)• void printCapabilitiesInfo (fmi2_import_t ∗fmu)• void printDependenciesInfo (fmi2_import_t ∗fmu, fmi2_import_variable_list_t ∗rows, fmi2_import_variable←↩

_list_t ∗cols, size_t ∗start, size_t ∗dep, char ∗factor)• int main (int argc, char ∗argv[ ])

Generated by Doxygen

Page 413: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.62 Test/FMI2/fmi2_import_xml_test.cc File Reference 345

Variables

• int expect_error• fmi2_xml_callbacks_t annotation_callbacks

XML callbacks are used to process parts of XML that are not handled by the library.

7.62.1 Function Documentation

7.62.1.1 int annotation_start_handle ( void ∗ context, const char ∗ parentName, void ∗ parent, const char ∗ elm, constchar ∗∗ attr )

Definition at line 30 of file fmi2_import_xml_test.cc.

7.62.1.2 int annotation_data_handle ( void ∗ context, const char ∗ s, int len )

Definition at line 42 of file fmi2_import_xml_test.cc.

7.62.1.3 int annotation_end_handle ( void ∗ context, const char ∗ elm )

Definition at line 49 of file fmi2_import_xml_test.cc.

7.62.1.4 void do_exit ( int code )

Definition at line 61 of file fmi2_import_xml_test.cc.

7.62.1.5 void mylogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message )

Definition at line 68 of file fmi2_import_xml_test.cc.

7.62.1.6 void print_int ( int i, void ∗ data )

Definition at line 76 of file fmi2_import_xml_test.cc.

7.62.1.7 void print_dbl ( double d, void ∗ data )

Definition at line 80 of file fmi2_import_xml_test.cc.

7.62.1.8 void printTypeInfo ( fmi2_import_variable_typedef_t ∗ vt )

Definition at line 84 of file fmi2_import_xml_test.cc.

Generated by Doxygen

Page 414: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

346 File Documentation

7.62.1.9 void testVariableSearch ( fmi2_import_t ∗ fmu, fmi2_import_variable_t ∗ v )

Definition at line 173 of file fmi2_import_xml_test.cc.

7.62.1.10 void printVariableInfo ( fmi2_import_t ∗ fmu, fmi2_import_variable_t ∗ v )

Definition at line 203 of file fmi2_import_xml_test.cc.

7.62.1.11 void printCapabilitiesInfo ( fmi2_import_t ∗ fmu )

Definition at line 274 of file fmi2_import_xml_test.cc.

7.62.1.12 void printDependenciesInfo ( fmi2_import_t ∗ fmu, fmi2_import_variable_list_t ∗ rows,fmi2_import_variable_list_t ∗ cols, size_t ∗ start, size_t ∗ dep, char ∗ factor )

Definition at line 284 of file fmi2_import_xml_test.cc.

7.62.1.13 int main ( int argc, char ∗ argv[ ] )

Definition at line 314 of file fmi2_import_xml_test.cc.

7.62.2 Variable Documentation

7.62.2.1 int expect_error

Definition at line 28 of file fmi2_import_xml_test.cc.

7.62.2.2 fmi2_xml_callbacks_t annotation_callbacks

Initial value:

= {annotation_start_handle,annotation_data_handle,annotation_end_handle, NULL}

XML callbacks are used to process parts of XML that are not handled by the library.

Definition at line 55 of file fmi2_import_xml_test.cc.

7.63 Test/FMI2/fmi2_xml_parsing_test.c File Reference

#include <stdlib.h>#include <fmilib.h>#include <stdio.h>#include "config_test.h"

Generated by Doxygen

Page 415: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.63 Test/FMI2/fmi2_xml_parsing_test.c File Reference 347

Functions

• char ∗ concat (char ∗s1, char ∗s2)• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void test_parser (char ∗xml_dir, int should_not_log_expected_msg, int configuration)• void fail_name_check (char ∗xml_dir)• void pass_name_check (char ∗xml_dir)• void parser_log_expected_message (char ∗xml_dir)• void test_variable_naming_conventions (void)• int main (int argc, char ∗argv[ ])

Variables

• static const int SHOULD_NOT_LOG_EXPECTED_MSG = 0• static const int SHOULD_LOG_EXPECTED_MSG = 1• static int did_not_log_expected_msg• static char ∗ expected_message = "Invalid structured ScalarVariable name"• static char ∗ name_check_test_directory

7.63.1 Function Documentation

7.63.1.1 char∗ concat ( char ∗ s1, char ∗ s2 )

Definition at line 13 of file fmi2_xml_parsing_test.c.

7.63.1.2 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 27 of file fmi2_xml_parsing_test.c.

7.63.1.3 void test_parser ( char ∗ xml_dir, int should_not_log_expected_msg, int configuration )

Definition at line 36 of file fmi2_xml_parsing_test.c.

7.63.1.4 void fail_name_check ( char ∗ xml_dir )

Definition at line 71 of file fmi2_xml_parsing_test.c.

7.63.1.5 void pass_name_check ( char ∗ xml_dir )

Definition at line 77 of file fmi2_xml_parsing_test.c.

7.63.1.6 void parser_log_expected_message ( char ∗ xml_dir )

Definition at line 82 of file fmi2_xml_parsing_test.c.

Generated by Doxygen

Page 416: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

348 File Documentation

7.63.1.7 void test_variable_naming_conventions ( void )

Definition at line 87 of file fmi2_xml_parsing_test.c.

7.63.1.8 int main ( int argc, char ∗ argv[ ] )

Definition at line 163 of file fmi2_xml_parsing_test.c.

7.63.2 Variable Documentation

7.63.2.1 const int SHOULD_NOT_LOG_EXPECTED_MSG = 0 [static]

Definition at line 6 of file fmi2_xml_parsing_test.c.

7.63.2.2 const int SHOULD_LOG_EXPECTED_MSG = 1 [static]

Definition at line 7 of file fmi2_xml_parsing_test.c.

7.63.2.3 int did_not_log_expected_msg [static]

Definition at line 9 of file fmi2_xml_parsing_test.c.

7.63.2.4 char∗ expected_message = "Invalid structured ScalarVariable name" [static]

Definition at line 10 of file fmi2_xml_parsing_test.c.

7.63.2.5 char∗ name_check_test_directory [static]

Definition at line 11 of file fmi2_xml_parsing_test.c.

7.64 Test/FMI2/fmu_dummy/fmu2_model.c File Reference

#include <stdio.h>#include <string.h>#include <fmu_dummy/fmu2_model.h>

Generated by Doxygen

Page 417: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.64 Test/FMI2/fmu_dummy/fmu2_model.c File Reference 349

Functions

• static int calc_initialize (component_ptr_t comp)• static int calc_get_derivatives (component_ptr_t comp)• static int calc_get_event_indicators (component_ptr_t comp)• static int calc_event_update (component_ptr_t comp)• const char ∗ fmi_get_version ()• fmi2Status fmi_set_debug_logging (fmi2Component c, fmi2Boolean loggingOn)• fmi2Status fmi_get_real (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Real value[ ])• fmi2Status fmi_get_integer (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Integer value[ ])• fmi2Status fmi_get_boolean (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Boolean

value[ ])• fmi2Status fmi_get_string (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2String value[ ])• fmi2Status fmi_set_real (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2Real

value[ ])• fmi2Status fmi_set_integer (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2Integer

value[ ])• fmi2Status fmi_set_boolean (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2Boolean

value[ ])• fmi2Status fmi_set_string (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2String

value[ ])• const char ∗ fmi_get_model_types_platform ()• fmi2Component fmi_instantiate (fmi2String instanceName, fmi2Type fmuType, fmi2String fmuGUID, fmi2←↩

String fmuLocation, const fmi2CallbackFunctions ∗functions, fmi2Boolean visible, fmi2Boolean loggingOn)• void fmi_free_instance (fmi2Component c)• fmi2Status fmi_setup_experiment (fmi2Component c, fmi2Boolean toleranceDefined, fmi2Real tolerance,

fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)• fmi2Status fmi_enter_initialization_mode (fmi2Component c)• fmi2Status fmi_exit_initialization_mode (fmi2Component c)• fmi2Status fmi_enter_event_mode (fmi2Component c)• fmi2Status fmi_new_discrete_states (fmi2Component c, fmi2EventInfo ∗eventInfo)• fmi2Status fmi_enter_continuous_time_mode (fmi2Component c)• fmi2Status fmi_set_time (fmi2Component c, fmi2Real fmitime)• fmi2Status fmi_set_continuous_states (fmi2Component c, const fmi2Real x[ ], size_t nx)• fmi2Status fmi_completed_integrator_step (fmi2Component c, fmi2Boolean noSetFMUStatePriorTo←↩

CurrentPoint, fmi2Boolean ∗enterEventMode, fmi2Boolean ∗terminateSimulation)• fmi2Status fmi_get_derivatives (fmi2Component c, fmi2Real derivatives[ ], size_t nx)• fmi2Status fmi_get_event_indicators (fmi2Component c, fmi2Real eventIndicators[ ], size_t ni)• fmi2Status fmi_get_continuous_states (fmi2Component c, fmi2Real states[ ], size_t nx)• fmi2Status fmi_get_nominals_of_continuousstates (fmi2Component c, fmi2Real x_nominal[ ], size_t nx)• fmi2Status fmi_terminate (fmi2Component c)• const char ∗ fmi_get_types_platform ()• fmi2Status fmi_reset (fmi2Component c)• fmi2Status fmi_set_real_input_derivatives (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,

const fmi2Integer order[ ], const fmi2Real value[ ])• fmi2Status fmi_get_real_output_derivatives (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,

const fmi2Integer order[ ], fmi2Real value[ ])• fmi2Status fmi_cancel_step (fmi2Component c)• fmi2Status fmi_do_step (fmi2Component c, fmi2Real currentCommunicationPoint, fmi2Real communication←↩

StepSize, fmi2Boolean newStep)• fmi2Status fmi_get_status (fmi2Component c, const fmi2StatusKind s, fmi2Status ∗value)• fmi2Status fmi_get_real_status (fmi2Component c, const fmi2StatusKind s, fmi2Real ∗value)• fmi2Status fmi_get_integer_status (fmi2Component c, const fmi2StatusKind s, fmi2Integer ∗value)• fmi2Status fmi_get_boolean_status (fmi2Component c, const fmi2StatusKind s, fmi2Boolean ∗value)• fmi2Status fmi_get_string_status (fmi2Component c, const fmi2StatusKind s, fmi2String ∗value)

Generated by Doxygen

Page 418: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

350 File Documentation

7.64.1 Function Documentation

7.64.1.1 static int calc_initialize ( component_ptr_t comp ) [static]

Definition at line 23 of file fmu2_model.c.

7.64.1.2 static int calc_get_derivatives ( component_ptr_t comp ) [static]

Definition at line 43 of file fmu2_model.c.

7.64.1.3 static int calc_get_event_indicators ( component_ptr_t comp ) [static]

Definition at line 50 of file fmu2_model.c.

7.64.1.4 static int calc_event_update ( component_ptr_t comp ) [static]

Definition at line 57 of file fmu2_model.c.

7.64.1.5 const char∗ fmi_get_version ( )

Definition at line 78 of file fmu2_model.c.

7.64.1.6 fmi2Status fmi_set_debug_logging ( fmi2Component c, fmi2Boolean loggingOn )

Definition at line 83 of file fmu2_model.c.

7.64.1.7 fmi2Status fmi_get_real ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Real value[ ] )

Definition at line 94 of file fmu2_model.c.

7.64.1.8 fmi2Status fmi_get_integer ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Integervalue[ ] )

Definition at line 118 of file fmu2_model.c.

7.64.1.9 fmi2Status fmi_get_boolean ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Booleanvalue[ ] )

Definition at line 132 of file fmu2_model.c.

Generated by Doxygen

Page 419: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.64 Test/FMI2/fmu_dummy/fmu2_model.c File Reference 351

7.64.1.10 fmi2Status fmi_get_string ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Stringvalue[ ] )

Definition at line 146 of file fmu2_model.c.

7.64.1.11 fmi2Status fmi_set_real ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2Realvalue[ ] )

Definition at line 160 of file fmu2_model.c.

7.64.1.12 fmi2Status fmi_set_integer ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, constfmi2Integer value[ ] )

Definition at line 184 of file fmu2_model.c.

7.64.1.13 fmi2Status fmi_set_boolean ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, constfmi2Boolean value[ ] )

Definition at line 198 of file fmu2_model.c.

7.64.1.14 fmi2Status fmi_set_string ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, constfmi2String value[ ] )

Definition at line 212 of file fmu2_model.c.

7.64.1.15 const char∗ fmi_get_model_types_platform ( )

Definition at line 251 of file fmu2_model.c.

7.64.1.16 fmi2Component fmi_instantiate ( fmi2String instanceName, fmi2Type fmuType, fmi2String fmuGUID,fmi2String fmuLocation, const fmi2CallbackFunctions ∗ functions, fmi2Boolean visible, fmi2BooleanloggingOn )

Definition at line 260 of file fmu2_model.c.

7.64.1.17 void fmi_free_instance ( fmi2Component c )

Definition at line 312 of file fmu2_model.c.

7.64.1.18 fmi2Status fmi_setup_experiment ( fmi2Component c, fmi2Boolean toleranceDefined, fmi2Real tolerance,fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime )

Definition at line 323 of file fmu2_model.c.

Generated by Doxygen

Page 420: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

352 File Documentation

7.64.1.19 fmi2Status fmi_enter_initialization_mode ( fmi2Component c )

Definition at line 344 of file fmu2_model.c.

7.64.1.20 fmi2Status fmi_exit_initialization_mode ( fmi2Component c )

Definition at line 354 of file fmu2_model.c.

7.64.1.21 fmi2Status fmi_enter_event_mode ( fmi2Component c )

Definition at line 359 of file fmu2_model.c.

7.64.1.22 fmi2Status fmi_new_discrete_states ( fmi2Component c, fmi2EventInfo ∗ eventInfo )

Definition at line 364 of file fmu2_model.c.

7.64.1.23 fmi2Status fmi_enter_continuous_time_mode ( fmi2Component c )

Definition at line 377 of file fmu2_model.c.

7.64.1.24 fmi2Status fmi_set_time ( fmi2Component c, fmi2Real fmitime )

Definition at line 382 of file fmu2_model.c.

7.64.1.25 fmi2Status fmi_set_continuous_states ( fmi2Component c, const fmi2Real x[ ], size_t nx )

Definition at line 393 of file fmu2_model.c.

7.64.1.26 fmi2Status fmi_completed_integrator_step ( fmi2Component c, fmi2Boolean noSetFMU←↩

StatePriorToCurrentPoint, fmi2Boolean ∗ enterEventMode, fmi2Boolean ∗ terminateSimulation)

Definition at line 407 of file fmu2_model.c.

7.64.1.27 fmi2Status fmi_get_derivatives ( fmi2Component c, fmi2Real derivatives[ ], size_t nx )

Definition at line 420 of file fmu2_model.c.

7.64.1.28 fmi2Status fmi_get_event_indicators ( fmi2Component c, fmi2Real eventIndicators[ ], size_t ni )

Definition at line 437 of file fmu2_model.c.

Generated by Doxygen

Page 421: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.64 Test/FMI2/fmu_dummy/fmu2_model.c File Reference 353

7.64.1.29 fmi2Status fmi_get_continuous_states ( fmi2Component c, fmi2Real states[ ], size_t nx )

Definition at line 454 of file fmu2_model.c.

7.64.1.30 fmi2Status fmi_get_nominals_of_continuousstates ( fmi2Component c, fmi2Real x_nominal[ ], size_t nx )

Definition at line 469 of file fmu2_model.c.

7.64.1.31 fmi2Status fmi_terminate ( fmi2Component c )

Definition at line 483 of file fmu2_model.c.

7.64.1.32 const char∗ fmi_get_types_platform ( )

Definition at line 494 of file fmu2_model.c.

7.64.1.33 fmi2Status fmi_reset ( fmi2Component c )

Definition at line 499 of file fmu2_model.c.

7.64.1.34 fmi2Status fmi_set_real_input_derivatives ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2Integer order[ ], const fmi2Real value[ ] )

Definition at line 504 of file fmu2_model.c.

7.64.1.35 fmi2Status fmi_get_real_output_derivatives ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2Integer order[ ], fmi2Real value[ ] )

Definition at line 520 of file fmu2_model.c.

7.64.1.36 fmi2Status fmi_cancel_step ( fmi2Component c )

Definition at line 532 of file fmu2_model.c.

7.64.1.37 fmi2Status fmi_do_step ( fmi2Component c, fmi2Real currentCommunicationPoint, fmi2RealcommunicationStepSize, fmi2Boolean newStep )

Definition at line 537 of file fmu2_model.c.

7.64.1.38 fmi2Status fmi_get_status ( fmi2Component c, const fmi2StatusKind s, fmi2Status ∗ value )

Definition at line 637 of file fmu2_model.c.

Generated by Doxygen

Page 422: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

354 File Documentation

7.64.1.39 fmi2Status fmi_get_real_status ( fmi2Component c, const fmi2StatusKind s, fmi2Real ∗ value )

Definition at line 649 of file fmu2_model.c.

7.64.1.40 fmi2Status fmi_get_integer_status ( fmi2Component c, const fmi2StatusKind s, fmi2Integer ∗ value )

Definition at line 661 of file fmu2_model.c.

7.64.1.41 fmi2Status fmi_get_boolean_status ( fmi2Component c, const fmi2StatusKind s, fmi2Boolean ∗ value )

Definition at line 669 of file fmu2_model.c.

7.64.1.42 fmi2Status fmi_get_string_status ( fmi2Component c, const fmi2StatusKind s, fmi2String ∗ value )

Definition at line 677 of file fmu2_model.c.

7.65 Test/FMI2/fmu_dummy/fmu2_model.h File Reference

#include <FMI2/fmi2Functions.h>#include <fmu_dummy/fmu2_model_defines.h>

Data Structures

• struct component_t

Macros

• #define FMI2_Export DllExport

Typedefs

• typedef component_t ∗ component_ptr_t

Generated by Doxygen

Page 423: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.65 Test/FMI2/fmu_dummy/fmu2_model.h File Reference 355

Functions

• const char ∗ fmi_get_version ()• fmi2Status fmi_set_debug_logging (fmi2Component c, fmi2Boolean loggingOn)• fmi2Component fmi_instantiate (fmi2String instanceName, fmi2Type fmuType, fmi2String fmuGUID, fmi2←↩

String fmuLocation, const fmi2CallbackFunctions ∗functions, fmi2Boolean visible, fmi2Boolean loggingOn)• void fmi_free_instance (fmi2Component c)• fmi2Status fmi_setup_experiment (fmi2Component c, fmi2Boolean toleranceDefined, fmi2Real tolerance,

fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)• fmi2Status fmi_enter_initialization_mode (fmi2Component c)• fmi2Status fmi_exit_initialization_mode (fmi2Component c)• fmi2Status fmi_terminate (fmi2Component c)• fmi2Status fmi_reset (fmi2Component c)• fmi2Status fmi_get_real (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Real value[ ])• fmi2Status fmi_get_integer (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Integer value[ ])• fmi2Status fmi_get_boolean (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Boolean

value[ ])• fmi2Status fmi_get_string (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2String value[ ])• fmi2Status fmi_set_real (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2Real

value[ ])• fmi2Status fmi_set_integer (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2Integer

value[ ])• fmi2Status fmi_set_boolean (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2Boolean

value[ ])• fmi2Status fmi_set_string (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2String

value[ ])• const char ∗ fmi_get_model_types_platform ()• fmi2Status fmi_enter_event_mode (fmi2Component c)• fmi2Status fmi_new_discrete_states (fmi2Component c, fmi2EventInfo ∗eventInfo)• fmi2Status fmi_enter_continuous_time_mode (fmi2Component c)• fmi2Status fmi_set_time (fmi2Component c, fmi2Real fmitime)• fmi2Status fmi_set_continuous_states (fmi2Component c, const fmi2Real x[ ], size_t nx)• fmi2Status fmi_completed_integrator_step (fmi2Component c, fmi2Boolean noSetFMUStatePriorTo←↩

CurrentPoint, fmi2Boolean ∗enterEventMode, fmi2Boolean ∗terminateSimulation)• fmi2Status fmi_get_derivatives (fmi2Component c, fmi2Real derivatives[ ], size_t nx)• fmi2Status fmi_get_event_indicators (fmi2Component c, fmi2Real eventIndicators[ ], size_t ni)• fmi2Status fmi_get_continuous_states (fmi2Component c, fmi2Real states[ ], size_t nx)• fmi2Status fmi_get_nominals_of_continuousstates (fmi2Component c, fmi2Real x_nominal[ ], size_t nx)

7.65.1 Macro Definition Documentation

7.65.1.1 #define FMI2_Export DllExport

Definition at line 24 of file fmu2_model.h.

7.65.2 Typedef Documentation

7.65.2.1 typedef component_t∗ component_ptr_t

Definition at line 71 of file fmu2_model.h.

Generated by Doxygen

Page 424: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

356 File Documentation

7.65.3 Function Documentation

7.65.3.1 const char∗ fmi_get_version ( )

Definition at line 77 of file fmu1_model.c.

7.65.3.2 fmi2Status fmi_set_debug_logging ( fmi2Component c, fmi2Boolean loggingOn )

Definition at line 83 of file fmu2_model.c.

7.65.3.3 fmi2Component fmi_instantiate ( fmi2String instanceName, fmi2Type fmuType, fmi2String fmuGUID,fmi2String fmuLocation, const fmi2CallbackFunctions ∗ functions, fmi2Boolean visible, fmi2BooleanloggingOn )

Definition at line 260 of file fmu2_model.c.

7.65.3.4 void fmi_free_instance ( fmi2Component c )

Definition at line 312 of file fmu2_model.c.

7.65.3.5 fmi2Status fmi_setup_experiment ( fmi2Component c, fmi2Boolean toleranceDefined, fmi2Real tolerance,fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime )

Definition at line 323 of file fmu2_model.c.

7.65.3.6 fmi2Status fmi_enter_initialization_mode ( fmi2Component c )

Definition at line 344 of file fmu2_model.c.

7.65.3.7 fmi2Status fmi_exit_initialization_mode ( fmi2Component c )

Definition at line 354 of file fmu2_model.c.

7.65.3.8 fmi2Status fmi_terminate ( fmi2Component c )

Definition at line 483 of file fmu2_model.c.

7.65.3.9 fmi2Status fmi_reset ( fmi2Component c )

Definition at line 499 of file fmu2_model.c.

Generated by Doxygen

Page 425: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.65 Test/FMI2/fmu_dummy/fmu2_model.h File Reference 357

7.65.3.10 fmi2Status fmi_get_real ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Real value[ ] )

Definition at line 94 of file fmu2_model.c.

7.65.3.11 fmi2Status fmi_get_integer ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Integervalue[ ] )

Definition at line 118 of file fmu2_model.c.

7.65.3.12 fmi2Status fmi_get_boolean ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Booleanvalue[ ] )

Definition at line 132 of file fmu2_model.c.

7.65.3.13 fmi2Status fmi_get_string ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Stringvalue[ ] )

Definition at line 146 of file fmu2_model.c.

7.65.3.14 fmi2Status fmi_set_real ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const fmi2Realvalue[ ] )

Definition at line 160 of file fmu2_model.c.

7.65.3.15 fmi2Status fmi_set_integer ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, constfmi2Integer value[ ] )

Definition at line 184 of file fmu2_model.c.

7.65.3.16 fmi2Status fmi_set_boolean ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, constfmi2Boolean value[ ] )

Definition at line 198 of file fmu2_model.c.

7.65.3.17 fmi2Status fmi_set_string ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, constfmi2String value[ ] )

Definition at line 212 of file fmu2_model.c.

7.65.3.18 const char∗ fmi_get_model_types_platform ( )

Definition at line 242 of file fmu1_model.c.

Generated by Doxygen

Page 426: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

358 File Documentation

7.65.3.19 fmi2Status fmi_enter_event_mode ( fmi2Component c )

Definition at line 359 of file fmu2_model.c.

7.65.3.20 fmi2Status fmi_new_discrete_states ( fmi2Component c, fmi2EventInfo ∗ eventInfo )

Definition at line 364 of file fmu2_model.c.

7.65.3.21 fmi2Status fmi_enter_continuous_time_mode ( fmi2Component c )

Definition at line 377 of file fmu2_model.c.

7.65.3.22 fmi2Status fmi_set_time ( fmi2Component c, fmi2Real fmitime )

Definition at line 382 of file fmu2_model.c.

7.65.3.23 fmi2Status fmi_set_continuous_states ( fmi2Component c, const fmi2Real x[ ], size_t nx )

Definition at line 393 of file fmu2_model.c.

7.65.3.24 fmi2Status fmi_completed_integrator_step ( fmi2Component c, fmi2Boolean noSetFMU←↩

StatePriorToCurrentPoint, fmi2Boolean ∗ enterEventMode, fmi2Boolean ∗ terminateSimulation)

Definition at line 407 of file fmu2_model.c.

7.65.3.25 fmi2Status fmi_get_derivatives ( fmi2Component c, fmi2Real derivatives[ ], size_t nx )

Definition at line 420 of file fmu2_model.c.

7.65.3.26 fmi2Status fmi_get_event_indicators ( fmi2Component c, fmi2Real eventIndicators[ ], size_t ni )

Definition at line 437 of file fmu2_model.c.

7.65.3.27 fmi2Status fmi_get_continuous_states ( fmi2Component c, fmi2Real states[ ], size_t nx )

Definition at line 454 of file fmu2_model.c.

7.65.3.28 fmi2Status fmi_get_nominals_of_continuousstates ( fmi2Component c, fmi2Real x_nominal[ ], size_t nx )

Definition at line 469 of file fmu2_model.c.

Generated by Doxygen

Page 427: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.66 Test/FMI2/fmu_dummy/fmu2_model_cs.c File Reference 359

7.66 Test/FMI2/fmu_dummy/fmu2_model_cs.c File Reference

#include <string.h>#include <FMI2/fmi2Functions.h>#include <fmu_dummy/fmu2_model.h>#include "config_test.h"#include "fmu2_model.c"

Functions

• FMI2_Export const char ∗ fmi2GetVersion ()• FMI2_Export fmi2Status fmi2SetDebugLogging (fmi2Component c, fmi2Boolean loggingOn, size_t n, const

fmi2String cat[ ])• FMI2_Export fmi2Component fmi2Instantiate (fmi2String instanceName, fmi2Type fmuType, fmi2String GUID,

fmi2String location, const fmi2CallbackFunctions ∗functions, fmi2Boolean visible, fmi2Boolean loggingOn)• FMI2_Export void fmi2FreeInstance (fmi2Component c)• FMI2_Export fmi2Status fmi2SetupExperiment (fmi2Component c, fmi2Boolean toleranceDefined, fmi2Real

tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)• FMI2_Export fmi2Status fmi2EnterInitializationMode (fmi2Component c)• FMI2_Export fmi2Status fmi2ExitInitializationMode (fmi2Component c)• FMI2_Export fmi2Status fmi2GetReal (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Real

value[ ])• FMI2_Export fmi2Status fmi2GetInteger (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2←↩

Integer value[ ])• FMI2_Export fmi2Status fmi2GetBoolean (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,

fmi2Boolean value[ ])• FMI2_Export fmi2Status fmi2GetString (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2←↩

String value[ ])• FMI2_Export fmi2Status fmi2SetReal (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const

fmi2Real value[ ])• FMI2_Export fmi2Status fmi2SetInteger (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const

fmi2Integer value[ ])• FMI2_Export fmi2Status fmi2SetBoolean (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const

fmi2Boolean value[ ])• FMI2_Export fmi2Status fmi2SetString (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const

fmi2String value[ ])• FMI2_Export const char ∗ fmi2GetTypesPlatform ()• FMI2_Export fmi2Status fmi2Terminate (fmi2Component c)• FMI2_Export fmi2Status fmi2Reset (fmi2Component c)• FMI2_Export fmi2Status fmi2SetRealInputDerivatives (fmi2Component c, const fmi2ValueReference vr[ ],

size_t nvr, const fmi2Integer order[ ], const fmi2Real value[ ])• FMI2_Export fmi2Status fmi2GetRealOutputDerivatives (fmi2Component c, const fmi2ValueReference vr[ ],

size_t nvr, const fmi2Integer order[ ], fmi2Real value[ ])• FMI2_Export fmi2Status fmi2CancelStep (fmi2Component c)• FMI2_Export fmi2Status fmi2DoStep (fmi2Component c, fmi2Real currentCommunicationPoint, fmi2Real

communicationStepSize, fmi2Boolean newStep)• FMI2_Export fmi2Status fmi2GetStatus (fmi2Component c, const fmi2StatusKind s, fmi2Status ∗value)• FMI2_Export fmi2Status fmi2GetRealStatus (fmi2Component c, const fmi2StatusKind s, fmi2Real ∗value)• FMI2_Export fmi2Status fmi2GetIntegerStatus (fmi2Component c, const fmi2StatusKind s, fmi2Integer∗value)

• FMI2_Export fmi2Status fmi2GetBooleanStatus (fmi2Component c, const fmi2StatusKind s, fmi2Boolean∗value)

• FMI2_Export fmi2Status fmi2GetStringStatus (fmi2Component c, const fmi2StatusKind s, fmi2String ∗value)

Generated by Doxygen

Page 428: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

360 File Documentation

7.66.1 Function Documentation

7.66.1.1 FMI2_Export const char∗ fmi2GetVersion ( )

Definition at line 38 of file fmu2_model_cs.c.

7.66.1.2 FMI2_Export fmi2Status fmi2SetDebugLogging ( fmi2Component c, fmi2Boolean loggingOn, size_t n, constfmi2String cat[ ] )

Definition at line 43 of file fmu2_model_cs.c.

7.66.1.3 FMI2_Export fmi2Component fmi2Instantiate ( fmi2String instanceName, fmi2Type fmuType, fmi2StringGUID, fmi2String location, const fmi2CallbackFunctions ∗ functions, fmi2Boolean visible, fmi2BooleanloggingOn )

Definition at line 48 of file fmu2_model_cs.c.

7.66.1.4 FMI2_Export void fmi2FreeInstance ( fmi2Component c )

Definition at line 57 of file fmu2_model_cs.c.

7.66.1.5 FMI2_Export fmi2Status fmi2SetupExperiment ( fmi2Component c, fmi2Boolean toleranceDefined, fmi2Realtolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime )

Definition at line 62 of file fmu2_model_cs.c.

7.66.1.6 FMI2_Export fmi2Status fmi2EnterInitializationMode ( fmi2Component c )

Definition at line 71 of file fmu2_model_cs.c.

7.66.1.7 FMI2_Export fmi2Status fmi2ExitInitializationMode ( fmi2Component c )

Definition at line 76 of file fmu2_model_cs.c.

7.66.1.8 FMI2_Export fmi2Status fmi2GetReal ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2Real value[ ] )

Definition at line 81 of file fmu2_model_cs.c.

7.66.1.9 FMI2_Export fmi2Status fmi2GetInteger ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2Integer value[ ] )

Definition at line 86 of file fmu2_model_cs.c.

Generated by Doxygen

Page 429: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.66 Test/FMI2/fmu_dummy/fmu2_model_cs.c File Reference 361

7.66.1.10 FMI2_Export fmi2Status fmi2GetBoolean ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2Boolean value[ ] )

Definition at line 91 of file fmu2_model_cs.c.

7.66.1.11 FMI2_Export fmi2Status fmi2GetString ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2String value[ ] )

Definition at line 96 of file fmu2_model_cs.c.

7.66.1.12 FMI2_Export fmi2Status fmi2SetReal ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2Real value[ ] )

Definition at line 101 of file fmu2_model_cs.c.

7.66.1.13 FMI2_Export fmi2Status fmi2SetInteger ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2Integer value[ ] )

Definition at line 106 of file fmu2_model_cs.c.

7.66.1.14 FMI2_Export fmi2Status fmi2SetBoolean ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2Boolean value[ ] )

Definition at line 111 of file fmu2_model_cs.c.

7.66.1.15 FMI2_Export fmi2Status fmi2SetString ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2String value[ ] )

Definition at line 116 of file fmu2_model_cs.c.

7.66.1.16 FMI2_Export const char∗ fmi2GetTypesPlatform ( )

Definition at line 122 of file fmu2_model_cs.c.

7.66.1.17 FMI2_Export fmi2Status fmi2Terminate ( fmi2Component c )

Definition at line 127 of file fmu2_model_cs.c.

7.66.1.18 FMI2_Export fmi2Status fmi2Reset ( fmi2Component c )

Definition at line 132 of file fmu2_model_cs.c.

Generated by Doxygen

Page 430: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

362 File Documentation

7.66.1.19 FMI2_Export fmi2Status fmi2SetRealInputDerivatives ( fmi2Component c, const fmi2ValueReference vr[ ],size_t nvr, const fmi2Integer order[ ], const fmi2Real value[ ] )

Definition at line 137 of file fmu2_model_cs.c.

7.66.1.20 FMI2_Export fmi2Status fmi2GetRealOutputDerivatives ( fmi2Component c, const fmi2ValueReferencevr[ ], size_t nvr, const fmi2Integer order[ ], fmi2Real value[ ] )

Definition at line 142 of file fmu2_model_cs.c.

7.66.1.21 FMI2_Export fmi2Status fmi2CancelStep ( fmi2Component c )

Definition at line 147 of file fmu2_model_cs.c.

7.66.1.22 FMI2_Export fmi2Status fmi2DoStep ( fmi2Component c, fmi2Real currentCommunicationPoint, fmi2RealcommunicationStepSize, fmi2Boolean newStep )

Definition at line 152 of file fmu2_model_cs.c.

7.66.1.23 FMI2_Export fmi2Status fmi2GetStatus ( fmi2Component c, const fmi2StatusKind s, fmi2Status ∗ value )

Definition at line 157 of file fmu2_model_cs.c.

7.66.1.24 FMI2_Export fmi2Status fmi2GetRealStatus ( fmi2Component c, const fmi2StatusKind s, fmi2Real ∗ value )

Definition at line 162 of file fmu2_model_cs.c.

7.66.1.25 FMI2_Export fmi2Status fmi2GetIntegerStatus ( fmi2Component c, const fmi2StatusKind s, fmi2Integer ∗value )

Definition at line 167 of file fmu2_model_cs.c.

7.66.1.26 FMI2_Export fmi2Status fmi2GetBooleanStatus ( fmi2Component c, const fmi2StatusKind s, fmi2Boolean ∗value )

Definition at line 172 of file fmu2_model_cs.c.

7.66.1.27 FMI2_Export fmi2Status fmi2GetStringStatus ( fmi2Component c, const fmi2StatusKind s, fmi2String ∗value )

Definition at line 177 of file fmu2_model_cs.c.

Generated by Doxygen

Page 431: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.67 Test/FMI2/fmu_dummy/fmu2_model_defines.h File Reference 363

7.67 Test/FMI2/fmu_dummy/fmu2_model_defines.h File Reference

Macros

• #define BUFFER 1024• #define MAGIC_TEST_VALUE 13.0 /∗ A test value for some functions ∗/• #define VAR_R_HIGHT 0• #define VAR_R_HIGHT_SPEED 1• #define VAR_R_GRATIVY 2• #define VAR_R_BOUNCE_CONF 3• #define EVENT_HIGHT 0• #define VAR_S_LOGGER_TEST 0• #define N_STATES 2• #define N_EVENT_INDICATORS 1• #define N_REAL 4• #define N_INTEGER 4• #define N_BOOLEAN 4• #define N_STRING 4• #define N_INPUT_REAL 2 /∗ CS only ∗/• #define N_INPUT_REAL_MAX_ORDER 2 /∗ CS only ∗/• #define N_OUTPUT_REAL 2 /∗ CS only ∗/• #define N_OUTPUT_REAL_MAX_ORDER 2 /∗ CS only ∗/• #define FMI_VERSION "2.0"• #define FMI_GUID "123"

7.67.1 Macro Definition Documentation

7.67.1.1 #define BUFFER 1024

Definition at line 25 of file fmu2_model_defines.h.

7.67.1.2 #define MAGIC_TEST_VALUE 13.0 /∗ A test value for some functions ∗/

Definition at line 26 of file fmu2_model_defines.h.

7.67.1.3 #define VAR_R_HIGHT 0

Definition at line 31 of file fmu2_model_defines.h.

7.67.1.4 #define VAR_R_HIGHT_SPEED 1

Definition at line 32 of file fmu2_model_defines.h.

7.67.1.5 #define VAR_R_GRATIVY 2

Definition at line 34 of file fmu2_model_defines.h.

Generated by Doxygen

Page 432: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

364 File Documentation

7.67.1.6 #define VAR_R_BOUNCE_CONF 3

Definition at line 35 of file fmu2_model_defines.h.

7.67.1.7 #define EVENT_HIGHT 0

Definition at line 38 of file fmu2_model_defines.h.

7.67.1.8 #define VAR_S_LOGGER_TEST 0

Definition at line 41 of file fmu2_model_defines.h.

7.67.1.9 #define N_STATES 2

Definition at line 44 of file fmu2_model_defines.h.

7.67.1.10 #define N_EVENT_INDICATORS 1

Definition at line 45 of file fmu2_model_defines.h.

7.67.1.11 #define N_REAL 4

Definition at line 46 of file fmu2_model_defines.h.

7.67.1.12 #define N_INTEGER 4

Definition at line 47 of file fmu2_model_defines.h.

7.67.1.13 #define N_BOOLEAN 4

Definition at line 48 of file fmu2_model_defines.h.

7.67.1.14 #define N_STRING 4

Definition at line 49 of file fmu2_model_defines.h.

7.67.1.15 #define N_INPUT_REAL 2 /∗ CS only ∗/

Definition at line 51 of file fmu2_model_defines.h.

Generated by Doxygen

Page 433: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.68 Test/FMI2/fmu_dummy/fmu2_model_me.c File Reference 365

7.67.1.16 #define N_INPUT_REAL_MAX_ORDER 2 /∗ CS only ∗/

Definition at line 52 of file fmu2_model_defines.h.

7.67.1.17 #define N_OUTPUT_REAL 2 /∗ CS only ∗/

Definition at line 53 of file fmu2_model_defines.h.

7.67.1.18 #define N_OUTPUT_REAL_MAX_ORDER 2 /∗ CS only ∗/

Definition at line 54 of file fmu2_model_defines.h.

7.67.1.19 #define FMI_VERSION "2.0"

Definition at line 57 of file fmu2_model_defines.h.

7.67.1.20 #define FMI_GUID "123"

Definition at line 59 of file fmu2_model_defines.h.

7.68 Test/FMI2/fmu_dummy/fmu2_model_me.c File Reference

#include <string.h>#include <FMI2/fmi2TypesPlatform.h>#include <FMI2/fmi2Functions.h>#include <fmu_dummy/fmu2_model.h>#include "config_test.h"#include "fmu2_model.c"

Functions

• FMI2_Export const char ∗ fmi2GetVersion ()• FMI2_Export fmi2Status fmi2SetDebugLogging (fmi2Component c, fmi2Boolean loggingOn, size_t n, const

fmi2String cat[ ])• FMI2_Export fmi2Component fmi2Instantiate (fmi2String instanceName, fmi2Type fmuType, fmi2String GUID,

fmi2String location, const fmi2CallbackFunctions ∗functions, fmi2Boolean visible, fmi2Boolean loggingOn)• FMI2_Export void fmi2FreeInstance (fmi2Component c)• FMI2_Export fmi2Status fmi2SetupExperiment (fmi2Component c, fmi2Boolean toleranceDefined, fmi2Real

tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)• FMI2_Export fmi2Status fmi2EnterInitializationMode (fmi2Component c)• FMI2_Export fmi2Status fmi2ExitInitializationMode (fmi2Component c)• FMI2_Export fmi2Status fmi2GetReal (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2Real

value[ ])• FMI2_Export fmi2Status fmi2GetInteger (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2←↩

Integer value[ ])

Generated by Doxygen

Page 434: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

366 File Documentation

• FMI2_Export fmi2Status fmi2GetBoolean (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2Boolean value[ ])

• FMI2_Export fmi2Status fmi2GetString (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, fmi2←↩

String value[ ])• FMI2_Export fmi2Status fmi2SetReal (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const

fmi2Real value[ ])• FMI2_Export fmi2Status fmi2SetInteger (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const

fmi2Integer value[ ])• FMI2_Export fmi2Status fmi2SetBoolean (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const

fmi2Boolean value[ ])• FMI2_Export fmi2Status fmi2SetString (fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr, const

fmi2String value[ ])• FMI2_Export const char ∗ fmi2GetTypesPlatform ()• FMI2_Export fmi2Status fmi2EnterEventMode (fmi2Component c)• FMI2_Export fmi2Status fmi2NewDiscreteStates (fmi2Component c, fmi2EventInfo ∗eventInfo)• FMI2_Export fmi2Status fmi2EnterContinuousTimeMode (fmi2Component c)• FMI2_Export fmi2Status fmi2SetTime (fmi2Component c, fmi2Real fmitime)• FMI2_Export fmi2Status fmi2SetContinuousStates (fmi2Component c, const fmi2Real x[ ], size_t nx)• FMI2_Export fmi2Status fmi2CompletedIntegratorStep (fmi2Component c, fmi2Boolean noSetFMUState←↩

PriorToCurrentPoint, fmi2Boolean ∗enterEventMode, fmi2Boolean ∗terminateSimulation)• FMI2_Export fmi2Status fmi2GetDerivatives (fmi2Component c, fmi2Real derivatives[ ], size_t nx)• FMI2_Export fmi2Status fmi2GetEventIndicators (fmi2Component c, fmi2Real eventIndicators[ ], size_t ni)• FMI2_Export fmi2Status fmi2GetContinuousStates (fmi2Component c, fmi2Real states[ ], size_t nx)• FMI2_Export fmi2Status fmi2GetNominalsOfContinuousStates (fmi2Component c, fmi2Real x_nominal[ ],

size_t nx)• FMI2_Export fmi2Status fmi2Terminate (fmi2Component c)• FMI2_Export fmi2Status fmi2Reset (fmi2Component c)

7.68.1 Function Documentation

7.68.1.1 FMI2_Export const char∗ fmi2GetVersion ( )

Definition at line 35 of file fmu2_model_me.c.

7.68.1.2 FMI2_Export fmi2Status fmi2SetDebugLogging ( fmi2Component c, fmi2Boolean loggingOn, size_t n, constfmi2String cat[ ] )

Definition at line 40 of file fmu2_model_me.c.

7.68.1.3 FMI2_Export fmi2Component fmi2Instantiate ( fmi2String instanceName, fmi2Type fmuType, fmi2StringGUID, fmi2String location, const fmi2CallbackFunctions ∗ functions, fmi2Boolean visible, fmi2BooleanloggingOn )

Definition at line 45 of file fmu2_model_me.c.

7.68.1.4 FMI2_Export void fmi2FreeInstance ( fmi2Component c )

Definition at line 54 of file fmu2_model_me.c.

Generated by Doxygen

Page 435: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.68 Test/FMI2/fmu_dummy/fmu2_model_me.c File Reference 367

7.68.1.5 FMI2_Export fmi2Status fmi2SetupExperiment ( fmi2Component c, fmi2Boolean toleranceDefined, fmi2Realtolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime )

Definition at line 59 of file fmu2_model_me.c.

7.68.1.6 FMI2_Export fmi2Status fmi2EnterInitializationMode ( fmi2Component c )

Definition at line 68 of file fmu2_model_me.c.

7.68.1.7 FMI2_Export fmi2Status fmi2ExitInitializationMode ( fmi2Component c )

Definition at line 73 of file fmu2_model_me.c.

7.68.1.8 FMI2_Export fmi2Status fmi2GetReal ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2Real value[ ] )

Definition at line 78 of file fmu2_model_me.c.

7.68.1.9 FMI2_Export fmi2Status fmi2GetInteger ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2Integer value[ ] )

Definition at line 83 of file fmu2_model_me.c.

7.68.1.10 FMI2_Export fmi2Status fmi2GetBoolean ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2Boolean value[ ] )

Definition at line 88 of file fmu2_model_me.c.

7.68.1.11 FMI2_Export fmi2Status fmi2GetString ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,fmi2String value[ ] )

Definition at line 93 of file fmu2_model_me.c.

7.68.1.12 FMI2_Export fmi2Status fmi2SetReal ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2Real value[ ] )

Definition at line 98 of file fmu2_model_me.c.

7.68.1.13 FMI2_Export fmi2Status fmi2SetInteger ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2Integer value[ ] )

Definition at line 103 of file fmu2_model_me.c.

Generated by Doxygen

Page 436: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

368 File Documentation

7.68.1.14 FMI2_Export fmi2Status fmi2SetBoolean ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2Boolean value[ ] )

Definition at line 108 of file fmu2_model_me.c.

7.68.1.15 FMI2_Export fmi2Status fmi2SetString ( fmi2Component c, const fmi2ValueReference vr[ ], size_t nvr,const fmi2String value[ ] )

Definition at line 113 of file fmu2_model_me.c.

7.68.1.16 FMI2_Export const char∗ fmi2GetTypesPlatform ( )

Definition at line 119 of file fmu2_model_me.c.

7.68.1.17 FMI2_Export fmi2Status fmi2EnterEventMode ( fmi2Component c )

Definition at line 124 of file fmu2_model_me.c.

7.68.1.18 FMI2_Export fmi2Status fmi2NewDiscreteStates ( fmi2Component c, fmi2EventInfo ∗ eventInfo )

Definition at line 129 of file fmu2_model_me.c.

7.68.1.19 FMI2_Export fmi2Status fmi2EnterContinuousTimeMode ( fmi2Component c )

Definition at line 134 of file fmu2_model_me.c.

7.68.1.20 FMI2_Export fmi2Status fmi2SetTime ( fmi2Component c, fmi2Real fmitime )

Definition at line 139 of file fmu2_model_me.c.

7.68.1.21 FMI2_Export fmi2Status fmi2SetContinuousStates ( fmi2Component c, const fmi2Real x[ ], size_t nx )

Definition at line 144 of file fmu2_model_me.c.

7.68.1.22 FMI2_Export fmi2Status fmi2CompletedIntegratorStep ( fmi2Component c, fmi2BooleannoSetFMUStatePriorToCurrentPoint, fmi2Boolean ∗ enterEventMode, fmi2Boolean ∗ terminateSimulation )

Definition at line 149 of file fmu2_model_me.c.

7.68.1.23 FMI2_Export fmi2Status fmi2GetDerivatives ( fmi2Component c, fmi2Real derivatives[ ], size_t nx )

Definition at line 157 of file fmu2_model_me.c.

Generated by Doxygen

Page 437: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.69 Test/fmi_import_test.c File Reference 369

7.68.1.24 FMI2_Export fmi2Status fmi2GetEventIndicators ( fmi2Component c, fmi2Real eventIndicators[ ], size_t ni )

Definition at line 162 of file fmu2_model_me.c.

7.68.1.25 FMI2_Export fmi2Status fmi2GetContinuousStates ( fmi2Component c, fmi2Real states[ ], size_t nx )

Definition at line 167 of file fmu2_model_me.c.

7.68.1.26 FMI2_Export fmi2Status fmi2GetNominalsOfContinuousStates ( fmi2Component c, fmi2Real x_nominal[ ],size_t nx )

Definition at line 172 of file fmu2_model_me.c.

7.68.1.27 FMI2_Export fmi2Status fmi2Terminate ( fmi2Component c )

Definition at line 177 of file fmu2_model_me.c.

7.68.1.28 FMI2_Export fmi2Status fmi2Reset ( fmi2Component c )

Definition at line 182 of file fmu2_model_me.c.

7.69 Test/fmi_import_test.c File Reference

#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <config_test.h>#include <fmilib.h>

Macros

• #define BUFFER 1000

Functions

• int fmi1_test (fmi_import_context_t ∗context, const char ∗dirPath)• int fmi2_test (fmi_import_context_t ∗context, const char ∗dirPath)• void importlogger (jm_callbacks ∗c, jm_string module, jm_log_level_enu_t log_level, jm_string message)• void do_exit (int code)• int main (int argc, char ∗argv[ ])

Generated by Doxygen

Page 438: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

370 File Documentation

7.69.1 Macro Definition Documentation

7.69.1.1 #define BUFFER 1000

Definition at line 23 of file fmi_import_test.c.

7.69.2 Function Documentation

7.69.2.1 int fmi1_test ( fmi_import_context_t ∗ context, const char ∗ dirPath )

Definition at line 38 of file fmi1_import_test.c.

7.69.2.2 int fmi2_test ( fmi_import_context_t ∗ context, const char ∗ dirPath )

Definition at line 41 of file fmi2_import_test.c.

7.69.2.3 void importlogger ( jm_callbacks ∗ c, jm_string module, jm_log_level_enu_t log_level, jm_string message)

Definition at line 28 of file fmi_import_test.c.

7.69.2.4 void do_exit ( int code )

Definition at line 33 of file fmi_import_test.c.

7.69.2.5 int main ( int argc, char ∗ argv[ ] )

Definition at line 40 of file fmi_import_test.c.

7.70 /tmp/FMILibraryBuild/build/doc/fmilib.h File Reference

Include file to be used in client applications of the FMI Library.

#include <stddef.h>#include "fmilib_config.h"#include <FMI/fmi_import_context.h>#include <FMI1/fmi1_import.h>#include <FMI2/fmi2_import.h>

7.70.1 Detailed Description

Include file to be used in client applications of the FMI Library.

Generated by Doxygen

Page 439: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.71 /tmp/FMILibraryBuild/build/doc/fmilib_config.h File Reference 371

7.71 /tmp/FMILibraryBuild/build/doc/fmilib_config.h File Reference

Library configuration file generated by the build system.

Macros

• #define CMAKE_INTDIR "."

The macro CMAKE_INTDIR gives intermediate directory for the current configuration (Debug/Release).

• #define FMI_FILE_SEP "/"

Platform folder separator.

• #define FMI_DLL_EXT ".so"

DLL file name suffix(.so, .dll, ...)

• #define FMI_PLATFORM "linux64"

Folder name inside FMU in which the DLL is found for this platform.

• #define FMI_BINARIES "binaries"

Folder name inside FMU where binaries are.

• #define FMI_MODEL_DESCRIPTION_XML "modelDescription.xml"

Model description XML file name.

• #define FMILIB_EXPORT

Used to declare the public API of the library needed for dynamic linking.

• #define FMILIB_PRIVATE

Intended for declaration of the private library functions.

• #define FMILIB_ENABLE_LOG_LEVEL_DEBUG

Activates debug level log messages. If not defined the debug messages are compiled out.

• #define FMILIB_SIZET_FORMAT "%zu"• #define FMILIB_GENERATE_BUILD_STAMP

Generate build-stamp file and enable fmilib_get_build_stamp().

• #define HAVE___VA_COPY• #define HAVE_VSNPRINTF• #define jm_rpl_vsnprintf vsnprintf

7.71.1 Detailed Description

Library configuration file generated by the build system.

7.71.2 Macro Definition Documentation

7.71.2.1 #define CMAKE_INTDIR "."

The macro CMAKE_INTDIR gives intermediate directory for the current configuration (Debug/Release).

It is redefined to "." for Makefile based build environments. Otherwise is set by MSVC.

7.71.2.2 #define FMI_FILE_SEP "/"

Platform folder separator.

Definition at line 48 of file fmilib_config.h.

Generated by Doxygen

Page 440: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

372 File Documentation

7.71.2.3 #define FMI_DLL_EXT ".so"

DLL file name suffix(.so, .dll, ...)

Definition at line 51 of file fmilib_config.h.

7.71.2.4 #define FMI_PLATFORM "linux64"

Folder name inside FMU in which the DLL is found for this platform.

Definition at line 54 of file fmilib_config.h.

7.71.2.5 #define FMI_BINARIES "binaries"

Folder name inside FMU where binaries are.

Definition at line 57 of file fmilib_config.h.

7.71.2.6 #define FMI_MODEL_DESCRIPTION_XML "modelDescription.xml"

Model description XML file name.

Definition at line 59 of file fmilib_config.h.

7.71.2.7 #define FMILIB_EXPORT

Used to declare the public API of the library needed for dynamic linking.

7.71.2.8 #define FMILIB_PRIVATE

Intended for declaration of the private library functions.

7.71.2.9 #define FMILIB_ENABLE_LOG_LEVEL_DEBUG

Activates debug level log messages. If not defined the debug messages are compiled out.

7.71.2.10 #define FMILIB_SIZET_FORMAT "%zu"

Definition at line 125 of file fmilib_config.h.

7.71.2.11 #define FMILIB_GENERATE_BUILD_STAMP

Generate build-stamp file and enable fmilib_get_build_stamp().

Generated by Doxygen

Page 441: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

7.72 /tmp/FMILibraryBuild/build/doc/fmilib_mainpage.h File Reference 373

7.71.2.12 #define HAVE___VA_COPY

Definition at line 156 of file fmilib_config.h.

7.71.2.13 #define HAVE_VSNPRINTF

Definition at line 158 of file fmilib_config.h.

7.71.2.14 #define jm_rpl_vsnprintf vsnprintf

Definition at line 160 of file fmilib_config.h.

7.72 /tmp/FMILibraryBuild/build/doc/fmilib_mainpage.h File Reference

Autogenerated file with documentation.

7.72.1 Detailed Description

Autogenerated file with documentation.

Generated by Doxygen

Page 442: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

374 File Documentation

Generated by Doxygen

Page 443: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Index

/tmp/FMILibraryBuild/build/doc/fmilib.h, 370/tmp/FMILibraryBuild/build/doc/fmilib_config.h, 371/tmp/FMILibraryBuild/build/doc/fmilib_mainpage.h, 373

A basic stack, 20JM_STACK_MAX_MEMORY_CHUNK, 23JM_STACK_MINIMAL_CAPACITY, 23jm_stack, 20jm_stack_alloc, 20jm_stack_declare_template, 23jm_stack_foreach, 23jm_stack_free, 21jm_stack_free_data, 21jm_stack_get_size, 22jm_stack_init, 21jm_stack_is_empty, 22jm_stack_pop, 22jm_stack_push, 22jm_stack_reserve, 22jm_stack_top, 22

A set of strings, 84jm_string_set, 84jm_string_set_find, 84jm_string_set_find_index, 84jm_string_set_put, 85

A vector of items (dynamic array), 86c, 96callbacks, 97capacity, 96cc, 96char, 96else, 97if, 94items, 97JM_TEMPLATE_INSTANCE_TYPE, 94, 95JM_VECTOR_MAX_MEMORY_CHUNK, 93JM_VECTOR_MINIMAL_CAPACITY, 93jm_compare_ft, 94jm_define_comp_f, 90, 94jm_diff, 90jm_diff_name, 96jm_mangle, 88jm_mangle_ex, 88jm_name_ID_map_t, 96jm_vector, 88, 94jm_vector_alloc, 88jm_vector_append, 92jm_vector_bsearch, 91jm_vector_bsearch_index, 91jm_vector_clone, 92

jm_vector_copy, 92jm_vector_declare_template, 93, 94jm_vector_find, 90jm_vector_find_index, 90jm_vector_foreach, 93jm_vector_foreach_c, 93jm_vector_free, 88jm_vector_free_data, 89jm_vector_get_item, 89jm_vector_get_itemp, 89jm_vector_get_last, 89jm_vector_get_lastp, 89jm_vector_get_size, 89jm_vector_init, 88jm_vector_insert, 92jm_vector_ptr2index, 93jm_vector_push_back, 93jm_vector_qsort, 91jm_vector_remove_item, 92jm_vector_reserve, 91jm_vector_resize, 91jm_vector_resize1, 92jm_vector_set_item, 91jm_vector_zero, 91reserve, 96size, 97size_t, 96v, 97

allocateMemoryfmi1_callback_functions_t, 224fmi1_me_callback_functions_t, 228fmi2_callback_functions_t, 229

annotation_callbacksfmi2_import_xml_test.cc, 346

annotation_data_handlefmi2_import_xml_test.cc, 345

annotation_end_handlefmi2_import_xml_test.cc, 345

annotation_start_handlefmi2_import_xml_test.cc, 345

BUFFERfmi1_import_test.c, 303fmi2_import_cs_test.c, 341fmi2_import_me_test.c, 342fmi2_import_test.c, 343fmi_import_cs_test.c, 309fmi_import_me_test.c, 311fmi_import_test.c, 370fmu1_model_defines.h, 332

Page 444: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

376 INDEX

fmu2_model_defines.h, 363Basic support for vendor annotations., 156

fmi1_import_annotation_t, 156fmi1_import_get_annotation_name, 157fmi1_import_get_annotation_value, 157fmi1_import_get_number_of_vendor_annotations,

157fmi1_import_get_number_of_vendors, 157fmi1_import_get_vendor, 157fmi1_import_get_vendor_annotation, 157fmi1_import_get_vendor_list, 157fmi1_import_get_vendor_name, 157fmi1_import_vendor_list_t, 156fmi1_import_vendor_t, 156

booleanscomponent_t, 219, 221

cA vector of items (dynamic array), 96

CMAKE_INTDIRfmilib_config.h, 371

calc_event_updatefmu1_model.c, 319fmu2_model.c, 350

calc_get_derivativesfmu1_model.c, 319fmu2_model.c, 350

calc_get_event_indicatorsfmu1_model.c, 319fmu2_model.c, 350

calc_initializefmu1_model.c, 319fmu2_model.c, 350

callBackFunctionsfmul_t, 235

callEventUpdatecomponent_t, 219

callbacksA vector of items (dynamic array), 97fmi1_capi_cs_test.c, 296fmi1_capi_me_test.c, 302fmul_t, 235

callocjm_callbacks, 236

capacityA vector of items (dynamic array), 96

ccA vector of items (dynamic array), 96

charA vector of items (dynamic array), 96

compar_intFMI1/jm_vector_test.c, 339jm_vector_test.c, 340

component_ptr_tfmu1_model.h, 324fmu2_model.h, 355

component_t, 217booleans, 219, 221callEventUpdate, 219

event_indicators, 218, 221eventInfo, 220, 222fmitime, 219, 222fmuLocation, 220functions, 219, 222GUID, 219input_real, 221, 223instanceName, 219integers, 219, 221interactive, 220loggingOn, 219, 222mimeType, 220output_real, 221, 223reals, 218, 221relativeTolerance, 220, 222states, 218, 221states_der, 218, 221states_nom, 218, 221states_prev, 220, 222states_vr, 218StopTimeDefined, 220, 223strings, 219, 222tStart, 220, 222tStop, 221, 223timeout, 220toleranceControlled, 219, 222visible, 220, 222

componentEnvironmentfmi2_callback_functions_t, 230

compress_test_fmu_zip.cimportlogger, 289main, 289

concatfmi1_xml_parsing_test.c, 305fmi2_xml_parsing_test.c, 347

Constuction, destruction and error handling, 104, 158fmi1_import_clear_last_error, 105fmi1_import_free, 105fmi1_import_get_last_error, 104fmi1_import_parse_xml, 104fmi2_import_clear_last_error, 158fmi2_import_free, 158fmi2_import_get_last_error, 158

contextDefinition of XML callbacks struct, 71fmul_t, 235jm_callbacks, 237

Convenience functions., 136, 194fmi1_default_callback_logger, 137fmi1_import_collect_model_counts, 136fmi1_import_expand_variable_references, 137fmi1_import_init_logger, 137fmi1_log_forwarding, 137fmi1_log_forwarding_v, 137fmi2_default_callback_logger, 195fmi2_import_collect_model_counts, 194fmi2_import_expand_variable_references, 195fmi2_import_init_logger, 195

Generated by Doxygen

Page 445: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 377

fmi2_log_forwarding, 195fmi2_log_forwarding_v, 195

create_parse_test_callbacksfmi1_xml_parsing_test.c, 306

DLL_HANDLEjm_portability.h, 283

DO_LOG_EXPECTED_MSGfmi1_xml_parsing_test.c, 308

dataHandleDefinition of XML callbacks struct, 70

Definition of callbacks struct and supporting functions,72

JM_MAX_ERROR_MESSAGE_SIZE, 73jm_callbacks, 73jm_calloc_f, 74jm_clear_last_error, 74jm_default_logger, 75jm_free_f, 74jm_get_default_callbacks, 75jm_get_last_error, 74jm_log, 75jm_log_debug, 77jm_log_debug_v, 76jm_log_error, 76jm_log_error_v, 76jm_log_fatal, 76jm_log_fatal_v, 75jm_log_info, 76jm_log_info_v, 76jm_log_v, 75jm_log_verbose, 76jm_log_verbose_v, 76jm_log_warning, 76jm_log_warning_v, 76jm_logger_f, 74jm_malloc_f, 73jm_realloc_f, 74jm_set_default_callbacks, 74

Definition of XML callbacks struct, 69context, 71dataHandle, 70endHandle, 70fmi2_xml_callbacks_t, 69fmi2_xml_element_data_handle_ft, 70fmi2_xml_element_end_handle_ft, 70fmi2_xml_element_start_handle_ft, 69startHandle, 70

destroyfmi_import_me_test.c, 311

destroy_parse_test_callbacksfmi1_xml_parsing_test.c, 306

did_log_expected_msgfmi1_xml_parsing_test.c, 308

did_not_log_expected_msgfmi2_xml_parsing_test.c, 348

do_event_iterationfmi2_import_me_test.c, 342

do_exit

FMI1/fmi_zip_unzip_test.c, 314FMI1/fmi_zip_zip_test.c, 316fmi1_capi_cs_test.c, 292fmi1_capi_me_test.c, 298fmi1_logger_test.c, 304fmi2_import_cs_test.c, 341fmi2_import_me_test.c, 342fmi2_import_xml_test.cc, 345fmi_import_cs_test.c, 309fmi_import_me_test.c, 311fmi_import_test.c, 370fmi_import_xml_test.c, 312fmi_zip_unzip_test.c, 315fmi_zip_zip_test.c, 317

do_pausefmi_total_test.c, 313

EVENT_HIGHTfmu1_model_defines.h, 332fmu2_model_defines.h, 364

elseA vector of items (dynamic array), 97

endHandleDefinition of XML callbacks struct, 70

Enum types used with FMI 1.0 libs, 43fmi1_base_type_bool, 46fmi1_base_type_enu_t, 44, 45fmi1_base_type_enum, 46fmi1_base_type_int, 46fmi1_base_type_real, 46fmi1_base_type_str, 46fmi1_base_type_to_string, 46fmi1_causality_enu_input, 45fmi1_causality_enu_internal, 45fmi1_causality_enu_none, 45fmi1_causality_enu_output, 45fmi1_causality_enu_t, 44, 45fmi1_causality_enu_unknown, 45fmi1_causality_to_string, 46fmi1_fmu_kind_enu_cs_standalone, 45fmi1_fmu_kind_enu_cs_tool, 45fmi1_fmu_kind_enu_me, 45fmi1_fmu_kind_enu_t, 44fmi1_fmu_kind_enu_unknown, 45fmi1_fmu_kind_to_string, 46fmi1_naming_convention_to_string, 46fmi1_naming_enu_flat, 44fmi1_naming_enu_structured, 44fmi1_naming_enu_unknown, 44fmi1_variability_enu_constant, 45fmi1_variability_enu_continuous, 45fmi1_variability_enu_discrete, 45fmi1_variability_enu_parameter, 45fmi1_variability_enu_t, 44, 45fmi1_variability_enu_unknown, 45fmi1_variability_to_string, 46fmi1_variable_alias_kind_enu_t, 44, 45fmi1_variable_is_alias, 45fmi1_variable_is_negated_alias, 45

Generated by Doxygen

Page 446: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

378 INDEX

fmi1_variable_is_not_alias, 45fmi1_variable_naming_convension_enu_t, 44

Enum types used with FMI 2.0 libs, 58FMI2_CS_CAPABILITIES, 60FMI2_ME_CAPABILITIES, 60FMI2_SI_BASE_UNITS, 60fmi2_SI_base_unit_exp_to_string, 67fmi2_SI_base_unit_to_string, 67fmi2_SI_base_units_Num, 64fmi2_SI_base_units_enu_t, 61, 64fmi2_base_type_bool, 63fmi2_base_type_enu_t, 61, 63fmi2_base_type_enum, 63fmi2_base_type_int, 63fmi2_base_type_real, 63fmi2_base_type_str, 63fmi2_base_type_to_string, 65fmi2_capabilities_Num, 64fmi2_capabilities_enu_t, 61, 63fmi2_capability_to_string, 65fmi2_causality_enu_calculated_parameter, 63fmi2_causality_enu_independent, 63fmi2_causality_enu_input, 63fmi2_causality_enu_local, 63fmi2_causality_enu_output, 63fmi2_causality_enu_parameter, 63fmi2_causality_enu_t, 61, 62fmi2_causality_enu_unknown, 63fmi2_causality_to_string, 65fmi2_dependency_factor_kind_constant, 64fmi2_dependency_factor_kind_dependent, 64fmi2_dependency_factor_kind_discrete, 64fmi2_dependency_factor_kind_enu_t, 61, 64fmi2_dependency_factor_kind_fixed, 64fmi2_dependency_factor_kind_num, 64fmi2_dependency_factor_kind_to_string, 67fmi2_dependency_factor_kind_tunable, 64fmi2_fmu_kind_cs, 62fmi2_fmu_kind_enu_t, 61, 62fmi2_fmu_kind_me, 62fmi2_fmu_kind_me_and_cs, 62fmi2_fmu_kind_to_string, 64fmi2_fmu_kind_unknown, 62fmi2_get_default_initial, 65fmi2_get_valid_initial, 65fmi2_initial_enu_approx, 63fmi2_initial_enu_calculated, 63fmi2_initial_enu_exact, 63fmi2_initial_enu_t, 61, 63fmi2_initial_enu_unknown, 63fmi2_initial_to_string, 65fmi2_naming_convention_to_string, 64fmi2_naming_enu_flat, 62fmi2_naming_enu_structured, 62fmi2_naming_enu_unknown, 62fmi2_variability_enu_constant, 62fmi2_variability_enu_continuous, 62fmi2_variability_enu_discrete, 62

fmi2_variability_enu_fixed, 62fmi2_variability_enu_t, 61, 62fmi2_variability_enu_tunable, 62fmi2_variability_enu_unknown, 62fmi2_variability_to_string, 64fmi2_variable_alias_kind_enu_t, 61, 63fmi2_variable_is_alias, 63fmi2_variable_is_not_alias, 63fmi2_variable_naming_convension_enu_t, 61, 62

errMessageBufferjm_callbacks, 237

event_indicatorscomponent_t, 218, 221

eventInfocomponent_t, 220, 222

expect_errorfmi2_import_xml_test.cc, 346

expected_messagefmi1_xml_parsing_test.c, 308fmi2_xml_parsing_test.c, 348

FMI 1.0 (CS) Co-Simulation functions, 124fmi1_import_cancel_step, 127fmi1_import_do_step, 127fmi1_import_free_slave_instance, 126fmi1_import_get_boolean_status, 129fmi1_import_get_integer_status, 129fmi1_import_get_real_output_derivatives, 127fmi1_import_get_real_status, 128fmi1_import_get_status, 128fmi1_import_get_string_status, 129fmi1_import_get_types_platform, 125fmi1_import_initialize_slave, 125fmi1_import_instantiate_slave, 125fmi1_import_reset_slave, 126fmi1_import_set_real_input_derivatives, 126fmi1_import_terminate_slave, 126

FMI 1.0 (ME & CS) Common functions, 131fmi1_import_get_boolean, 134fmi1_import_get_integer, 134fmi1_import_get_real, 133fmi1_import_get_string, 135fmi1_import_get_version, 131fmi1_import_set_boolean, 133fmi1_import_set_debug_logging, 132fmi1_import_set_integer, 132fmi1_import_set_real, 132fmi1_import_set_string, 133

FMI 1.0 (ME) Model Exchange functions, 117fmi1_import_completed_integrator_step, 120fmi1_import_eventUpdate, 121fmi1_import_free_model_instance, 119fmi1_import_get_continuous_states, 122fmi1_import_get_derivatives, 121fmi1_import_get_event_indicators, 121fmi1_import_get_model_types_platform, 118fmi1_import_get_nominal_continuous_states, 122fmi1_import_get_state_value_references, 122fmi1_import_initialize, 120

Generated by Doxygen

Page 447: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 379

fmi1_import_instantiate_model, 119fmi1_import_set_continuous_states, 120fmi1_import_set_time, 119fmi1_import_terminate, 123

FMI 1.0 Constructor and Destructor, 115fmi1_import_create_dllfmu, 115fmi1_import_destroy_dllfmu, 115fmi1_import_set_debug_mode, 116

FMI 1.0 import interface, 24FMI 2.0 (CS) Co-Simulation functions, 179

fmi2_import_cancel_step, 180fmi2_import_do_step, 180fmi2_import_get_boolean_status, 182fmi2_import_get_integer_status, 181fmi2_import_get_real_output_derivatives, 180fmi2_import_get_real_status, 181fmi2_import_get_status, 181fmi2_import_get_string_status, 182fmi2_import_set_real_input_derivatives, 179

FMI 2.0 (ME & CS) Common functions, 183fmi2_import_de_serialize_fmu_state, 192fmi2_import_enter_initialization_mode, 186fmi2_import_exit_initialization_mode, 186fmi2_import_free_fmu_state, 191fmi2_import_free_instance, 185fmi2_import_get_boolean, 189fmi2_import_get_directional_derivative, 192fmi2_import_get_fmu_state, 190fmi2_import_get_integer, 189fmi2_import_get_real, 188fmi2_import_get_string, 190fmi2_import_get_types_platform, 190fmi2_import_get_version, 184fmi2_import_instantiate, 185fmi2_import_reset, 187fmi2_import_serialize_fmu_state, 192fmi2_import_serialized_fmu_state_size, 191fmi2_import_set_boolean, 188fmi2_import_set_debug_logging, 184fmi2_import_set_fmu_state, 191fmi2_import_set_integer, 187fmi2_import_set_real, 187fmi2_import_set_string, 188fmi2_import_setup_experiment, 185fmi2_import_terminate, 186

FMI 2.0 (ME) Model Exchange functions, 174fmi2_import_completed_integrator_step, 176fmi2_import_enter_continuous_time_mode, 175fmi2_import_enter_event_mode, 174fmi2_import_get_continuous_states, 177fmi2_import_get_derivatives, 176fmi2_import_get_event_indicators, 177fmi2_import_get_nominals_of_continuous_states,

177fmi2_import_new_discrete_states, 175fmi2_import_set_continuous_states, 176fmi2_import_set_time, 175

FMI 2.0 Constructor and Destructor, 172

fmi2_import_create_dllfmu, 172fmi2_import_destroy_dllfmu, 172fmi2_import_set_debug_mode, 173

FMI 2.0 import interface, 29FMI import library, 15FMI1/compress_test_fmu_zip.c

importlogger, 289main, 289

FMI1/fmi_zip_unzip_test.cdo_exit, 314importlogger, 314main, 314

FMI1/fmi_zip_zip_test.cdo_exit, 316importlogger, 316main, 316PRINT_MY_DEBUG, 316

FMI1/jm_vector_test.ccompar_int, 339log_error, 339main, 339print_dbl, 339print_int, 339return_code, 339TESTVAL, 338VINIT_SIZE, 338

FMI2_CS_CAPABILITIESEnum types used with FMI 2.0 libs, 60

FMI2_EXPAND_CS_CAPABILITIES_ENUfmi2_enums.h, 275

FMI2_EXPAND_ME_CAPABILITIES_ENUfmi2_enums.h, 275

FMI2_EXPAND_SI_BASE_UNIT_ENUfmi2_enums.h, 276

FMI2_Exportfmu2_model.h, 355

FMI2_ME_CAPABILITIESEnum types used with FMI 2.0 libs, 60

FMI2_SI_BASE_UNITSEnum types used with FMI 2.0 libs, 60

FMI_BINARIESfmilib_config.h, 372

FMI_DLL_EXTfmilib_config.h, 371

FMI_FILE_SEPfmilib_config.h, 371

FMI_GUIDfmu1_model_defines.h, 334fmu2_model_defines.h, 365

FMI_IMPORT_NAME_CHECKLibrary initialization, 99

FMI_MODEL_DESCRIPTION_XMLfmilib_config.h, 372

FMI_PLATFORMfmilib_config.h, 372

FMI_TEST_LOGGER_TEST_RESULT_FILEfmu1_model.c, 319

FMI_TEST_LOGGER_TEST_SOURCE_FILE

Generated by Doxygen

Page 448: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

380 INDEX

fmu1_model.c, 319FMI_VERSION

fmu1_model_defines.h, 334fmu2_model_defines.h, 365

FMILIB_ENABLE_LOG_LEVEL_DEBUGfmilib_config.h, 372

FMILIB_EXPORTfmilib_config.h, 372

FMILIB_GENERATE_BUILD_STAMPfmilib_config.h, 372

FMILIB_PRIVATEfmilib_config.h, 372

FMILIB_SIZET_FORMATfmilib_config.h, 372

fail_name_checkfmi1_xml_parsing_test.c, 306fmi2_xml_parsing_test.c, 347

fcnxml_test_files_t, 239

filenamexml_test_files_t, 239

fmi1_base_type_boolEnum types used with FMI 1.0 libs, 46

fmi1_base_type_enu_tEnum types used with FMI 1.0 libs, 44, 45

fmi1_base_type_enumEnum types used with FMI 1.0 libs, 46

fmi1_base_type_intEnum types used with FMI 1.0 libs, 46

fmi1_base_type_realEnum types used with FMI 1.0 libs, 46

fmi1_base_type_strEnum types used with FMI 1.0 libs, 46

fmi1_base_type_to_stringEnum types used with FMI 1.0 libs, 46

fmi1_boolean_enu_tFunctions and types supporting FMI 1.0 process-

ing., 42fmi1_callback_allocate_memory_ft

Functions and types supporting FMI 1.0 process-ing., 36

fmi1_callback_free_memory_ftFunctions and types supporting FMI 1.0 process-

ing., 36fmi1_callback_functions_t, 223

allocateMemory, 224freeMemory, 224logger, 224stepFinished, 224

fmi1_callback_logger_ftFunctions and types supporting FMI 1.0 process-

ing., 36fmi1_cancel_step_ft

Functions and types supporting FMI 1.0 process-ing., 40

fmi1_capi_cs_test.ccallbacks, 296do_exit, 292

fmilogger, 292fmu, 296INSTANCE_NAME, 291importlogger, 292MODEL_IDENTIFIER, 291main, 295test_cancel_step, 293test_create_dllfmu, 292test_destroy_dllfmu, 295test_do_step, 293test_fmi_get_version, 292test_free_dll, 295test_free_slave_instance, 295test_get_boolean_status, 294test_get_integer_status, 293test_get_real_output_derivatives, 295test_get_real_status, 293test_get_status, 293test_get_string_status, 294test_get_types_platform, 292test_initialize_slave, 293test_instantiate_slave, 293test_load_dll, 292test_load_dll_fcn, 292test_reset_slave, 294test_set_debug_logging, 293test_set_get_boolean, 294test_set_get_integer, 294test_set_get_real, 294test_set_get_string, 294test_set_real_input_derivatives, 295test_terminate_slave, 295

fmi1_capi_me_test.ccallbacks, 302do_exit, 298fmilogger, 298fmu, 302INSTANCE_NAME, 298importlogger, 298MODEL_IDENTIFIER, 298main, 302test_completed_integrator_step, 300test_create_dllfmu, 298test_destroy_dllfmu, 302test_event_update, 300test_fmi_get_model_types_platform, 299test_fmi_get_version, 299test_fmi_set_time, 299test_free_dll, 301test_free_model_instance, 301test_get_continuous_states, 300test_get_derivatives, 300test_get_event_indicators, 300test_get_nominal_continuous_states, 300test_get_state_value_references, 300test_initialize, 299test_instantiate_model, 299test_load_dll, 299

Generated by Doxygen

Page 449: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 381

test_load_dll_fcn, 299test_set_continuous_states, 299test_set_debug_logging, 300test_set_get_boolean, 301test_set_get_integer, 301test_set_get_real, 301test_set_get_string, 301test_terminate, 301

fmi1_causality_enu_inputEnum types used with FMI 1.0 libs, 45

fmi1_causality_enu_internalEnum types used with FMI 1.0 libs, 45

fmi1_causality_enu_noneEnum types used with FMI 1.0 libs, 45

fmi1_causality_enu_outputEnum types used with FMI 1.0 libs, 45

fmi1_causality_enu_tEnum types used with FMI 1.0 libs, 44, 45

fmi1_causality_enu_unknownEnum types used with FMI 1.0 libs, 45

fmi1_causality_to_stringEnum types used with FMI 1.0 libs, 46

fmi1_completed_integrator_step_ftFunctions and types supporting FMI 1.0 process-

ing., 38fmi1_default_callback_logger

Convenience functions., 137fmi1_do_step_ft

Functions and types supporting FMI 1.0 process-ing., 40

fmi1_do_step_statusFunctions and types supporting FMI 1.0 process-

ing., 42fmi1_event_info_t, 224

iterationConverged, 225nextEventTime, 225stateValueReferencesChanged, 225stateValuesChanged, 225terminateSimulation, 225upcomingTimeEvent, 225

fmi1_event_update_ftFunctions and types supporting FMI 1.0 process-

ing., 39fmi1_false

Functions and types supporting FMI 1.0 process-ing., 42

fmi1_fmu_kind_enu_cs_standaloneEnum types used with FMI 1.0 libs, 45

fmi1_fmu_kind_enu_cs_toolEnum types used with FMI 1.0 libs, 45

fmi1_fmu_kind_enu_meEnum types used with FMI 1.0 libs, 45

fmi1_fmu_kind_enu_tEnum types used with FMI 1.0 libs, 44

fmi1_fmu_kind_enu_unknownEnum types used with FMI 1.0 libs, 45

fmi1_fmu_kind_to_stringEnum types used with FMI 1.0 libs, 46

fmi1_free_model_instance_ftFunctions and types supporting FMI 1.0 process-

ing., 38fmi1_free_slave_instance_ft

Functions and types supporting FMI 1.0 process-ing., 40

fmi1_get_boolean_ftFunctions and types supporting FMI 1.0 process-

ing., 38fmi1_get_boolean_status_ft

Functions and types supporting FMI 1.0 process-ing., 41

fmi1_get_continuous_states_ftFunctions and types supporting FMI 1.0 process-

ing., 39fmi1_get_derivatives_ft

Functions and types supporting FMI 1.0 process-ing., 39

fmi1_get_event_indicators_ftFunctions and types supporting FMI 1.0 process-

ing., 39fmi1_get_integer_ft

Functions and types supporting FMI 1.0 process-ing., 37

fmi1_get_integer_status_ftFunctions and types supporting FMI 1.0 process-

ing., 41fmi1_get_model_typesPlatform_ft

Functions and types supporting FMI 1.0 process-ing., 38

fmi1_get_nominal_continuousStates_ftFunctions and types supporting FMI 1.0 process-

ing., 39fmi1_get_platform

Functions and types supporting FMI 1.0 process-ing., 42

fmi1_get_real_ftFunctions and types supporting FMI 1.0 process-

ing., 37fmi1_get_real_outputDerivatives_ft

Functions and types supporting FMI 1.0 process-ing., 40

fmi1_get_real_status_ftFunctions and types supporting FMI 1.0 process-

ing., 41fmi1_get_state_valueReferences_ft

Functions and types supporting FMI 1.0 process-ing., 39

fmi1_get_status_ftFunctions and types supporting FMI 1.0 process-

ing., 40fmi1_get_string_ft

Functions and types supporting FMI 1.0 process-ing., 38

fmi1_get_string_status_ftFunctions and types supporting FMI 1.0 process-

ing., 41fmi1_get_types_platform_ft

Generated by Doxygen

Page 450: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

382 INDEX

Functions and types supporting FMI 1.0 process-ing., 39

fmi1_get_version_ftFunctions and types supporting FMI 1.0 process-

ing., 37fmi1_import_alloc_variable_list

Handling of variable lists, 26fmi1_import_annotation_t

Basic support for vendor annotations., 156fmi1_import_append_to_var_list

Handling of variable lists, 27fmi1_import_bool_variable_t

Functions for handling variable definitions., 150fmi1_import_cancel_step

FMI 1.0 (CS) Co-Simulation functions, 127fmi1_import_capabilities_t

Functions to retrieve capability flags., 113fmi1_import_clear_last_error

Constuction, destruction and error handling, 105fmi1_import_clone_variable_list

Handling of variable lists, 26fmi1_import_collect_model_counts

Convenience functions., 136fmi1_import_completed_integrator_step

FMI 1.0 (ME) Model Exchange functions, 120fmi1_import_convert_from_display_unit

Functions for handling unit definitions., 147fmi1_import_convert_to_display_unit

Functions for handling unit definitions., 147fmi1_import_create_dllfmu

FMI 1.0 Constructor and Destructor, 115fmi1_import_create_var_list

General information retrieval, 111fmi1_import_destroy_dllfmu

FMI 1.0 Constructor and Destructor, 115fmi1_import_display_unit_t

Functions for handling unit definitions., 145fmi1_import_do_step

FMI 1.0 (CS) Co-Simulation functions, 127fmi1_import_enum_variable_t

Functions for handling variable definitions., 150fmi1_import_enumeration_typedef_t

Support for processing variable types, 141fmi1_import_eventUpdate

FMI 1.0 (ME) Model Exchange functions, 121fmi1_import_expand_variable_references

Convenience functions., 137fmi1_import_filter_variables

Handling of variable lists, 27fmi1_import_free

Constuction, destruction and error handling, 105fmi1_import_free_model_instance

FMI 1.0 (ME) Model Exchange functions, 119fmi1_import_free_slave_instance

FMI 1.0 (CS) Co-Simulation functions, 126fmi1_import_free_variable_list

Handling of variable lists, 26fmi1_import_get_GUID

General information retrieval, 107fmi1_import_get_additional_model_name

Functions to retrieve co-simulation related informa-tion., 139

fmi1_import_get_annotation_nameBasic support for vendor annotations., 157

fmi1_import_get_annotation_valueBasic support for vendor annotations., 157

fmi1_import_get_authorGeneral information retrieval, 108

fmi1_import_get_base_typeSupport for processing variable types, 142

fmi1_import_get_base_unitFunctions for handling unit definitions., 146

fmi1_import_get_booleanFMI 1.0 (ME & CS) Common functions, 134

fmi1_import_get_boolean_statusFMI 1.0 (CS) Co-Simulation functions, 129

fmi1_import_get_boolean_variable_startFunctions for handling variable definitions., 155

fmi1_import_get_canBeInstantiatedOnlyOncePer←↩

ProcessFunctions to retrieve capability flags., 114

fmi1_import_get_canHandleEventsFunctions to retrieve capability flags., 114

fmi1_import_get_canHandleVariableCommunication←↩

StepSizeFunctions to retrieve capability flags., 114

fmi1_import_get_canInterpolateInputsFunctions to retrieve capability flags., 114

fmi1_import_get_canNotUseMemoryManagement←↩

FunctionsFunctions to retrieve capability flags., 114

fmi1_import_get_canRejectStepsFunctions to retrieve capability flags., 114

fmi1_import_get_canRunAsynchronuouslyFunctions to retrieve capability flags., 114

fmi1_import_get_canSignalEventsFunctions to retrieve capability flags., 114

fmi1_import_get_capabilitiesGeneral information retrieval, 109

fmi1_import_get_causalityFunctions for handling variable definitions., 153

fmi1_import_get_continuous_statesFMI 1.0 (ME) Model Exchange functions, 122

fmi1_import_get_default_experiment_startGeneral information retrieval, 109

fmi1_import_get_default_experiment_stopGeneral information retrieval, 109

fmi1_import_get_default_experiment_toleranceGeneral information retrieval, 109

fmi1_import_get_derivativesFMI 1.0 (ME) Model Exchange functions, 121

fmi1_import_get_descriptionGeneral information retrieval, 108

fmi1_import_get_direct_dependencyGeneral information retrieval, 110

fmi1_import_get_display_unit_gain

Generated by Doxygen

Page 451: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 383

Functions for handling unit definitions., 147fmi1_import_get_display_unit_name

Functions for handling unit definitions., 147fmi1_import_get_display_unit_offset

Functions for handling unit definitions., 147fmi1_import_get_entry_point

Functions to retrieve co-simulation related informa-tion., 139

fmi1_import_get_enum_type_item_descriptionSupport for processing variable types, 144

fmi1_import_get_enum_type_item_nameSupport for processing variable types, 144

fmi1_import_get_enum_type_maxSupport for processing variable types, 144

fmi1_import_get_enum_type_minSupport for processing variable types, 144

fmi1_import_get_enum_type_sizeSupport for processing variable types, 144

fmi1_import_get_enum_variable_maxFunctions for handling variable definitions., 155

fmi1_import_get_enum_variable_minFunctions for handling variable definitions., 155

fmi1_import_get_enum_variable_startFunctions for handling variable definitions., 155

fmi1_import_get_event_indicatorsFMI 1.0 (ME) Model Exchange functions, 121

fmi1_import_get_fmu_kindGeneral information retrieval, 109

fmi1_import_get_generation_date_and_timeGeneral information retrieval, 108

fmi1_import_get_generation_toolGeneral information retrieval, 108

fmi1_import_get_integerFMI 1.0 (ME & CS) Common functions, 134

fmi1_import_get_integer_statusFMI 1.0 (CS) Co-Simulation functions, 129

fmi1_import_get_integer_type_maxSupport for processing variable types, 144

fmi1_import_get_integer_type_minSupport for processing variable types, 144

fmi1_import_get_integer_variable_maxFunctions for handling variable definitions., 155

fmi1_import_get_integer_variable_minFunctions for handling variable definitions., 155

fmi1_import_get_integer_variable_startFunctions for handling variable definitions., 155

fmi1_import_get_last_errorConstuction, destruction and error handling, 104

fmi1_import_get_manual_startFunctions to retrieve co-simulation related informa-

tion., 139fmi1_import_get_maxOutputDerivativeOrder

Functions to retrieve capability flags., 114fmi1_import_get_mime_type

Functions to retrieve co-simulation related informa-tion., 139

fmi1_import_get_model_identifierGeneral information retrieval, 107

fmi1_import_get_model_nameGeneral information retrieval, 107

fmi1_import_get_model_standard_versionGeneral information retrieval, 108

fmi1_import_get_model_types_platformFMI 1.0 (ME) Model Exchange functions, 118

fmi1_import_get_model_versionGeneral information retrieval, 108

fmi1_import_get_naming_conventionGeneral information retrieval, 109

fmi1_import_get_nominal_continuous_statesFMI 1.0 (ME) Model Exchange functions, 122

fmi1_import_get_number_of_additional_modelsFunctions to retrieve co-simulation related informa-

tion., 139fmi1_import_get_number_of_continuous_states

General information retrieval, 109fmi1_import_get_number_of_event_indicators

General information retrieval, 109fmi1_import_get_number_of_vendor_annotations

Basic support for vendor annotations., 157fmi1_import_get_number_of_vendors

Basic support for vendor annotations., 157fmi1_import_get_real

FMI 1.0 (ME & CS) Common functions, 133fmi1_import_get_real_output_derivatives

FMI 1.0 (CS) Co-Simulation functions, 127fmi1_import_get_real_status

FMI 1.0 (CS) Co-Simulation functions, 128fmi1_import_get_real_type_is_relative_quantity

Support for processing variable types, 144fmi1_import_get_real_type_max

Support for processing variable types, 143fmi1_import_get_real_type_min

Support for processing variable types, 143fmi1_import_get_real_type_nominal

Support for processing variable types, 143fmi1_import_get_real_type_unit

Support for processing variable types, 143fmi1_import_get_real_variable_display_unit

Functions for handling variable definitions., 155fmi1_import_get_real_variable_max

Functions for handling variable definitions., 154fmi1_import_get_real_variable_min

Functions for handling variable definitions., 154fmi1_import_get_real_variable_nominal

Functions for handling variable definitions., 154fmi1_import_get_real_variable_start

Functions for handling variable definitions., 154fmi1_import_get_real_variable_unit

Functions for handling variable definitions., 154fmi1_import_get_state_value_references

FMI 1.0 (ME) Model Exchange functions, 122fmi1_import_get_status

FMI 1.0 (CS) Co-Simulation functions, 128fmi1_import_get_string

FMI 1.0 (ME & CS) Common functions, 135fmi1_import_get_string_status

Generated by Doxygen

Page 452: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

384 INDEX

FMI 1.0 (CS) Co-Simulation functions, 129fmi1_import_get_string_variable_start

Functions for handling variable definitions., 155fmi1_import_get_sublist

Handling of variable lists, 26fmi1_import_get_type_as_enum

Support for processing variable types, 143fmi1_import_get_type_as_int

Support for processing variable types, 142fmi1_import_get_type_as_real

Support for processing variable types, 142fmi1_import_get_type_definition_number

Support for processing variable types, 141fmi1_import_get_type_definitions

General information retrieval, 110fmi1_import_get_type_description

Support for processing variable types, 142fmi1_import_get_type_display_unit

Support for processing variable types, 142fmi1_import_get_type_name

Support for processing variable types, 142fmi1_import_get_type_quantity

Support for processing variable types, 143fmi1_import_get_typedef

Support for processing variable types, 141fmi1_import_get_types_platform

FMI 1.0 (CS) Co-Simulation functions, 125fmi1_import_get_unit

Functions for handling unit definitions., 146fmi1_import_get_unit_definitions

General information retrieval, 110fmi1_import_get_unit_definitions_number

Functions for handling unit definitions., 146fmi1_import_get_unit_display_unit

Functions for handling unit definitions., 146fmi1_import_get_unit_display_unit_number

Functions for handling unit definitions., 146fmi1_import_get_unit_name

Functions for handling unit definitions., 146fmi1_import_get_value_referece_list

Handling of variable lists, 26fmi1_import_get_variability

Functions for handling variable definitions., 153fmi1_import_get_variable

Handling of variable lists, 26fmi1_import_get_variable_alias_base

General information retrieval, 110fmi1_import_get_variable_alias_kind

Functions for handling variable definitions., 155fmi1_import_get_variable_aliases

General information retrieval, 110fmi1_import_get_variable_as_boolean

Functions for handling variable definitions., 154fmi1_import_get_variable_as_enum

Functions for handling variable definitions., 153fmi1_import_get_variable_as_integer

Functions for handling variable definitions., 153fmi1_import_get_variable_as_real

Functions for handling variable definitions., 153fmi1_import_get_variable_as_string

Functions for handling variable definitions., 153fmi1_import_get_variable_base_type

Functions for handling variable definitions., 152fmi1_import_get_variable_by_name

Functions for handling variable definitions., 151fmi1_import_get_variable_by_vr

Functions for handling variable definitions., 152fmi1_import_get_variable_declared_type

Functions for handling variable definitions., 152fmi1_import_get_variable_description

Functions for handling variable definitions., 152fmi1_import_get_variable_has_start

Functions for handling variable definitions., 153fmi1_import_get_variable_is_fixed

Functions for handling variable definitions., 153fmi1_import_get_variable_list

General information retrieval, 110fmi1_import_get_variable_list_alphabetical_order

General information retrieval, 111fmi1_import_get_variable_list_size

Handling of variable lists, 26fmi1_import_get_variable_name

Functions for handling variable definitions., 152fmi1_import_get_variable_original_order

Functions for handling variable definitions., 155fmi1_import_get_variable_vr

Functions for handling variable definitions., 152fmi1_import_get_vendor

Basic support for vendor annotations., 157fmi1_import_get_vendor_annotation

Basic support for vendor annotations., 157fmi1_import_get_vendor_list

Basic support for vendor annotations., 157fmi1_import_get_vendor_name

Basic support for vendor annotations., 157fmi1_import_get_version

FMI 1.0 (ME & CS) Common functions, 131fmi1_import_init_logger

Convenience functions., 137fmi1_import_initialize

FMI 1.0 (ME) Model Exchange functions, 120fmi1_import_initialize_slave

FMI 1.0 (CS) Co-Simulation functions, 125fmi1_import_instantiate_model

FMI 1.0 (ME) Model Exchange functions, 119fmi1_import_instantiate_slave

FMI 1.0 (CS) Co-Simulation functions, 125fmi1_import_integer_typedef_t

Support for processing variable types, 141fmi1_import_integer_variable_t

Functions for handling variable definitions., 150fmi1_import_join_var_list

Handling of variable lists, 27fmi1_import_model_counts_t, 225

num_bool_vars, 228num_causality_none, 227

Generated by Doxygen

Page 453: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 385

num_constants, 226num_continuous, 227num_discrete, 226num_enum_vars, 227num_inputs, 227num_integer_vars, 227num_internal, 227num_outputs, 227num_parameters, 226num_real_vars, 227num_string_vars, 228

fmi1_import_parse_xmlConstuction, destruction and error handling, 104Library initialization, 100

fmi1_import_prepend_to_var_listHandling of variable lists, 28

fmi1_import_real_typedef_tSupport for processing variable types, 141

fmi1_import_real_variable_tFunctions for handling variable definitions., 150

fmi1_import_reset_slaveFMI 1.0 (CS) Co-Simulation functions, 126

fmi1_import_set_booleanFMI 1.0 (ME & CS) Common functions, 133

fmi1_import_set_continuous_statesFMI 1.0 (ME) Model Exchange functions, 120

fmi1_import_set_debug_loggingFMI 1.0 (ME & CS) Common functions, 132

fmi1_import_set_debug_modeFMI 1.0 Constructor and Destructor, 116

fmi1_import_set_integerFMI 1.0 (ME & CS) Common functions, 132

fmi1_import_set_realFMI 1.0 (ME & CS) Common functions, 132

fmi1_import_set_real_input_derivativesFMI 1.0 (CS) Co-Simulation functions, 126

fmi1_import_set_stringFMI 1.0 (ME & CS) Common functions, 133

fmi1_import_set_timeFMI 1.0 (ME) Model Exchange functions, 119

fmi1_import_string_variable_tFunctions for handling variable definitions., 150

fmi1_import_tLibrary initialization, 99

fmi1_import_terminateFMI 1.0 (ME) Model Exchange functions, 123

fmi1_import_terminate_slaveFMI 1.0 (CS) Co-Simulation functions, 126

fmi1_import_test.cBUFFER, 303fmi1_test, 303fmi1logger, 303

fmi1_import_type_definitions_tSupport for processing variable types, 141

fmi1_import_unit_definitions_tFunctions for handling unit definitions., 146

fmi1_import_unit_tFunctions for handling unit definitions., 145

fmi1_import_var_list_push_backHandling of variable lists, 28

fmi1_import_variable_filter_function_ftHandling of variable lists, 26

fmi1_import_variable_list_tFunctions for handling variable definitions., 150

fmi1_import_variable_tFunctions for handling variable definitions., 150

fmi1_import_variable_typedef_tSupport for processing variable types, 141

fmi1_import_vendor_list_tBasic support for vendor annotations., 156

fmi1_import_vendor_tBasic support for vendor annotations., 156

fmi1_initialize_ftFunctions and types supporting FMI 1.0 process-

ing., 38fmi1_initialize_slave_ft

Functions and types supporting FMI 1.0 process-ing., 40

fmi1_instantiate_model_ftFunctions and types supporting FMI 1.0 process-

ing., 38fmi1_instantiate_slave_ft

Functions and types supporting FMI 1.0 process-ing., 39

fmi1_last_successful_timeFunctions and types supporting FMI 1.0 process-

ing., 42fmi1_log_forwarding

Convenience functions., 137fmi1_log_forwarding_v

Convenience functions., 137fmi1_logger_test.c

do_exit, 304logFile, 304logger, 304MESSAGE_SIZE_TO_EXPAND_AND_PRINT,

304main, 304test_logger, 304

fmi1_me_callback_functions_t, 228allocateMemory, 228freeMemory, 229logger, 228

fmi1_naming_convention_to_stringEnum types used with FMI 1.0 libs, 46

fmi1_naming_enu_flatEnum types used with FMI 1.0 libs, 44

fmi1_naming_enu_structuredEnum types used with FMI 1.0 libs, 44

fmi1_naming_enu_unknownEnum types used with FMI 1.0 libs, 44

fmi1_pending_statusFunctions and types supporting FMI 1.0 process-

ing., 42fmi1_reset_slave_ft

Generated by Doxygen

Page 454: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

386 INDEX

Functions and types supporting FMI 1.0 process-ing., 40

fmi1_set_boolean_ftFunctions and types supporting FMI 1.0 process-

ing., 37fmi1_set_continuous_states_ft

Functions and types supporting FMI 1.0 process-ing., 38

fmi1_set_debug_logging_ftFunctions and types supporting FMI 1.0 process-

ing., 37fmi1_set_integer_ft

Functions and types supporting FMI 1.0 process-ing., 37

fmi1_set_real_ftFunctions and types supporting FMI 1.0 process-

ing., 37fmi1_set_real_inputDerivatives_ft

Functions and types supporting FMI 1.0 process-ing., 40

fmi1_set_string_ftFunctions and types supporting FMI 1.0 process-

ing., 37fmi1_set_time_ft

Functions and types supporting FMI 1.0 process-ing., 38

fmi1_status_discardFunctions and types supporting FMI 1.0 process-

ing., 41fmi1_status_error

Functions and types supporting FMI 1.0 process-ing., 41

fmi1_status_fatalFunctions and types supporting FMI 1.0 process-

ing., 41fmi1_status_kind_t

Functions and types supporting FMI 1.0 process-ing., 41

fmi1_status_okFunctions and types supporting FMI 1.0 process-

ing., 41fmi1_status_pending

Functions and types supporting FMI 1.0 process-ing., 41

fmi1_status_tFunctions and types supporting FMI 1.0 process-

ing., 41fmi1_status_to_string

Functions and types supporting FMI 1.0 process-ing., 42

fmi1_status_warningFunctions and types supporting FMI 1.0 process-

ing., 41fmi1_step_finished_ft

Functions and types supporting FMI 1.0 process-ing., 37

fmi1_terminate_ftFunctions and types supporting FMI 1.0 process-

ing., 39fmi1_terminate_slave_ft

Functions and types supporting FMI 1.0 process-ing., 40

fmi1_testfmi1_import_test.c, 303fmi_import_test.c, 370

fmi1_trueFunctions and types supporting FMI 1.0 process-

ing., 42fmi1_undefined_value_reference

Functions and types supporting FMI 1.0 process-ing., 42

fmi1_value_reference_enu_tFunctions and types supporting FMI 1.0 process-

ing., 41, 42fmi1_variability_enu_constant

Enum types used with FMI 1.0 libs, 45fmi1_variability_enu_continuous

Enum types used with FMI 1.0 libs, 45fmi1_variability_enu_discrete

Enum types used with FMI 1.0 libs, 45fmi1_variability_enu_parameter

Enum types used with FMI 1.0 libs, 45fmi1_variability_enu_t

Enum types used with FMI 1.0 libs, 44, 45fmi1_variability_enu_unknown

Enum types used with FMI 1.0 libs, 45fmi1_variability_to_string

Enum types used with FMI 1.0 libs, 46fmi1_variable_alias_kind_enu_t

Enum types used with FMI 1.0 libs, 44, 45fmi1_variable_is_alias

Enum types used with FMI 1.0 libs, 45fmi1_variable_is_negated_alias

Enum types used with FMI 1.0 libs, 45fmi1_variable_is_not_alias

Enum types used with FMI 1.0 libs, 45fmi1_variable_naming_convension_enu_t

Enum types used with FMI 1.0 libs, 44fmi1_xml_parsing_test.c

concat, 305create_parse_test_callbacks, 306DO_LOG_EXPECTED_MSG, 308destroy_parse_test_callbacks, 306did_log_expected_msg, 308expected_message, 308fail_name_check, 306fmu_test_f, 305importlogger, 305main, 307NO_LOG_EXPECTED_MSG, 308name_check_test_directory, 308parser_log_expected_message, 306parser_no_log_expected_message, 306pass_name_check, 306should_have_1_no_alias_var, 307should_have_no_vars, 307

Generated by Doxygen

Page 455: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 387

should_have_size_2_alias_group, 307should_have_size_2_no_alis, 307should_have_size_3_alias_group, 307test_alias_set_error_handling, 307test_deprecation_errors, 307test_parser, 306test_parser_with_cleanup, 306test_parsing_and_fmu, 306test_parsing_fail_and_fmu, 306test_parsing_pass_and_fmu, 307test_variable_naming_conventions, 307

fmi1loggerfmi1_import_test.c, 303

fmi2_SI_base_unit_exp_to_stringEnum types used with FMI 2.0 libs, 67

fmi2_SI_base_unit_to_stringEnum types used with FMI 2.0 libs, 67

fmi2_SI_base_units_NumEnum types used with FMI 2.0 libs, 64

fmi2_SI_base_units_enu_tEnum types used with FMI 2.0 libs, 61, 64

fmi2_base_type_boolEnum types used with FMI 2.0 libs, 63

fmi2_base_type_enu_tEnum types used with FMI 2.0 libs, 61, 63

fmi2_base_type_enumEnum types used with FMI 2.0 libs, 63

fmi2_base_type_intEnum types used with FMI 2.0 libs, 63

fmi2_base_type_realEnum types used with FMI 2.0 libs, 63

fmi2_base_type_strEnum types used with FMI 2.0 libs, 63

fmi2_base_type_to_stringEnum types used with FMI 2.0 libs, 65

fmi2_boolean_enu_tFunctions and types supporting FMI 2.0 process-

ing., 57fmi2_callback_allocate_memory_ft

Functions and types supporting FMI 2.0 process-ing., 51

fmi2_callback_free_memory_ftFunctions and types supporting FMI 2.0 process-

ing., 51fmi2_callback_functions_t, 229

allocateMemory, 229componentEnvironment, 230freeMemory, 229logger, 229stepFinished, 229

fmi2_callback_logger_ftFunctions and types supporting FMI 2.0 process-

ing., 51fmi2_cancel_step_ft

Functions and types supporting FMI 2.0 process-ing., 55

fmi2_capabilities_NumEnum types used with FMI 2.0 libs, 64

fmi2_capabilities_enu_tEnum types used with FMI 2.0 libs, 61, 63

fmi2_capability_to_stringEnum types used with FMI 2.0 libs, 65

fmi2_causality_enu_calculated_parameterEnum types used with FMI 2.0 libs, 63

fmi2_causality_enu_independentEnum types used with FMI 2.0 libs, 63

fmi2_causality_enu_inputEnum types used with FMI 2.0 libs, 63

fmi2_causality_enu_localEnum types used with FMI 2.0 libs, 63

fmi2_causality_enu_outputEnum types used with FMI 2.0 libs, 63

fmi2_causality_enu_parameterEnum types used with FMI 2.0 libs, 63

fmi2_causality_enu_tEnum types used with FMI 2.0 libs, 61, 62

fmi2_causality_enu_unknownEnum types used with FMI 2.0 libs, 63

fmi2_causality_to_stringEnum types used with FMI 2.0 libs, 65

fmi2_completed_integrator_step_ftFunctions and types supporting FMI 2.0 process-

ing., 54fmi2_cosimulation

Functions and types supporting FMI 2.0 process-ing., 56

fmi2_de_serialize_fmu_state_ftFunctions and types supporting FMI 2.0 process-

ing., 54fmi2_default_callback_logger

Convenience functions., 195fmi2_dependency_factor_kind_constant

Enum types used with FMI 2.0 libs, 64fmi2_dependency_factor_kind_dependent

Enum types used with FMI 2.0 libs, 64fmi2_dependency_factor_kind_discrete

Enum types used with FMI 2.0 libs, 64fmi2_dependency_factor_kind_enu_t

Enum types used with FMI 2.0 libs, 61, 64fmi2_dependency_factor_kind_fixed

Enum types used with FMI 2.0 libs, 64fmi2_dependency_factor_kind_num

Enum types used with FMI 2.0 libs, 64fmi2_dependency_factor_kind_to_string

Enum types used with FMI 2.0 libs, 67fmi2_dependency_factor_kind_tunable

Enum types used with FMI 2.0 libs, 64fmi2_do_step_ft

Functions and types supporting FMI 2.0 process-ing., 55

fmi2_do_step_statusFunctions and types supporting FMI 2.0 process-

ing., 57fmi2_enter_continuous_time_mode_ft

Functions and types supporting FMI 2.0 process-ing., 54

Generated by Doxygen

Page 456: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

388 INDEX

fmi2_enter_event_mode_ftFunctions and types supporting FMI 2.0 process-

ing., 54fmi2_enter_initialization_mode_ft

Functions and types supporting FMI 2.0 process-ing., 52

fmi2_enums.hFMI2_EXPAND_CS_CAPABILITIES_ENU, 275FMI2_EXPAND_ME_CAPABILITIES_ENU, 275FMI2_EXPAND_SI_BASE_UNIT_ENU, 276

fmi2_event_info_t, 230newDiscreteStatesNeeded, 230nextEventTime, 231nextEventTimeDefined, 231nominalsOfContinuousStatesChanged, 230terminateSimulation, 230valuesOfContinuousStatesChanged, 230

fmi2_exit_initialization_mode_ftFunctions and types supporting FMI 2.0 process-

ing., 52fmi2_false

Functions and types supporting FMI 2.0 process-ing., 57

fmi2_fmu_kind_csEnum types used with FMI 2.0 libs, 62

fmi2_fmu_kind_enu_tEnum types used with FMI 2.0 libs, 61, 62

fmi2_fmu_kind_meEnum types used with FMI 2.0 libs, 62

fmi2_fmu_kind_me_and_csEnum types used with FMI 2.0 libs, 62

fmi2_fmu_kind_to_stringEnum types used with FMI 2.0 libs, 64

fmi2_fmu_kind_unknownEnum types used with FMI 2.0 libs, 62

fmi2_free_fmu_state_ftFunctions and types supporting FMI 2.0 process-

ing., 53fmi2_free_instance_ft

Functions and types supporting FMI 2.0 process-ing., 52

fmi2_get_boolean_ftFunctions and types supporting FMI 2.0 process-

ing., 53fmi2_get_boolean_status_ft

Functions and types supporting FMI 2.0 process-ing., 56

fmi2_get_continuous_states_ftFunctions and types supporting FMI 2.0 process-

ing., 55fmi2_get_default_initial

Enum types used with FMI 2.0 libs, 65fmi2_get_derivatives_ft

Functions and types supporting FMI 2.0 process-ing., 55

fmi2_get_directional_derivative_ftFunctions and types supporting FMI 2.0 process-

ing., 54

fmi2_get_event_indicators_ftFunctions and types supporting FMI 2.0 process-

ing., 55fmi2_get_fmu_state_ft

Functions and types supporting FMI 2.0 process-ing., 53

fmi2_get_integer_ftFunctions and types supporting FMI 2.0 process-

ing., 52fmi2_get_integer_status_ft

Functions and types supporting FMI 2.0 process-ing., 56

fmi2_get_nominals_of_continuous_states_ftFunctions and types supporting FMI 2.0 process-

ing., 55fmi2_get_real_ft

Functions and types supporting FMI 2.0 process-ing., 52

fmi2_get_real_output_derivatives_ftFunctions and types supporting FMI 2.0 process-

ing., 55fmi2_get_real_status_ft

Functions and types supporting FMI 2.0 process-ing., 55

fmi2_get_status_ftFunctions and types supporting FMI 2.0 process-

ing., 55fmi2_get_string_ft

Functions and types supporting FMI 2.0 process-ing., 53

fmi2_get_string_status_ftFunctions and types supporting FMI 2.0 process-

ing., 56fmi2_get_types_platform

Functions and types supporting FMI 2.0 process-ing., 57

fmi2_get_types_platform_ftFunctions and types supporting FMI 2.0 process-

ing., 51fmi2_get_valid_initial

Enum types used with FMI 2.0 libs, 65fmi2_get_version_ft

Functions and types supporting FMI 2.0 process-ing., 51

fmi2_import_alloc_variable_listHandling of variable lists, 31

fmi2_import_append_to_var_listHandling of variable lists, 32

fmi2_import_bool_variable_tFunctions for handling variable definitions., 210

fmi2_import_cancel_stepFMI 2.0 (CS) Co-Simulation functions, 180

fmi2_import_clear_last_errorConstuction, destruction and error handling, 158

fmi2_import_clone_variable_listHandling of variable lists, 31

fmi2_import_collect_model_countsConvenience functions., 194

Generated by Doxygen

Page 457: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 389

fmi2_import_completed_integrator_stepFMI 2.0 (ME) Model Exchange functions, 176

fmi2_import_convert_from_SI_base_unitFunctions for handling unit definitions., 206

fmi2_import_convert_from_display_unitFunctions for handling unit definitions., 207

fmi2_import_convert_to_SI_base_unitFunctions for handling unit definitions., 206

fmi2_import_convert_to_display_unitFunctions for handling unit definitions., 207

fmi2_import_create_dllfmuFMI 2.0 Constructor and Destructor, 172

fmi2_import_create_var_listGeneral information retrieval, 166

fmi2_import_cs_test.cBUFFER, 341do_exit, 341fmilogger, 341importlogger, 341main, 342test_simulate_cs, 342

fmi2_import_de_serialize_fmu_stateFMI 2.0 (ME & CS) Common functions, 192

fmi2_import_destroy_dllfmuFMI 2.0 Constructor and Destructor, 172

fmi2_import_display_unit_tFunctions for handling unit definitions., 205

fmi2_import_do_stepFMI 2.0 (CS) Co-Simulation functions, 180

fmi2_import_enter_continuous_time_modeFMI 2.0 (ME) Model Exchange functions, 175

fmi2_import_enter_event_modeFMI 2.0 (ME) Model Exchange functions, 174

fmi2_import_enter_initialization_modeFMI 2.0 (ME & CS) Common functions, 186

fmi2_import_enum_variable_tFunctions for handling variable definitions., 210

fmi2_import_enumeration_typedef_tSupport for processing variable types, 198

fmi2_import_exit_initialization_modeFMI 2.0 (ME & CS) Common functions, 186

fmi2_import_expand_variable_referencesConvenience functions., 195

fmi2_import_filter_variablesHandling of variable lists, 32

fmi2_import_freeConstuction, destruction and error handling, 158

fmi2_import_free_fmu_stateFMI 2.0 (ME & CS) Common functions, 191

fmi2_import_free_instanceFMI 2.0 (ME & CS) Common functions, 185

fmi2_import_free_variable_listHandling of variable lists, 31

fmi2_import_get_GUIDGeneral information retrieval, 163

fmi2_import_get_SI_unit_exponentsFunctions for handling unit definitions., 205

fmi2_import_get_SI_unit_factor

Functions for handling unit definitions., 206fmi2_import_get_SI_unit_offset

Functions for handling unit definitions., 206fmi2_import_get_author

General information retrieval, 163fmi2_import_get_base_type

Support for processing variable types, 200fmi2_import_get_base_unit

Functions for handling unit definitions., 206fmi2_import_get_boolean

FMI 2.0 (ME & CS) Common functions, 189fmi2_import_get_boolean_status

FMI 2.0 (CS) Co-Simulation functions, 182fmi2_import_get_boolean_variable_start

Functions for handling variable definitions., 214fmi2_import_get_canHandleMultipleSetPerTimeInstant

Functions for handling variable definitions., 212fmi2_import_get_capability

General information retrieval, 162fmi2_import_get_causality

Functions for handling variable definitions., 212fmi2_import_get_continuous_states

FMI 2.0 (ME) Model Exchange functions, 177fmi2_import_get_copyright

General information retrieval, 163fmi2_import_get_default_experiment_start

General information retrieval, 165fmi2_import_get_default_experiment_step

General information retrieval, 165fmi2_import_get_default_experiment_stop

General information retrieval, 165fmi2_import_get_default_experiment_tolerance

General information retrieval, 165fmi2_import_get_derivatives

FMI 2.0 (ME) Model Exchange functions, 176fmi2_import_get_derivatives_dependencies

General information retrieval, 169fmi2_import_get_derivatives_list

General information retrieval, 168fmi2_import_get_description

General information retrieval, 163fmi2_import_get_directional_derivative

FMI 2.0 (ME & CS) Common functions, 192fmi2_import_get_discrete_states_dependencies

General information retrieval, 169fmi2_import_get_discrete_states_list

General information retrieval, 168fmi2_import_get_display_unit_factor

Functions for handling unit definitions., 206fmi2_import_get_display_unit_name

Functions for handling unit definitions., 206fmi2_import_get_display_unit_offset

Functions for handling unit definitions., 206fmi2_import_get_enum_type_item_description

Support for processing variable types, 203fmi2_import_get_enum_type_item_name

Support for processing variable types, 202fmi2_import_get_enum_type_item_value

Generated by Doxygen

Page 458: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

390 INDEX

Support for processing variable types, 202fmi2_import_get_enum_type_max

Support for processing variable types, 202fmi2_import_get_enum_type_min

Support for processing variable types, 202fmi2_import_get_enum_type_size

Support for processing variable types, 202fmi2_import_get_enum_type_value_name

Support for processing variable types, 203fmi2_import_get_enum_variable_max

Functions for handling variable definitions., 215fmi2_import_get_enum_variable_min

Functions for handling variable definitions., 215fmi2_import_get_enum_variable_start

Functions for handling variable definitions., 215fmi2_import_get_event_indicators

FMI 2.0 (ME) Model Exchange functions, 177fmi2_import_get_fmu_kind

General information retrieval, 165fmi2_import_get_fmu_state

FMI 2.0 (ME & CS) Common functions, 190fmi2_import_get_generation_date_and_time

General information retrieval, 164fmi2_import_get_generation_tool

General information retrieval, 164fmi2_import_get_initial

Functions for handling variable definitions., 212fmi2_import_get_initial_unknowns_dependencies

General information retrieval, 170fmi2_import_get_initial_unknowns_list

General information retrieval, 168fmi2_import_get_integer

FMI 2.0 (ME & CS) Common functions, 189fmi2_import_get_integer_status

FMI 2.0 (CS) Co-Simulation functions, 181fmi2_import_get_integer_type_max

Support for processing variable types, 202fmi2_import_get_integer_type_min

Support for processing variable types, 201fmi2_import_get_integer_variable_max

Functions for handling variable definitions., 215fmi2_import_get_integer_variable_min

Functions for handling variable definitions., 215fmi2_import_get_integer_variable_start

Functions for handling variable definitions., 215fmi2_import_get_last_error

Constuction, destruction and error handling, 158fmi2_import_get_license

General information retrieval, 163fmi2_import_get_log_categories_num

General information retrieval, 166fmi2_import_get_log_category

General information retrieval, 166fmi2_import_get_log_category_description

General information retrieval, 166fmi2_import_get_model_identifier_CS

General information retrieval, 162fmi2_import_get_model_identifier_ME

General information retrieval, 162fmi2_import_get_model_name

General information retrieval, 162fmi2_import_get_model_standard_version

General information retrieval, 164fmi2_import_get_model_version

General information retrieval, 163fmi2_import_get_naming_convention

General information retrieval, 164fmi2_import_get_nominals_of_continuous_states

FMI 2.0 (ME) Model Exchange functions, 177fmi2_import_get_number_of_continuous_states

General information retrieval, 164fmi2_import_get_number_of_event_indicators

General information retrieval, 164fmi2_import_get_outputs_dependencies

General information retrieval, 169fmi2_import_get_outputs_list

General information retrieval, 167fmi2_import_get_previous

Functions for handling variable definitions., 212fmi2_import_get_real

FMI 2.0 (ME & CS) Common functions, 188fmi2_import_get_real_output_derivatives

FMI 2.0 (CS) Co-Simulation functions, 180fmi2_import_get_real_status

FMI 2.0 (CS) Co-Simulation functions, 181fmi2_import_get_real_type_is_relative_quantity

Support for processing variable types, 201fmi2_import_get_real_type_is_unbounded

Support for processing variable types, 201fmi2_import_get_real_type_max

Support for processing variable types, 201fmi2_import_get_real_type_min

Support for processing variable types, 201fmi2_import_get_real_type_nominal

Support for processing variable types, 201fmi2_import_get_real_type_unit

Support for processing variable types, 201fmi2_import_get_real_variable_derivative_of

Functions for handling variable definitions., 213fmi2_import_get_real_variable_display_unit

Functions for handling variable definitions., 214fmi2_import_get_real_variable_max

Functions for handling variable definitions., 214fmi2_import_get_real_variable_min

Functions for handling variable definitions., 214fmi2_import_get_real_variable_nominal

Functions for handling variable definitions., 214fmi2_import_get_real_variable_reinit

Functions for handling variable definitions., 213fmi2_import_get_real_variable_start

Functions for handling variable definitions., 213fmi2_import_get_real_variable_unit

Functions for handling variable definitions., 214fmi2_import_get_source_file_cs

General information retrieval, 167fmi2_import_get_source_file_me

Generated by Doxygen

Page 459: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 391

General information retrieval, 167fmi2_import_get_source_files_cs_num

General information retrieval, 167fmi2_import_get_source_files_me_num

General information retrieval, 166fmi2_import_get_status

FMI 2.0 (CS) Co-Simulation functions, 181fmi2_import_get_string

FMI 2.0 (ME & CS) Common functions, 190fmi2_import_get_string_status

FMI 2.0 (CS) Co-Simulation functions, 182fmi2_import_get_string_variable_start

Functions for handling variable definitions., 214fmi2_import_get_sublist

Handling of variable lists, 32fmi2_import_get_type_as_enum

Support for processing variable types, 200fmi2_import_get_type_as_int

Support for processing variable types, 200fmi2_import_get_type_as_real

Support for processing variable types, 200fmi2_import_get_type_definition_number

Support for processing variable types, 199fmi2_import_get_type_definitions

General information retrieval, 165fmi2_import_get_type_description

Support for processing variable types, 200fmi2_import_get_type_display_unit

Support for processing variable types, 199fmi2_import_get_type_name

Support for processing variable types, 199fmi2_import_get_type_quantity

Support for processing variable types, 200fmi2_import_get_typedef

Support for processing variable types, 199fmi2_import_get_types_platform

FMI 2.0 (ME & CS) Common functions, 190fmi2_import_get_unit

Functions for handling unit definitions., 205fmi2_import_get_unit_definitions

General information retrieval, 165fmi2_import_get_unit_definitions_number

Functions for handling unit definitions., 205fmi2_import_get_unit_display_unit

Functions for handling unit definitions., 206fmi2_import_get_unit_display_unit_number

Functions for handling unit definitions., 205fmi2_import_get_unit_name

Functions for handling unit definitions., 205fmi2_import_get_value_referece_list

Handling of variable lists, 31fmi2_import_get_variability

Functions for handling variable definitions., 211fmi2_import_get_variable

Handling of variable lists, 31fmi2_import_get_variable_alias_base

General information retrieval, 165fmi2_import_get_variable_alias_kind

Functions for handling variable definitions., 215fmi2_import_get_variable_aliases

General information retrieval, 165fmi2_import_get_variable_as_boolean

Functions for handling variable definitions., 213fmi2_import_get_variable_as_enum

Functions for handling variable definitions., 212fmi2_import_get_variable_as_integer

Functions for handling variable definitions., 212fmi2_import_get_variable_as_real

Functions for handling variable definitions., 212fmi2_import_get_variable_as_string

Functions for handling variable definitions., 213fmi2_import_get_variable_base_type

Functions for handling variable definitions., 211fmi2_import_get_variable_by_name

General information retrieval, 167fmi2_import_get_variable_by_vr

General information retrieval, 167fmi2_import_get_variable_declared_type

Functions for handling variable definitions., 211fmi2_import_get_variable_description

Functions for handling variable definitions., 211fmi2_import_get_variable_has_start

Functions for handling variable definitions., 211fmi2_import_get_variable_list

General information retrieval, 165fmi2_import_get_variable_list_size

Handling of variable lists, 31fmi2_import_get_variable_name

Functions for handling variable definitions., 211fmi2_import_get_variable_original_order

Functions for handling variable definitions., 215fmi2_import_get_variable_vr

Functions for handling variable definitions., 211fmi2_import_get_vendor_name

General information retrieval, 166fmi2_import_get_vendors_num

General information retrieval, 166fmi2_import_get_version

FMI 2.0 (ME & CS) Common functions, 184fmi2_import_init_logger

Convenience functions., 195fmi2_import_instantiate

FMI 2.0 (ME & CS) Common functions, 185fmi2_import_integer_typedef_t

Support for processing variable types, 198fmi2_import_integer_variable_t

Functions for handling variable definitions., 210fmi2_import_join_var_list

Handling of variable lists, 32fmi2_import_me_test.c

BUFFER, 342do_event_iteration, 342do_exit, 342main, 343test_parsed_all_varialbes, 343test_simulate_me, 343

Generated by Doxygen

Page 460: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

392 INDEX

fmi2_import_model_counts_t, 231num_bool_vars, 234num_calculated_parameters, 233num_constants, 232num_continuous, 232num_discrete, 232num_enum_vars, 234num_fixed, 232num_independent, 233num_inputs, 233num_integer_vars, 233num_local, 233num_outputs, 233num_parameters, 233num_real_vars, 233num_string_vars, 234num_tunable, 232

fmi2_import_new_discrete_statesFMI 2.0 (ME) Model Exchange functions, 175

fmi2_import_parse_xmlLibrary initialization, 100

fmi2_import_prepend_to_var_listHandling of variable lists, 33

fmi2_import_real_typedef_tSupport for processing variable types, 198

fmi2_import_real_variable_tFunctions for handling variable definitions., 210

fmi2_import_resetFMI 2.0 (ME & CS) Common functions, 187

fmi2_import_serialize_fmu_stateFMI 2.0 (ME & CS) Common functions, 192

fmi2_import_serialized_fmu_state_sizeFMI 2.0 (ME & CS) Common functions, 191

fmi2_import_set_booleanFMI 2.0 (ME & CS) Common functions, 188

fmi2_import_set_continuous_statesFMI 2.0 (ME) Model Exchange functions, 176

fmi2_import_set_debug_loggingFMI 2.0 (ME & CS) Common functions, 184

fmi2_import_set_debug_modeFMI 2.0 Constructor and Destructor, 173

fmi2_import_set_fmu_stateFMI 2.0 (ME & CS) Common functions, 191

fmi2_import_set_integerFMI 2.0 (ME & CS) Common functions, 187

fmi2_import_set_realFMI 2.0 (ME & CS) Common functions, 187

fmi2_import_set_real_input_derivativesFMI 2.0 (CS) Co-Simulation functions, 179

fmi2_import_set_stringFMI 2.0 (ME & CS) Common functions, 188

fmi2_import_set_timeFMI 2.0 (ME) Model Exchange functions, 175

fmi2_import_setup_experimentFMI 2.0 (ME & CS) Common functions, 185

fmi2_import_string_variable_tFunctions for handling variable definitions., 210

fmi2_import_t

Library initialization, 99fmi2_import_terminate

FMI 2.0 (ME & CS) Common functions, 186fmi2_import_test.c

BUFFER, 343fmi2_test, 344fmi2logger, 344stepFinished, 344

fmi2_import_type_definitions_tSupport for processing variable types, 199

fmi2_import_unit_definitions_tFunctions for handling unit definitions., 205

fmi2_import_unit_tFunctions for handling unit definitions., 205

fmi2_import_var_list_push_backHandling of variable lists, 33

fmi2_import_variable_filter_function_ftHandling of variable lists, 31

fmi2_import_variable_list_tFunctions for handling variable definitions., 210

fmi2_import_variable_tFunctions for handling variable definitions., 210

fmi2_import_variable_typedef_tSupport for processing variable types, 198

fmi2_import_xml_test.ccannotation_callbacks, 346annotation_data_handle, 345annotation_end_handle, 345annotation_start_handle, 345do_exit, 345expect_error, 346main, 346mylogger, 345print_dbl, 345print_int, 345printCapabilitiesInfo, 346printDependenciesInfo, 346printTypeInfo, 345printVariableInfo, 346testVariableSearch, 345

fmi2_initial_enu_approxEnum types used with FMI 2.0 libs, 63

fmi2_initial_enu_calculatedEnum types used with FMI 2.0 libs, 63

fmi2_initial_enu_exactEnum types used with FMI 2.0 libs, 63

fmi2_initial_enu_tEnum types used with FMI 2.0 libs, 61, 63

fmi2_initial_enu_unknownEnum types used with FMI 2.0 libs, 63

fmi2_initial_to_stringEnum types used with FMI 2.0 libs, 65

fmi2_instantiate_ftFunctions and types supporting FMI 2.0 process-

ing., 52fmi2_last_successful_time

Functions and types supporting FMI 2.0 process-ing., 57

Generated by Doxygen

Page 461: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 393

fmi2_log_forwardingConvenience functions., 195

fmi2_log_forwarding_vConvenience functions., 195

fmi2_model_exchangeFunctions and types supporting FMI 2.0 process-

ing., 56fmi2_naming_convention_to_string

Enum types used with FMI 2.0 libs, 64fmi2_naming_enu_flat

Enum types used with FMI 2.0 libs, 62fmi2_naming_enu_structured

Enum types used with FMI 2.0 libs, 62fmi2_naming_enu_unknown

Enum types used with FMI 2.0 libs, 62fmi2_new_discrete_states_ft

Functions and types supporting FMI 2.0 process-ing., 54

fmi2_pending_statusFunctions and types supporting FMI 2.0 process-

ing., 57fmi2_reset_ft

Functions and types supporting FMI 2.0 process-ing., 52

fmi2_serialize_fmu_state_ftFunctions and types supporting FMI 2.0 process-

ing., 54fmi2_serialized_fmu_state_size_ft

Functions and types supporting FMI 2.0 process-ing., 54

fmi2_set_boolean_ftFunctions and types supporting FMI 2.0 process-

ing., 53fmi2_set_continuous_states_ft

Functions and types supporting FMI 2.0 process-ing., 54

fmi2_set_debug_logging_ftFunctions and types supporting FMI 2.0 process-

ing., 52fmi2_set_fmu_state_ft

Functions and types supporting FMI 2.0 process-ing., 53

fmi2_set_integer_ftFunctions and types supporting FMI 2.0 process-

ing., 53fmi2_set_real_ft

Functions and types supporting FMI 2.0 process-ing., 53

fmi2_set_real_input_derivatives_ftFunctions and types supporting FMI 2.0 process-

ing., 55fmi2_set_string_ft

Functions and types supporting FMI 2.0 process-ing., 53

fmi2_set_time_ftFunctions and types supporting FMI 2.0 process-

ing., 54fmi2_setup_experiment_ft

Functions and types supporting FMI 2.0 process-ing., 52

fmi2_status_discardFunctions and types supporting FMI 2.0 process-

ing., 56fmi2_status_error

Functions and types supporting FMI 2.0 process-ing., 56

fmi2_status_fatalFunctions and types supporting FMI 2.0 process-

ing., 56fmi2_status_kind_t

Functions and types supporting FMI 2.0 process-ing., 56

fmi2_status_okFunctions and types supporting FMI 2.0 process-

ing., 56fmi2_status_pending

Functions and types supporting FMI 2.0 process-ing., 56

fmi2_status_tFunctions and types supporting FMI 2.0 process-

ing., 56fmi2_status_to_string

Functions and types supporting FMI 2.0 process-ing., 57

fmi2_status_warningFunctions and types supporting FMI 2.0 process-

ing., 56fmi2_step_finished_ft

Functions and types supporting FMI 2.0 process-ing., 51

fmi2_terminate_ftFunctions and types supporting FMI 2.0 process-

ing., 52fmi2_terminated

Functions and types supporting FMI 2.0 process-ing., 57

fmi2_testfmi2_import_test.c, 344fmi_import_test.c, 370

fmi2_trueFunctions and types supporting FMI 2.0 process-

ing., 57fmi2_type_t

Functions and types supporting FMI 2.0 process-ing., 56

fmi2_variability_enu_constantEnum types used with FMI 2.0 libs, 62

fmi2_variability_enu_continuousEnum types used with FMI 2.0 libs, 62

fmi2_variability_enu_discreteEnum types used with FMI 2.0 libs, 62

fmi2_variability_enu_fixedEnum types used with FMI 2.0 libs, 62

fmi2_variability_enu_tEnum types used with FMI 2.0 libs, 61, 62

fmi2_variability_enu_tunable

Generated by Doxygen

Page 462: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

394 INDEX

Enum types used with FMI 2.0 libs, 62fmi2_variability_enu_unknown

Enum types used with FMI 2.0 libs, 62fmi2_variability_to_string

Enum types used with FMI 2.0 libs, 64fmi2_variable_alias_kind_enu_t

Enum types used with FMI 2.0 libs, 61, 63fmi2_variable_is_alias

Enum types used with FMI 2.0 libs, 63fmi2_variable_is_not_alias

Enum types used with FMI 2.0 libs, 63fmi2_variable_naming_convension_enu_t

Enum types used with FMI 2.0 libs, 61, 62fmi2_xml_callbacks_t, 234

Definition of XML callbacks struct, 69fmi2_xml_element_data_handle_ft

Definition of XML callbacks struct, 70fmi2_xml_element_end_handle_ft

Definition of XML callbacks struct, 70fmi2_xml_element_start_handle_ft

Definition of XML callbacks struct, 69fmi2_xml_parsing_test.c

concat, 347did_not_log_expected_msg, 348expected_message, 348fail_name_check, 347importlogger, 347main, 348name_check_test_directory, 348parser_log_expected_message, 347pass_name_check, 347SHOULD_LOG_EXPECTED_MSG, 348SHOULD_NOT_LOG_EXPECTED_MSG, 348test_parser, 347test_variable_naming_conventions, 347

fmi2BooleanFunctions and types supporting FMI 2.0 process-

ing., 50fmi2Byte

Functions and types supporting FMI 2.0 process-ing., 51

fmi2CancelStepfmu2_model_cs.c, 362

fmi2CharFunctions and types supporting FMI 2.0 process-

ing., 50fmi2CompletedIntegratorStep

fmu2_model_me.c, 368fmi2Component

Functions and types supporting FMI 2.0 process-ing., 50

fmi2ComponentEnvironmentFunctions and types supporting FMI 2.0 process-

ing., 50fmi2DoStep

fmu2_model_cs.c, 362fmi2EnterContinuousTimeMode

fmu2_model_me.c, 368

fmi2EnterEventModefmu2_model_me.c, 368

fmi2EnterInitializationModefmu2_model_cs.c, 360fmu2_model_me.c, 367

fmi2ExitInitializationModefmu2_model_cs.c, 360fmu2_model_me.c, 367

fmi2FMUstateFunctions and types supporting FMI 2.0 process-

ing., 50fmi2FreeInstance

fmu2_model_cs.c, 360fmu2_model_me.c, 366

fmi2GetBooleanfmu2_model_cs.c, 360fmu2_model_me.c, 367

fmi2GetBooleanStatusfmu2_model_cs.c, 362

fmi2GetContinuousStatesfmu2_model_me.c, 369

fmi2GetDerivativesfmu2_model_me.c, 368

fmi2GetEventIndicatorsfmu2_model_me.c, 368

fmi2GetIntegerfmu2_model_cs.c, 360fmu2_model_me.c, 367

fmi2GetIntegerStatusfmu2_model_cs.c, 362

fmi2GetNominalsOfContinuousStatesfmu2_model_me.c, 369

fmi2GetRealfmu2_model_cs.c, 360fmu2_model_me.c, 367

fmi2GetRealOutputDerivativesfmu2_model_cs.c, 362

fmi2GetRealStatusfmu2_model_cs.c, 362

fmi2GetStatusfmu2_model_cs.c, 362

fmi2GetStringfmu2_model_cs.c, 361fmu2_model_me.c, 367

fmi2GetStringStatusfmu2_model_cs.c, 362

fmi2GetTypesPlatformfmu2_model_cs.c, 361fmu2_model_me.c, 368

fmi2GetVersionfmu2_model_cs.c, 360fmu2_model_me.c, 366

fmi2Instantiatefmu2_model_cs.c, 360fmu2_model_me.c, 366

fmi2IntegerFunctions and types supporting FMI 2.0 process-

ing., 50

Generated by Doxygen

Page 463: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 395

fmi2NewDiscreteStatesfmu2_model_me.c, 368

fmi2RealFunctions and types supporting FMI 2.0 process-

ing., 50fmi2Reset

fmu2_model_cs.c, 361fmu2_model_me.c, 369

fmi2SetBooleanfmu2_model_cs.c, 361fmu2_model_me.c, 367

fmi2SetContinuousStatesfmu2_model_me.c, 368

fmi2SetDebugLoggingfmu2_model_cs.c, 360fmu2_model_me.c, 366

fmi2SetIntegerfmu2_model_cs.c, 361fmu2_model_me.c, 367

fmi2SetRealfmu2_model_cs.c, 361fmu2_model_me.c, 367

fmi2SetRealInputDerivativesfmu2_model_cs.c, 361

fmi2SetStringfmu2_model_cs.c, 361fmu2_model_me.c, 368

fmi2SetTimefmu2_model_me.c, 368

fmi2SetupExperimentfmu2_model_cs.c, 360fmu2_model_me.c, 366

fmi2StringFunctions and types supporting FMI 2.0 process-

ing., 51fmi2Terminate

fmu2_model_cs.c, 361fmu2_model_me.c, 369

fmi2ValueReferenceFunctions and types supporting FMI 2.0 process-

ing., 50fmi2logger

fmi2_import_test.c, 344fmi_cancel_step

fmu1_model.c, 323fmu2_model.c, 353

fmi_completed_integrator_stepfmu1_model.c, 321fmu1_model.h, 326fmu2_model.c, 352fmu2_model.h, 358

fmi_construct_dll_dir_nameUtilities, 18

fmi_construct_dll_file_nameUtilities, 18

fmi_do_stepfmu1_model.c, 323fmu2_model.c, 353

fmi_enter_continuous_time_modefmu2_model.c, 352fmu2_model.h, 358

fmi_enter_event_modefmu2_model.c, 352fmu2_model.h, 357

fmi_enter_initialization_modefmu2_model.c, 351fmu2_model.h, 356

fmi_event_updatefmu1_model.c, 321fmu1_model.h, 326

fmi_exit_initialization_modefmu2_model.c, 352fmu2_model.h, 356

fmi_free_instancefmu2_model.c, 351fmu2_model.h, 356

fmi_free_model_instancefmu1_model.c, 321fmu1_model.h, 326

fmi_free_slave_instancefmu1_model.c, 322

fmi_get_booleanfmu1_model.c, 320fmu1_model.h, 325fmu2_model.c, 350fmu2_model.h, 357

fmi_get_boolean_statusfmu1_model.c, 323fmu2_model.c, 354

fmi_get_continuous_statesfmu1_model.c, 321fmu1_model.h, 327fmu2_model.c, 352fmu2_model.h, 358

fmi_get_derivativesfmu1_model.c, 321fmu1_model.h, 326fmu2_model.c, 352fmu2_model.h, 358

fmi_get_event_indicatorsfmu1_model.c, 321fmu1_model.h, 326fmu2_model.c, 352fmu2_model.h, 358

fmi_get_integerfmu1_model.c, 320fmu1_model.h, 325fmu2_model.c, 350fmu2_model.h, 357

fmi_get_integer_statusfmu1_model.c, 323fmu2_model.c, 354

fmi_get_model_types_platformfmu1_model.c, 320fmu1_model.h, 326fmu2_model.c, 351

Generated by Doxygen

Page 464: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

396 INDEX

fmu2_model.h, 357fmi_get_nominal_continuousstates

fmu1_model.c, 322fmu1_model.h, 327

fmi_get_nominals_of_continuousstatesfmu2_model.c, 353fmu2_model.h, 358

fmi_get_realfmu1_model.c, 320fmu1_model.h, 325fmu2_model.c, 350fmu2_model.h, 356

fmi_get_real_output_derivativesfmu1_model.c, 323fmu2_model.c, 353

fmi_get_real_statusfmu1_model.c, 323fmu2_model.c, 353

fmi_get_state_value_referencesfmu1_model.c, 322fmu1_model.h, 327

fmi_get_statusfmu1_model.c, 323fmu2_model.c, 353

fmi_get_stringfmu1_model.c, 320fmu1_model.h, 325fmu2_model.c, 350fmu2_model.h, 357

fmi_get_string_statusfmu1_model.c, 323fmu2_model.c, 354

fmi_get_types_platformfmu1_model.c, 322fmu2_model.c, 353

fmi_get_versionfmu1_model.c, 319fmu1_model.h, 325fmu2_model.c, 350fmu2_model.h, 356

fmi_import_allocate_contextLibrary initialization, 99

fmi_import_context_tLibrary initialization, 99

fmi_import_create_URL_from_abs_pathUtility functions supporting interactions with the li-

brary, 103fmi_import_cs_test.c

BUFFER, 309do_exit, 309fmilogger, 309importlogger, 309main, 310test_simulate_cs, 309test_xml, 309test_xml_modelDescription_cs_tc, 309xml_test_files, 310

fmi_import_free_context

Library initialization, 99fmi_import_get_dll_path

Utility functions supporting interactions with the li-brary, 103

fmi_import_get_fmi_versionLibrary initialization, 100

fmi_import_get_model_description_pathUtility functions supporting interactions with the li-

brary, 103fmi_import_me_test.c

BUFFER, 311destroy, 311do_exit, 311load, 311main, 311NUMBER_OF_TESTS, 311test_simulate_me, 311

fmi_import_mk_temp_dirUtility functions supporting interactions with the li-

brary, 102fmi_import_rmdir

Utility functions supporting interactions with the li-brary, 102

fmi_import_set_configurationLibrary initialization, 100

fmi_import_test.cBUFFER, 370do_exit, 370fmi1_test, 370fmi2_test, 370importlogger, 370main, 370

fmi_import_xml_test.cdo_exit, 312main, 313mylogger, 312print_dbl, 312print_int, 312printCapabilitiesInfo, 312printTypeInfo, 312printVariableInfo, 312testVariableSearch, 312

fmi_initializefmu1_model.c, 321fmu1_model.h, 326

fmi_initialize_slavefmu1_model.c, 322

fmi_instantiatefmu2_model.c, 351fmu2_model.h, 356

fmi_instantiate_modelfmu1_model.c, 321fmu1_model.h, 326

fmi_instantiate_slavefmu1_model.c, 322

fmi_new_discrete_statesfmu2_model.c, 352fmu2_model.h, 358

Generated by Doxygen

Page 465: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 397

fmi_resetfmu2_model.c, 353fmu2_model.h, 356

fmi_reset_slavefmu1_model.c, 322

fmi_set_booleanfmu1_model.c, 320fmu1_model.h, 325fmu2_model.c, 351fmu2_model.h, 357

fmi_set_continuous_statesfmu1_model.c, 321fmu1_model.h, 326fmu2_model.c, 352fmu2_model.h, 358

fmi_set_debug_loggingfmu1_model.c, 319fmu1_model.h, 325fmu2_model.c, 350fmu2_model.h, 356

fmi_set_integerfmu1_model.c, 320fmu1_model.h, 325fmu2_model.c, 351fmu2_model.h, 357

fmi_set_realfmu1_model.c, 320fmu1_model.h, 325fmu2_model.c, 351fmu2_model.h, 357

fmi_set_real_input_derivativesfmu1_model.c, 322fmu2_model.c, 353

fmi_set_stringfmu1_model.c, 320fmu1_model.h, 325fmu2_model.c, 351fmu2_model.h, 357

fmi_set_timefmu1_model.c, 321fmu1_model.h, 326fmu2_model.c, 352fmu2_model.h, 358

fmi_setup_experimentfmu2_model.c, 351fmu2_model.h, 356

fmi_terminatefmu1_model.c, 322fmu1_model.h, 327fmu2_model.c, 353fmu2_model.h, 356

fmi_terminate_slavefmu1_model.c, 322

fmi_total_test.cdo_pause, 313main, 314mylogger, 313PRINT_MY_DEBUG, 313

fmi_version_1_enuUtilities, 17

fmi_version_2_0_enuUtilities, 17

fmi_version_enu_tUtilities, 17

fmi_version_to_stringUtilities, 19

fmi_version_unknown_enuUtilities, 17

fmi_version_unsupported_enuUtilities, 17

fmi_zip_unzip_test.cdo_exit, 315importlogger, 315main, 315

fmi_zip_zip_test.cdo_exit, 317importlogger, 317main, 317PRINT_MY_DEBUG, 317

fmiBooleanFunctions and types supporting FMI 1.0 process-

ing., 36fmiCancelStep

fmu1_model_cs.c, 330fmiCompletedIntegratorStep

fmu1_model_me.c, 337fmiComponent

Functions and types supporting FMI 1.0 process-ing., 36

fmiDoStepfmu1_model_cs.c, 330

fmiDoStepStatusfmu1_model_me.c, 335

fmiEventUpdatefmu1_model_me.c, 337

fmiFreeModelInstancefmu1_model_me.c, 337

fmiFreeSlaveInstancefmu1_model_cs.c, 330

fmiGetBooleanfmu1_model_cs.c, 329fmu1_model_me.c, 336

fmiGetBooleanStatusfmu1_model_cs.c, 331

fmiGetContinuousStatesfmu1_model_me.c, 337

fmiGetDerivativesfmu1_model_me.c, 337

fmiGetEventIndicatorsfmu1_model_me.c, 337

fmiGetIntegerfmu1_model_cs.c, 329fmu1_model_me.c, 336

fmiGetIntegerStatusfmu1_model_cs.c, 331

fmiGetModelTypesPlatform

Generated by Doxygen

Page 466: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

398 INDEX

fmu1_model_me.c, 336fmiGetNominalContinuousStates

fmu1_model_me.c, 337fmiGetReal

fmu1_model_cs.c, 329fmu1_model_me.c, 335

fmiGetRealOutputDerivativesfmu1_model_cs.c, 330

fmiGetRealStatusfmu1_model_cs.c, 331

fmiGetStateValueReferencesfmu1_model_me.c, 338

fmiGetStatusfmu1_model_cs.c, 331

fmiGetStringfmu1_model_cs.c, 329fmu1_model_me.c, 336

fmiGetStringStatusfmu1_model_cs.c, 331

fmiGetTypesPlatformfmu1_model_cs.c, 329

fmiGetVersionfmu1_model_cs.c, 328fmu1_model_me.c, 335

fmiInitializefmu1_model_me.c, 337

fmiInitializeSlavefmu1_model_cs.c, 330

fmiInstantiateModelfmu1_model_me.c, 336

fmiInstantiateSlavefmu1_model_cs.c, 330

fmiIntegerFunctions and types supporting FMI 1.0 process-

ing., 36fmiLastSuccessfulTime

fmu1_model_me.c, 335fmiPendingStatus

fmu1_model_me.c, 335fmiReal

Functions and types supporting FMI 1.0 process-ing., 36

fmiResetSlavefmu1_model_cs.c, 330

fmiSetBooleanfmu1_model_cs.c, 329fmu1_model_me.c, 336

fmiSetContinuousStatesfmu1_model_me.c, 337

fmiSetDebugLoggingfmu1_model_cs.c, 328fmu1_model_me.c, 335

fmiSetIntegerfmu1_model_cs.c, 329fmu1_model_me.c, 336

fmiSetRealfmu1_model_cs.c, 329fmu1_model_me.c, 336

fmiSetRealInputDerivativesfmu1_model_cs.c, 330

fmiSetStringfmu1_model_cs.c, 329fmu1_model_me.c, 336

fmiSetTimefmu1_model_me.c, 337

fmiStatusKindfmu1_model_me.c, 335

fmiStringFunctions and types supporting FMI 1.0 process-

ing., 36fmiTerminate

fmu1_model_me.c, 338fmiTerminateSlave

fmu1_model_cs.c, 330fmiValueReference

Functions and types supporting FMI 1.0 process-ing., 36

fmilib_config.hCMAKE_INTDIR, 371FMI_BINARIES, 372FMI_DLL_EXT, 371FMI_FILE_SEP, 371FMI_MODEL_DESCRIPTION_XML, 372FMI_PLATFORM, 372FMILIB_ENABLE_LOG_LEVEL_DEBUG, 372FMILIB_EXPORT, 372FMILIB_GENERATE_BUILD_STAMP, 372FMILIB_PRIVATE, 372FMILIB_SIZET_FORMAT, 372HAVE___VA_COPY, 372HAVE_VSNPRINTF, 373jm_rpl_vsnprintf, 373

fmiloggerfmi1_capi_cs_test.c, 292fmi1_capi_me_test.c, 298fmi2_import_cs_test.c, 341fmi_import_cs_test.c, 309

fmitimecomponent_t, 219, 222

fmufmi1_capi_cs_test.c, 296fmi1_capi_me_test.c, 302fmul_t, 235

fmu1_model.ccalc_event_update, 319calc_get_derivatives, 319calc_get_event_indicators, 319calc_initialize, 319FMI_TEST_LOGGER_TEST_RESULT_FILE, 319FMI_TEST_LOGGER_TEST_SOURCE_FILE, 319fmi_cancel_step, 323fmi_completed_integrator_step, 321fmi_do_step, 323fmi_event_update, 321fmi_free_model_instance, 321fmi_free_slave_instance, 322

Generated by Doxygen

Page 467: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 399

fmi_get_boolean, 320fmi_get_boolean_status, 323fmi_get_continuous_states, 321fmi_get_derivatives, 321fmi_get_event_indicators, 321fmi_get_integer, 320fmi_get_integer_status, 323fmi_get_model_types_platform, 320fmi_get_nominal_continuousstates, 322fmi_get_real, 320fmi_get_real_output_derivatives, 323fmi_get_real_status, 323fmi_get_state_value_references, 322fmi_get_status, 323fmi_get_string, 320fmi_get_string_status, 323fmi_get_types_platform, 322fmi_get_version, 319fmi_initialize, 321fmi_initialize_slave, 322fmi_instantiate_model, 321fmi_instantiate_slave, 322fmi_reset_slave, 322fmi_set_boolean, 320fmi_set_continuous_states, 321fmi_set_debug_logging, 319fmi_set_integer, 320fmi_set_real, 320fmi_set_real_input_derivatives, 322fmi_set_string, 320fmi_set_time, 321fmi_terminate, 322fmi_terminate_slave, 322

fmu1_model.hcomponent_ptr_t, 324fmi_completed_integrator_step, 326fmi_event_update, 326fmi_free_model_instance, 326fmi_get_boolean, 325fmi_get_continuous_states, 327fmi_get_derivatives, 326fmi_get_event_indicators, 326fmi_get_integer, 325fmi_get_model_types_platform, 326fmi_get_nominal_continuousstates, 327fmi_get_real, 325fmi_get_state_value_references, 327fmi_get_string, 325fmi_get_version, 325fmi_initialize, 326fmi_instantiate_model, 326fmi_set_boolean, 325fmi_set_continuous_states, 326fmi_set_debug_logging, 325fmi_set_integer, 325fmi_set_real, 325fmi_set_string, 325fmi_set_time, 326

fmi_terminate, 327fmu1_model_cs.c

fmiCancelStep, 330fmiDoStep, 330fmiFreeSlaveInstance, 330fmiGetBoolean, 329fmiGetBooleanStatus, 331fmiGetInteger, 329fmiGetIntegerStatus, 331fmiGetReal, 329fmiGetRealOutputDerivatives, 330fmiGetRealStatus, 331fmiGetStatus, 331fmiGetString, 329fmiGetStringStatus, 331fmiGetTypesPlatform, 329fmiGetVersion, 328fmiInitializeSlave, 330fmiInstantiateSlave, 330fmiResetSlave, 330fmiSetBoolean, 329fmiSetDebugLogging, 328fmiSetInteger, 329fmiSetReal, 329fmiSetRealInputDerivatives, 330fmiSetString, 329fmiTerminateSlave, 330MODEL_IDENTIFIER, 328

fmu1_model_defines.hBUFFER, 332EVENT_HIGHT, 332FMI_GUID, 334FMI_VERSION, 334MAGIC_TEST_VALUE, 332MODEL_IDENTIFIER_STR, 332N_BOOLEAN, 333N_EVENT_INDICATORS, 333N_INPUT_REAL_MAX_ORDER, 333N_INPUT_REAL, 333N_INTEGER, 333N_OUTPUT_REAL_MAX_ORDER, 333N_OUTPUT_REAL, 333N_REAL, 333N_STATES, 333N_STRING, 333STRINGIFY2, 332STRINGIFY, 332VAR_R_BOUNCE_CONF, 332VAR_R_GRATIVY, 332VAR_R_HIGHT_SPEED, 332VAR_R_HIGHT, 332VAR_S_LOGGER_TEST, 332

fmu1_model_me.cfmiCompletedIntegratorStep, 337fmiDoStepStatus, 335fmiEventUpdate, 337fmiFreeModelInstance, 337fmiGetBoolean, 336

Generated by Doxygen

Page 468: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

400 INDEX

fmiGetContinuousStates, 337fmiGetDerivatives, 337fmiGetEventIndicators, 337fmiGetInteger, 336fmiGetModelTypesPlatform, 336fmiGetNominalContinuousStates, 337fmiGetReal, 335fmiGetStateValueReferences, 338fmiGetString, 336fmiGetVersion, 335fmiInitialize, 337fmiInstantiateModel, 336fmiLastSuccessfulTime, 335fmiPendingStatus, 335fmiSetBoolean, 336fmiSetContinuousStates, 337fmiSetDebugLogging, 335fmiSetInteger, 336fmiSetReal, 336fmiSetString, 336fmiSetTime, 337fmiStatusKind, 335fmiTerminate, 338MODEL_IDENTIFIER, 335

fmu2_model.ccalc_event_update, 350calc_get_derivatives, 350calc_get_event_indicators, 350calc_initialize, 350fmi_cancel_step, 353fmi_completed_integrator_step, 352fmi_do_step, 353fmi_enter_continuous_time_mode, 352fmi_enter_event_mode, 352fmi_enter_initialization_mode, 351fmi_exit_initialization_mode, 352fmi_free_instance, 351fmi_get_boolean, 350fmi_get_boolean_status, 354fmi_get_continuous_states, 352fmi_get_derivatives, 352fmi_get_event_indicators, 352fmi_get_integer, 350fmi_get_integer_status, 354fmi_get_model_types_platform, 351fmi_get_nominals_of_continuousstates, 353fmi_get_real, 350fmi_get_real_output_derivatives, 353fmi_get_real_status, 353fmi_get_status, 353fmi_get_string, 350fmi_get_string_status, 354fmi_get_types_platform, 353fmi_get_version, 350fmi_instantiate, 351fmi_new_discrete_states, 352fmi_reset, 353fmi_set_boolean, 351

fmi_set_continuous_states, 352fmi_set_debug_logging, 350fmi_set_integer, 351fmi_set_real, 351fmi_set_real_input_derivatives, 353fmi_set_string, 351fmi_set_time, 352fmi_setup_experiment, 351fmi_terminate, 353

fmu2_model.hcomponent_ptr_t, 355FMI2_Export, 355fmi_completed_integrator_step, 358fmi_enter_continuous_time_mode, 358fmi_enter_event_mode, 357fmi_enter_initialization_mode, 356fmi_exit_initialization_mode, 356fmi_free_instance, 356fmi_get_boolean, 357fmi_get_continuous_states, 358fmi_get_derivatives, 358fmi_get_event_indicators, 358fmi_get_integer, 357fmi_get_model_types_platform, 357fmi_get_nominals_of_continuousstates, 358fmi_get_real, 356fmi_get_string, 357fmi_get_version, 356fmi_instantiate, 356fmi_new_discrete_states, 358fmi_reset, 356fmi_set_boolean, 357fmi_set_continuous_states, 358fmi_set_debug_logging, 356fmi_set_integer, 357fmi_set_real, 357fmi_set_string, 357fmi_set_time, 358fmi_setup_experiment, 356fmi_terminate, 356

fmu2_model_cs.cfmi2CancelStep, 362fmi2DoStep, 362fmi2EnterInitializationMode, 360fmi2ExitInitializationMode, 360fmi2FreeInstance, 360fmi2GetBoolean, 360fmi2GetBooleanStatus, 362fmi2GetInteger, 360fmi2GetIntegerStatus, 362fmi2GetReal, 360fmi2GetRealOutputDerivatives, 362fmi2GetRealStatus, 362fmi2GetStatus, 362fmi2GetString, 361fmi2GetStringStatus, 362fmi2GetTypesPlatform, 361fmi2GetVersion, 360

Generated by Doxygen

Page 469: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 401

fmi2Instantiate, 360fmi2Reset, 361fmi2SetBoolean, 361fmi2SetDebugLogging, 360fmi2SetInteger, 361fmi2SetReal, 361fmi2SetRealInputDerivatives, 361fmi2SetString, 361fmi2SetupExperiment, 360fmi2Terminate, 361

fmu2_model_defines.hBUFFER, 363EVENT_HIGHT, 364FMI_GUID, 365FMI_VERSION, 365MAGIC_TEST_VALUE, 363N_BOOLEAN, 364N_EVENT_INDICATORS, 364N_INPUT_REAL_MAX_ORDER, 364N_INPUT_REAL, 364N_INTEGER, 364N_OUTPUT_REAL_MAX_ORDER, 365N_OUTPUT_REAL, 365N_REAL, 364N_STATES, 364N_STRING, 364VAR_R_BOUNCE_CONF, 363VAR_R_GRATIVY, 363VAR_R_HIGHT_SPEED, 363VAR_R_HIGHT, 363VAR_S_LOGGER_TEST, 364

fmu2_model_me.cfmi2CompletedIntegratorStep, 368fmi2EnterContinuousTimeMode, 368fmi2EnterEventMode, 368fmi2EnterInitializationMode, 367fmi2ExitInitializationMode, 367fmi2FreeInstance, 366fmi2GetBoolean, 367fmi2GetContinuousStates, 369fmi2GetDerivatives, 368fmi2GetEventIndicators, 368fmi2GetInteger, 367fmi2GetNominalsOfContinuousStates, 369fmi2GetReal, 367fmi2GetString, 367fmi2GetTypesPlatform, 368fmi2GetVersion, 366fmi2Instantiate, 366fmi2NewDiscreteStates, 368fmi2Reset, 369fmi2SetBoolean, 367fmi2SetContinuousStates, 368fmi2SetDebugLogging, 366fmi2SetInteger, 367fmi2SetReal, 367fmi2SetString, 368fmi2SetTime, 368

fmi2SetupExperiment, 366fmi2Terminate, 369

fmu_test_ffmi1_xml_parsing_test.c, 305

fmuLocationcomponent_t, 220

fmul_t, 235callBackFunctions, 235callbacks, 235context, 235fmu, 235

freejm_callbacks, 237

freeMemoryfmi1_callback_functions_t, 224fmi1_me_callback_functions_t, 229fmi2_callback_functions_t, 229

functionscomponent_t, 219, 222

Functions and types supporting FMI 1.0 processing., 34fmi1_boolean_enu_t, 42fmi1_callback_allocate_memory_ft, 36fmi1_callback_free_memory_ft, 36fmi1_callback_logger_ft, 36fmi1_cancel_step_ft, 40fmi1_completed_integrator_step_ft, 38fmi1_do_step_ft, 40fmi1_do_step_status, 42fmi1_event_update_ft, 39fmi1_false, 42fmi1_free_model_instance_ft, 38fmi1_free_slave_instance_ft, 40fmi1_get_boolean_ft, 38fmi1_get_boolean_status_ft, 41fmi1_get_continuous_states_ft, 39fmi1_get_derivatives_ft, 39fmi1_get_event_indicators_ft, 39fmi1_get_integer_ft, 37fmi1_get_integer_status_ft, 41fmi1_get_model_typesPlatform_ft, 38fmi1_get_nominal_continuousStates_ft, 39fmi1_get_platform, 42fmi1_get_real_ft, 37fmi1_get_real_outputDerivatives_ft, 40fmi1_get_real_status_ft, 41fmi1_get_state_valueReferences_ft, 39fmi1_get_status_ft, 40fmi1_get_string_ft, 38fmi1_get_string_status_ft, 41fmi1_get_types_platform_ft, 39fmi1_get_version_ft, 37fmi1_initialize_ft, 38fmi1_initialize_slave_ft, 40fmi1_instantiate_model_ft, 38fmi1_instantiate_slave_ft, 39fmi1_last_successful_time, 42fmi1_pending_status, 42fmi1_reset_slave_ft, 40

Generated by Doxygen

Page 470: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

402 INDEX

fmi1_set_boolean_ft, 37fmi1_set_continuous_states_ft, 38fmi1_set_debug_logging_ft, 37fmi1_set_integer_ft, 37fmi1_set_real_ft, 37fmi1_set_real_inputDerivatives_ft, 40fmi1_set_string_ft, 37fmi1_set_time_ft, 38fmi1_status_discard, 41fmi1_status_error, 41fmi1_status_fatal, 41fmi1_status_kind_t, 41fmi1_status_ok, 41fmi1_status_pending, 41fmi1_status_t, 41fmi1_status_to_string, 42fmi1_status_warning, 41fmi1_step_finished_ft, 37fmi1_terminate_ft, 39fmi1_terminate_slave_ft, 40fmi1_true, 42fmi1_undefined_value_reference, 42fmi1_value_reference_enu_t, 41, 42fmiBoolean, 36fmiComponent, 36fmiInteger, 36fmiReal, 36fmiString, 36fmiValueReference, 36

Functions and types supporting FMI 2.0 processing., 48fmi2_boolean_enu_t, 57fmi2_callback_allocate_memory_ft, 51fmi2_callback_free_memory_ft, 51fmi2_callback_logger_ft, 51fmi2_cancel_step_ft, 55fmi2_completed_integrator_step_ft, 54fmi2_cosimulation, 56fmi2_de_serialize_fmu_state_ft, 54fmi2_do_step_ft, 55fmi2_do_step_status, 57fmi2_enter_continuous_time_mode_ft, 54fmi2_enter_event_mode_ft, 54fmi2_enter_initialization_mode_ft, 52fmi2_exit_initialization_mode_ft, 52fmi2_false, 57fmi2_free_fmu_state_ft, 53fmi2_free_instance_ft, 52fmi2_get_boolean_ft, 53fmi2_get_boolean_status_ft, 56fmi2_get_continuous_states_ft, 55fmi2_get_derivatives_ft, 55fmi2_get_directional_derivative_ft, 54fmi2_get_event_indicators_ft, 55fmi2_get_fmu_state_ft, 53fmi2_get_integer_ft, 52fmi2_get_integer_status_ft, 56fmi2_get_nominals_of_continuous_states_ft, 55fmi2_get_real_ft, 52

fmi2_get_real_output_derivatives_ft, 55fmi2_get_real_status_ft, 55fmi2_get_status_ft, 55fmi2_get_string_ft, 53fmi2_get_string_status_ft, 56fmi2_get_types_platform, 57fmi2_get_types_platform_ft, 51fmi2_get_version_ft, 51fmi2_instantiate_ft, 52fmi2_last_successful_time, 57fmi2_model_exchange, 56fmi2_new_discrete_states_ft, 54fmi2_pending_status, 57fmi2_reset_ft, 52fmi2_serialize_fmu_state_ft, 54fmi2_serialized_fmu_state_size_ft, 54fmi2_set_boolean_ft, 53fmi2_set_continuous_states_ft, 54fmi2_set_debug_logging_ft, 52fmi2_set_fmu_state_ft, 53fmi2_set_integer_ft, 53fmi2_set_real_ft, 53fmi2_set_real_input_derivatives_ft, 55fmi2_set_string_ft, 53fmi2_set_time_ft, 54fmi2_setup_experiment_ft, 52fmi2_status_discard, 56fmi2_status_error, 56fmi2_status_fatal, 56fmi2_status_kind_t, 56fmi2_status_ok, 56fmi2_status_pending, 56fmi2_status_t, 56fmi2_status_to_string, 57fmi2_status_warning, 56fmi2_step_finished_ft, 51fmi2_terminate_ft, 52fmi2_terminated, 57fmi2_true, 57fmi2_type_t, 56fmi2Boolean, 50fmi2Byte, 51fmi2Char, 50fmi2Component, 50fmi2ComponentEnvironment, 50fmi2FMUstate, 50fmi2Integer, 50fmi2Real, 50fmi2String, 51fmi2ValueReference, 50

Functions for handling unit definitions., 145, 204fmi1_import_convert_from_display_unit, 147fmi1_import_convert_to_display_unit, 147fmi1_import_display_unit_t, 145fmi1_import_get_base_unit, 146fmi1_import_get_display_unit_gain, 147fmi1_import_get_display_unit_name, 147fmi1_import_get_display_unit_offset, 147

Generated by Doxygen

Page 471: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 403

fmi1_import_get_unit, 146fmi1_import_get_unit_definitions_number, 146fmi1_import_get_unit_display_unit, 146fmi1_import_get_unit_display_unit_number, 146fmi1_import_get_unit_name, 146fmi1_import_unit_definitions_t, 146fmi1_import_unit_t, 145fmi2_import_convert_from_SI_base_unit, 206fmi2_import_convert_from_display_unit, 207fmi2_import_convert_to_SI_base_unit, 206fmi2_import_convert_to_display_unit, 207fmi2_import_display_unit_t, 205fmi2_import_get_SI_unit_exponents, 205fmi2_import_get_SI_unit_factor, 206fmi2_import_get_SI_unit_offset, 206fmi2_import_get_base_unit, 206fmi2_import_get_display_unit_factor, 206fmi2_import_get_display_unit_name, 206fmi2_import_get_display_unit_offset, 206fmi2_import_get_unit, 205fmi2_import_get_unit_definitions_number, 205fmi2_import_get_unit_display_unit, 206fmi2_import_get_unit_display_unit_number, 205fmi2_import_get_unit_name, 205fmi2_import_unit_definitions_t, 205fmi2_import_unit_t, 205

Functions for handling variable definitions., 148, 208fmi1_import_bool_variable_t, 150fmi1_import_enum_variable_t, 150fmi1_import_get_boolean_variable_start, 155fmi1_import_get_causality, 153fmi1_import_get_enum_variable_max, 155fmi1_import_get_enum_variable_min, 155fmi1_import_get_enum_variable_start, 155fmi1_import_get_integer_variable_max, 155fmi1_import_get_integer_variable_min, 155fmi1_import_get_integer_variable_start, 155fmi1_import_get_real_variable_display_unit, 155fmi1_import_get_real_variable_max, 154fmi1_import_get_real_variable_min, 154fmi1_import_get_real_variable_nominal, 154fmi1_import_get_real_variable_start, 154fmi1_import_get_real_variable_unit, 154fmi1_import_get_string_variable_start, 155fmi1_import_get_variability, 153fmi1_import_get_variable_alias_kind, 155fmi1_import_get_variable_as_boolean, 154fmi1_import_get_variable_as_enum, 153fmi1_import_get_variable_as_integer, 153fmi1_import_get_variable_as_real, 153fmi1_import_get_variable_as_string, 153fmi1_import_get_variable_base_type, 152fmi1_import_get_variable_by_name, 151fmi1_import_get_variable_by_vr, 152fmi1_import_get_variable_declared_type, 152fmi1_import_get_variable_description, 152fmi1_import_get_variable_has_start, 153fmi1_import_get_variable_is_fixed, 153

fmi1_import_get_variable_name, 152fmi1_import_get_variable_original_order, 155fmi1_import_get_variable_vr, 152fmi1_import_integer_variable_t, 150fmi1_import_real_variable_t, 150fmi1_import_string_variable_t, 150fmi1_import_variable_list_t, 150fmi1_import_variable_t, 150fmi2_import_bool_variable_t, 210fmi2_import_enum_variable_t, 210fmi2_import_get_boolean_variable_start, 214fmi2_import_get_canHandleMultipleSetPerTime←↩

Instant, 212fmi2_import_get_causality, 212fmi2_import_get_enum_variable_max, 215fmi2_import_get_enum_variable_min, 215fmi2_import_get_enum_variable_start, 215fmi2_import_get_initial, 212fmi2_import_get_integer_variable_max, 215fmi2_import_get_integer_variable_min, 215fmi2_import_get_integer_variable_start, 215fmi2_import_get_previous, 212fmi2_import_get_real_variable_derivative_of, 213fmi2_import_get_real_variable_display_unit, 214fmi2_import_get_real_variable_max, 214fmi2_import_get_real_variable_min, 214fmi2_import_get_real_variable_nominal, 214fmi2_import_get_real_variable_reinit, 213fmi2_import_get_real_variable_start, 213fmi2_import_get_real_variable_unit, 214fmi2_import_get_string_variable_start, 214fmi2_import_get_variability, 211fmi2_import_get_variable_alias_kind, 215fmi2_import_get_variable_as_boolean, 213fmi2_import_get_variable_as_enum, 212fmi2_import_get_variable_as_integer, 212fmi2_import_get_variable_as_real, 212fmi2_import_get_variable_as_string, 213fmi2_import_get_variable_base_type, 211fmi2_import_get_variable_declared_type, 211fmi2_import_get_variable_description, 211fmi2_import_get_variable_has_start, 211fmi2_import_get_variable_name, 211fmi2_import_get_variable_original_order, 215fmi2_import_get_variable_vr, 211fmi2_import_integer_variable_t, 210fmi2_import_real_variable_t, 210fmi2_import_string_variable_t, 210fmi2_import_variable_list_t, 210fmi2_import_variable_t, 210

Functions to retrieve capability flags., 113fmi1_import_capabilities_t, 113fmi1_import_get_canBeInstantiatedOnlyOnce←↩

PerProcess, 114fmi1_import_get_canHandleEvents, 114fmi1_import_get_canHandleVariableCommunication←↩

StepSize, 114fmi1_import_get_canInterpolateInputs, 114

Generated by Doxygen

Page 472: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

404 INDEX

fmi1_import_get_canNotUseMemoryManagement←↩

Functions, 114fmi1_import_get_canRejectSteps, 114fmi1_import_get_canRunAsynchronuously, 114fmi1_import_get_canSignalEvents, 114fmi1_import_get_maxOutputDerivativeOrder, 114

Functions to retrieve co-simulation related information.,139

fmi1_import_get_additional_model_name, 139fmi1_import_get_entry_point, 139fmi1_import_get_manual_start, 139fmi1_import_get_mime_type, 139fmi1_import_get_number_of_additional_models,

139

GUIDcomponent_t, 219

General information retrieval, 106, 160fmi1_import_create_var_list, 111fmi1_import_get_GUID, 107fmi1_import_get_author, 108fmi1_import_get_capabilities, 109fmi1_import_get_default_experiment_start, 109fmi1_import_get_default_experiment_stop, 109fmi1_import_get_default_experiment_tolerance,

109fmi1_import_get_description, 108fmi1_import_get_direct_dependency, 110fmi1_import_get_fmu_kind, 109fmi1_import_get_generation_date_and_time, 108fmi1_import_get_generation_tool, 108fmi1_import_get_model_identifier, 107fmi1_import_get_model_name, 107fmi1_import_get_model_standard_version, 108fmi1_import_get_model_version, 108fmi1_import_get_naming_convention, 109fmi1_import_get_number_of_continuous_states,

109fmi1_import_get_number_of_event_indicators, 109fmi1_import_get_type_definitions, 110fmi1_import_get_unit_definitions, 110fmi1_import_get_variable_alias_base, 110fmi1_import_get_variable_aliases, 110fmi1_import_get_variable_list, 110fmi1_import_get_variable_list_alphabetical_order,

111fmi2_import_create_var_list, 166fmi2_import_get_GUID, 163fmi2_import_get_author, 163fmi2_import_get_capability, 162fmi2_import_get_copyright, 163fmi2_import_get_default_experiment_start, 165fmi2_import_get_default_experiment_step, 165fmi2_import_get_default_experiment_stop, 165fmi2_import_get_default_experiment_tolerance,

165fmi2_import_get_derivatives_dependencies, 169fmi2_import_get_derivatives_list, 168fmi2_import_get_description, 163

fmi2_import_get_discrete_states_dependencies,169

fmi2_import_get_discrete_states_list, 168fmi2_import_get_fmu_kind, 165fmi2_import_get_generation_date_and_time, 164fmi2_import_get_generation_tool, 164fmi2_import_get_initial_unknowns_dependencies,

170fmi2_import_get_initial_unknowns_list, 168fmi2_import_get_license, 163fmi2_import_get_log_categories_num, 166fmi2_import_get_log_category, 166fmi2_import_get_log_category_description, 166fmi2_import_get_model_identifier_CS, 162fmi2_import_get_model_identifier_ME, 162fmi2_import_get_model_name, 162fmi2_import_get_model_standard_version, 164fmi2_import_get_model_version, 163fmi2_import_get_naming_convention, 164fmi2_import_get_number_of_continuous_states,

164fmi2_import_get_number_of_event_indicators, 164fmi2_import_get_outputs_dependencies, 169fmi2_import_get_outputs_list, 167fmi2_import_get_source_file_cs, 167fmi2_import_get_source_file_me, 167fmi2_import_get_source_files_cs_num, 167fmi2_import_get_source_files_me_num, 166fmi2_import_get_type_definitions, 165fmi2_import_get_unit_definitions, 165fmi2_import_get_variable_alias_base, 165fmi2_import_get_variable_aliases, 165fmi2_import_get_variable_by_name, 167fmi2_import_get_variable_by_vr, 167fmi2_import_get_variable_list, 165fmi2_import_get_vendor_name, 166fmi2_import_get_vendors_num, 166

HAVE___VA_COPYfmilib_config.h, 372

HAVE_VSNPRINTFfmilib_config.h, 373

Handling of variable lists, 25, 30fmi1_import_alloc_variable_list, 26fmi1_import_append_to_var_list, 27fmi1_import_clone_variable_list, 26fmi1_import_filter_variables, 27fmi1_import_free_variable_list, 26fmi1_import_get_sublist, 26fmi1_import_get_value_referece_list, 26fmi1_import_get_variable, 26fmi1_import_get_variable_list_size, 26fmi1_import_join_var_list, 27fmi1_import_prepend_to_var_list, 28fmi1_import_var_list_push_back, 28fmi1_import_variable_filter_function_ft, 26fmi2_import_alloc_variable_list, 31fmi2_import_append_to_var_list, 32fmi2_import_clone_variable_list, 31

Generated by Doxygen

Page 473: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 405

fmi2_import_filter_variables, 32fmi2_import_free_variable_list, 31fmi2_import_get_sublist, 32fmi2_import_get_value_referece_list, 31fmi2_import_get_variable, 31fmi2_import_get_variable_list_size, 31fmi2_import_join_var_list, 32fmi2_import_prepend_to_var_list, 33fmi2_import_var_list_push_back, 33fmi2_import_variable_filter_function_ft, 31

Handling platform specific defines and functions, 80jm_create_URL_from_abs_path, 82jm_dll_function_ptr, 80jm_get_dir_abspath, 82jm_get_system_temp_dir, 81jm_mk_temp_dir, 82jm_mkdir, 83jm_mkdtemp, 81jm_portability_free_dll_handle, 81jm_portability_get_current_working_directory, 81jm_portability_get_last_dll_error, 81jm_portability_load_dll_function, 81jm_portability_load_dll_handle, 81jm_portability_set_current_working_directory, 81jm_rmdir, 83jm_snprintf, 83jm_vsnprintf, 83

INSTANCE_NAMEfmi1_capi_cs_test.c, 291fmi1_capi_me_test.c, 298

IDjm_name_ID_map_t, 238

ifA vector of items (dynamic array), 94

importloggercompress_test_fmu_zip.c, 289FMI1/compress_test_fmu_zip.c, 289FMI1/fmi_zip_unzip_test.c, 314FMI1/fmi_zip_zip_test.c, 316fmi1_capi_cs_test.c, 292fmi1_capi_me_test.c, 298fmi1_xml_parsing_test.c, 305fmi2_import_cs_test.c, 341fmi2_xml_parsing_test.c, 347fmi_import_cs_test.c, 309fmi_import_test.c, 370fmi_zip_unzip_test.c, 315fmi_zip_zip_test.c, 317

input_realcomponent_t, 221, 223

instanceNamecomponent_t, 219

integerscomponent_t, 219, 221

interactivecomponent_t, 220

Interface to the standard FMI 1.0 "C" API, 112Interface to the standard FMI 2.0 "C" API, 171

itemsA vector of items (dynamic array), 97

iterationConvergedfmi1_event_info_t, 225

JM_MAX_ERROR_MESSAGE_SIZEDefinition of callbacks struct and supporting func-

tions, 73JM_STACK_MAX_MEMORY_CHUNK

A basic stack, 23JM_STACK_MINIMAL_CAPACITY

A basic stack, 23JM_TEMPLATE_INSTANCE_TYPE

A vector of items (dynamic array), 94, 95JM_VECTOR_MAX_MEMORY_CHUNK

A vector of items (dynamic array), 93JM_VECTOR_MINIMAL_CAPACITY

A vector of items (dynamic array), 93jm_callbacks, 236

calloc, 236context, 237Definition of callbacks struct and supporting func-

tions, 73errMessageBuffer, 237free, 237log_level, 237logger, 237malloc, 236realloc, 236

jm_calloc_fDefinition of callbacks struct and supporting func-

tions, 74jm_clear_last_error

Definition of callbacks struct and supporting func-tions, 74

jm_compare_ftA vector of items (dynamic array), 94

jm_create_URL_from_abs_pathHandling platform specific defines and functions, 82

jm_default_loggerDefinition of callbacks struct and supporting func-

tions, 75jm_define_comp_f

A vector of items (dynamic array), 90, 94jm_diff

A vector of items (dynamic array), 90jm_diff_name

A vector of items (dynamic array), 96jm_vector.h, 287

jm_diff_namedjm_named_ptr.h, 282

jm_dll_function_ptrHandling platform specific defines and functions, 80

jm_free_fDefinition of callbacks struct and supporting func-

tions, 74jm_get_default_callbacks

Definition of callbacks struct and supporting func-tions, 75

Generated by Doxygen

Page 474: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

406 INDEX

jm_get_dir_abspathHandling platform specific defines and functions, 82

jm_get_last_errorDefinition of callbacks struct and supporting func-

tions, 74jm_get_system_temp_dir

Handling platform specific defines and functions, 81jm_log

Definition of callbacks struct and supporting func-tions, 75

jm_log_debugDefinition of callbacks struct and supporting func-

tions, 77jm_log_debug_v

Definition of callbacks struct and supporting func-tions, 76

jm_log_errorDefinition of callbacks struct and supporting func-

tions, 76jm_log_error_v

Definition of callbacks struct and supporting func-tions, 76

jm_log_fatalDefinition of callbacks struct and supporting func-

tions, 76jm_log_fatal_v

Definition of callbacks struct and supporting func-tions, 75

jm_log_infoDefinition of callbacks struct and supporting func-

tions, 76jm_log_info_v

Definition of callbacks struct and supporting func-tions, 76

jm_log_level_allUtilities, 18

jm_log_level_debugUtilities, 18

jm_log_level_enu_tUtilities, 17

jm_log_level_errorUtilities, 18

jm_log_level_fatalUtilities, 18

jm_log_level_infoUtilities, 18

jm_log_level_nothingUtilities, 18

jm_log_level_to_stringUtilities, 19

jm_log_level_verboseUtilities, 18

jm_log_level_warningUtilities, 18

jm_log_vDefinition of callbacks struct and supporting func-

tions, 75jm_log_verbose

Definition of callbacks struct and supporting func-tions, 76

jm_log_verbose_vDefinition of callbacks struct and supporting func-

tions, 76jm_log_warning

Definition of callbacks struct and supporting func-tions, 76

jm_log_warning_vDefinition of callbacks struct and supporting func-

tions, 76jm_logger_f

Definition of callbacks struct and supporting func-tions, 74

jm_malloc_fDefinition of callbacks struct and supporting func-

tions, 73jm_mangle

A vector of items (dynamic array), 88jm_mangle_ex

A vector of items (dynamic array), 88jm_mk_temp_dir

Handling platform specific defines and functions, 82jm_mkdir

Handling platform specific defines and functions, 83jm_mkdtemp

Handling platform specific defines and functions, 81jm_name_ID_map_t, 237

A vector of items (dynamic array), 96ID, 238name, 238Utilities, 17

jm_named_allocNamed objects, 78

jm_named_alloc_vNamed objects, 79

jm_named_freeNamed objects, 79

jm_named_ptr, 238name, 239Named objects, 78ptr, 239

jm_named_ptr.hjm_diff_named, 282

jm_named_vector_freeNamed objects, 79

jm_named_vector_free_dataNamed objects, 79

jm_portability.hDLL_HANDLE, 283

jm_portability_free_dll_handleHandling platform specific defines and functions, 81

jm_portability_get_current_working_directoryHandling platform specific defines and functions, 81

jm_portability_get_last_dll_errorHandling platform specific defines and functions, 81

jm_portability_load_dll_functionHandling platform specific defines and functions, 81

Generated by Doxygen

Page 475: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 407

jm_portability_load_dll_handleHandling platform specific defines and functions, 81

jm_portability_set_current_working_directoryHandling platform specific defines and functions, 81

jm_realloc_fDefinition of callbacks struct and supporting func-

tions, 74jm_rmdir

Handling platform specific defines and functions, 83jm_rpl_vsnprintf

fmilib_config.h, 373jm_set_default_callbacks

Definition of callbacks struct and supporting func-tions, 74

jm_snprintfHandling platform specific defines and functions, 83

jm_stackA basic stack, 20

jm_stack_allocA basic stack, 20

jm_stack_declare_templateA basic stack, 23

jm_stack_foreachA basic stack, 23

jm_stack_freeA basic stack, 21

jm_stack_free_dataA basic stack, 21

jm_stack_get_sizeA basic stack, 22

jm_stack_initA basic stack, 21

jm_stack_is_emptyA basic stack, 22

jm_stack_popA basic stack, 22

jm_stack_pushA basic stack, 22

jm_stack_reserveA basic stack, 22

jm_stack_topA basic stack, 22

jm_status_enu_tUtilities, 17

jm_status_errorUtilities, 17

jm_status_successUtilities, 17

jm_status_warningUtilities, 17

jm_stringUtilities, 17

jm_string_setA set of strings, 84

jm_string_set_findA set of strings, 84

jm_string_set_find_indexA set of strings, 84

jm_string_set_putA set of strings, 85

jm_vectorA vector of items (dynamic array), 88, 94

jm_vector.hjm_diff_name, 287

jm_vector_allocA vector of items (dynamic array), 88

jm_vector_appendA vector of items (dynamic array), 92

jm_vector_bsearchA vector of items (dynamic array), 91

jm_vector_bsearch_indexA vector of items (dynamic array), 91

jm_vector_cloneA vector of items (dynamic array), 92

jm_vector_copyA vector of items (dynamic array), 92

jm_vector_declare_templateA vector of items (dynamic array), 93, 94Named objects, 79

jm_vector_findA vector of items (dynamic array), 90

jm_vector_find_indexA vector of items (dynamic array), 90

jm_vector_foreachA vector of items (dynamic array), 93

jm_vector_foreach_cA vector of items (dynamic array), 93

jm_vector_freeA vector of items (dynamic array), 88

jm_vector_free_dataA vector of items (dynamic array), 89

jm_vector_get_itemA vector of items (dynamic array), 89

jm_vector_get_itempA vector of items (dynamic array), 89

jm_vector_get_lastA vector of items (dynamic array), 89

jm_vector_get_lastpA vector of items (dynamic array), 89

jm_vector_get_sizeA vector of items (dynamic array), 89

jm_vector_initA vector of items (dynamic array), 88

jm_vector_insertA vector of items (dynamic array), 92

jm_vector_ptr2indexA vector of items (dynamic array), 93

jm_vector_push_backA vector of items (dynamic array), 93

jm_vector_qsortA vector of items (dynamic array), 91

jm_vector_remove_itemA vector of items (dynamic array), 92

jm_vector_reserveA vector of items (dynamic array), 91

jm_vector_resize

Generated by Doxygen

Page 476: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

408 INDEX

A vector of items (dynamic array), 91jm_vector_resize1

A vector of items (dynamic array), 92jm_vector_set_item

A vector of items (dynamic array), 91jm_vector_test.c

compar_int, 340log_error, 340main, 340print_dbl, 340print_int, 340return_code, 341TESTVAL, 340VINIT_SIZE, 340

jm_vector_zeroA vector of items (dynamic array), 91

jm_voidpUtilities, 17

jm_vsnprintfHandling platform specific defines and functions, 83

Library initialization, 98FMI_IMPORT_NAME_CHECK, 99fmi1_import_parse_xml, 100fmi1_import_t, 99fmi2_import_parse_xml, 100fmi2_import_t, 99fmi_import_allocate_context, 99fmi_import_context_t, 99fmi_import_free_context, 99fmi_import_get_fmi_version, 100fmi_import_set_configuration, 100

loadfmi_import_me_test.c, 311

log_errorFMI1/jm_vector_test.c, 339jm_vector_test.c, 340

log_leveljm_callbacks, 237

logFilefmi1_logger_test.c, 304

loggerfmi1_callback_functions_t, 224fmi1_logger_test.c, 304fmi1_me_callback_functions_t, 228fmi2_callback_functions_t, 229jm_callbacks, 237

loggingOncomponent_t, 219, 222

MAGIC_TEST_VALUEfmu1_model_defines.h, 332fmu2_model_defines.h, 363

MESSAGE_SIZE_TO_EXPAND_AND_PRINTfmi1_logger_test.c, 304

MODEL_IDENTIFIER_STRfmu1_model_defines.h, 332

MODEL_IDENTIFIERfmi1_capi_cs_test.c, 291

fmi1_capi_me_test.c, 298fmu1_model_cs.c, 328fmu1_model_me.c, 335

maincompress_test_fmu_zip.c, 289FMI1/compress_test_fmu_zip.c, 289FMI1/fmi_zip_unzip_test.c, 314FMI1/fmi_zip_zip_test.c, 316FMI1/jm_vector_test.c, 339fmi1_capi_cs_test.c, 295fmi1_capi_me_test.c, 302fmi1_logger_test.c, 304fmi1_xml_parsing_test.c, 307fmi2_import_cs_test.c, 342fmi2_import_me_test.c, 343fmi2_import_xml_test.cc, 346fmi2_xml_parsing_test.c, 348fmi_import_cs_test.c, 310fmi_import_me_test.c, 311fmi_import_test.c, 370fmi_import_xml_test.c, 313fmi_total_test.c, 314fmi_zip_unzip_test.c, 315fmi_zip_zip_test.c, 317jm_vector_test.c, 340

mallocjm_callbacks, 236

mimeTypecomponent_t, 220

myloggerfmi2_import_xml_test.cc, 345fmi_import_xml_test.c, 312fmi_total_test.c, 313

N_BOOLEANfmu1_model_defines.h, 333fmu2_model_defines.h, 364

N_EVENT_INDICATORSfmu1_model_defines.h, 333fmu2_model_defines.h, 364

N_INPUT_REAL_MAX_ORDERfmu1_model_defines.h, 333fmu2_model_defines.h, 364

N_INPUT_REALfmu1_model_defines.h, 333fmu2_model_defines.h, 364

N_INTEGERfmu1_model_defines.h, 333fmu2_model_defines.h, 364

N_OUTPUT_REAL_MAX_ORDERfmu1_model_defines.h, 333fmu2_model_defines.h, 365

N_OUTPUT_REALfmu1_model_defines.h, 333fmu2_model_defines.h, 365

N_REALfmu1_model_defines.h, 333fmu2_model_defines.h, 364

N_STATES

Generated by Doxygen

Page 477: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 409

fmu1_model_defines.h, 333fmu2_model_defines.h, 364

N_STRINGfmu1_model_defines.h, 333fmu2_model_defines.h, 364

NO_LOG_EXPECTED_MSGfmi1_xml_parsing_test.c, 308

NUMBER_OF_TESTSfmi_import_me_test.c, 311

namejm_name_ID_map_t, 238jm_named_ptr, 239

name_check_test_directoryfmi1_xml_parsing_test.c, 308fmi2_xml_parsing_test.c, 348

Named objects, 78jm_named_alloc, 78jm_named_alloc_v, 79jm_named_free, 79jm_named_ptr, 78jm_named_vector_free, 79jm_named_vector_free_data, 79jm_vector_declare_template, 79

newDiscreteStatesNeededfmi2_event_info_t, 230

nextEventTimefmi1_event_info_t, 225fmi2_event_info_t, 231

nextEventTimeDefinedfmi2_event_info_t, 231

nominalsOfContinuousStatesChangedfmi2_event_info_t, 230

num_bool_varsfmi1_import_model_counts_t, 228fmi2_import_model_counts_t, 234

num_calculated_parametersfmi2_import_model_counts_t, 233

num_causality_nonefmi1_import_model_counts_t, 227

num_constantsfmi1_import_model_counts_t, 226fmi2_import_model_counts_t, 232

num_continuousfmi1_import_model_counts_t, 227fmi2_import_model_counts_t, 232

num_discretefmi1_import_model_counts_t, 226fmi2_import_model_counts_t, 232

num_enum_varsfmi1_import_model_counts_t, 227fmi2_import_model_counts_t, 234

num_fixedfmi2_import_model_counts_t, 232

num_independentfmi2_import_model_counts_t, 233

num_inputsfmi1_import_model_counts_t, 227fmi2_import_model_counts_t, 233

num_integer_varsfmi1_import_model_counts_t, 227fmi2_import_model_counts_t, 233

num_internalfmi1_import_model_counts_t, 227

num_localfmi2_import_model_counts_t, 233

num_outputsfmi1_import_model_counts_t, 227fmi2_import_model_counts_t, 233

num_parametersfmi1_import_model_counts_t, 226fmi2_import_model_counts_t, 233

num_real_varsfmi1_import_model_counts_t, 227fmi2_import_model_counts_t, 233

num_string_varsfmi1_import_model_counts_t, 228fmi2_import_model_counts_t, 234

num_tunablefmi2_import_model_counts_t, 232

output_realcomponent_t, 221, 223

PRINT_MY_DEBUGFMI1/fmi_zip_zip_test.c, 316fmi_total_test.c, 313fmi_zip_zip_test.c, 317

parser_log_expected_messagefmi1_xml_parsing_test.c, 306fmi2_xml_parsing_test.c, 347

parser_no_log_expected_messagefmi1_xml_parsing_test.c, 306

pass_name_checkfmi1_xml_parsing_test.c, 306fmi2_xml_parsing_test.c, 347

performTestxml_test_files_t, 239

print_dblFMI1/jm_vector_test.c, 339fmi2_import_xml_test.cc, 345fmi_import_xml_test.c, 312jm_vector_test.c, 340

print_intFMI1/jm_vector_test.c, 339fmi2_import_xml_test.cc, 345fmi_import_xml_test.c, 312jm_vector_test.c, 340

printCapabilitiesInfofmi2_import_xml_test.cc, 346fmi_import_xml_test.c, 312

printDependenciesInfofmi2_import_xml_test.cc, 346

printTypeInfofmi2_import_xml_test.cc, 345fmi_import_xml_test.c, 312

printVariableInfofmi2_import_xml_test.cc, 346

Generated by Doxygen

Page 478: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

410 INDEX

fmi_import_xml_test.c, 312ptr

jm_named_ptr, 239

reallocjm_callbacks, 236

realscomponent_t, 218, 221

relativeTolerancecomponent_t, 220, 222

reserveA vector of items (dynamic array), 96

return_codeFMI1/jm_vector_test.c, 339jm_vector_test.c, 341

SHOULD_LOG_EXPECTED_MSGfmi2_xml_parsing_test.c, 348

SHOULD_NOT_LOG_EXPECTED_MSGfmi2_xml_parsing_test.c, 348

STRINGIFY2fmu1_model_defines.h, 332

STRINGIFYfmu1_model_defines.h, 332

should_have_1_no_alias_varfmi1_xml_parsing_test.c, 307

should_have_no_varsfmi1_xml_parsing_test.c, 307

should_have_size_2_alias_groupfmi1_xml_parsing_test.c, 307

should_have_size_2_no_alisfmi1_xml_parsing_test.c, 307

should_have_size_3_alias_groupfmi1_xml_parsing_test.c, 307

sizeA vector of items (dynamic array), 97

size_tA vector of items (dynamic array), 96

src/Import/include/FMI/fmi_import_context.h, 241src/Import/include/FMI/fmi_import_util.h, 242src/Import/include/FMI1/fmi1_import.h, 243src/Import/include/FMI1/fmi1_import_capabilities.h, 244src/Import/include/FMI1/fmi1_import_capi.h, 245src/Import/include/FMI1/fmi1_import_convenience.h,

248src/Import/include/FMI1/fmi1_import_cosim.h, 249src/Import/include/FMI1/fmi1_import_type.h, 249src/Import/include/FMI1/fmi1_import_unit.h, 251src/Import/include/FMI1/fmi1_import_variable.h, 252src/Import/include/FMI1/fmi1_import_variable_list.←↩

h, 254src/Import/include/FMI1/fmi1_import_vendor_annotations.←↩

h, 255src/Import/include/FMI2/fmi2_import.h, 256src/Import/include/FMI2/fmi2_import_capi.h, 258src/Import/include/FMI2/fmi2_import_convenience.h,

261src/Import/include/FMI2/fmi2_import_type.h, 262src/Import/include/FMI2/fmi2_import_unit.h, 264

src/Import/include/FMI2/fmi2_import_variable.h, 265src/Import/include/FMI2/fmi2_import_variable_list.←↩

h, 267src/Util/include/FMI/fmi_util.h, 268src/Util/include/FMI/fmi_version.h, 269src/Util/include/FMI1/fmi1_enums.h, 269src/Util/include/FMI1/fmi1_functions.h, 271src/Util/include/FMI1/fmi1_types.h, 273src/Util/include/FMI2/fmi2_enums.h, 273src/Util/include/FMI2/fmi2_functions.h, 276src/Util/include/FMI2/fmi2_types.h, 278src/Util/include/FMI2/fmi2_xml_callbacks.h, 278src/Util/include/JM/jm_callbacks.h, 279src/Util/include/JM/jm_named_ptr.h, 281src/Util/include/JM/jm_portability.h, 282src/Util/include/JM/jm_stack.h, 283src/Util/include/JM/jm_string_set.h, 284src/Util/include/JM/jm_types.h, 284src/Util/include/JM/jm_vector.h, 285src/Util/include/JM/jm_vector_template.h, 287startHandle

Definition of XML callbacks struct, 70stateValueReferencesChanged

fmi1_event_info_t, 225stateValuesChanged

fmi1_event_info_t, 225states

component_t, 218, 221states_der

component_t, 218, 221states_nom

component_t, 218, 221states_prev

component_t, 220, 222states_vr

component_t, 218stepFinished

fmi1_callback_functions_t, 224fmi2_callback_functions_t, 229fmi2_import_test.c, 344

StopTimeDefinedcomponent_t, 220, 223

stringscomponent_t, 219, 222

Support for processing variable types, 140, 197fmi1_import_enumeration_typedef_t, 141fmi1_import_get_base_type, 142fmi1_import_get_enum_type_item_description,

144fmi1_import_get_enum_type_item_name, 144fmi1_import_get_enum_type_max, 144fmi1_import_get_enum_type_min, 144fmi1_import_get_enum_type_size, 144fmi1_import_get_integer_type_max, 144fmi1_import_get_integer_type_min, 144fmi1_import_get_real_type_is_relative_quantity,

144fmi1_import_get_real_type_max, 143

Generated by Doxygen

Page 479: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 411

fmi1_import_get_real_type_min, 143fmi1_import_get_real_type_nominal, 143fmi1_import_get_real_type_unit, 143fmi1_import_get_type_as_enum, 143fmi1_import_get_type_as_int, 142fmi1_import_get_type_as_real, 142fmi1_import_get_type_definition_number, 141fmi1_import_get_type_description, 142fmi1_import_get_type_display_unit, 142fmi1_import_get_type_name, 142fmi1_import_get_type_quantity, 143fmi1_import_get_typedef, 141fmi1_import_integer_typedef_t, 141fmi1_import_real_typedef_t, 141fmi1_import_type_definitions_t, 141fmi1_import_variable_typedef_t, 141fmi2_import_enumeration_typedef_t, 198fmi2_import_get_base_type, 200fmi2_import_get_enum_type_item_description,

203fmi2_import_get_enum_type_item_name, 202fmi2_import_get_enum_type_item_value, 202fmi2_import_get_enum_type_max, 202fmi2_import_get_enum_type_min, 202fmi2_import_get_enum_type_size, 202fmi2_import_get_enum_type_value_name, 203fmi2_import_get_integer_type_max, 202fmi2_import_get_integer_type_min, 201fmi2_import_get_real_type_is_relative_quantity,

201fmi2_import_get_real_type_is_unbounded, 201fmi2_import_get_real_type_max, 201fmi2_import_get_real_type_min, 201fmi2_import_get_real_type_nominal, 201fmi2_import_get_real_type_unit, 201fmi2_import_get_type_as_enum, 200fmi2_import_get_type_as_int, 200fmi2_import_get_type_as_real, 200fmi2_import_get_type_definition_number, 199fmi2_import_get_type_description, 200fmi2_import_get_type_display_unit, 199fmi2_import_get_type_name, 199fmi2_import_get_type_quantity, 200fmi2_import_get_typedef, 199fmi2_import_integer_typedef_t, 198fmi2_import_real_typedef_t, 198fmi2_import_type_definitions_t, 199fmi2_import_variable_typedef_t, 198

TESTVALFMI1/jm_vector_test.c, 338jm_vector_test.c, 340

tStartcomponent_t, 220, 222

tStopcomponent_t, 221, 223

terminateSimulationfmi1_event_info_t, 225fmi2_event_info_t, 230

Test/FMI1/compress_test_fmu_zip.c, 289Test/FMI1/fmi1_capi_cs_test.c, 290Test/FMI1/fmi1_capi_me_test.c, 296Test/FMI1/fmi1_import_test.c, 302Test/FMI1/fmi1_logger_test.c, 303Test/FMI1/fmi1_xml_parsing_test.c, 304Test/FMI1/fmi_import_cs_test.c, 308Test/FMI1/fmi_import_me_test.c, 310Test/FMI1/fmi_import_xml_test.c, 311Test/FMI1/fmi_total_test.c, 313Test/FMI1/fmi_zip_unzip_test.c, 314Test/FMI1/fmi_zip_zip_test.c, 315Test/FMI1/fmu_dummy/fmu1_model.c, 317Test/FMI1/fmu_dummy/fmu1_model.h, 324Test/FMI1/fmu_dummy/fmu1_model_cs.c, 327Test/FMI1/fmu_dummy/fmu1_model_defines.h, 331Test/FMI1/fmu_dummy/fmu1_model_me.c, 334Test/FMI1/jm_vector_test.c, 338Test/FMI2/fmi2_import_cs_test.c, 341Test/FMI2/fmi2_import_me_test.c, 342Test/FMI2/fmi2_import_test.c, 343Test/FMI2/fmi2_import_xml_test.cc, 344Test/FMI2/fmi2_xml_parsing_test.c, 346Test/FMI2/fmu_dummy/fmu2_model.c, 348Test/FMI2/fmu_dummy/fmu2_model.h, 354Test/FMI2/fmu_dummy/fmu2_model_cs.c, 359Test/FMI2/fmu_dummy/fmu2_model_defines.h, 363Test/FMI2/fmu_dummy/fmu2_model_me.c, 365Test/compress_test_fmu_zip.c, 288Test/fmi_import_test.c, 369Test/fmi_zip_unzip_test.c, 315Test/fmi_zip_zip_test.c, 316Test/jm_vector_test.c, 339test_alias_set_error_handling

fmi1_xml_parsing_test.c, 307test_cancel_step

fmi1_capi_cs_test.c, 293test_completed_integrator_step

fmi1_capi_me_test.c, 300test_create_dllfmu

fmi1_capi_cs_test.c, 292fmi1_capi_me_test.c, 298

test_deprecation_errorsfmi1_xml_parsing_test.c, 307

test_destroy_dllfmufmi1_capi_cs_test.c, 295fmi1_capi_me_test.c, 302

test_do_stepfmi1_capi_cs_test.c, 293

test_event_updatefmi1_capi_me_test.c, 300

test_fmi_get_model_types_platformfmi1_capi_me_test.c, 299

test_fmi_get_versionfmi1_capi_cs_test.c, 292fmi1_capi_me_test.c, 299

test_fmi_set_timefmi1_capi_me_test.c, 299

Generated by Doxygen

Page 480: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

412 INDEX

test_free_dllfmi1_capi_cs_test.c, 295fmi1_capi_me_test.c, 301

test_free_model_instancefmi1_capi_me_test.c, 301

test_free_slave_instancefmi1_capi_cs_test.c, 295

test_get_boolean_statusfmi1_capi_cs_test.c, 294

test_get_continuous_statesfmi1_capi_me_test.c, 300

test_get_derivativesfmi1_capi_me_test.c, 300

test_get_event_indicatorsfmi1_capi_me_test.c, 300

test_get_integer_statusfmi1_capi_cs_test.c, 293

test_get_nominal_continuous_statesfmi1_capi_me_test.c, 300

test_get_real_output_derivativesfmi1_capi_cs_test.c, 295

test_get_real_statusfmi1_capi_cs_test.c, 293

test_get_state_value_referencesfmi1_capi_me_test.c, 300

test_get_statusfmi1_capi_cs_test.c, 293

test_get_string_statusfmi1_capi_cs_test.c, 294

test_get_types_platformfmi1_capi_cs_test.c, 292

test_initializefmi1_capi_me_test.c, 299

test_initialize_slavefmi1_capi_cs_test.c, 293

test_instantiate_modelfmi1_capi_me_test.c, 299

test_instantiate_slavefmi1_capi_cs_test.c, 293

test_load_dllfmi1_capi_cs_test.c, 292fmi1_capi_me_test.c, 299

test_load_dll_fcnfmi1_capi_cs_test.c, 292fmi1_capi_me_test.c, 299

test_loggerfmi1_logger_test.c, 304

test_parsed_all_varialbesfmi2_import_me_test.c, 343

test_parserfmi1_xml_parsing_test.c, 306fmi2_xml_parsing_test.c, 347

test_parser_with_cleanupfmi1_xml_parsing_test.c, 306

test_parsing_and_fmufmi1_xml_parsing_test.c, 306

test_parsing_fail_and_fmufmi1_xml_parsing_test.c, 306

test_parsing_pass_and_fmufmi1_xml_parsing_test.c, 307

test_reset_slavefmi1_capi_cs_test.c, 294

test_set_continuous_statesfmi1_capi_me_test.c, 299

test_set_debug_loggingfmi1_capi_cs_test.c, 293fmi1_capi_me_test.c, 300

test_set_get_booleanfmi1_capi_cs_test.c, 294fmi1_capi_me_test.c, 301

test_set_get_integerfmi1_capi_cs_test.c, 294fmi1_capi_me_test.c, 301

test_set_get_realfmi1_capi_cs_test.c, 294fmi1_capi_me_test.c, 301

test_set_get_stringfmi1_capi_cs_test.c, 294fmi1_capi_me_test.c, 301

test_set_real_input_derivativesfmi1_capi_cs_test.c, 295

test_simulate_csfmi2_import_cs_test.c, 342fmi_import_cs_test.c, 309

test_simulate_mefmi2_import_me_test.c, 343fmi_import_me_test.c, 311

test_terminatefmi1_capi_me_test.c, 301

test_terminate_slavefmi1_capi_cs_test.c, 295

test_variable_naming_conventionsfmi1_xml_parsing_test.c, 307fmi2_xml_parsing_test.c, 347

test_xmlfmi_import_cs_test.c, 309

test_xml_modelDescription_cs_tcfmi_import_cs_test.c, 309

testVariableSearchfmi2_import_xml_test.cc, 345fmi_import_xml_test.c, 312

timeoutcomponent_t, 220

toleranceControlledcomponent_t, 219, 222

upcomingTimeEventfmi1_event_info_t, 225

Utilities, 16fmi_construct_dll_dir_name, 18fmi_construct_dll_file_name, 18fmi_version_1_enu, 17fmi_version_2_0_enu, 17fmi_version_enu_t, 17fmi_version_to_string, 19fmi_version_unknown_enu, 17fmi_version_unsupported_enu, 17

Generated by Doxygen

Page 481: FMI Library: part of JModelica · Contents 1 FMI Library: part of JModelica.org1 1.1 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

INDEX 413

jm_log_level_all, 18jm_log_level_debug, 18jm_log_level_enu_t, 17jm_log_level_error, 18jm_log_level_fatal, 18jm_log_level_info, 18jm_log_level_nothing, 18jm_log_level_to_string, 19jm_log_level_verbose, 18jm_log_level_warning, 18jm_name_ID_map_t, 17jm_status_enu_t, 17jm_status_error, 17jm_status_success, 17jm_status_warning, 17jm_string, 17jm_voidp, 17

Utility functions supporting interactions with the library,102

fmi_import_create_URL_from_abs_path, 103fmi_import_get_dll_path, 103fmi_import_get_model_description_path, 103fmi_import_mk_temp_dir, 102fmi_import_rmdir, 102

vA vector of items (dynamic array), 97

VAR_R_BOUNCE_CONFfmu1_model_defines.h, 332fmu2_model_defines.h, 363

VAR_R_GRATIVYfmu1_model_defines.h, 332fmu2_model_defines.h, 363

VAR_R_HIGHT_SPEEDfmu1_model_defines.h, 332fmu2_model_defines.h, 363

VAR_R_HIGHTfmu1_model_defines.h, 332fmu2_model_defines.h, 363

VAR_S_LOGGER_TESTfmu1_model_defines.h, 332fmu2_model_defines.h, 364

VINIT_SIZEFMI1/jm_vector_test.c, 338jm_vector_test.c, 340

valuesOfContinuousStatesChangedfmi2_event_info_t, 230

visiblecomponent_t, 220, 222

xml_test_filesfmi_import_cs_test.c, 310

xml_test_files_t, 239fcn, 239filename, 239performTest, 239

Generated by Doxygen