Taking Your Measurements to the Web with LabVIEW
Overview
Today, the Web is an essential part of the way a business operates. Not only can you use the Web to gain visibility, share information, and sell products, but you also can use it to improve the way you design, manufacture, and test products; to decrease design time; and to ensure quality.
Just as advancements in PC technologies transformed the way we automate measurements, networks are revolutionizing the fundamental architecture of PC-based measurement solutions. Some have proposed that network technologies are ushering in a post-PC era. Networks are not antiquating the PC, but revolutionizing the PC platform. The basic components found in a PC platform, such as I/O, processors, memory and storage, and displays, are still the building blocks, but they no longer need to be packaged as a self-contained unit. With networking technologies, you can distribute these components to the location most appropriate for your application. The platform is fundamentally the same, but the deployment capabilities of the platform are enhanced radically. Using network technologies in your measurement solutions, you can perform I/O on the production floor, deploy additional processing power for in-depth analysis in the control center, log and store postanalysis information to a corporate database, and display key information to clients around the world via a Web browser. The essential tool that you need to tie all of these pieces together is the software. LabVIEW provides a platform for designing your test system to take advantage of all of the latest technologies while providing an environment still focused on your developing your application quickly.
National Instruments LabVIEW focuses on solving measurement and automation needs by incorporating commercial technologies and balancing powerful ease-of-use functionality. LabVIEW provides the most productive development environment for empowering scientists and engineers to develop their own solutions. Any LabVIEW application, without any additional development time, can be turned into a remote application accessed via a Web browser. High-level functions are available to generate Web reports through Microsoft Excel or Word so you do not have to design and develop the low-level interfaces. You can enable live data sharing for individual user interface items simply by right-clicking the item and placing a checkmark in a checkbox. These technologies not only save valuable development time, but also help you take advantage of the economies of scale that the Web provides.
Many technologies are available for sharing information and data on the Web, and it is useful to understand some basic classifications before beginning your application. For convenience and clarity we have broken the applications into four main types – Publishing Data, Sharing Data, Remote Control, and Distributed Execution.
- Publishing Data – Generates a static Web report of test results that you can share with others. This method is the electronic version of the traditional printed report but has the advantage of easy access through a standard Web browser.
- Sharing Data – Expands the concept of publishing data to include transferring the actual data among computers where you can perform different analyses on that data, depending on your needs. Some applications might require streaming the actual data for additional processing, storage, or monitoring. For example, you can update out-of-bound parameters while the test is still progressing.
- Remote Control – Expands the concept of sharing data to include enabling another computer to connect to the experiment and control that experiment remotely. For many applications, the test might be in a harsh environment or run overnight where it is inconvenient for someone to be at the terminal continuously.
- Distributed Execution – Combines several of the concepts by developing a system architecture that shares the acquisition and analysis of the test among several computers. Systems of the future will consist of measurement nodes that can transfer data between computers, so different parts of the test can run at different places, and the data still can be correlated and used to control other hardware items.
Publishing Data
The use of the Web for distributing information from invoices of new cars, to e-mail alerts of airline specials, to continuously updated research and stock quotes has become everyday business. In the same way the Web provides this daily information, it is the ideal medium for sharing your measurement results with others. One of the simplest ways to share information across a network or the Internet is by publishing a report or summary. These reports help disseminate vital information quickly to various groups in the company in a form that can easily be accessed using Web browsers.
With the built-in Web Server in LabVIEW, you can publish the front panel of the application without adding any development time to your project. After you enable the Web Server, LabVIEW generates front panel images that you can access from any Web browser. Often, you might want to extend the reporting capability beyond publishing an image of the front panel, such as by creating a report that includes tables, lists, operator information, dates, and times along with the graphs and analysis on the front panel. You also can take advantage of report generation functions to publish reports in HTML format ready for publishing to the Web. These functions professionally document the results of an application quickly and easily by adding images, front panels, bulleted lists, and tables, thereby making it easy to further integrate your applications on the Web.
Often, you might want to generate a report using a standard application such as Microsoft Word or Excel. You can add the Report Generation Toolkit for Microsoft Office to LabVIEW to provide high-level functions that make creating these reports fast and easy. You do not need to understand the hierarchical ActiveX interface to interact with Microsoft Word or Excel, because these high-level functions incorporate the most common tools to enable you to generate professional reports. Beyond the ability to create the reports for internal use, the toolkit also has functions you can use to generate HTML from Microsoft Word or Excel so you can share the results of the report easily throughout the world.
![]() (1) |
![]() (2) |

