You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constchar*guid="{19751346-37ce-4422-86bf-bd1609f0d579}"; // global unique id of the fmu
2043
-
fmi2Componentc; // instance of the fmu
2044
-
//fmi2Status fmiFlag; // return code of the fmu functions
2045
-
constchar*fmuResourceLocation="file:///D:\\proj\\lbnl\\eplustofmu\\_fmu_export_schedule"; // path to the unzipped fmu location as URL
2046
-
constchar*modelDescriptionPath="file:///D:\\proj\\lbnl\\eplustofmu\\_fmu_export_schedule\\modelDescription.xml"; // path to the unzipped fmu location as URL
2047
-
constchar*mimeType="application/x-fmu-sharedlibrary"; // denotes tool in case of tool coupling
2048
-
fmi2Realtimeout=1000; // wait period in milli seconds, 0 for unlimited wait period"
2049
-
fmi2Booleanvisible=fmi2False; // no simulator user interface
2050
-
fmi2Booleaninteractive=fmi2False; // simulation run without user interaction
2051
-
fmi2CallbackFunctionscallbacks= {fmuLogger, calloc, free, NULL, NULL}; // called by the model during simulation
2052
-
ModelDescription*md; // handle to the parsed XML file
2053
-
fmi2StringinstanceName; // instance name of the FMU
2054
-
intnSteps=0;
2055
-
intloggingOn=0;
2056
-
intretVal;
2057
-
//FILE* file;
2058
-
constfmi2ValueReferencevalRefIn[]={1};
2059
-
constfmi2ValueReferencevalRefOut[]={100001};
2060
-
fmi2RealvalIn[1]={50000};
2061
-
fmi2RealvalOut[1];
2062
-
char*fmiVersionStr;
2063
-
Element*defaultExp;
2064
-
fmi2Statusfmi2Flag; // return code of the fmu functions
2065
-
fmi2BooleantoleranceDefined=fmi2False; // true if model description define tolerance
2066
-
//int nCategories;
2067
-
//char **categories;
2068
-
fmi2Realtolerance=0; // used in setting up the experiment
printf("This is the fmi version %s\n", fmiVersionStr);
2125
-
while (time<tStop) {
2126
-
// set the inputs
2127
-
retVal=fmi2SetReal(c, valRefIn, 1, valIn);
2128
-
// do step
2129
-
retVal=fmi2DoStep(c, time, 900, 1);
2130
-
// get the outputs
2131
-
retVal=fmi2GetReal(c, valRefOut, 1, valOut);
2132
-
printf ("This is the value of output %f\n", valOut);
2133
-
time=time+900;
2134
-
}
2135
-
// terminate the FMU
2136
-
retVal=fmi2Terminate(c);
2137
-
// free te FMU
2138
-
fmi2FreeInstance(c);
2139
-
printf ("Simulation successfully terminated\n");
2140
-
}
2060
+
//void main(){
2061
+
// double time;
2062
+
// double tStart=0; // start time
2063
+
// double tStop=86400; // start time
2064
+
// const char* guid="{19751346-37ce-4422-86bf-bd1609f0d579}"; // global unique id of the fmu
2065
+
// fmi2Component c; // instance of the fmu
2066
+
// //fmi2Status fmiFlag; // return code of the fmu functions
2067
+
// const char* fmuResourceLocation ="file:///D:\\proj\\lbnl\\eplustofmu\\_fmu_export_schedule"; // path to the unzipped fmu location as URL
2068
+
// const char* modelDescriptionPath = "file:///D:\\proj\\lbnl\\eplustofmu\\_fmu_export_schedule\\modelDescription.xml"; // path to the unzipped fmu location as URL
2069
+
// const char* mimeType="application/x-fmu-sharedlibrary"; // denotes tool in case of tool coupling
2070
+
// fmi2Real timeout=1000; // wait period in milli seconds, 0 for unlimited wait period"
2071
+
// fmi2Boolean visible=fmi2False; // no simulator user interface
2072
+
// fmi2Boolean interactive=fmi2False; // simulation run without user interaction
2073
+
// fmi2CallbackFunctions callbacks= {fmuLogger, calloc, free, NULL, NULL}; // called by the model during simulation
2074
+
// ModelDescription* md; // handle to the parsed XML file
2075
+
// fmi2String instanceName; // instance name of the FMU
2076
+
// int nSteps=0;
2077
+
// int loggingOn=0;
2078
+
// int retVal;
2079
+
// //FILE* file;
2080
+
// const fmi2ValueReference valRefIn[]={1};
2081
+
// const fmi2ValueReference valRefOut[]={100001};
2082
+
// fmi2Real valIn[1]={50000};
2083
+
// fmi2Real valOut[1];
2084
+
// char* fmiVersionStr;
2085
+
// Element *defaultExp;
2086
+
// fmi2Status fmi2Flag; // return code of the fmu functions
2087
+
// fmi2Boolean toleranceDefined = fmi2False; // true if model description define tolerance
2088
+
// //int nCategories;
2089
+
// //char **categories;
2090
+
// fmi2Real tolerance = 0; // used in setting up the experiment
0 commit comments