diff --git a/OMCompiler/Compiler/Template/CodegenCppInit.tpl b/OMCompiler/Compiler/Template/CodegenCppInit.tpl
index aa43299c77a..f3851195809 100644
--- a/OMCompiler/Compiler/Template/CodegenCppInit.tpl
+++ b/OMCompiler/Compiler/Template/CodegenCppInit.tpl
@@ -19,7 +19,7 @@ template modelInitXMLFile(SimCode simCode, String numRealVars, String numIntVars
let descriptionTag = if generateFMUModelDescription then "fmiModelDescription" else "ModelDescription"
let fmiDescriptionAttributes = if generateFMUModelDescription then fmiDescriptionAttributes(simCode, FMUVersion, FMUType, FMUGuid) else 'modelName="<%dotPath(modelInfo.name)%>"'
let fmiTypeDefinitions = if generateFMUModelDescription then CodegenFMUCommon.fmiTypeDefinitions(simCode, FMUVersion)
- let fmiDefaultExperiment = if generateFMUModelDescription then CodegenFMUCommon.DefaultExperiment(simulationSettingsOpt)
+ let fmiDefaultExperiment = if generateFMUModelDescription then CodegenFMUCommon.DefaultExperiment(simulationSettingsOpt, FMUVersion)
<<
diff --git a/OMCompiler/Compiler/Template/CodegenFMU1.tpl b/OMCompiler/Compiler/Template/CodegenFMU1.tpl
index 2b5bed8401c..44a6aeb19ad 100644
--- a/OMCompiler/Compiler/Template/CodegenFMU1.tpl
+++ b/OMCompiler/Compiler/Template/CodegenFMU1.tpl
@@ -64,7 +64,7 @@ case SIMCODE(__) then
>
<%fmiTypeDefinitions(simCode, "1.0")%>
- <%DefaultExperiment(simulationSettingsOpt)%>
+ <%DefaultExperiment(simulationSettingsOpt, "1.0")%>
<%fmiModelVariables(simCode, "1.0")%>
<%if isFMICSType(FMUType) then Implementation()%>
diff --git a/OMCompiler/Compiler/Template/CodegenFMU2.tpl b/OMCompiler/Compiler/Template/CodegenFMU2.tpl
index 87575d220d0..1836b1acb9e 100644
--- a/OMCompiler/Compiler/Template/CodegenFMU2.tpl
+++ b/OMCompiler/Compiler/Template/CodegenFMU2.tpl
@@ -98,7 +98,7 @@ case SIMCODE(__) then
>> %>
- <%DefaultExperiment(simulationSettingsOpt)%>
+ <%DefaultExperiment(simulationSettingsOpt, "2.0")%>
<%fmiModelVariables(simCode, "2.0")%>
<%ModelStructure(modelStructure)%>
diff --git a/OMCompiler/Compiler/Template/CodegenFMUCommon.tpl b/OMCompiler/Compiler/Template/CodegenFMUCommon.tpl
index 991c7e9d1de..6366394373c 100644
--- a/OMCompiler/Compiler/Template/CodegenFMUCommon.tpl
+++ b/OMCompiler/Compiler/Template/CodegenFMUCommon.tpl
@@ -793,21 +793,26 @@ match type_
>>
end TypeDefinitionType;
-template DefaultExperiment(Option simulationSettingsOpt)
+template DefaultExperiment(Option simulationSettingsOpt, String FMUVersion)
"Generates code for DefaultExperiment file for FMU target."
::=
match simulationSettingsOpt
case SOME(v) then
<<
- />
+ />
>>
end DefaultExperiment;
-template DefaultExperimentAttribute(SimulationSettings simulationSettings)
+template DefaultExperimentAttribute(SimulationSettings simulationSettings, String FMUVersion)
"Generates code for DefaultExperiment Attribute file for FMU target."
::=
match simulationSettings
case SIMULATION_SETTINGS(__) then
+ if isFMIVersion20(FMUVersion) then
+ <<
+ startTime="<%startTime%>" stopTime="<%stopTime%>" tolerance="<%tolerance%>" stepSize="<%stepSize%>"
+ >>
+ else
<<
startTime="<%startTime%>" stopTime="<%stopTime%>" tolerance="<%tolerance%>"
>>
diff --git a/testsuite/omsimulator/Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.mos b/testsuite/omsimulator/Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.mos
index fe6195b4bfc..439cf57521d 100644
--- a/testsuite/omsimulator/Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.mos
+++ b/testsuite/omsimulator/Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.mos
@@ -14,12 +14,12 @@ readFile("Pendulum_systemCall.log");
// "Modelica.Mechanics.MultiBody.Examples.Elementary.Pendulum.fmu"
// ""
// 0
-// "info: maximum step size for 'model.root': 0.010000
+// "info: maximum step size for 'model.root': 0.002000
// info: Result file: model_res.mat (bufferSize=10)
// info: Parameter model.root.fmu.world.label1 will not be stored in the result file, because the signal type is not supported
// info: Parameter model.root.fmu.world.label2 will not be stored in the result file, because the signal type is not supported
// info: Final Statistics for 'model.root':
-// NumSteps = 523 NumRhsEvals = 533 NumLinSolvSetups = 36
-// NumNonlinSolvIters = 532 NumNonlinSolvConvFails = 0 NumErrTestFails = 1
+// NumSteps = 2511 NumRhsEvals = 2517 NumLinSolvSetups = 134
+// NumNonlinSolvIters = 2516 NumNonlinSolvConvFails = 0 NumErrTestFails = 1
// "
// endResult
diff --git a/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/exposeLocalIOs.mos b/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/exposeLocalIOs.mos
index c1a088438c1..e4fd2d2c955 100644
--- a/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/exposeLocalIOs.mos
+++ b/testsuite/openmodelica/cppruntime/fmu/modelExchange/2.0/exposeLocalIOs.mos
@@ -120,7 +120,7 @@ readFile("modelDescription.tmp.xml");
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
// fmi_attributes_21_tmp.xml"); getErrorString();
+
+system("sed -n \"/ fmi_attributes_21.xml"); getErrorString();
+readFile("fmi_attributes_21.xml"); getErrorString();
+
+
+// Result:
+// true
+// ""
+// "fmi_attributes_21.fmu"
+// ""
+// 0
+// ""
+// 0
+// ""
+// "
+// "
+// ""
+// endResult
diff --git a/testsuite/openmodelica/fmi/ModelExchange/2.0/testBug2764.mos b/testsuite/openmodelica/fmi/ModelExchange/2.0/testBug2764.mos
index 6586c888151..000ebb75d8d 100644
--- a/testsuite/openmodelica/fmi/ModelExchange/2.0/testBug2764.mos
+++ b/testsuite/openmodelica/fmi/ModelExchange/2.0/testBug2764.mos
@@ -129,7 +129,7 @@ readFile("modelDescription.tmp.xml");
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
//
//
//
-//
+//
//
//
//