This function sets 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.

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


  TagsDBSetTagProperty( strTagName, numPropertyID, numOrStrPropertyValue )  
Web Studio Help tagsdb tagsdbsettagproperty.xml d446433e123 TagsDBSetTagProperty
The name of the project tag on which the tag property will be set.
The tag property to be set, identified by one of the following values:
Value Property Data Type
0 Tag name String
1 Array size Integer
2 Data type String ("Boolean", "Integer", "Real", "String", "classname")
3 Description String
4 Scope Integer (0 for Local, 1 for Server)
5 Startup value String
6 Minimum value Real
7 Maximum value Real
8 Engineering unit String
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 set alarm conditions on project tags, use the function TagsDBSetAlarm. Other tag properties not listed here cannot be set during run time.
The value to set to the tag property. The value must be of the appropriate data type.

Returned value

This function 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.
-1 The function TagsDBBeginEdit was not executed successfully before this function was called.
0 Function executed successfully.


The following restrictions apply to the execution of this function:
  • The 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;
  • The function TagsDBBeginEdit must have been executed previously, in order to lock the tags database for editing; and
  • The function TagsDBEndEdit must be executed when the editing is finished, in order to release the tags database and resume normal run-time operations.

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