YV&C Current Issue
![]() View the Magazine
|
YV&C Recommended Yacht Charter Links
Industry Commentary Monitoring Air Pollution in Real Time Using XML - A reliable and cost-effective open source solution
Monitoring Air Pollution in Real Time Using XML - A reliable and cost-effective open source solution
Jan. 7, 2004 12:00 AM
A few years ago there was no indication that XML could play an important role in computer-based process control. However, fast development and the spread of XML to different fields, and emerging trends in the field of automation, have changed the situation tremendously. Several factors support the application of XML in this field:
After user analysis and discussions with the client, the Cantonal Environmental Protection Agency at Tuzla, the decision was made not to use the routine solution to the problem, the SCADA (supervisory control and data acquisition) system. The main arguments for this decision were that the SCADA system has a multi-dimension structure, and several features would be not used in this application. In addition, the price for SCADA would be significantly higher and developing the SCADA application would take longer than developing a solution using open source resources. Another advantage of this approach is that it's easier to make custom-designed applications than to work with SCADA, which isn't so flexible. Several measurement stations collect air quality data, which must be processed and stored in local systems and sent to the central computer where it is processed and stored in a database. If alarm messages are sent, the corresponding activity is performed. The data stored in the archive can be analyzed and shown to users - clients on the intranet who can demand different reports that are available for different times from different locations. In this system there are several points where XML technologies can be used to improve efficiency. Here are some possibilities:
After discussion with the client, the Cantonal Environment Protection Agency, the following solution was developed. Data from each station's measurement devices is sent to an OPTO 22 PLC (programmable logical controller) system. The OPTO 22 generates XML text string messages. This is an advantage compared to the other PLC systems, which generate messages as streams of bits. XML documents travel over phone lines to a central computer. An application program uses XSLT to generate new XML documents in a more suitable form. The central computer parses these XML documents for data analysis using JDOM. JDOM is, quite simply, a tool that creates a Java representation of an XML document. JDOM provides a way to represent that document for easy and efficient reading, manipulation, and writing. It has a straightforward API, is lightweight and fast, and is optimized for the Java programmer. It's an alternative to DOM and SAX, although it integrates well with both. JDOM generates and sends new XML documents to the database where the data is stored and to the Java Message Service (JMS). The JMS API improves programmer productivity by defining a common set of messaging concepts and programming strategies that will be supported by all JMS technology-compliant messaging systems where the type publish is used. The central computer, JBoss server (intranet), connects clients. Users on the client select different applications generated from the XML document sent from the server. The screen generation process consists of the following steps:
The XML document that presents the status of devices at different measurement stations is transformed by the XSLT document for further processing; part of it is shown in Listing 2. This XSLT document generates the XML shown in Listing 3, which is used in further processing. This transformation is realized from a Java application and JDOM; a part of it is shown in Listing 4. The new XML document is sent to the Web server using JMS; the Web server is realized under JBoss. In the application layer, the XML document is parsed and analyzed. Depending on the incoming data, different actions can be triggered. For example, if the SO2 concentration is higher than acceptable, an alarm is generated. On the application level, JDOM navigates and modifies the XML document. Data extracted from the XML document is saved in MySQL using JDBC. Data, rather than the entire XML document, is saved so it can be analyzed later in the context of a different application. JDOM generates new XML that is sent to other clients, as shown in Listing 5. Users on clients select different applications by clicking on different icons on the map. Applications are generated using XSLT stylesheets to transform XML documents sent by the Web server, in the SVG document. Listing 6 shows part of a typical XSLT stylesheet that dynamically generates corresponding SVG documents. The user interface is Java, and the Batik library supports drawing the SVG documents onscreen. The following classes are imported from the Batik, DOM, and SVG libraries.
import org.apache.batik.swing.JSVGCanvas; Running Java code generates Figures 2 and 3.
Conclusion Our approach has several advantages:
We think that the approach described in this article will be used in the future in systems that have a large collection of data that has to be processed and shown on an intranet. One example of a potential application is the development of an intranet-based information system for a distributed electricity production system.
Resources
...
Acknowledgements: The authors would like to thank Artes Group, Jure Londrandt, Damijan Onisak and Slavko Sadl. Reader Feedback: Page 1 of 1
YV&C Recommended Yacht Charter Links
|
Most Popular Most Watched Today |
|||||||||||||||||||||||||