RS-232 to Web page


Thread Starter


As a school project, I have a system that measures water in a remote tank and displays the
information on a webpage on the internet. I want to display the information coming from a RS-232 cable to the webpage. I know that RS-232 cable is plug to the back of the computer. But how do I transfer the information over to display the contents coming from the cable?

Bruno Tijink

Please give some more info(or mail me directly esp the way you measure.
time: every minute/hour
signal: what signal does come in, you only can use digital programming language

[email protected]
you have to find out what format/protocol is the data coming in to your computer. Find out how does the senor work and how you get the data to the computer. (it may have software that dumps the data into a text file if so you have 1/2 the battle done) if no software was available with the sensor, you have to find out the format and then build a protocol that will take the data and pass it off to your webserver, probably the least expensive way would be to download a demo version of OmniServer.

That's a software that enables you to read data from different sensors and then pass them off to other software, or store them in a file. Best way would be to ask the OmniServer people to help you to write the protocol. It is fairly easy but takes some getting used to, so get the guys at OmniServer to help you out.

Once you have the data coming in to your computer as text (being written into a text file) you can make a webpage that takes the input from this text file and refreshes every (say) 20 seconds. That way you will have always displayed the most recent data.

What sensor are you using to read in the RS232 data?

Download OmniServer from "":

Good luck

Raymond van der Tas

<P>In order to publish RS232 data on a web page there are at least two ways:</P>

<P>1) Write an ASP (active server page) script which instantiates the MS-Comm Control. ASP is supported after installing Microsoft IIS web services. A few lines of example code to get you started:</P>

Dim mycomm
Dim myString

Set mycomm = Server.CreateObject("MSCOMMLib.MSComm.1")
myString = mycomm.Settings
response.write "Comm Settings" & myString

<P>You should enhance the code a bit to call methods in the comm control and read/write the serial data stream. To try this, you could probably best code in Visual Basic (the online help will guide you through the use of the Comm control). Afterwards you can port your code to ASP (VB Script/Java Script).</P>

<P>2) A less time consuming method which requires no programming at all, would be to use ICONICS GENESIS/WebHMI SCADA/HMI you would first install an OPC Server that talks to the devices. You will create a little process display and place the OPC Tag on it:
An "Export HTML" button would automatically post the display to the Web Server.
Remote web clients IE /Netscape are now able to browse your web site and see the live data. To try this you should ask for the free SCADA/WebhMI Development CD at <a href=""></a></P>
Write one application that will read the data from the serial port and log it into a small data base, or similar. Use scripting on your webpage to pull the data back out.


Write a jave applet that reads the port, and embed it into your webpage.

--Joe Jansen

Israel Cabrera G.

All you guys are complexing things too much.

First of all,, Get a LINUX PC!!!

I suggest SuSE 7.3 or higher, 8.0 is coming

With a linux machine you can write your own code to communicate with the rs-232 port, and if a protocol exist, use it, write it down to communicate with the device.

As your info is very incomplete, I'm imagining
that you have a uController to obtain data from the water tank connected to the PC.

Secondly, Install the "Apache Server with PHP support" it will allow you to write some nice code to display your data via a Web page almost instantly (real time?)!!

if you need more HELP!???

write me at: [email protected]

Israel C.