(3)
Figure 1. Use LabVIEW (1) to generate a report in Microsoft Word (2), then create HTML (3) to display the data on the Web.
In addition to Word and Excel, some corporations use databases to store the data and use a Web interface for viewing reports. For quality control purposes, manufacturing might prefer to use a database that the rest of the company can easily access through a Web interface. The Database Connectivity Toolkit provides a common ADO interface for easy transfer of data and information to and from a database. Many databases have a front end that is accessible and searchable through a Web interface. Anyone who has access can then search and view the data in a Web browser.
While we mentioned the most common ways to share and view reports on the Web, many others exist. With the LabVIEW Internet Toolkit, you can use FTP to transfer data files on the Web. You might be gathering a large amount of information and prefer to place these files on an FTP site where you can share them easily. FTP sites are a good way to share larger files that might not be appropriate to send in e-mail and around which it might be difficult to create HTML.
You can quickly see that the Web has become the preferred medium for disseminating test data, because with it you can easily create reports and send updates. With the built-in tools in LabVIEW, it is easy for you to take advantage of these technologies.
Sharing Data
A report offers a static view of compiled information. While this may deliver an easy-to-read summary of a completed test, it does not provide an easy way to access the data that created the report. In many applications, real-time access to acquired data is needed to control or monitor a process or perform a test across a network. The results of one measurement or automation process can be passed directly to the next process. In this type of application, it is sharing the actual information that is important, as opposed to the data reporting applications where sharing static views, such as a report or a Web page, were sufficient. In this kind of application, manufacturing might share quality data with the R&D organization, which could then analyze the data directly instead of just looking at a report that manufacturing generated.
For data sharing, XML is quickly becoming a standard way to transfer, in a text-readable fashion, data that can easily be displayed on the Web. Because of the universal XML standard, you can generate a Web report that has a defined set of data and you can bring it easily into other applications. Because the data is readily accessible, applications can download any XML document, parse the data, and perform custom analyses. LabVIEW provides built-in functions you can use to create or read XML documents.
Another method of sharing data directly with other parts of the organization is through DataSocket. Using DataSocket, a National Instruments technology built on top of TCP/IP, you can quickly stream data between computers and applications. DataSocket implementation requires no extra development time because it enables a graph or other user interface item to stream the data it is displaying over the network. Because DataSocket also is implemented as an ActiveX control, a Java Bean, and a component of Measurement Studio for C/C++ and Visual Basic development, you can incorporate this technology in many other applications. To subscribe to the DataSocket Server item containing the data, these applications use a URL address to begin receiving data and any updates that are sent. Using DataSocket, you can generate a Web page to show updates of quality information from a manufacturing floor, changing properties of materials during an ongoing test, or even updates of the weather. You can see a live example at ni.com/weather (linked below).
Figure 2. This application sends an e-mail alert when specified limits are exceeded.
Sometimes you might want to take advantage of cellular phones or pagers to develop your application. With the Internet Toolkit, you can use LabVIEW to send e-mail alerts. Electronic notifications can then be created for operators that use pagers or mobile phones to receive alerts from the production area when certain process values exceed established limits. The operator gets updated as the test runs, and his time is freed up to spend on more productive tasks.
See Also:
NI Weather Station
Remote Control
With remote control, you can control the execution of a system from another computer in a remote location. One instance where this would be useful is with a system in a harsh environment where you have limited access. You also might want a way to perform remote monitoring, control, even run diagnostics, while the system itself is dedicated to running acquisition and control. Sometimes tests are designed to run for long periods of time, but at certain intervals, parameters must be changed or other tests begun. Because the operator of the test does not want to have to drive back to work on the weekend or at night just to make these small modifications to the tests, the operator logs onto the network from home, connects to the test, and makes those changes just as if he or she were on site.
With LabVIEW, you can achieve remote execution for every application you develop with just a few clicks of the mouse. Without any additional programming, you can configure any LabVIEW application for remote control through a common Web browser. The user simply points the Web browser to the Web page associated with the application. The remote user can access fully the user interface that appears in the Web browser. The acquisition still occurs on the host computer, but the remote user has complete control of the application. Other users also can point their Web browser to the same URL to view the test. To avoid confusion, only one client can control the application at a time, but that control can pass easily among the various clients at run-time. At any time during this process, the host computer can take control of the application away from any of the remote clients who are in control.
Figure 3. VI Running Both in LabVIEW and Embedded in a Web Browser
Using built-in LabVIEW tools, you can take advantage of powerful networking technologies for Web-based applications through common Web browser interfaces, as well as use the latest in Windows technologies with your LabVIEW applications. Windows XP introduces Remote Desktop and Remote Assistance, which you can use to help debug deployed systems. After you deploy a system in the field, often it is cost prohibitive for the support staff to visit every site. With Remote Desktop, a support operator can log into the Windows XP machine and act as if he or she were sitting at the desk where that machine is located. With Remote Assistance, the operator can remain in control of the desktop but the support operator can view the desktop on his/her remote machine. At any time, the operator can give up control of the desktop to the support operator and still see which troubleshooting techniques are in use. These new technologies in Windows XP make troubleshooting deployed systems much easier than ever before. As the industry-standard software development tool, LabVIEW takes advantage of these new features and provides additional features that complement them
At times, you might want to use the Web browser to initiate the measurement or automation application, but not actually control the experiment. In this case, you might have an operator log in, set certain parameters, and run the application. You can accomplish this using CGI. With CGI, you can communicate with a server-side program or script run by an HTTP server in response to an HTTP request from a Web browser. This program normally builds HTML dynamically by accessing other data sources such as a database. As part of the HTTP request, the browser can send to the server the parameters to use in the application.
Distributed Execution
You can take advantage of networking to distribute execution, dedicating certain machines for the acquisition and control while offloading analysis and presentation on other systems. Each system is optimized to perform specific functions. Because you can share data among the distributed components and each component accomplishes a unique task, this network functions as a complete system.
With network access to various measurement nodes, you can develop software that uses each computer to complete a portion of the application. A test can have several acquisition nodes, each sending data back to a main computer or cluster of computers where the analysis is performed and reports are generated and sent to the Web.
For certain test and control applications, you might need an embedded, reliable solution. For these applications, you can download the LabVIEW Real-Time Module to a PXI instrumentation system or a FieldPoint distributed I/O module. LabVIEW runs on a real-time operating system on these systems, but still can be accessed from a host computer through Ethernet. From this computer, you can use remote front panels in LabVIEW to control the application, or you can use DataSocket to transfer the data directly from the real-time target to a host computer, which could then act as a server to further disseminate that data to other computers.
Figure 4. Using LabVIEW and the Web, different systems work together in one application.
An example application is a structural test system measuring the vibration and harmonics of a bridge design. You can set up one node with a camera to monitor the testing of the bridge. You can set up another node to measure parameters such as wind direction and speed, temperature, and humidity. Finally, you can set up a node to measure the load, strain, and displacement on certain areas of the bridge. You want to send all the data back to a main computer that correlates the data, analyzes the data, and displays the results of the test on a Web page.
Each of these nodes would need to be running autonomously, acquiring data and sending it onto other computers to correlate the data and create reports. Using the LabVIEW Real-Time Module and PXI, each of the measurement nodes could become an embedded, reliable, and durable solution. Remote front panels in LabVIEW are extensible to the LabVIEW Real-Time Module, so you could easily control any of the measurement nodes to modify parameters of the test. The original creation and testing of the code is also completed using a Windows operating system and then downloaded to the measurement node. So, you can make major modifications to the test and download them to the embedded target without visiting the site. Next, one of the live data-sharing techniques could be used to transfer the data to another cluster of computers that would correlate and analyze the data. Finally, you could set up an Internet server to share the Web reports and analysis with others around the country.
See Also:
Customer Solutions: AT&T Monitors Remote Sites Using LabVIEW System
Customer Solutions: EcoMonitor - Air Quality Continuous Monitoring System
Customer Solutions: LabVIEW and FieldPoint Monitor Leonardo da Vinci Manuscript
Customer Solutions: Using LabVIEW to Access and Control a Harsh Environment Laboratory through the Internet
Books and Publications: LabVIEW Internet Applications by Jeffrey Travis
Building Intelligent Ethernet-Based Distributed I/O Systems with National Instruments LabVIEW
Building an HTML Document with an Embedded VI Panel
Configuring a DataSocket Server
DataSocket Overview
Developing Remote Front Panel LabVIEW Applications
Publishing Your Data Over The Web
Summary
The Web is changing the way we take measurements and distribute results. Many different options exist for publishing reports, sharing data, and remotely controlling applications. LabVIEW incorporates the latest Web technologies, so you can take advantage of the power of the Web without having to become experts in any Web technologies. With LabVIEW, you can incorporate the Web into many different aspects of your application, from just sharing the data with colleagues to creating a unique, powerful distributed application combining different measurement nodes and multiple computers together into one measurement and control system. With LabVIEW, you can integrate your applications easily into the existing corporate networking infrastructure so your corporation can better share data and increase the productivity of those performing the measurements. Begin taking advantage of these technologies today by purchasing LabVIEW at ni.com/labview.
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).


