Hello,

I use Revision r9248 on a 64-bit fedora linux.

There is an error if I want to access real values (with high
indices, maybe the last one in modelDescription.xml) from a fmu.


I got the following code in den XYZ_FMU.c:

// define model size
#define NUMBER_OF_STATES 18
#define NUMBER_OF_EVENT_INDICATORS 36
#define NUMBER_OF_REALS 2861
#define NUMBER_OF_INTEGERS 0
#define NUMBER_OF_STRINGS 0
#define NUMBER_OF_BOOLEANS 0
#define NUMBER_OF_EXTERNALFUNCTIONS 0


The last entry of modelDescription.xml is:

  <ScalarVariable
    name="p_arm3_aussen.sarturis_position_out_mat[3,3]"
    valueReference="2878"
    variability="continuous"
    causality="internal"
    alias="alias">
    <Real   />
  </ScalarVariable>


As you see the value reference is 2878, which means there
are 2879 values in my model (zero based). This is exactly
the NUMBER_OF_STATES + NUMBER_OF_REALS.


In /usr/include/omc/fmu_model_interface.c there is following
code (line 567)

    if (vrOutOfRange(comp, "fmiGetReal", vr[i], NUMBER_OF_REALS))
      return fmiError;

Which means that one can never access scalar variables with a
valueReference greater than NUMBER_OF_REALS. As I understand
both states and depending real values are threated as
scalar variables in fmu without distinction. 


Timo


Reply via email to