System.tag.exists ..... but it doesn't

If I run the following in the script console

gnamePath = '[MQTT Engine]DCNET/MAP/S1/R1/B1/G10/Name'
if system.tag.exists (gnamePath):
	print 'Tag Exists'

and a folder for [MQTT Engine]DCNET/MAP/S1/R1/B1/G10/ is present , BUT the tag “Name” is NOT present in that folder then this will print " Tag Exists"

The function description is
Checks whether or not a Tag with a given path exists.

The folder has no tags in it is this the problem?

What version of Ignition is this happening on?

8.1.7

Updated to 8.1.12 now getting this message

image

only file in this path is modules file. Tried uninstalling, and downloading designer for reinstall. No luck

Delete the 11.0.11.1 folder in that path and you should be able to launch.

That fixed the designer launch after upgrade .

Still have issue with system.tag.exists

Have you tried refreshing the tag provider to make sure the folder is actually empty? I just ran a test in 8.1.9 and it worked as expected for me (empty folder and returned false when I checked for a non-existent tag in the empty folder).

Edit: Just wanted to note that the provider I tested against does not use MQTT.

Yes. Did this in the tag browser same results.

I think this might be a bug that is specific to the MQTT modules.

I thought maybe it affected any ManagedTagProvider implementation but I just tested against the provider from the SDK example and it works as expected.

I’d contact Cirrus Link or maybe paging @wes0johnson will work :slight_smile:

This is not something I’ve seen before. I’m not sure how the MQTT Engine module could be causing this other than maybe with the way we configure the ManagedTagProvider. I believe some of the config options we use are different from the SDK example. I’ll take a look and see if I can repro this and isolate the cause.

system.tag.exists expects QualityCode Bad_NotFound to be returned after trying to read a tag that doesn’t exist.

Is this not something that is handled by the ManagedTagProvider itself? I just glanced at the SDK example and it doesn’t do anything explicitly around this that I can see…

Well, that’s what I thought, but like I said when I tested the MTP example it all works fine :confused:

I’m not sure why it’s not behaving the same for tags from the MQTT provider.

I’ll do some digging on my side and see what I can find.

So I think I figured this out. I was not able to reproduce with the SDK example, but I was with Engine. This is how I got it to happen:

  1. I created an Edge Node with 3 tags under a single device and published from Transmission
  2. I deleted one of the tags from the Edge side
  3. I restarted MQTT Engine (this is key)
  4. I published a new birth from the Edge

This produced the following:

The reason is that MQTT Engine does not persist tags. But, it does still persist the tag configuration. So, I think ‘tagExists’ looks to see if it is in the DB tag table - which does not necessarily mean it is visible in Designer. With this, I suspect the tag you are trying to look up did exist at one point and was never deleted from the Ignition Tag DB (via a delete event or similar). But, Engine has since been restarted which is why it is not visible in Designer.

I believe that if you delete that tag from the DB, tagExists will properly return false.