Hello all,
I have been attempting to pull specific properties out of tags that are returned by system.tag.browseConfiguration().
Following the post here I made the following script:
"""
This example will browse the root of the Tag Provider named "default".
For each tag found, prints the non-default properties.
"""
from com.inductiveautomation.ignition.common.sqltags.model import TagProp
# Specify the folder to browse. Modify this line to filter on a specific folder.
folderPath = "CF1/CF1_BowlSpeed"
db = TagProp.HistoricalDeadband
histEnabled = TagProp.HistoryEnabled
# Start a non-recursive browse, and stores the configuration data in a variable
tagConfig = system.tag.browseConfiguration(folderPath, False)
# Iterate through the configuration data
for tag in tagConfig:
#print "--------------------------------------------------------------------"
propList = tag.getProperties()
print "Property '%s' has a value of '%s'" % (str(db), tag.get(db))
print "Property '%s' has a value of '%s'" % (str(histEnabled), tag.get(histEnabled))
# Iterate through the list of properties
for prop in propList:
#Print the property name and value.
if prop == db:
print "Property '%s' has a value of '%s'" % (prop, tag.get(prop))
elif prop == histEnabled:
print "Property '%s' has a value of '%s'" % (prop, tag.get(prop))
The output is the following:
Property 'HistoricalDeadband' has a value of 'None'
Property 'HistoryEnabled' has a value of 'None'
Property 'HistoricalDeadband' has a value of '15.0'
Property 'HistoryEnabled' has a value of 'True'
My question is how is it that one method returns ‘None’ while the other method returns a value?
I would really like to pull the exact properties I want and not depend on the getProperties() method.
Thanks