In the API fmi3GetBinary (in fmi3Functions.c ) this piece of code is missing.
if (S->isDirtyValues) {
CALL(calculateValues(S));
S->isDirtyValues = false;
}
Also in
fmi3SetBinary
you need to add this line:
if (nValueReferences > 0) S->isDirtyValues = true;