Author Topic: Control Nano-10 via external webserver  (Read 13288 times)

shoop_nl

  • Newbie
  • Posts: 4
  • http://www.majesticsoft.nl
    • View Profile
Control Nano-10 via external webserver
« on: January 27, 2011, 03:27:47 AM »
Hi,

Is it possible to control the nano-10 via an external webserver.
For example I have on a webserver an aplication running with PHP and Via this website I want to give a start command to set an output via the PLC.

If yes, is there some example of this?
or maybe I need to include the PLCmon.jar applet to make this possible.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Control Nano-10 via external webserver
« Reply #1 on: January 27, 2011, 09:18:36 AM »
You can control the Nano-10 from a PHP server if you can issue a HTTP GET command. Nano-10 supports web query method using the /HOSTLINK/xxxxxx  command where xxxxxx is the actual host link command (refer to Chapter 16 of the User's Manual).

E.g. if the IP address of Nano-10 is 192.168.1.5:9080, you can turn on output #1 on the PLC from the browser address bar using the URL:

http://192.168.1.5:9080/HOSTLINK/Wb0100FF

(Of course this assumes that the output #1 is not under program control otherwise it will only be turned on for 1 scan time and the PLC program will update it back to its programmed status in the next I/O scan).

You should test the command in your browser and you will understand how to do it. After that it is a matter of coding your PHP server to send the HTTP GET command to the PLC.
« Last Edit: January 27, 2011, 09:20:57 AM by support »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

shoop_nl

  • Newbie
  • Posts: 4
  • http://www.majesticsoft.nl
    • View Profile
Re:Control Nano-10 via external webserver
« Reply #2 on: January 27, 2011, 02:30:28 PM »
Thank you, Now I know how to use the HOSTLINK options to communicate. I can probably use a similar construction to check if the output was set. Assuming I will not get some kind of success back from the HTTP GET.

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Control Nano-10 via external webserver
« Reply #3 on: January 27, 2011, 04:07:19 PM »
When you send GET /HOSTLINK/Wb0100FF the webserver will send you a HTTP response which you can check to ensure success. Of course you can also issue the /HOSTLINK/RO00 to read the output channel 0 (contains bits for output 1 to 8) to verify if it has been turned on. It is all up to your program.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

shoop_nl

  • Newbie
  • Posts: 4
  • http://www.majesticsoft.nl
    • View Profile
Re:Control Nano-10 via external webserver
« Reply #4 on: January 30, 2011, 06:53:03 AM »
Ok I managed to create a hostlink library in my PHP frame work. But since I do not have my nano-10 yet, I was wondering if I can do some testing with the simulator in the studant package of the TL software. If yes how do I send a hostlink command to the simulator?
« Last Edit: February 01, 2011, 08:02:40 AM by shoop_nl »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:Control Nano-10 via external webserver
« Reply #5 on: January 30, 2011, 08:51:16 PM »
Unfortunately these are not simulated by TRiLOGI so you will have to wait for arrival of your Nano-10 PLC in order to test it.
Email: support@triplc.com
Tel: 1-877-TRI-PLCS

shoop_nl

  • Newbie
  • Posts: 4
  • http://www.majesticsoft.nl
    • View Profile
Re:Control Nano-10 via external webserver
« Reply #6 on: February 16, 2011, 12:12:46 PM »
This works great, with the curl module of php enabled it is very easy to view and control settings on the nano-10