TagsDBGetTagProperty

This function gets the value of a specified tag property during run time. Tag properties are the metadata on project tags, such as tag name, array size, data type, description, scope, and so on. In some cases, calling this function is the same as using tag fields (e.g., tagname->property).

Function Group Execution Windows Embedded Thin Client Mobile Access
TagsDBGetTagProperty Tags Database Synchronous Supported (see “Notes” below) Not supported Not supported Not supported

Syntax

  TagsDBGetTagProperty( strTagName, numPropertyID )  
Web Studio Help tagsdb tagsdbgettagproperty.xml d439348e127 TagsDBGetTagProperty
strTagName
The name of the project tag from which the tag property will be gotten.
numPropertyID
The tag property to be gotten, identified by one of the following values:
Value Property Data Type Same as…
0 Tag name String tagname->Name
1 Array size Integer tagname->Size
2 Data type String ("Boolean", "Integer", "Real", "String", "classname") -
3 Description String tagname->Description
4 Scope Integer (0 for Local, 1 for Server) -
5 Startup value String -
6 Minimum value Real tagname->Min
7 Maximum value Real tagname->Max
8 Engineering unit String tagname->Unit
9 Retentive value Integer (0 for disabled, 1 for enabled) -
10 Retentive properties Integer (0 for disabled, 1 for enabled) -
11 Dead band Real -
12 Smoothing Integer (0 for disabled, 1 for enabled) -
Tip: To get alarm conditions on project tags, use the function TagsDBGetAlarm. Other tag properties not listed here cannot be gotten during run time.
numOrStrPropertyValue
The value to set to the tag property. The value must be of the appropriate data type.

Returned value

If this function is executed succesfully, then it returns the value of the specified tag property. Otherwise, it returns one of the following possible values:
Value Description
-4 Project tag (as specified by strTagName) does not exist.
-3 Wrong parameter type or inconsistent value.
-2 Invalid number of parameters.

Notes

This function can only be executed on the project server — it cannot be called by a Graphics Script, Screen Script, or Command animation running on a project client.

For more information about the Tags Database functions and examples of how to use them, see Edit the tags database during run time.

TagsDBGetTagProperty