Download Previous Project Report

Transcript
In order to communicate with the data logger we used the Onset remote monitoring software to
setup an auto readout schedule. This automatically queries the data logger for the weather data every
20 seconds and stores this data in an XML file. Once the data is in XML format we used a Java program
to parse the information and store it in our mySQL database. The pseudo code for this program is the
following:
while(true){
open the Xml file;
Read last sensor entry;
Check to see if the last entry is the same timestamp as the new entry
if(new entry Date!=old entry Date){
insert data into mySQL database;
new entry Date= old entry Date;
}
close the XML file;
}//End Pseudo code
As you can see this from the pseudo code this program runs in a loop. Each pass through the loop the
program opens the XML file and read in the last sensor entry. If this entry is not the same as the last
entry read in by the program then it enters the information into the mySQL database. Then the program
closes the XML file and repeats itself.
3