User Manual

GETTING STARTED


OTHER EDITIONS


LAUNCHERS


MODULES


PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support

ALL USER MANUAL VERSIONS

Ignition 8.1. Offline Version (04/2021)
Ignition 8 Online Version
Ignition 7.9 Online Version
Ignition 7.8 Online Version

Deprecated Pages

SDK Documentation

Employees

Sign In

Skip to end of metadata
Go to start of metadata

This function is used in Python Scripting.

Description

Returns a list of nodes found at the specified path. The list objects are returned as dictionaries with some basic information about each node.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

  system.tag. browse(path, filter)

  • Parameters 

String path - The path that will be browsed, typically to a folder or UDT instance.

Dictionary[String, Any] filter - A dictionary of browse filter keys. Keys are listed below.

  • Returns

Results - A Results object which contains a list of Tag dictionaries, one for each Tag found during the browse. See Scripting Object Reference.

  • Scope

Gateway, Vision Client, Perspective Session

Filter Keys

The following keys represent filter criteria that can be used by the filter parameter. 

KeyDescriptionExample Filter
name
The name of the item. Utilizes the * character as a wildcard character. 
# Literally search for "MyTag"
{"name":"MyTag"}

# Searches for any names that contain "Tag" in their name
{"name":"*Tag*"}
dataType
Represents the data type on the Tag. Valid values can be found on the Tag Properties page .
{"dataType":"Int4"}
valueSource
Represents how the node derives its value. Generally only used by nodes with a Tag type of "AtomicTag". Valid values can be found on the Value Source description on the Tag Properties page.
{"valueSource":"opc"}
tagType
The type of the node (Tag, folder, UDT instance, etc). A list of possible types can be found on the Tag Properties page.
{"tagType":"AtomicTag"}
typeId
Represents the UDT type of the node. If the node is a UDT definition, then the value will be None. If the node is not a UDT, then this filter choice will not remove the element. As such, this filter functions best when paired with a tagType filter with a value of UdtInstance.
{"typeId":"myUDT", "tagType":"UdtInstance"}
quality
Represents the quality on the node. While there are many types of quality codes, this function only recognizes "Bad" and "Good". More granular quality codes are ignored. 
{"quality":"Good"}
maxResults
Limits the amount of results that will be returned by the function. 
{"maxResults":10}
recursive

The following feature is new in Ignition version 8.1.2
Click here to check out the other new features

Allows the browse to find all Tags inside the starting folder or UDT instance, even if they are inside nested folders or UDT instances themselves. Accepted values are True and False. False is the default, meaning that the browse will only return tags directly inside the starting folder or UDT instance.

{"recursive":True}
Results Object

The contents of each dictionary in the Results object varies based on the tagType of the node in question.

General Keys

By default all dictionaries contain the following:

KeyDescription
fullPath

A fully qualified Tag path to the node, including the name of the node. 

The value returned by this key is a BasicTagPath. However you can easily cast the variable to a string:
# Browse the Tag Provider named "default".
results = system.tag.browse("[default]")

for i in results.getResults():
	stringPath = str(i['fullPath'])
	
	# Do something useful with the stringPath...

hasChildren
A boolean representing if the node contains sub-nodes, such as folders and UDT definitions. Useful in cases where you need to recursively call the browse function. 
name
The name of the node. 
tagType
The type of the node. 

Tag Keys

If the node is a Tag ( tagType = AtomicTag ), then it will also contains the following keys:

KeyDescription
dataType
The data type of the Tag.
valueSource
Represents how the Tag derives its value. 
value
The last known qualified value on the Tag. 

UDT Keys

Both UDT Instances and UDT Definitions add the following key:

KeyDescription
tagType

Represents the type the UDT is based off of. 

UDT Definitions will have a value of None . 

Code Examples
Code Snippet - Simple Browse
# This simple script will browse a given Tag path, in this case the root of the provider called default, and print the results.

results = system.tag.browse(path = '[default]', filter = {})
for result in results.getResults():
	print result
Code Snippet - Filtered Browse
# This simple script will browse a given Tag path, in this case the root of the provider called default, and print the results.
# It also is filtering out anything that is not Atomic Tag, like folders and UDT Instances.

results = system.tag.browse(path = '[default]', filter = {'tagType':'AtomicTag'})
for result in results.getResults():
	print result
Code Snippet - Wildcards with the Name Parameter
# Similar to the Filtered Browse above, except a wildcard character may be used when filtering on the name parameter
# The wildcard character ( the * character) represents any number of characters, including none.  

results = system.tag.browse(path = '[default]', filter = {'name':'*M*'})
for result in results.getResults():
	print result
Code Snippet - Simple Browse with Condition
# This simple script will browse a given Tag path, in this case the root of the Tag Provider called default, and print the results.
# After it browses, it finds all of the items that do not have children and prints only those.

results = system.tag.browse(path = '[default]', filter = {})
for result in results.getResults():
	if result['hasChildren'] == False:
		print result
Code Snippet - Recursive Browse
# This script has created a browseTags function which can be called with a Tag path and filter.
# The function will recursively find all items under that path by going into folders and UDT Instances.
# This example gives the initial path of '[default]', meaning it will find every item in the Tag Provider called default.

results = system.tag.browse("[default]", {"tagType":"UdtInstance", "recursive":True}).results
for result in results:
	    print str(result['fullPath'])
Keywords

system tag browse, tag.browse