Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 22, 2008

Building Distributed Monitoring and Control Systems with LabVIEW

90 ratings | 3.82 out of 5
Read in | Print

Overview

This paper examines the benefits of creating distributed monitoring and control systems as well as the fundamentals of building these systems. Engineers can use the concepts presented in this paper to design reliable, high performance systems today that can easily integrate with future technologies.

Introduction

Implementing a distributed measurement and control system allows engineers to optimize the processes running on each machine and over the network--creating a more reliable and higher performance system. Distributed systems can be separated into two pieces, the backbone of the system and the nodes.

When designing a system, it is important to first understand what needs to be accomplished. Will the system need to be able to do both control and monitoring? Which unique business processes need to be integrated into the system, for example a purchasing database or quality tracking database? Identifying the integral processes up front is important to properly architect the system. Choosing the right tools helps engineers build commonly used features and provides the flexibility to incorporate custom processes or equipment from third party vendors. National Instruments LabVIEW is a flexible development environment that is designed to help engineers easily integrate many disparate components into a complete monitoring and control system.

Although this paper concentrates primarily on software tools, National Instruments also provides general-purpose data acquisition hardware as well as optimized devices for control and measurement analysis.

Defining the Backbone


When thinking about a distributed system, it is a good idea to look at the entire system first. At the top level is the backbone of the system. The backbone of a distributed system can be simplified to key servers and the network. The software running on the key servers must manage network transfers, data management, data visualization, alarms and events, and security. A key characteristic of the backbone is that it must be able to communicate with the rest of the hardware through a common protocol, such as TCP/IP. The software used at each machine in the network must support the same communication protocols. In addition, the key servers should support a variety of communication protocols so they can interface with legacy and next-generation machines in the system. Choosing a software package, such as LabVIEW, that supports many industry standard protocols is critical to reducing development time for each machine on the network and integrating networked devices with the key servers.



Figure 1. Diagram of a Distributed System


Networking
As a data acquisition system grows, data can be stored on multiple computers and monitored centrally. Or, it can be stored on one central server. The most difficult challenge is to communicate with live data. In order to do this easily, the software tools must be integrated with the operating system’s native networking technology and do this as transparently as possible. Networking tools should be designed to maximize throughput and should be stable and reliable if there are disruptions in the network. OLE for Process Control (OPC) is an industry standard interface through which software and hardware can communicate irrespective of the manufacturer. LabVIEW provides support for OPC through the LabVIEW Datalogging and Supervisory Control (DSC) Module. Yet, OPC may not operate at the performance needed for higher speeds. For this requirement, the DSC Module also includes a built-in networking protocol for optimal throughput.

Data Management
The key servers should also have the ability to log data. Data logging is the process of acquiring data and storing it in a file or a database. The more complicated an application is, the more critical it becomes to have tools that do this well. Small amounts of data can easily be stored in text or spreadsheet files; however, larger amounts of data benefit from more sophisticated data storage formats.

Many different ways to store large data sets exist and each has its own advantages and disadvantages. The two primary types of databases used are relational and streaming databases. Relational databases are more traditional databases often used in business applications. Although extremely flexible, they are not optimized for disk space and fast throughput. Streaming databases, on the other hand, are designed for quickly storing large amounts of data to disk. However, an engineer cannot define tables or other structures and therefore loses some flexibility and search capabilities. When building a database, some of the most common challenges are designing an easy-to-use, scalable file structure and data structure. Without the right tools, engineers can spend hours designing and modifying their data structures. The DSC Module features a streaming database designed to meet the needs of measurement and control applications. With built-in data hierarchy and data structure definition, the built-in database provides superior space utilization and data throughput.

Data Visualization
Logging data to disk is not the only challenge one faces when designing distributed systems. Engineers and operators also need visibility into the data, either as the signals are acquired or after the acquisition is complete. Two different ways to view data exist. First, data can be viewed from the server during the acquisition. This is also known as live data. Engineers need to look at live data in order to monitor the status of a running system.

Viewing live data from a single machine is a relatively straightforward operation. To monitor live data, engineers can create a user interface, such as a LabVIEW front panel, and view it on a local monitor or embed it in a Web page using the LabVIEW 6.1 Remote Panels feature.

