A HMI Architecture for LabVIEW Touch Panel Module
Overview
This document describes a common Human Machine Interface (HMI) application architecture and gives an overview of how to implement that architecture using the LabVIEW Touch Panel Module.
Table of Contents
Background
For applications where operators interact with machines, there is a natural need for a mechanism through which the machine can be configured and monitored by the operator. A Human Machine Interface (HMI) is typically used to fulfill this need.
National Instruments’ Touch Panel Computers (TPCs) offer an on-board processor, a rugged LCD touch panel interface, an assortment of integrated I/O ports and native LabVIEW support via the LabVIEW Touch Panel Module. These features make the NI TPCs the ideal HMI for interacting with machine control systems.
Figure 1. NI Touch Panel Computers
This document describes a typical HMI application architecture and gives an overview of how to implement that architecture for NI TPCs using the LabVIEW Touch Panel Module. For most of the components that make up the HMI architecture, reference libraries and reference designs have been created as tools for decreasing development time and for implementing best practices.
A Typical HMI Architecture
Figure 2 is a block diagram of a typical HMI architecture and it shows the relationships between the different software components.
Figure 2. Typical HMI Architecture
Paged Display System
The typical machine control application involves hundreds of data variables or tags. Some of these tags are related to controller I/O and controller status but the tag list also includes many internal tags for system state management, configuration, calibration, etc. A HMI application organizes tag values and presents them to the operator by grouping related tags in a display page. In addition to the tag data, each page includes navigation buttons that allow the operator to view other pages. Behind the scenes, a Navigation Engine handles transitions between display pages.
Display Objects
Standard indicators can be used to display analog, string and digital tag values. Alarm Displays, however, have behaviors that require additional software support. Common alarm displays include an alarm summary and an alarm footer. The alarm summary typically is its own page, which an operator can view to see a complete list of alarms. An alarm footer is a one-line display that can be added to the bottom of any page to bring alarms to the operator's immediate attention. The Alarm Displays Engine provides the behavior for alarm displays.
Data Entry Objects
HMI data entry can require more effort then a typical desktop computer, particularly when the HMI is targeted to a touch panel device where the mouse and keyboard are not available. Data Entry Objects must be oversized and custom keypads must be created for entering most data types (numeric, date, password, enumerated, etc.).
Tag Engine
The tag engine is a mechanism for storing and retrieving current tag values. It is the hub that the other components use to exchange data as follows:
- UI pages read tag values for display purposes
- Operators use data entry objects to update tag values that are passed to the rest of the system
- The Event Engine monitors current tag values for certain conditions
- The Data Engine exchanges tag values with the machine controller
Event Engine
The Event Engine compares a subset of tag values to a set of pre-defined conditions (value equal to X, value in range or out of range, etc.) and logs an event when a tag value matches one of its event conditions. Some events are simply logged while other events require operator intervention and are configured as alarms. The alarm event data is sent to the Alarm Displays Engine, which manages how the alarm is presented to the operator. When the tag value goes out of the alarm state, the Event Engine sends an alarm canceling event to the Alarm Displays Engine.
Web Server
An HMI may provide Internet access to the alarm and event logs, allowing remote users to read the log files using a web browser.
Data Engine
The HMI Data Engine exchanges tag values with the machine controller via a communication protocol supported by the controller. PLCs typically communicate by a proprietary protocol or using an industry standard such as Modbus. While PAC communication can be based on these standards, it often takes advantage of Ethernet based protocols.
Tag Configuration Editor
The Tag Configuration Editor is a utility that developers use to create, configure and maintain the application tag list. It exports a configuration file that the HMI can use to initialize the tag engine.
Implementing a Typical HMI Architecture Using the LabVIEW Touch Panel Module
The LabVIEW Touch Panel Module provides a graphical programming interface that allows users to develop a HMI application in a Windows development environment and deploy the finished executable to a National Instrument Touch Panel Computer. For a more understandable structure, the HMI Architecture can broken into the Navigation loop, the Scan loop and the Background Processes loop. This is illustrated in Figure 3.

