Connecting Tech Pros Worldwide Forums | Help | Site Map

Inputing data to web page via com port

Claus Mygind's Avatar
Familiar Sight
 
Join Date: Mar 2008
Posts: 173
#1: 2 Weeks Ago
At our lab we use several scales for weighing material. These scales have cables that can be connected to the computer's com port. They use standard RS-232 cables. They transmit in standard ASCII.

We want to capture the weight electronically rather than having to input the data manually.

Is there a way I can put that data into an <input> element on my HTML page?

Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#2: 2 Weeks Ago

re: Inputing data to web page via com port


Yes, write a handler program (in C++ or a .NET language or any standalone language of your choice) that handles the Serial port communication.
Give it a simple web interface, then you can use the XMLHttpRequest to make calls to it.
This assumes that the security settings for XMLHttpRequest allow you to make calls to the location of the software
Claus Mygind's Avatar
Familiar Sight
 
Join Date: Mar 2008
Posts: 173
#3: 2 Weeks Ago

re: Inputing data to web page via com port


So what you are saying is I need to install a stand alone program on the client machine which reads the com port and then feeds the data to the HTML page in the browser.

There is no other way for an web page in a browser to receive input other than from the keyboard or the mouse?
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,664
#4: 2 Weeks Ago

re: Inputing data to web page via com port


Quote:

Originally Posted by Claus Mygind View Post

There is no other way for an web page in a browser to receive input other than from the keyboard or the mouse?

asked the other way round, why should a web page receive other input than keyboard and mouse?
Claus Mygind's Avatar
Familiar Sight
 
Join Date: Mar 2008
Posts: 173
#5: 2 Weeks Ago

re: Inputing data to web page via com port


Thank you for the restatement. In this case I have an alternate input device, in this case the scale.

From other research I am doing now, it appears that a stand alone app must receive the data and then send it to the HTML page or alternately I could send it to excel and use excel to transmit the data to my web server.
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,161
#6: 2 Weeks Ago

re: Inputing data to web page via com port


I guess the main point was something other then html/javascript will need to be used to communicate via the serial port.
It possible that a java applet or even a flash object(maybe?) could be granted the abilities to talk to the serial port, but I am unaware of the security settings and implications of doing so.
Claus Mygind's Avatar
Familiar Sight
 
Join Date: Mar 2008
Posts: 173
#7: 2 Weeks Ago

re: Inputing data to web page via com port


Yes I have now learned that thanks to your original post. I am working on some ideas or I may just purchase a program for that purpose.


Thanks again for your feedback
Reply