Viewing live data from multiple machines is more challenging. Each machine viewing data must be running a client, whose job is to query for the required data when asked. It is important to understand what type of server the application is going to be connecting to and choose a software package that will help make the communication easy. One of the most common servers is OPC. Finding a software package with a built-in OPC server/client can save valuable development time.

The second way to view data is after it has been stored in a file, also known as historical visualization. Use this data for post-acquisition analysis and presentation. The challenges associated with this are similar to data logging. Without the right tools, engineers must know the file and data structures before analyzing and viewing the data. Choosing a software development tool that does this can again save time.

The DSC Module builds upon the LabVIEW analysis and presentation functions to include built-in OPC connectivity and visualization tools to easily view live and historical data from multiple machines.

Managing Alarms and Events
When acquiring large amounts of data or data over long periods of time, engineers are typically less interested in the value of each data point and are more interested in significant changes in the data values. These changes can be monitored using alarms and events. It is important that the history of these alarms and events be preserved, so they can be analyzed at a later date. Key features needed to support alarms include the ability to generate an alarm, store it along with the associated data, and recall the alarm and all of the relevant information after the acquisition. Relevant information may include when the alarm was triggered, who acknowledged it, and at what time it was acknowledged. With the DSC Module, engineers can configure and monitor alarms using the HMI wizard, allowing them to focus on what causes the alarms rather than programming an alarm infrastructure themselves.


Figure 2. The HMI Wizard encapsulates configuration data and graphical programming.


Security
Handling sensitive data often brings up security questions. Who should have access to the data and to which parts? Should everyone be able to modify the file or database? Probably not. Developing security code can be time consuming and cumbersome. By defining the system needs up front, engineers can choose tools to help them to do this. The DSC Module enables engineers to define user profiles that limit access to different specific user interface controls on the application, as well as to different and sensitive sections of the data.

Integration


Integrating components into an existing or new backbone is often the most difficult and time consuming part of building a system. In order for the integration to go as smoothly as possible, it is important to gather the requirements at the beginning of the process and choose software tools that will make this process easier. Looking for tools that are open and flexible is crucial to making this easier. Open software tools use industry protocols, such as OPC and TCP/IP, and work with other vendors to make integration easier for the end user. Flexible software tools will empower engineers with the capability to easily add different components to the backbone of the system.

LabVIEW has been developed from the beginning to work with third party hardware. It has the underlying architecture of a traditional programming language, which allows engineers to properly work with physical I/O, real-time constraints, and hardware configuration. A large user community also exists to share ideas and resources in order to help engineers work on their programs.

Defining the Nodes


As one can see, there are a lot of tasks that need to be handled by the key servers. And the more they are asked to do, the larger the processors need to be and the more efficient the code needs to be. Otherwise, the computer can easily become overburdened by these different applications and tasks. This is where the concept of distributed computing comes in. By off-loading some of the tasks such as data acquisition, analysis, and control to the node level, engineers are able to more efficiently use their available resources.

At the node level of the system is the hardware with specific tasks, such as a conveyor belt controller or a safety shutdown monitor. With certain hardware components, intelligence can be incorporated at the I/O level. The control routine executing at each node can have a faster response time because the networking dependencies are eliminated. In addition, off-loading the node processing from the key servers reduces the number of tasks they need to run, which frees them up to monitor a larger system. The gains in processing efficiency are most evident when the node level control system integrates and analyzes varied I/O such as motion control, image acquisition, analog data acquisition, and serial data transfers.

Real-Time Operating Systems
Many node level control systems are implemented with dedicated controllers using technology such as real-time operating systems. This platform is ideal for the node control because the real-time operating system offers deterministic performance, high reliability, and stand-alone operation. Determinism is the quality of having a task always execute at a certain time or within a certain amount of time. The advantage of this is a high level of precision in the control loop. Real-time operating systems are more reliable than other operating systems because they are dedicated to only one application or process at a time. With fewer tasks to distract the operating system, the real-time system will experience more robust operation. Finally these dedicated targets can operate as stand-alone or embedded systems. This offers the advantage of not needing an operator to interact with the process at all times.

