Search

User Manual

GETTING STARTED


MODULES AND PLATFORM


APPENDIX


TUTORIALS & HELPFUL TRICKS


GLOSSARY


STRATEGIC PARTNER LINKS

Sepasoft - MES Modules
Cirrus Link - MQTT Modules

RESOURCES

Inductive University
Ignition Demo Project
Knowledge Base Articles
Forum
IA Support
SDK Documentation
SDK Examples

ALL MANUAL VERSIONS

Ignition 8
Ignition 7.9
Ignition 7.8

Deprecated Pages

Skip to end of metadata
Go to start of metadata

This feature is new in Ignition version 8.0.0
Click here to check out the other new features
This function is used in Python Scripting.

Description

Retrieves Tags from the Gateway as Python dictionaries. These can be edited and then saved back using system.tag.configure.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax

system.tag.getConfiguration(basePath, recursive)

  • Parameters

String basePath - The starting point where the Tags will be retrieved. This can be a folder containing, and if recursive is true, then the function will attempt to retrieve all of the tags in the folder.

Boolean recursive If true, the entire Tag Tree under the specified path will be retrieved. Note that this will only check one level under the base path. True recursion would require multiple uses of this function at different paths.

  • Returns

List - A List of Tag dictionaries. Nested Tags are placed in a list marked as "tags" in the dictionary.

  • Scope

Gateway, Vision Client, Perspective Session

Code Examples
Python - Access a Single Property on a Single Tag
# This example will look up the Data Type property on a tag. 

path = '[default]My_Folder/My_Tag'

config = system.tag.getConfiguration(path, False)

# While the call above was directed at a single tag, the function
#    still returns a list, so we access index 0 to examine the properties
#    (hence the "[0]"). 
#
# Additionally, we can access the DataType property in a similar manner 
#    to accessing a key in a Python Dictionary. 

print config[0]['dataType']
Python - Get All Properties for a Single Configuration
# This example will get the configuration of a single tag

# Update the path here with the tag path you're trying to reach
path = '[default]Sine/Sine0'

# Get the configurations
tags = system.tag.getConfiguration(path)

for tagDict in tags:
	
    # Iterate over the dictionary with the iteritems function
    for key, value in tagDict.iteritems():
		
        # Do something with the keys and values
        print key, ' : ', value
Python - Return an Entire Folder of Tag Configurations
# This example will get the configurations of tags under a folder. 

# Update the path here with the folder you want to start at
folder = '[default]Folder/Another_Folder'

# Get the configurations. We'll specify True for the second parameter to search 
# recursivly
nodes = system.tag.getConfiguration(folder, True)

# Iterate over the results
for item in nodes:
	
    # Through the results, search each dictionary
    for key, value in item.iteritems():
		
		# ...looking for a 'tags' key
		if key == 'tags':
			print '#######Found some tags!#######'
				
			# iterate over the tag configurations we found
			for tagConfig in value:
				
				# Do something with the results.
				print tagConfig["name"]
Keywords

system tag getConfiguration, tag.getConfiguration

  • No labels