modelon-community / fmi-library

C library for importing FMUs
Other
116 stars 34 forks source link

Which FMI2 API return "variability" value from modeldescription.xml #151

Closed SudeepGhoshIN closed 3 weeks ago

SudeepGhoshIN commented 3 weeks ago

Hi Team, We want to featch the value of "variability" from modeldescription.xml Can you let me know through which api I can get the value whether its fixed or not ?

fmi2_import_variable_t var = fmi2_import_get_variable(varList, i); baseType = fmi2_import_get_variable_base_type(var); VariableType = fmi2_base_type_to_string(baseType); if (VariableType == "Real") { fmi2_import_real_variable_t rv = fmi2_import_get_variable_as_real(var);
fmi2_real_t StartValue = fmi2_import_get_real_variable_start(rv);
}

    <ScalarVariable
      name           = "TAmb"
      valueReference = "15"
      description    = "TAmb"
      causality      = "parameter"
      variability    = "fixed" >
      <Real 
        unit     = "K"
        start    = "2.93150000000000000e+02"/>
    </ScalarVariable>
    <ScalarVariable
      name           = "TDif"
      valueReference = "16"
      description    = "TDif"
      causality      = "parameter"
      variability    = "fixed" >
      <Real 
        unit     = "K"
        start    = "2.00000000000000000e+00"/>
    </ScalarVariable>