Finding "Bad Tags" in Ignition after change in PLC tags

I am developing an Ignition Project for data-logging and HMI for a PLC (AB CLX). To begin with, I browsed the PLC tags with the OPC Browser and dragged across all the relevant tags.

Since then, I have worked on the PLC logic and added/removed/changed the name of some of the tags on the PLC. The associated tags in my Ignition project then change their quality to something other than “Good” (I have my PLC connected).

Now that I want to update my Ignition Project to reflect the changes on the PLC, I want to get a list of all the tags with ‘not good’ quality. I don’t want to delete all the tags and drag them in from the OPC browser again because I have configured different scanclasses etc. for each tag. I just want to remove or rename and change the path of the bad tags.

I have written a script to do this:

[code]allTags=system.tag.browseTags(parentPath=’’, recursive=True)

badTags=[badtag for badtag in allTags if system.tag.getAttribute(badtag.str(), ‘Quality’).str()!=‘Good’]
for tag in badTags:
print tag

print ‘%d bad tags out of %d found’ %(len(badTags), len(allTags))
print “Script Done!”[/code]

I also tried exporting the tags, but the “Quality” attribute is not exported.
Is there an easier way to do this?

try this

tagProvider = '[put your tag provider name here]' folder = '' folderPath = tagProvider + folder tags = system.tag.browseTags(tagProvider + folder,recursive=1) for tag in tags: tagQual = system.tag.read(tagProvider + tag.path + '.quality').value print tag.path,tagQual

1 Like

So there’s no way to do it without a script then? No log anywhere which records which tags aren’t connecting? I’ve tried to look around for one on the Gateway Webpage.

Anyway here’s a more readable version of my script for posterity.

[code]allTags=system.tag.browseTags(parentPath=’’, recursive=True)

badTags=[badTag for badTag in allTags if not system.tag.read(badTag.path).quality.isGood()]
for tag in badTags:
print tag

print ‘%d bad tags out of %d found’ %(len(badTags), len(allTags)) [/code]

Strangely enough there isn’t a way to do this right now, without scripting. We probably should add some sort of tool for this, probably as part of the tag search.

Regards,

1 Like