A Tag Configuration Editor for Machine Control
Overview
The Tag Configuration Editor (TCE) is an application development utility to create and edit tag configuration files for use in a machine control application. It is distributed as an executable application and can be accessed from the LabVIEW tools menu. The tag configuration files created by the TCE describe the list of tags used in a HMI and controller of the machine control reference architecture and are used to initialize a number of other components in the application.
Table of Contents
Introduction
The Tag Configuration Editor is used during the development phase of a machine control application to create the HMI and controller configuration files that are used during the run-time initialization of several application components. On the HMI tag configuration files are used to define the tags in the Touch Panel Alarm Engine (TAE), the Current Value Table (CVT), and the CVT Client Communication (CCC). In the controller they are used to initialize the CVT and the cRIO I/O Engine (CIE). The machine control reference architecture uses two separate tag configuration files, one for the HMI and one for the controller.
Figure 1: Use of the Tag Configuration Editor in the Machine Control Architecture
The TCE is designed as a generic editor of tags (variables) used in an application. For use in the machine control reference architecture, the TCE supports specific I/O interfaces that allow binding of tags to external data sources. In case of the HMI tags can be bound to data sources on the controller using the CVT Client Communication (CCC) interface. For the controller targeted to CompactRIO, tags can be bound to physical I/O channels through the FPGA using the cRIO I/O Engine (CIE) interface. Both of these interfaces are described in detail in other Developer Zone articles.
The TCE could be adapted to support other interfaces and protocols such as FieldPoint I/O, DAQ I/O, and industrial communication protocols such as Modbus, by customizing the source code and adding the necessary configuration dialogs.
Figure 2: Tag Configuration Editor Interface
The TCE user interface is very intuitive and easy to use. The TCE UI contains one tag configuration at a time which is shown in the main window. The left side of the editor shows a complete list of the tags in the configuration. Tags can be sorted by tag order, alphabetically or by address using the Sort menu.
When a tag is selected in the left window, the parameters of the tag are shown and can be edited in the tab section on the right side of the window. Depending on the configuration target (HMI or controller) of the current configuration different tabs are visible. The basic settings of a tag are listed in the first tab, while additional target-specific settings are listed in additional tabs.
Target mode
Tag configurations for the HMI and controller are created and stored in separate configuration files. Therefore the TCE is always set to target either an HMI or controller which enables the proper tabs and options in the editor. The target mode is set using the Target menu. This setting is not stored in the tag configuration file and must be set in the editor before creating a new configuration or loading an existing configuration. If the target mode is changed while a configuration is loaded, the configuration will be removed from memory. If a configuration is loaded in the wrong target mode, you can simply change the target mode (do not save any changes) and reload the file.
Tag Configuration Developement
This section describes the basic operations of the TCE used to create or edit a tag configuration file.
Creating, Loading, and Saving a Tag Configuration
A new tag configuration can be created using the Create New … button or the File menu. An existing configuration can be loaded from file using the Open… button or File menu. If a new configuration is created or an existing configuration is loaded while another configuration is already loaded in memory, the editor will unload the current configuration and prompt you to save any unsaved changes.
The current configuration is saved using the Save button or the File menu. The current configuration can be saved in a different file using the Save As … option in the File menu.
Creating and Editing Tags
Tags can be created using the New Tag button, Tag menu or by using the right-click menu of the tag list on the left side of the window. You can also duplicate an existing tag using the Tag menu or right-click menu. Tags can be deleted from the current configuration using the Delete Tag button, Tag menu, or right-click menu.
When a tag is selected in the tag list, its settings can be edited in the tab section on the right side of the editor. Basic settings for each tag include a tag name, data type, and default value. The default value is used during the initialization of the Current Value Table.
External tag connections are configured in the lower section of the first tab. By default a new tag is considered an Internal tag that exists within a target but is not exchanged with an external data source/sink. To connect a tag to an external data source/sink, select the appropriate Protocol, Direction and Address.
HMI-Specific Settings
Label
When targeted to an HMI you can configure a label for each tag. The label is a descriptive string that may be used as part of HMI operations to provide a label on a control or indicator or add other descriptive information to the HMI. The label of a tag can be localized to a number of different languages in the TCE. The localized string can be accessed using the CVT in the HMI to easily localize a complete HMI to different languages at run-time.
To quickly localize a complete tag configuration you can export labels for all tags to a text file, translate the labels in a separate text editor and then import the localized labels. In the Localization menu select Save Resource Strings… to save the labels to a separate file. After translating the labels import the file using Load Resource Strings… while the tag configuration is loaded in the editor. The tag configuration must not be changed between the time that the resource strings are exported and when they are imported. Save the tag configuration before exporting the labels and then do not make any changes until re-importing the translated labels.
CCC Interface
Tags configured on an HMI can be connected to tags stored in a controller using the CVT Client Communication interface. This connection is configured in the Tag Configuration Editor. The connection is unidirectional, so you have to select to either write or read the tag from the HMI. The tag address is the name of the tag as it is stored in the CVT on the controller.
Event and Alarms
On an HMI you can use the Touch Panel Alarm Engine (TAE) component to add alarm detection features to your application. This component is configured through the Tag Configuration Editor to detect specific conditions on tags and set either an event or alarm on these conditions. Details about the Touch Panel Alarm Engine can be found in a separate Developer Zone Article.
In the second tab of the editor you can enable event and alarm detection for a tag on the HMI. In addition you configure the condition which will trigger the event or alarm. The supported Event Type is dependent on the data type of the current tag. High Limit, Low Limit and Hysteresis are set in units of the tag, while Deadband is configured in seconds.
Controller-Specific Settings
When targeted to the controller, tags can be configured to connect to physical I/O channels on a CompactRIO system using the cRIO I/O Engine interface. The number and type of channels available for connections depend on the specific configuration of modules used by an application.
To properly configure controller tags for an application, the cRIO module configuration must be specified in the second tab of the editor before configuring any tags. In the second tab select the chassis and modules used by the application. Then click Update Configuration.
Figure 3: cRIO Module Configuration
Once this step is completed, the channel selection in the first tab will display the list of available Read or Write channels and properly configure the channel address. For more information on the cRIO I/O Engine consult the documentation available on Developer Zone.
Figure 4: Select cRIO channel for tag
The cRIO module configuration in the Tag Configuration Editor is not stored as part of the tag configuration file. If you load an existing controller tag configuration file, you must manually confirm and update the cRIO module configuration in the editor before editing the tag configuration. The cRIO module configuration is loaded by the TCE from the last time the TCE was used.
Importing and Exporting a Tag Configuration
The normal tag configuration file format is a binary file and cannot be read or edited using an external editor. In order to save a configuration as a text file that can be loaded in a separate editor you can export and import the tag configuration. Use the Import… and Export… options in the File menu. To create a new configuration using a separate editor, create a new configuration with a few sample tags and export it to a file. Use the format of the exported tag file as a guide.
The Export file format is a tab delimited table that can be loaded in Microsoft Excel or most other text editors. The first row of the file contains the names of each column in the file. Certain fields in the Export file such as Protocol, Direction, and EventType are stored as numeric values. Use a sample configuration file as a guide for these values.
In the Label field specific formatting characters are exported as backlash codes. They are converted back during the import process. These are:
|
Language delimiter |
\l |
|
New Line |
\n |
When editing an exported file you must use these codes in order for the file to be imported correctly.
Deploying a Tag Configuration
To use tag configuration files in an application they must be deployed to the target systems before they can be loaded by the application. Typically the files are copied using FTP to the target system. They should be copied to a separate folder on the target such as c:\config. The Tag Configuration Editor includes four VIs to load tag configuration files for the four different components that currently use these files.
If you make changes to a tag configuration file in the process of developing an application you must re-deploy the files to your targets before running the application.
Loading a Tag Configuration in an Application
As part of the Tag Configuration Editor installation, four VIs are copied into the LabVIEW user palette to load tag configuration files in an application. There is a separate VI for each component of the machine control reference architecture that uses the tag configuration file.
- Touch Panel Alarm Engine (TAE)
- Current Value Table (CVT)
- CVT Client Communication (CCC)
- cRIO I/O Engine (CIE)
These VIs are used in the application in conjunction with these components to provide tag list information to the initialization routine of each of these components.
Figure 5: TCE Function Palette
Machine Control Reference Architecture
The Tag Configuration Editor is an integral part of the Machine Control Reference Architecture. To better understand how it relates to the rest of the architecture review the documents describing the architecture and its components starting with A Reference Architecture for Local Machine Control.
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/).

