NI Blog

Community Browser
Showing results for 
Search instead for 
Did you mean: 

Designing LabVIEW NXG: Web Integration


Throughout LabVIEW NXG development, NI R&D has championed the cause of bringing true web development powers to domain experts to serve up professional, modern engineering UIs. 


Our previous solution, LabVIEW Remote Front Panels, successfully brought VI panels to the web browser without requiring LabVIEW developers to learn web technology. However, this solution has a number of drawbacks.It often requires a phone call to IT asking them to changefirewall settings to allow Remote Front Panels network traffic to flow. Users have to work around limited browser support and largeplug-in downloads that if ignored, lead to this outcome: 




This approach has not kept up with the times. The modern web is composed of JavaScript, CSS, and HTML5. It’s based on open standards and open source software that facilitates a write once and run anywhere approach. There are fewer and fewer client-side plug-ins to install as browsers have become more powerful and capable.  


Based on this, we took a step back to determine how to best leverage these trends and bring the modern web to our users, without forcing them keep up with a rapidly evolving web technology space. 


After experimenting with different ways of bringing web technology to LabVIEW NXG and evaluating those against customer use cases, we settled on the concept of WebVIs.  


WebVIs are authored using the same LabVIEW paradigms that a desktop LabVIEW developer is familiar with but offers a different set of web-friendly controls for the Panel and a subset of the G language on the Diagram. In the LabVIEW NXG IDE, when you press the run button on a WebVI the VI Panel runs and shows results as you might expect, but it’s actually executing inside a Chrome Embedded Framework browser seamlessly hosted in the LabVIEW NXG IDE. Watch a walkthrough of building a WebVI here. 


A WebVI Panel is transformed into HTML5/CSS, and the Diagram is compiled into instructions that execute in the browser through JavaScript. Instead of asking users to install a plug in, we include a copy of our browser friendly LabVIEW run-time engine named Vireo with every WebVI. Vireo is responsible for executing the compiled VI.  


If you’re curious, the source for Vireo can be found on GitHub and is available under an open sourcelicense. Together Vireo and its support files are only 5 MB in sizea smaller disk footprint than a decent photo! 



Customize as Needed 



Because WebVIs are transformed into standard HTML5/CSS/JavaScript, you have the option to augment and customize your web output as you see fit. On the Panel, you can add custom elements to the WebVIs DOM, add visual polish by providing custom styling in the form of CSS, embed your WebVI in an iframe in a dashboard HTML page, and more. You can also extend the functionality of the WebVI diagram to take advantage of what the browser can do, but LabVIEW does not yet support, by providing your own JavaScript code and using JavaScript Library Interface nodes on the Diagram to call your JavaScript functions. 


These customizations require learning HTML5/CSS/JavaScript to some degree. You don't have to do this, but you can if you need to. 


Our first few releases support two options that enable LabVIEW 201x applications to supply data to WebVIs. 


  1. The first option is to create a LabVIEW 201x Web Service to publish data and create a WebVI based on LabVIEW NXG that uses the HTTP palette nodes to query the web service (or any other interesting non-LabVIEW RESTful web service).  
  2. The second option is to publish your data from LabVIEW 201x to the local NI Web Server using Tags and Messages, and then read or write those Tags and Messages from a WebVI diagram.  


Once you have the data on the WebVI diagram, you can perform basic math, format data, and wire up the data to your WebVI panel’s indicators. The library of functions we offer on the WebVI diagram to execute in the browser is growing with each release of theLabVIEW NXG Web Module. 






Finally, for anyone else to see and interact with the data, you must host the generated webpages on a server. There is no one-size-fits-all solution for the right server architecture; it depends on the application. Choosing the appropriate strategy requires up-front planning and decision making. NI has assembled a flexible set of server options to choose from that are approachable to a LabVIEW audienceranging from deploying as part of your LabVIEW 201x web service to hosting WebVIs on your own SystemLink server behind a firewall to securely uploading your WebVI to the SystemLink Cloud (making your WebVI available to authorized users using any device in any place on the planet with Internet connectivity). Walk through hosting a WebVI onan NI web server here. 


As the R&D product owner for this technology, I’m excited to hear about your own experiences with WebVIs built with the LabVIEW NXG Web Module. Hopefully, you find success like our partners at MeasX did when converting their X-Conn Runout application to LabVIEW NXG + WebVIs. Your feedback is essential to influencing our plans and mission to most effectively bring the modern web to you.


Read more about designing LabVIEW NXG >>

-Darin Gillis
R&D Product Owner, NXG Web Module