TagsDBAddTag
- Last UpdatedOct 29, 2026
- 2 minute read
TagsDBAddTag is a built-in function that adds a new project tag to the tags database during run time.
|
Function |
Group |
Execution |
String Exp. |
Windows |
Windows Embedded |
IoT View |
Thin Clients |
Mobile Access |
|---|---|---|---|---|---|---|---|---|
|
TagsDBAddTag |
Tags Database |
Synchronous |
No |
Supported (see Notes below) |
Not supported |
Not supported |
Not supported |
Not supported |
Syntax
TagsDBAddTag(strTagName,optstrTagType,optNumArraySize,optstrDescription,optNumScope)
TagsDBAddTag ( strTagName { | , { optStrTagType | "Boolean" | "Integer" | "Real" | "String" | "classname" } { | ,optNumArraySize { | ,optStrDescription { | , { optNumScope | 0 | 1 } } } } } )
strTagName
The name of the project tag to be added.
optStrTagType
The data type of the project tag to be added. This parameter accepts only the following values: "Boolean", "Integer", "Real", "String", or "classname".
This parameter is optional; if no value is specified, the default value is "Integer".
optNumArraySize
The array size of the project tag to be added.
This parameter is optional; if no value is specified, the default value is 0.
optStrDescription
A description of the project tag to be added.
This parameter is optional; if no value is specified, the default value is "".
optNumScope
The scope of the project tag to be added. This parameter accepts only the following values: 0 (Local) or 1 (Server).
This parameter is optional; if no value is specified, the default value is 1.
Return value
This function returns one of the following possible values:
|
Value |
Description |
|---|---|
|
0 |
Function executed successfully. |
|
-1 |
The TagsDBBeginEdit function was not executed successfully before this function was called. |
|
-2 |
Invalid number of parameters. |
|
-3 |
Wrong parameter type or inconsistent value. |
|
-4 |
A project tag with the specified name already exists in the tags database. |
|
-5 |
The maximum number of tags (as determined by the project's target system) has been reached. |
Notes
The following restrictions apply to the execution of this function:
-
The function can be executed only on the project runtime server — it cannot be called by a Graphics Script, Screen Script, or Command animation running on a thin client;
-
The TagsDBBeginEdit function must have been executed previously, in order to lock the tags database for editing; and
-
The TagsDBEndEdit function must be executed when the editing is done, in order to release the tags database and resume normal runtime operations.
For more information about the Tags Database functions and examples of how to use them, see Using TagsDB functions to edit the tags database during run time.