fmuStruct.callbacks.logger = fmuLogger;\r
fmuStruct.callbacks.allocateMemory = calloc;\r
fmuStruct.callbacks.freeMemory = free;\r
- fmu.instantiateModel(getModelIdentifier(fmu.modelDescription), fmuStruct.guid, fmuStruct.callbacks, fmiFalse);\r
fmuStruct.c = fmu.instantiateModel(getModelIdentifier(fmu.modelDescription), fmuStruct.guid, fmuStruct.callbacks, fmiFalse);\r
if (!fmuStruct.c) return throwException(env, "could not instantiate model");\r
\r
fmiFlag = fmu.setTime(fmuStruct.c, fmuStruct.currentTime);\r
if (fmiFlag > fmiWarning) throwException(env, "could not set time");\r
\r
- vr = getReference(fmuStruct, "time");\r
- if(vr != NULL) {\r
- fmu.setReal(fmuStruct.c, &vr, 1, &(fmuStruct.currentTime));\r
+ if(referenceExists(fmuStruct, "time")) {\r
+ vr = getReference(fmuStruct, "time");\r
+ if(vr != NULL) {\r
+ fmu.setReal(fmuStruct.c, &vr, 1, &(fmuStruct.currentTime));\r
+ }\r
}\r
\r
if(debug)\r
printf("Actual time: %lf\n", fmuStruct.currentTime);\r
- \r
+\r
if (fmiFlag > fmiWarning) \r
return throwException(env, "could not set time");\r
\r