Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge HMI

TagsDBGetFirstTag

  • Last UpdatedOct 29, 2026
  • 2 minute read

TagsDBGetFirstTag is a built-in function that gets the name of the first tag in the tags database. It acts like an array pointer, with the array being the tags database, and it can be used in coordination with the TagsDBGetNextTag function either to generate a list of tags or to process the tags one at a time, depending on how you write your script.

Function

Group

Execution

String Exp.

Windows

Windows Embedded

IoT View

Thin Clients

Mobile Access

TagsDBGetFirstTag

Tags Database

Synchronous

Yes

Supported (see Notes below)

Not supported

Not supported

Not supported

Not supported

Syntax

TagsDBGetFirstTag(optNumProjectOrSystem)

TagsDBGetFirstTag ( { | { optNumProjectOrSystem | 0 | 1 } } )

optNumProjectOrSystem

Numeric flag that determines whether to get from the user-defined Project Tags or from the pre-defined System Tags:

Value

Description

0

Project Tags

1

System Tags

This parameter is optional; if no value is specified, the default value is 1.

Return value

If this function is executed successfully, it returns the name of the first tag. Otherwise, it returns one of the following possible values:

Value

Description

-2

Invalid number of parameters.

-3

No tags found in the tags database.

Notes

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

Also, this function can be called at any time; the TagsDBBeginEdit function does not need to have been executed beforehand. If that is the case, however, then TagsDBGetFirstTag and TagsDBGetNextTag can be used only to generate a list of tags. They cannot be used โ€” along with with the other Tags Database functions โ€” to edit the tags unless TagsDBBeginEdit has been executed.

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.

In This Topic