About tag properties
Tag properties are metadata associated with each tag in the project database.
Most of the time, you may think of tags as simple program variables that store values, because that is how you generally use them in your project. Each tag, however, is in fact a complex data structure that can be handled in different ways during run time, depending on how the tag properties are configured.
In addition to standard metadata like array size, data type, description, and scope, the tag properties are used to configure alarm conditions, get tag quality, convert between different units of measurement, access individual bits, retain values through project restarts, save historical data, and so on.
Many tag properties can be viewed and edited directly in the Project Tags datasheet. In fact, every column after Name in the datasheet is another tag property, and while the datasheet shows the most common properties by default, you can configure it to show even more. To do this, right-click anywhere in the datasheet, and then click the additional tag properties on the shortcut menu. The selected properties are added as columns in the datasheet.
Other tag properties can be configured using the Tag Properties dialog. To access this dialog, select the tag in the datasheet, and then on the Home tab of the ribbon, in the Tags group, click Properties.
Finally, you can get and set many tag properties during run time just as you would get and set the values of the tags themselves, using either of the following methods:
- Call the functions TagsDBGetTagProperty and TagsDBSetTagProperty in any scripting interface; or
- Use the tag field syntax (e.g., tagname->property) wherever you would normally specify a project tag.