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

Programmable RS232 Tutorial


This tutorial covers applications were the equipment(data source) has a programmable RS232 port. By programming the RS232 port to output XML encoded data we can easily monitor bit and number data over time by using XMLparse.

 Station 1                                                      Server PC
------------               Client PC                          -------------
|Machine   |    RS232    ----------------                     |Apache     |
|          |----->---->--|XMLparse      |                     |PHP        |
|          |   XML data  |files(records)|   Inter/Intranet    |MySQL      |
|          |             |sync.exe      |---------------------|sync.php   |
------------             ----------------       HTTP          -------------
In this application we are monitoring the status of a machine using two PCs. One setup as a server and the other as a client. You will need full control over the client PC but you may choose to use an ISP's server or set up your own. In this example data is coming from Station 1 to the client computer on com port 1. We have programmed the machine (station 1) to output XML encoded data once every second. The client PC running XMLparse parses the data out of the XML and creates time stamped data records. At scheduled intervals the client PC sends its data records to the server to be added to the database.

Possible sources of data include:

Programmable Logic Controllers
Anything with a programmable RS232 port


Lets start by setting up our client and server computers. This includes the operating system and services we will need on each PC. To setup a Frontier Data System you will need a minim of one computer that will act as both a client and server.

Server Setup
Client Setup

Set permissions of the RS232 ports to allow use
su -
*ROOT password*
chmod 777 /dev/ttyS0
chmod 777 /dev/ttyS1


XMLparse.c is included in the FDSclient.tar package.
Compile XMLparse using this command. gcc XMLparse.c -o XMLparse.exe

Start XMLparse

See the README file in FDSclient.tar

Test the system

XMLparse Test

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