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

**URL:** <https://forum.inductiveautomation.com/t/finding-bad-tags-in-ignition-after-change-in-plc-tags/9388>\
**Category:** General Discussion\
**Created:** [November 27, 2014, 2:21am UTC](https://forum.inductiveautomation.com/t/finding-bad-tags-in-ignition-after-change-in-plc-tags/9388 "2014-11-27T02:21:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jash](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@jash](https://forum.inductiveautomation.com/u/jash)\
**Post date:** [November 27, 2014, 2:21am UTC](https://forum.inductiveautomation.com/t/finding-bad-tags-in-ignition-after-change-in-plc-tags/9388/1 "2014-11-27T02:21:40Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [November 27, 2014, 3:39am UTC](https://forum.inductiveautomation.com/t/finding-bad-tags-in-ignition-after-change-in-plc-tags/9388/2 "2014-11-27T03:39:25Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![jash](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@jash](https://forum.inductiveautomation.com/u/jash)\
**Post date:** [November 27, 2014, 4:27am UTC](https://forum.inductiveautomation.com/t/finding-bad-tags-in-ignition-after-change-in-plc-tags/9388/3 "2014-11-27T04:27:02Z")

</div>

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]

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [December 4, 2014, 7:07pm UTC](https://forum.inductiveautomation.com/t/finding-bad-tags-in-ignition-after-change-in-plc-tags/9388/4 "2014-12-04T19:07:03Z")

</div>

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,
