Internet Control of a Labview VI (Part II)

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.

Advertisements

About Tayeb

Electronics engineer, part-time webmaster and owner of "Aliatron", a tech-oriented company registered in Portugal and Mozambique.
This entry was posted in Electronic Projects, Internet of Things and tagged , , , , . Bookmark the permalink.

24 Responses to Internet Control of a Labview VI (Part II)

  1. Pingback: Internet Control of a Labview VI (Part I) | RedAcacia

  2. Ali Erdem Onder says:

    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.

    • Tayeb says:

      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.

  3. Ali Erdem Onder says:

    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.

    • Tayeb says:

      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.

  4. Kashif says:

    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?

    • Tayeb says:

      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.

  5. Kashif says:

    i have created a website and i want it to control from there. how?

  6. Edu says:

    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…

  7. Edu says:

    Thank you… another question… if i have a router.. how could i change the configuration to allow the external control of the VI

    • Tayeb says:

      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.

  8. Karla says:

    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?

    • Tayeb says:

      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.

  9. GUSTVO says:

    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%

  10. WebPager says:

    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.

  11. Miha says:

    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.

    • Tayeb says:

      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.

  12. mhd says:

    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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s