Classes Folder

The Classes folder contains all of the project classes and their respective members. Classes are compound tags consisting of user-defined data-type structures or tag types (Integer, Real, Boolean, and String). Classes allow for high-level encapsulation in the project database. A class-type tag provides a set of values for its members.

To define a class you must define the members and their types. Class members are variables that hold values for an object with particular characteristics. Thus, the defining a class can be very useful for projects with a repeating group of variables.

Note: When you create a class folder, a Class icon displays in the Tag List subfolder located in the Project Tags folder.

To access the members of a class, use the following syntax with a period ( . ) as the separator: TagName.MemberName. For example: tk.LEV or tk.TMP.

If the tk tag is an array, you use the following syntax:

For example: tk[1].LEV or tk[n].TMP

A class-type tag contains a set of values (rather than a single value) associated with the class. You create class-type tags by grouping simple tags, which become the members. The maximum number of members for any class depends on the product specification. Class members can hold standard Integer, Real, Boolean, and String values, as mentioned previously.

To create a new class, use one of the following methods to open the Insert Class dialog:
When the Insert Class dialog displays, enter a class name in the Name field, and then click OK to close the dialog.
Figure 1. Insert Class dialog

Note: You must type a unique class name. You cannot create two classes with the same name. In addition, you cannot configure shared tags and system tags as classes.

IWS saves class folders in the Tag List subfolder (located in the Project Tags folder). You can edit the classes in this folder.

When the Class datasheet displays, you can use it to create, modify, or delete any class members and their viewable properties. (You cannot edit classes from the Tag Property dialog.)
Figure 2. Class Datasheet

Note: The maximum number of members for each class is 512 as long as it does not exceed the maximum number of tags supported by the license (Product Type) selected for the project. When a tag is created from a class type, each member from the class counts as one tag for licensing restrictions, because each member has an independent value.

To edit a class member or property, you can right-click on the item and use standard Windows commands to cut (Ctrl+X), copy (Ctrl+C), or paste (Ctrl+V). You can also undo (Ctrl+Z) the last modification to a field.

You also edit member properties as follows:
Note: Members of a class cannot be of another class type.

Also, you must create a unique class name. You cannot reuse the name of an existing class. However, you can create members with the same name in different classes.

To delete a class and all its members, right-click on a class folder and select delete. IWS disables the delete option if you are running any runtime tasks. In addition, you cannot delete a class if it is associated with any tag.