SourceForge.net Logo

Home- Data Collection- Data Mining- GPL Software- Services- FAQ- Tips


XMLparse

XMLparse is designed to be a universal software interface to monitor data over time. In situations where your are monitoring a device that has a programmable RS232 port, data can be encoded in XML and easily monitored using XMLparse. By sending a stream of XML data every second, changes in the data can be identified and recorded. XMLparse creates a time stamped record for each bit and number change.

Example
Station 0 has 48 monitored bits and 2 monitored numbers.
Station 0 bit status
47      40   39      32   31      24  23      16   15      8     7      0
 00000010     00101000     00000010    01000000     10000000     00000100

Station 0 number values
 1      0
503   32000
Once per second station 0 sends a stream of XML encoded data to our client computer running XMLparse. See XML Encoded Data for details.
*<w,0,2>552</w,0,2><w,0,1>576</w,0,1><w,0,0>32771</w,0,0>
<n,0,0>3200</n,0,0><n,0,1>502</n,0,1>$
Initially, XMLparse creates a record for each bit and number that is included in the XML data stream.
b 19900901231729 000 240 1         //  Start of communication
b 19900901231729 000 000 0
b 19900901231729 000 001 0
b 19900901231729 000 002 1
b 19900901231729 000 003 0
b 19900901231729 000 004 0
b 19900901231729 000 005 0
b 19900901231729 000 006 0
b 19900901231729 000 007 0
b 19900901231729 000 008 0
b 19900901231729 000 009 0
b 19900901231729 000 010 0
b 19900901231729 000 011 0
b 19900901231729 000 012 0
b 19900901231729 000 013 0
b 19900901231729 000 014 0
b 19900901231729 000 015 1
b 19900901231729 000 016 0
b 19900901231729 000 017 0
b 19900901231729 000 018 0
b 19900901231729 000 019 0
b 19900901231729 000 020 0
b 19900901231729 000 021 0
b 19900901231729 000 022 1
b 19900901231729 000 023 0
b 19900901231729 000 024 0
b 19900901231729 000 025 1
b 19900901231729 000 026 0
b 19900901231729 000 027 0
b 19900901231729 000 028 0
b 19900901231729 000 029 0
b 19900901231729 000 030 0
b 19900901231729 000 031 0
b 19900901231729 000 032 0
b 19900901231729 000 033 0
b 19900901231729 000 034 0
b 19900901231729 000 035 1
b 19900901231729 000 036 0
b 19900901231729 000 037 1
b 19900901231729 000 038 0
b 19900901231729 000 039 0
b 19900901231729 000 040 0
b 19900901231729 000 041 1
b 19900901231729 000 042 0
b 19900901231729 000 043 0
b 19900901231729 000 044 0
b 19900901231729 000 045 0
b 19900901231729 000 046 0
b 19900901231729 000 047 0
n 19900901231729 000 000 32000
n 19900901231729 000 001 503
The format of the records is
Type       Time Stamp      Station    Element    Value
(b) bit      yyyymmddhhmmss  000/255    000/255    0/1
(n) number   yyyymmddhhmmss  000/255    000/255    -3.4E+38 to 3.4E+38
If the data stream does not change there will be no additional data records produced. If the XML stream changes to
$<w,0,2>552</w,0,2><w,0,1>576</w,0,1><w,0,0>32772</w,0,0>
<n,0,0>3200</n,0,0><n,0,1>503</n,0,1>*
XMLparse will create 4 records
b 19900901231029 000 000 0
b 19900901231029 000 001 0
b 19900901231029 000 002 1
n 19900901231029 000 001 503
If the stream has not been received for 5 seconds XMLparse will create a record to show loss of communication to the station.

b 19900901231129 000 240 0         // Loss of communication

When the stream is started again it will produce a start of communication record and a new record for each bit and number being monitored.
Records are stored as individual text files. In the case of bit and number records all of the data can be stored in the file name. Future data types may use the body of the file. Each record is also appended to data_bit.txt of data_number.txt safe keeping and troubleshooting. The data in data_bit.txt and data_number.txt is seperated with tabs and can be easily dumped into mysql.
mysql> LOAD DATA LOCAL INFILE "data_bit.txt" INTO TABLE data_bit;


Home- Data Collection- Data Mining- GPL Software- Services- FAQ- Tips

SourceForge.net Logo

http://sourceforge.net/projects/frontiertech/