Inputing data to web page via com port

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Claus Mygind
    Contributor
    • Mar 2008
    • 571

    Inputing data to web page via com port

    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
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    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

    Comment

    • Claus Mygind
      Contributor
      • Mar 2008
      • 571

      #3
      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?

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        Originally posted by Claus Mygind
        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?

        Comment

        • Claus Mygind
          Contributor
          • Mar 2008
          • 571

          #5
          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.

          Comment

          • Plater
            Recognized Expert Expert
            • Apr 2007
            • 7872

            #6
            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.

            Comment

            • Claus Mygind
              Contributor
              • Mar 2008
              • 571

              #7
              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

              Comment

              • madbohem
                New Member
                • Apr 2010
                • 1

                #8
                there is a great little program that can help you achieve this scenario so you can concentrate on the web page portion of what you want... and its free***

                by free i mean there are various licenses mostly referring to 64 bit versions of its self and distribution. and if you do need to distribute the solution, it is a one time license fee.

                program is called VSPE and is extremely useful for doing all sorts of things with ports, including taking a com port and streaming it via TCP

                Eterlogic Software web site. Virtual serial port emulation for software developers and engineers.

                Comment

                • Claus Mygind
                  Contributor
                  • Mar 2008
                  • 571

                  #9
                  Originally posted by madbohem
                  there is a great little program that can help you achieve this scenario so you can concentrate on the web page portion of what you want... and its free***

                  by free i mean there are various licenses mostly referring to 64 bit versions of its self and distribution. and if you do need to distribute the solution, it is a one time license fee.

                  program is called VSPE and is extremely useful for doing all sorts of things with ports, including taking a com port and streaming it via TCP

                  http://www.eterlogic.com/Products.VSPE.html
                  This looks very interesting. I went on to develop a non-browser version of what I needed. But I may go back now and review. Thanks for the input.

                  Comment

                  • Claus Mygind
                    Contributor
                    • Mar 2008
                    • 571

                    #10
                    There is an new option that allows web pages to communicate with serial ports. Chrome has a Serial-Port API. You cannot run it in the standard Chrome browser. But you can run it a Chrome App where you give the app specific permission to communicate with the ports. This is done in the manifest.json file. This really opens alot of possibilities and eliminates the need to develop an interface in C, JAVA or some other language.

                    Comment

                    Working...