V 10
1
LANG:1 8 (NoName)
PANEL,334 68 738 400 N "_3DFace" 0
EEE E E 1 -1 -1 0  -1 -1
"" 0 1
EE 2
"CBRef""1"
"EClose"E
""
DISPLAY_LAYER, 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
LAYER, 0 
1
LANG:1 6 Layer1
13 0
"Button1"
""
1 170 130 E E E 1 E 1 E N "_3DText" E N "_3DFace" E E
 E E
1 0 0 0 0 0
EE E
0
1
LANG:1 0 
0
1
LANG:1 119 -microsoft windows-Courier New-normal-r-normal-*-*-110-100-100-*-*-iso8859-1|-12,0,0,0,400,0,0,0,0,3,2,1,49,Courier New
0 ""
168 128 462 172
T 
1
LANG:1 7 Button1
"main()
{
   string logFilePath, logFileName;
   time startTime, endtime;
   
   setTime(startTime,2003,11,24);
   setTime(startTime,2003,11,25);
   logFilePath = getPath(LOG_REL_PATH);
   logFileName = \"archivedData_log.txt\";
   
   getArchivedData(logFilePath+logFileName, startTime, endtime);
}

getArchivedData(string logFileName, time startTime, time endtime)
{
   int i, err;
   dyn_int evt;
   dyn_float buffer_pressure_data, buffer_temperature_data;
   dyn_time buffer_pressure_time, buffer_temperature_time;
   file log_file;
 
   //get archived data
   dpGetPeriod(startTime, endtime, -1, //1) Buffer Pressure
   									   \"Cooling:Buffer.Pressure:_original.._value\", 
				                        buffer_pressure_data, buffer_pressure_time, evt,
				                        //2) Buffer Temperature
				                       \"Cooling:Buffer.Temperature:_original.._value\", 
				                        buffer_temperature_data, buffer_temperature_time);
   if(dynlen(buffer_pressure_data)==0)
     {
     	DebugN(\"=========== no buffer pressure data archived, try to start the archive \");
     }
   if(dynlen(buffer_temperature_data)==0)
     {
        DebugN(\"=========== no buffer temperature data archived, try to start the archive \");
     }
   //2) Buffer Temperature
   //dpGetPeriod(startTime, endtime, -1, \"Cooling:Buffer.Temperature:_original.._value\", 
				                          // buffer_temperature_data, buffer_temperature_time, evt);
	
   for(i=1; i<=dynlen(buffer_temperature_time);	i++)
      {		                           
   		 DebugN(\"==================== buffer_temperature_time = \", buffer_temperature_data[i]);
   		 DebugN(\"==================== buffer_pressure_time = \", buffer_pressure_data[i]);
   	  }

   //open archived data log file (for writitng)
   log_file = fopen(logFileName, \"w\"); 
   err=ferror(log_file);
   if(err != 0) DebugN(\"======== Error no. \", err, \" occurred\");
   
   //write columns title line
   fprintf(log_file,   \"Data Change Time             Buffer Temperature           Buffer Pressure\");
   
   //write archive data to the log file
   for(i=1; i<=dynlen(buffer_temperature_time);	i++)
   {
      fprintf(log_file, \"%s      %f      %f\",
                        buffer_temperature_time[i], buffer_temperature_data[i], buffer_pressure_data[i]);
   }

 
   fclose(log_file); // close file
 

}" 0
 E E E
0
LAYER, 1 
1
LANG:1 6 Layer2
0
LAYER, 2 
1
LANG:1 6 Layer3
0
LAYER, 3 
1
LANG:1 6 Layer4
0
LAYER, 4 
1
LANG:1 6 Layer5
0
LAYER, 5 
1
LANG:1 6 Layer6
0
LAYER, 6 
1
LANG:1 6 Layer7
0
LAYER, 7 
1
LANG:1 6 Layer8
0
0