In part I we have built a simple VI that controls a LED, switching it on or off through a virtual pressure button. We will now show step by step how to launch the application in the Internet and control it remotely.
STEP 23 – Before anything else, we need to prepare the VI for multiple viewing. To do so in File menu we choose VI proprieties
A new window will open and in this select in Categories drop down menu Execution
A new widow will open and select Reentrant execution as shown in image
Press OK
STEP 24 – Next we prepare the webserver. In menu Tools choose Options
In Options window, choose Web Server: Configuration
Enable server by clicking in the choice box on the right of the phrase Enable Web Server.
Press OK.
STEP 25 – Choose now Web Server – Visible VIs, and add switched_usb6009.vi as shown, in the field below the phrase Visible VI. Keep all other defaults as they appear
Press OK
STEP 26 – We will next prepare the webpage and launch it. Choose Tools -> Web Publishing Tool
In Web Publishing Tool window choose the VI
Press Next after the VI is selected
STEP 27 – Write the title and HTML content as suggested in the image
Press NEXT
STEP 28 – In the next window change the default name of the html file to index. Press Save to Disk button
A new window will open Document URL, press Connect button and then OK
STEP 29 – The webpage will be published and the browser will open
Now with the right button of the mouse placed onto the published VI choose Request Control of VI
STEP 30 – The grayed buttons of the image will now show up. Press the run continuously button
STEP 31 – Now press the virtual button on the VI
The virtual LED on the switch button will light up
The LED Circuit connected to DAQ device will also light up, having thus achieved remote control of the circuit
STEP 32 – Knowing the IP of the PC (and better fixing the IP) one ought to be open the Labview’s page on the Internet. If the PC is behind a router, one needs to make the adequate changes in the router, in order toall external demands to the local fixed IP.
One last thing
In order to view the LED switiching on and off a webcam setup is required. In order to stream video YAWCAM freeware is advised. Having the requirements mentioned on the YAMCAM website one can easily establish a streaming server. If the PC is behind a router the video streaming server port must be opened on the router.
Conclusions
Having designed a VI we have controlled a real world circuit with a virtual button on the VI. We next have achieved Internet control of the VI using the tools that Labview offers.
Pingback: Internet Control of a Labview VI (Part I) | RedAcacia
thank you very much. this helped me a lot. but i have a question in my mind in step 28 how did we chose the web page’s adress. or did we directly copy our html file to the web page? Can you also add access control to the application? Thanks in advance.
Welcome to my blog Ali. Step27 allows you to give the appropriate name to the webpage. Once you have followed the remainder steps you will have a server functioning in your PC.
I hope I have answered. If you feel you are missing something please let me know.
Wish you good luck in your project.
Thank you very much. I understood it now. your web page really helped me a lot. i hope it will help more people like me. thank you again. have a good day.
Welcome back Ali.
I’m glad you got it working and undersrtood the steps. If you have online publication of your work, please share it here by indicating the URL.
AOA. I am a bit confused. I am using Labview 2010. After step 27 when it gives me the option to save it, it displays localhost:/something in url field. It points to localhost. But i want it to be on a website accessible from anywhere in the world. How can i do it?
Welcome to the blog, Kashif.
Well, that’s what has to happen.
The next thing is to know your local IP, perhaps configure your router so that the server is accessible from outside with IP forwarding, and finally, if you don’t have a fixed IP, to use one of the providers like dynalias, no-ip, etc
There are in the Internet many examples that explain how to do it.
I hope I have removed your doubts. The best way to learn is by doing it.
i have created a website and i want it to control from there. how?
What do you want to control? The images and description in my tutorial show how to control say a LED.
Hi… thank you for the help… but i have a problem… do i need the application builder?.. because when i preview in browser i cant see the VI… it says that i need a plug… or something like that…
Welcome to my blog. You will need plugin in your browser. Please check the following link from National Instruments:
http://digital.ni.com/public.nsf/allkb/151BE12C055F57CE86257043006CB4B3
Let me know if it works.
Thank you… another question… if i have a router.. how could i change the configuration to allow the external control of the VI
Well it depends on your router. You will need to Telnet into it to ip forward. The command I used in my Speedtouch router after telneting is:
:nat mapadd intf=Internet type=napt outside_addr=0.0.0.1 inside_addr=local ip protocol=tcp/udp outside_port=outside tcp/udp port inside_port=inside tcp/udp port
:saveall
More on Speedtouch router at: http://www.julietmikebravo.nl/st_resources/
So, really you need to find the manual of your router and Telnet into it and add the ip forwarding. You will need the internal IP of your PC where Labview is running.
Hi, so..if i create th web serve vi in a PC and it has a fixed IP, then how can i access from a different computer? could you please explain it?
Welcome to my blog. You need to check the IP of the PC with the application. You will find the service with IP instead of localhost.
hola una pregunra lo q pasa es q realize un proyecto en labview solo encendiendo un led pero la ora de cargarlo en la pagina wed no carga solo dice descargando panel al 0%
Welcome to the blog.
It seems you need IE ou Mozilla plugin to control the panel. Check the following for Labview 8.2:
http://forums.ni.com/t5/LabVIEW/Get-Labview-plugin-automatically-to-view-front-panel-remotely/td-p/80061/page/2
I think this seems to be the problem.
That’s a bit outdated now. Have a look at WebPager plugin for LabVIEW (https://labicom.net/labdeveloper/WebPager/). It allows to put front panels into web browser in a much simpler and cleaner way. Moreover, with WebPager you don’t have to install any plugins or run-time engines. Also, it will consume less traffic and there are lots of other advantages – you can read about them on the web site.
Welcome to my blog. Quite interesting though again it is a plugin. I will try out.
One question: Can I control application from another computer now? If I don’t, what I need to do to control from another computer?
Thanks.
Welcome to my blog Miha. Yes you can, you need a plugin. Please read through the tutorial. Page is launched as http://localhost.
With IP forwarding in your router you can also access the page externally. It is beyond the aims of tutorial external web access, but there is plentiful of information on the Web, on how to do it, including addressing the issue of dynamic IP, with services available, at little, or no cost.
hi can you help me please it gives me error when i press connect it give in NI front to control that client does not have access to specified vi
No idea. Have you folowed the steps correctly?
ok i repeated the steps it work thank you a lot ,,it is a nice idea i want to build it as project for my labview course ,,,one more question can i access from outside not only from the same network ?
how do i publish my VI using web publishing tools on my web page?
To get on Web you need IP forwarding on your router and an IP service. I do not know if that is your question.
how can i connect the ni usb 6009 DAQ device with the internet
I follow your steps but when i connect to URL gives me “access error :401–Unauthorized”