Programmatically discover tag references

I’m not sure how to do this but I would like to programmatically discover all tag names referenced by a given control from jython scripting for any reason. You can kind of see this from the status page on the gateway portal but its not programmatic and its for all open screens.

I have tried to setup my projects so that I can actually do this if people follow my convention of how to use dynamic properties + indirect tags on controls but its not perfect. For example if multiple tags are used for style and value on a control I cannot tell and would like to.

From this I can guess what tags are on a given screen (we have dense ones with hundreds) so that I can do analysis about which tags are in which scan classes on a given screen and how I need to reassign them to use bandwidth most efficiently.

I need to do this to keep down our bandwidth from devices and I find people occasionally pulling in a tag to a summary screen which pulls in thousands of other tags because its in the same scanclass which can double our traffic.

[quote=“todd.be”]
I need to do this to keep down our bandwidth from devices and I find people occasionally pulling in a tag to a summary screen which pulls in thousands of other tags because its in the same scanclass which can double our traffic.[/quote]

Are you sure this is what’s happening? Are you using leased scan classes? And are you aware that they don’t work like that as of 7.2? :slight_smile:

We are still using 7.1.8 since we have not found a 7.2 build we like (though last 7.2.5 beta looks nice) and need to find time window to push into production. I also did not see any significant change in the database structure in 7.2 that would make this different for us as we have our own tag engine that looks at the database. We are using leased scanclasses so it relies on the leaseexpire setting in the sc table to indicate tags are desired.

Now if you had an individual leaseexpire on a per tag basis that would make me very happy as I could more precisely determine what tags are actually in use.

The problem is definitely that but the request for discovering tags is still the real request. And would be nice to see what tags a control was using for other reasons.

You’re right- tag level leasing won’t apply to you, because you’re using an external provider. As you noted, you would need a “leaseexpire” per tag, which doesn’t currently exist.

The feature to easily track down how tags are bound has been asked before and is good. Hopefully we can work something in soon.

Regards,

Back to the other issue, I suppose it wouldn’t hurt to ask if you plan to ever update the sqlt_core table to include some mechanism that could be used by external providers to deduce which tags are actively subscribed to?

A timestamp that is constantly updated would be prohibitive on a per tag basis but a status flag on the tag and a timestamp of the subscription change on the scanclass would go a long way to helping us out here.

The only real issue I see would be requiring the tables to be altered on install and presumably would be backward compatible with providers that do not use the new columns.