There are several different real-time operating systems available on the market today. When considering which one to use, engineers should consider how they will develop the code to run on that operating system. One option is to use a traditional text-based language. This can involve a steep learning curve and special skills for optimizing control code. Another option is to use LabVIEW and the Real-Time Module.

The LabVIEW Real-Time Module extends the LabVIEW development environment with the ability to deploy and execute applications to a dedicated target running a real-time operating system. The built-in LabVIEW tools for measurement and control systems deliver software and hardware functionality specific to real-time applications, such as PID control functions and advanced timing and synchronization capabilities. With a unique approach to real-time development, LabVIEW delivers a highly productive platform for engineers to create deterministic and embedded systems.


[+] Enlarge Image
Figure 3. The LabVIEW Graphical Development Environment

Incorporating Analysis into Monitoring and Control

In order to implement control at the I/O level, engineers must be able to embed analysis functions in the I/O code. Embedding these functions in the control code allows users to extract valuable information from data, make decisions on the process, and obtain results. Unfortunately, combining analysis with data acquisition and data presentation is not always a straightforward process. Application software packages typically address one component of the application but seldom address all aspects. LabVIEW was designed to address the requirements for a start-to-finish, fully-integrated solution so that engineers can seamlessly integrate all phases of their application in a single environment.

LabVIEW provides powerful analysis libraries, routines, and algorithms that range from basic math to advanced signal processing, which can be seamlessly integrated with all other functions in LabVIEW. These functions, in conjunction with powerful data visualization capabilities, make LabVIEW the ideal tool for any application.

Engineers incorporate analysis into their applications and programs in different ways. There are certain considerations that help determine the way in which analysis should be performed. The following paragraphs describe inline analysis, offline analysis, and additional analysis tools.

Inline Analysis
Inline analysis implies that the data is analyzed within the same application where it is acquired, such as at the control I/O. Decisions have to be made immediately and the results have direct consequences on the process, typically through parameters that need to be changed or actions that must be performed. When dealing with inline analysis, it is important to consider the amount of data acquired and the particular analysis routines that are performed on that data. A proper balance must be found as they could easily become computationally intensive and have an adverse effect on the performance of the application. LabVIEW offers analysis and mathematical routines that natively work together with data acquisition functions and display capabilities, so that they can be easily built into any application.

When dealing with control processes where high-speed, deterministic, point-by-point data acquisition is present, a specific type of inline analysis is needed: point-by-point. Any time resources are dedicated to real-time data acquisition, point-by-point analysis becomes a necessity as acquisition rates and control loops are increased by orders of magnitude. The point-by-point approach simplifies the design, implementation, and testing process, because the flow of the application closely matches the natural flow of the real-world processes that the application is monitoring and controlling. Point-by-point analysis is also streamlined and stable, because it directly ties into the acquisition and analysis process.


Figure 4. Point-by-Point Analysis


By adding these powerful algorithms and routines into their applications, engineers eliminate the guess work and create intelligent processes that can analyze results during run time, improving efficiency and iteratively correlating input variables to experiment or process performance. This type of analysis allows the acquisition and analysis process to move closer to the point of control in embedded controllers and dedicated CPUs.

Offline Analysis
Offline applications do not typically have the demand for results to be obtained in real-time fashion in order to make decisions on the process. Offline analysis applications require only that sufficient computational resources are available. The main intent of such applications is to identify cause and effect of variables affecting a process by correlating multiple data sets. These applications generally require importing data from custom binary or ASCII files and commercial databases such as the LabVIEW DSC Module historical database, Oracle, Access, and other SQL/ODBC-enabled databases.

Once the data is imported into LabVIEW, users perform several of hundreds of available analysis routines, manipulate the data, and arrange it in a specific format for reporting purposes. LabVIEW provides functions to access any type of file format and database, SQL functionality in order for engineers to communicate with existing business databases through the Database Connectivity Toolset, and support for the latest data-sharing technologies such as XML, web-enabled data presentation, and ActiveX.

Additional Analysis Tools
In addition to the built-in measurement analysis libraries, engineers rely on add-on toolsets and modules to reduce development time for specialized application needs. By incorporating toolset components into custom applications, users reduce the need for particular expertise commonly associated with developing more vertical applications such as PID control, vibration measurements, and image processing.

