Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

LAB 2 - CREATE PROJECT TAGS

In this lab you will create tags used in subsequent labs.


Create a single tag
1. There are several ways to create a tag. The simplest way is to click Tag in the Global group on the Insert
tag of the Ribbon.

Pro Tip: You can also insert a single tag by right-clicking on the Project Tags folder in the
Project Explorer and selecting Insert Tag.

2. Selecting Tag opens the New Tag dialog, allowing easy tag creation.

3. Fill on the fields as shown in the above image and click OK to add the tag called iVar1 to the Tags
Database.

Pro Tip: You can quickly monitor your current tag count by using the Status Bar. The
information at the far right side, Tag Count , will give you the current number of
user- created tags.

Create multiple tags


1. Expand the Project Tags folder under the Global Tab of the Project Explorer. Open the Tags Database
by double-clicking the Datasheet View icon.

2. The Tags Database Worksheet is opened.


3. Create two more tags called iVar2 and iVar3 by filling out the tags database worksheet as
shown below.

4. Close the tags database worksheet.

Create classes and class tag arrays


The primary values needed for this project are as follows:

Each storage tank has values for Pressure, Temperature, Level, and Contents

Each tank has an Empty valve and Fill Valve. Each Valve has a Command and State value.

The simplest way to do this is by creating arrays of class tags.

1. In the Insert tab of the Ribbon, click on Class under Global.

Pro Tip: You can also create a new class by right-clicking on the Classes folder in the
Project Explorer and selecting Insert Class.

2. Type Tank in the Name field of the Insert Class dialog as shown below and click OK.

3. The new class worksheet will be displayed in the Workspace.


4. Configure the class members called rLevel, rPressure, rTemperature, and sContents as shown below.

5. Close the Class: Tank tab.

6. In the Insert tab of the Ribbon, click on Class under Global.

7. Type Valve in the Name field of the Insert Class dialog as shown below and click OK to open the new
class

8. Configure the class members called bCommand and bState as shown below.

9. Close the Class: Valve.

10. In the Global tab of the Project Explorer, expand the Project Tags folder and double-click on Datasheet
View to open the tags database worksheet.

11. Configure the cTank, cFillValve, and cEmptyValve tags as shown below

12. Close the project tags datasheet view.

The status bar should indicate that you are using 35 Tags, as each combination of tag, class member
and array element provides us with access to a different value in the Project.

You might also like