Internet PLC Forum
General => Technical support => Topic started by: shoop_nl 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.
-
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.
-
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.
-
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.
-
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?
-
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.
-
This works great, with the curl module of php enabled it is very easy to view and control settings on the nano-10