0

Which call order is correct ?

1. fmi2SetReal/Integer/Boolean/String

fmi2SetupExperiment

fmi2EnterInitializationMode

or

2. fmi2SetupExperiment

fmi2SetReal/Integer/Boolean/String

fmi2EnterInitializationMode

As per the standard:

"Before calling fmi2EnterInitializationMode function, all variables with attribute can be set with the “fmi2SetXXX” functions.fmi2SetupExperiment must be called at least once before calling fmi2EnterInitializationMode, in order that startTime is defined."

But the order is not specified.

Pseudo code in FMI standard has fmi2SetXXX followed by fmi2SetupExperiment


//communication step size

h = 0.01;

// set all variable start values (of "ScalarVariable / / start")

s1_fmi2SetReal/Integer/Boolean/String(s1, ...);

s2_fmi2SetReal/Integer/Boolean/String(s2, ...);

//Initialize slaves

s1_fmi2SetupExperiment(s1, fmi2False, 0.0, startTime, fmi2True, stopTime);

s2_fmi2SetupExperiment(s1, fmi2False, 0.0, startTime, fmi2True, stopTime);

s1_fmi2EnterInitializationMode(s1);


Which call order is correct and why ?

Thanks in advance.

1 Answers1

0

In section 3.2.3 State Machine of Calling Sequence of the FMI Standard version 2.0.1 it's stated that you are allowed to call fmi2SetSEA and fmi2SetupExperiment, where SEA is one of Real, Integer, Boolean, String for a variable with variability not equal "constant", that has initial="exact" or "approx", while in state instantiated.

So the order does not matter and both ways must be supported by every implementation of the FMI 2.0 supporting tool.

And since fmi2SetupExperiment and fmiSetSEA don't change the same data it shouldn't matter any way, as long fmi2EnterInitializationMode wasn't called.

AnHeuermann
  • 761
  • 3
  • 14