[+] Enlarge Image
Figure 3. HMI LabVIEW Architecture
The Navigation Loop contains the HMI pages and is responsible for organizing and navigating these pages. The Scan Loop contains the Data Engine, Alarm Engine, and Hardware IO Communication Drivers. It is responsible for exchanging data between the HMI and the machine controller as well as for monitoring alarms. The Background Processes loop is where any other components exist that need to execute parallel to the Navigation and Scan Loop.
Other components in the HMI architecture interact indirectly with the HMI application. For example, both web servers and the Tag Configuration Editor interact through support files (web pages and configuration files respectively).
Navigation Loop
This Navigation Loop is implemented as a simple state machine built with a while loop and a case structure. Each case encloses a display page or HMI page VI that, when called, is displayed on the HMI screen. Figure 4 below is an example of a navigation loop.
Figure 4. Example Navigation Loop Block Diagram
This example is using the HMI Navigation Engine (HNE) reference library, which was created for the purpose of HMI page management and navigation. Please refer to the document HMI Navigation Engine (HNE) Reference Library for more on using the HNE to create your navigation loop.
HMI Pages
As state above, the navigation loop contains all the HMI pages for an application. Each HMI Page is a LabVIEW VI created to monitor and configure a specific process or sub-process in the machine. The most common elements on a page front panel are: Navigation buttons, action buttons, numeric indicators, graphs, images, and boolean controls and indicators. Figure 5 shows an example page containing a typical set of front panel elements.
Figure 5. HMI Page (LabVIEW VI Front Panel)
The page block diagram uses the event-based producer consumer design pattern provided with the Asynchronous Message Communication (AMC) reference library to implement a responsive, event-driven user interface (UI). Figure 6 shows an example page block diagram containing the AMC design pattern.

[+] Enlarge Image
Figure 6. Example Page Block Diagram Using AMC Design Pattern
Please refer to the Creating HMI pages for LabVIEW Touch Panel document for more information on implementing Display or HMI Pages.
Alarm Displays
In Figure 3, the Alarm Displays is included in the Navigation Loop. This is because an Alarm Display is often just a special type of HMI page that displays the latest active and historical alarms. Another common way to display alarms is through an alarm footer. This alarm footer is a one-line display that is added to the bottom of any page.
The Touch Panel Alarm Engine (TAE) reference library was created to monitor, log and display active and historical alarms. It installs a palette to User Libraries»TAE named Display Alarms. This palette has an API for accessing, formatting and displaying the newest active and historical alarms on HMI pages. Please refer to the document Touch Panel Alarm Engine (TAE) Reference Library for more information on using the TAE to build an Alarm Display.
Scan Loop
The Scan Loop is implemented as sequence of processes that execute in a loop at a particular rate. Some of the specific processes contained within are the Data Engine and Alarm Engine. Figure 4 below shows an example of a scan loop.
[+] Enlarge Image
Figure 7. Example Scan Loop Block Diagram
This example uses the CVT Client Communication (CCC) reference library to implement the Data Engine and the Touch Panel Alarm Engine (TAE) reference library to implement the Alarm Engine.
CVT Client Communication (CCC)
The CVT Client Communication (CCC) reference library was created for sharing the latest tag values between the HMI and machine controller such that the HMI always has the latest data from the machine controller and vice versa. The CCC receives this latest data and updates the HMI's local Tag Engine so that the data is available throughout the HMI application. Figure 8 shows how the CCC is implemented in the HMI Scan Loop.
Figure 8. CCC VIs Residing in the HMI Scan Loop
Please refer to the document CVT Client Communication (CCC) Reference Library for more information on using the CCC to implement the Data Engine in the Scan Loop.
Touch Panel Alarm Engine (TAE)
The Touch Panel Alarm Engine (TAE) reference library was created to monitor, log and display alarms. It does this by comparing tag values against different alarm criteria. If an alarm is detected, that tag is added to a global alarm status list, classified as an active alarm and then logged to disk. When the tag value no longer meets the alarm criteria, it becomes a historical alarm.
The TAE should execute after all the tags it is monitoring are updated with the latest values. This makes the Scan Loop a ideal location for the TAE. See Figure 9 for an example of how to add the TAE to your scan loop.
Figure 9. TAE Alarm Engine VI Residing in the Scan Loop
Please refer to the document Touch Panel Alarm Engine (TAE) Reference Library for more information on using the TAE to implement the Alarm Engine in the Scan Loop.
Current Value Table (CVT)
As discussed above, the Tag Engine is a mechanism used by multiple processes for storing and retrieving current tag values from anywhere in the HMI application. The Current Value Table (CVT) reference library was created to implement this mechanism. The CVT creates a central storage location for all tag data residing on the HMI and provides an API that easily accesses this tag data. Both the CCC and TAE rely on the CVT to send and receive updated tag data. Please refer to the document Current Value Table (CVT) Reference Library for more information on using the CVT to implement the Tag Engine.
Tag Configuration Editor
A Tag Configuration Editor is a support tool that helps with the creation and configuration of tags. As the purposed implementation of a HMI architecture using the LabVIEW Touch Panel module still relies on tags, a Tag Configuration Editor specific to the reference libraries discussed above was created. Please refer to the document A Tag Configuration Editor for Machine Control for more information.
Where to Go From Here
The following is a map of other documents that describe the machine control reference architecture. You can click on the image to navigate directly to each document.
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/).
