XML for Embedded System Command, Control, Communication, and Information


Extensible Markup Language (XML) is a world standard for intercommunication of data.  This paper describes an implementation for using XML to control and monitor an embedded system. Figure 1 presents the notional architecture for using XML as the basis for the command and data subsystem for an embedded system.  This architecture was implemented as part of the AcuGuide CT™ robotic surgical assistant.




Both the embedded controller and the remote system utilize the Xerces XML parser (www.apache.org) to parse the XML data stream.  One XML schema is used containing two “root” nodes: Command and Data. XML commands and data are transmitted via standard sockets in the implemented system.  Custom action methods are installed to perform application-specific functions.  A separate process (or thread) on the embedded controller sends “changes only” updates of the System State Data to the remote system, where a thread parses this data stream and updates the remote copy of the System State Data.  The remote system includes a GUI for generating commands and displaying data.





Figure 1 – XML Command and Control Architecture


Implementation Overview


The embedded controller architecture described above was implemented on standard industrial PC hardware using Microsoft Windows XP Professional as the primary OS with the VenturCom RTX real-time extension OS for real-time functionality.  The “client” (Remote System) software was demonstrated on Windows 2000 as well as Windows XP.


The modifications to the Xerces public release to mechanize the socket interface took about 120 hours.  Development tools included XMLSpy™ (www.altova.com), Microsoft Visual Studio 6.0 (www.microsoft.com), and Borland JBuilder 9.0 (www.borland.com).


The XML schema definition was facilitated by the use of code generation technology developed by 4C Consulting.




The text-based Command and Control interface allows different implementations to operate the embedded controller.  For example, the implemented system included a remote command-line interface for issuing commands to the embedded controller.  Another remote system implementation used Java to parse the data. 




  1. Because XML is a “document-level” definition, an “incremental parse” Xerces implementation is required. 
  2. To ensure timely operation, the socket write interface must “flush” after issuing each command and at the end of a data transfer operation.  A cycle counter was used to detect network faults and timeouts.
  3. Conversion of binary data to/from text takes a significant amount of CPU time.
  4. The text-based data definition requires significantly more network bandwidth than a binary packet scheme.
  5. The low-level socket implementation required customization of the Xerces 2.2 software release.




The XML Command and Control Architecture described here enabled the rapid implementation of a remote control interface for an embedded controller.  This standards-based architecture is appropriated for low-bandwidth embedded systems not requiring hard-real-time response times.


Copyright© 2004 Gilbert T. Williams/4C Consulting. All Rights Reserved.  Please send questions/comments to bert@gtw4c.com.