PID Control
The LabVIEW PID Control Toolset adds sophisticated control algorithms to control applications. By combining the PID and fuzzy logic control functions in this toolset with measurement analysis functions in LabVIEW, users can quickly develop programs for automated control. In addition, by integrating these control tools with NI data acquisition hardware, users can create powerful, robust control systems.

Sound & Vibration Analysis
The LabVIEW Sound and Vibration Toolset provides the basic tools required to quickly create custom applications for sound and vibration analysis. Use it to extend LabVIEW with functions and visualization tools for handling calibration, frequency analysis, transient analysis, sound-level measurements, and fractional-octave analysis.

Order Analysis
Order analysis is typically used for machine condition monitoring and rotating or reciprocating machinery. With order analysis, engineers get more information than with simpler analysis tools, such as the Fast Fourier Transform, by analyzing the signals in the time and frequency domains simultaneously. This functionality is available in the LabVIEW Order Analysis Toolset.

Vision/Image Processing
IMAQ Vision for LabVIEW adds high-level machine vision and image processing to LabVIEW. Engineers can use IMAQ Vision in machines as well as factory automation operations that require extremely reliable, high-speed vision systems.

Post Acquisition Analysis and Report Generation


Having thought about the system design, the next question is: how will the data be used? Will engineers need to pull data from a central database and create a report to share with colleagues, managers, or customers? If this is the case, then it is important to choose a software package that is tightly integrated with the rest of the system. One example is National Instruments DIAdem, which engineers can use to import data from many different sources or databases, interactively analyze large sets of data, and easily create professional reports.


[+] Enlarge Image
Figure 5. DIAdem Report


With DIAdem, engineers can easily retrieve data acquired by their LabVIEW application. Use a wizard to point to a data file for DIAdem to retrieve and determine the best way to visualize and present the content of the file. This can also easily be done programmatically from within LabVIEW. Retrieving data from several files at once is simple, and engineers can quickly compare results and data sets obtained by different applications or different runs of the same application.

Unlike standard spreadsheet programs, large data sets are not an issue for DIAdem. In fact, DIAdem is capable of dealing with more than a billion data points. Not only can engineers easily pull data from the DSC Module database, they can also retrieve data from SQL/ODBC and Microsoft ADO-enabled databases. DIAdem has integrated mechanisms with which data can easily be saved to and retrieved from these databases.

Once the data has been acquired and analyzed and the desired results obtained, engineers need to share the results with colleagues and customers. DIAdem makes this task simple. With DIAdem, engineers can interactively design reusable and fully-customizable report templates. Any of the objects on the report can show data from the acquired or calculated channels. Once satisfied with the layout of the report, it can be stored for reuse or sent to a printer.

System Maintenance and Upgrades


Lastly, designing a system that will be easy to scale and maintain from the beginning is extremely important. Different things to consider include minimizing the differences between the current system and the new one as much as possible, as well as automating as many steps as possible. Collaborating with the different groups responsible for maintenance at the beginning of the project and learning about their processes and expectations can help engineers design a system that will minimize the maintenance steps. One way to do this is to build user interfaces for maintenance procedures and then automate them whenever possible. Although working with a cross-functional team may reveal some conflicting requirements, dealing with as many of these up front as possible will result in a better system.

Conclusion


Distributed monitoring and control systems enable engineers to take advantage of the processing power of all available resources in order to more efficiently use the entire system. Choosing open and flexible tools for the backbone of the system allows engineers to more easily integrate products from many different vendors. Choosing a real-time operating system and designing an embedded application with analysis will help off-load some of the computational requirements from the key servers as well as provide engineers with faster, more sophisticated control algorithms at the node level. National Instruments LabVIEW with the DSC and Real-Time Modules gives engineers the tools needed to succeed when designing, building, and integrating distributed systems.

90 ratings | 3.82 out of 5
Read in | Print

Reader Comments | Submit a comment »

Very powerful information at this age technology. Thanks to whoever wrote it.
- Bonface Navade, Student. basuluda@yahoo.com - Dec 24, 2007

Very Impressive!
Will Email myself at home and read in less hectic enviroment
- patrick hadaway, Nistem Corp.. p_hadaway@nistem.com - Apr 21, 2003

 

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/).