tags = system.tag.browseConfiguration("parent", True)
for tag in tags:
print tag.get("value")
is returning this error
TypeError: get(): "1st arg can't be coerced to com.inductiveautomation.ignition.common.config.Property"
in the Script Console. We are running 7.9.5.
Essentially, TagConfiguration.get is not accepting a string as the property name as described here. TagConfiguration.get is working when I pass in a Property object from TagConfiguration.getProperties(). Is this a bug in 7.9.5 or am I missing something?
.get() there doesn’t accept a string. You’ll have do something like:
from import com.inductiveautomation.ignition.common.sqltags.model import TagProp
tags = system.tag.browseConfiguration("parent", True)
for tag in data:
print tag.get(TagProp.Value)
Sorry about that, this is an oversight in the documentation. The .get() function currently takes in a property object, not a string. You can loop through the non-default properties like the first example on the [system.tag.browseConfiguration] (https://docs.inductiveautomation.com/display/DOC79/system.tag.browseConfiguration) user manual page.
tagConfig = system.tag.browseConfiguration("[default]", False)
for tag in tagConfig:
propList = tag.getProperties()
for prop in propList:
#Print the property name and value.
print "Property '%s' has a value of '%s'" % (prop, tag.get(prop))