diff --git a/LastLib/Resources/Last.fmu b/LastLib/Resources/Last.fmu index 4a6184c..35491ae 100644 Binary files a/LastLib/Resources/Last.fmu and b/LastLib/Resources/Last.fmu differ diff --git a/LastLib/Resources/binaries/linux64/Last.so b/LastLib/Resources/binaries/linux64/Last.so index 5393b92..f5281f6 100644 Binary files a/LastLib/Resources/binaries/linux64/Last.so and b/LastLib/Resources/binaries/linux64/Last.so differ diff --git a/LastLib/Resources/binaries/win32/Last.dll b/LastLib/Resources/binaries/win32/Last.dll index 64107a0..a035879 100644 Binary files a/LastLib/Resources/binaries/win32/Last.dll and b/LastLib/Resources/binaries/win32/Last.dll differ diff --git a/LastLib/Resources/binaries/win64/Last.dll b/LastLib/Resources/binaries/win64/Last.dll index 3d056c6..a81615f 100644 Binary files a/LastLib/Resources/binaries/win64/Last.dll and b/LastLib/Resources/binaries/win64/Last.dll differ diff --git a/LastLib/Resources/sources/fmuTemplate.c b/LastLib/Resources/sources/fmuTemplate.c index 898cb7c..8745529 100644 --- a/LastLib/Resources/sources/fmuTemplate.c +++ b/LastLib/Resources/sources/fmuTemplate.c @@ -71,8 +71,8 @@ static fmiBoolean invalidState(ModelInstance* comp, const char* f, int statesExp comp->state = modelError; comp->functions.logger(comp, comp->instanceName, fmiError, "error", "%s: Illegal call sequence.", f); - if (comp->state < 1<<4) { - comp->functions.logger(comp, comp->instanceName, fmiError, "error", + if (comp->loggingOn && comp->state < 1<<4) { + comp->functions.logger(comp, comp->instanceName, fmiOK, "log", "%s must not be called in FMU state %s. " "Expected FMU state(s): %s.", f, stateNames[state], stateNames[statesExpected]); } @@ -187,7 +187,7 @@ static fmiStatus init(char* fname, fmiComponent c, fmiBoolean toleranceControlle // fname is fmiTerminate or fmiTerminateSlave static fmiStatus terminate(char* fname, fmiComponent c){ ModelInstance* comp = (ModelInstance *)c; - if (invalidState(comp, fname, modelInitialized)) + if (invalidState(comp, fname, modelInitialized|modelError)) return fmiError; if (comp->loggingOn) comp->functions.logger(c, comp->instanceName, fmiOK, "log", fname); comp->state = modelTerminated;