A Reference Architecture for Local Machine Control
Overview
This document provides an overview to a complete machine control architecture using the NI Touch Panel Computer (TPC) as an HMI and the NI CompactRIO platform as the machine controller. Both of these platforms are configured and programmed using NI LabVIEW and therefore this architecture can be used on other LabVIEW platforms including Windows PCs for the HMI, and other PACs (Programmable Automation Controllers) such as PXI and CompactFieldpoint for the machine controller.
Table of Contents
Introduction
In a typical local machine control application one HMI is used in conjunction with one machine controller. These pieces are located close to the machine and are used by the operator to monitor the status of the machine and initiate operations on the machine.

Figure 1: Examples of Different Combinations of HMIs and Controllers Used in Local Machine Control Applications
There are many different ways to architect such a solution and to distribute the code between the two systems. This document recommends one such solution. The architecture presented in this and several associated documents is built using a number of software reference libraries that have been defined as part of the overall architecture. Each library serves a specific purpose and, depending on an individual application, may not be necessary to include in the final solution. In addition, some of these libraries provide very general functions and may be used in other types of applications. The individual libraries are described in more detail in a series of additional Developer Zone articles. This document describes the high level operation of the architecture and discusses how the reference libraries work together. You can search Developer Zone using the name of the individual libraries for more detailed information on each.
Local Machine Control Architecture
The two basic systems that make up the local machine control architecture are the HMI and machine controller. Each of these systems contains a tag engine which manages the data, variables, tags, etc. used by the system as well as additional components that define the operations of the individual system. For the HMI, the other components include the user interface and alarm engine. For the controller the main component in addition to the tag engine is the control logic which automates the operations of the machine. The controller interfaces to the machine using the I/O channels.

[+] Enlarge Image
Figure 2: High-Level View of the Local Machine Control Architecture
HMI
The HMI system contains a number of separate software reference libraries that together provide the user interface for the machine control application. The basic functionality of these libraries is described in this section.

[+] Enlarge Image
Figure 3: HMI Machine Control Architecture Overview
The HMI tag engine component is comprised of two reference libraries, the Current Value Table (CVT) and an I/O engine. The CVT stores all of the tags and variables used throughout the HMI in a central location. The CVT contains the most recently updated value for each tag so that all other libraries have access to this current value. Any reference library running on the HMI platform is able to access these tags. For communication with the machine controller the CVT uses the HMI I/O engine. The I/O engine handles the exchange of tag values between the CVT on the HMI and a corresponding CVT on the controller. In the current implementation of the local machine control architecture, which uses CompactRIO as the machine controller, the HMI I/O engine consists of the CVT Client Communication (CCC) reference library. This library provides the HMI with a TCP/IP interface to the CVT running on the controller. The HMI I/O engine can be expanded to use other communication protocols so that the HMI can interface to other types of controllers such as PLCs.
The user interface functionality of the HMI is typically implemented through pages and uses a number of different reference libraries. The Asynchronous Message Communication (AMC) reference library provides an event-driven producer consumer template ideally suited for responding to operator interaction. The page's controls are used to update CVT tags with the latest data intended for the machine controller and conversely, the page's indicators are updated with the latest data from the machine controller through CVT tags. The localization of these controls and indicators as well as all other aspects of the HMI pages are handled by the Localization Configuration Editor (LCE) reference library. Coordinating multiple UI pages, which are common in most machine control applications, is handled using the HMI Navigation Engine (HNE) reference library. The HNE automates the process of hosting and switching between multiple UI pages. Another common feature of many machine control applications are alarms and events. These are handled and processed on the HMI using the Touch Panel Alarm Engine (TAE) reference library. The TAE interfaces with the CVT to retrieve current values and then monitors them for alarm conditions. Current alarms are displayed on the UI pages.
The tags used by the Current Value Table, I/O engine and Alarm Engine are configured as part of the application and the configuration is stored in a common tag configuration file (*.tcf). This file is created and edited using the Tag Configuration Editor (TCE) and is also used for configuring the machine controller.
Machine Controller
The basic organization of reference libraries on the machine controller is similar to the HMI. However, UI pages and the alarm engine are replaced with the machine-specific process and control logic.

[+] Enlarge Image
Figure 4: Controller Architecture Overview
The machine controller tag engine component is similar to the HMI as it is made up of two reference libraries, the Current Value Table (CVT) and the cRIO I/O Engine (CIE). The CVT on the machine controller is the same library used in the HMI. The cRIO I/O Engine is based on the Scan Engine interface to cRIO I/O channels. The CIE is customized by the developer through the LabVIEW project or Tag Configuration Editor (TCE). Once updated for the current hardware selection, the CIE provides a configurable I/O interface that maps physical I/O channels to tags in the CVT. CVT tags are continuously updated with values from the input channels and the output channels are continuously updated with values from the CVT.
The machine controller process and control logic represent the heart of the machine control application and implements the direct control of the machine. It is able to interact with the machine through the CVT and CIE. Based on user interactions from the HMI and status data from the machine, the control logic updates the output channels going to the machine. The machine builder defines this logic using LabVIEW diagrams, which can be based on common design patterns such as a state machine or the LabVIEW State Chart module.
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/).
