Returns an array of tags from a specific folder. The function supports filtering and recursion. Leave filters blank to return all tags.
If called in the gateway scope, a Tag Provider must be specified.
This scripting function has no Client Permission restrictions.
system.tag.browseTags(parentPath, tagPath, tagType, dataType, udtParentType, recursive, sort)
String parentPath - The parent folder path. Leave blank for the root folder. Note: you can specify the tag provider name in square brackets at the beginning of the parentPath string. Example: "[myTagProvider]MyTagsFolder". If the tag provider name is left off then the project default provider will be used.
String tagPath - Filters on a tag path. Use * as a wildcard for any number of characters and a ? for a single character.
String tagType - Filters on a tag type. Possible values are
String dataType - The data type of the tag. Not used for UDT instances or folders. Possible values are Int1, Int2, Int4, Int8, Float4, Float8, Boolean, String, and DateTime.
String udtParentType - The name of the parent UDT.
boolean recursive - Recursively search for tags inside of folders. Note: It is highly recommended that recursive is set to false, as server timeouts are more likely to occur. See the panel below for more details.
String sort - Sets the sort order, possible values are ASC and DESC. Sorting is done on the full path of the tag.
BrowseTag - An array of BrowseTag. BrowseTag has the following variables: name, path, fullPath, type, dataType, and the following functions: isFolder(), isUDT(), isOPC(), isMemory(), isExpression(), isQuery().
The recursive Parameter
The recursive argument will allow the function to recursively search for tags inside of folders. In larger Tag Providers, recursively calling this function will take some time to complete, and take a fair amount of system resources to complete. In these scenarios, it's not uncommon for a timeout to occur if the request originated from a client.
It is highly recommended that the native recursive behavior on this function is disabled. Instead, manual recursion may be utilized by making multiple function calls in your code. This allows the browse to occur in a timely manner, and in smaller segments of work. See the examples below for more details.