Author Topic: Read data from webpage  (Read 11460 times)

wittmane

  • Newbie
  • Posts: 5
  • I'm a llama!
    • View Profile
Read data from webpage
« on: August 11, 2014, 07:32:53 AM »
I have another device that I am using for the primary webpage, but I want it to get some readings from my Nano-10. I was thinking using ajax on the other device would be nice, but looking at the pre-made webpages, it seems that the data from the Nano-10 is displayed through the use of JavaScript, which wouldn't work for getting that through an ajax request. Is there some way to send the data directly so ajax would work or have some other way of sending the data so that another device can read it and display it through the use of html and JavaScript?

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Read data from webpage
« Reply #1 on: August 11, 2014, 10:13:23 PM »
If the other device is able to make a TCP connection to the Nano-10 server, then it can send the HTTP protocol string "GET HOSTLINK/xxx*"  where xxx is the hostlink commands (Chapters 15 and 16 of the User's Manual) and the Nano-10 will return the response string to the caller. This is how the javascript webpage uses the Ajax to communicate with the Nano-10.

You can easily test it using your webbrowser to enter e.g.

http://192.168.1.5:9080/HOSTLINK/IR*

You will get something like "IR01*"
Email: support@triplc.com
Tel: 1-877-TRI-PLCS