Perspective Power Chart tag browser question

I agree, the "Power Chart" component, IMHO, was a big miss. The vision is there definitely, but the functionality is just not. Of course, Vision has also had much longer to mature than perspective, so I mean no offense to the dev's, I only mean it has some opportunities for improvement.

You can enable the filterBrowseNode to only show tags which are historical but it's involved and doesn't exactly meet your needs here.

I would still, forgo system.tag.browse(), it doesn't take long for a system to grow to a large enough scale that it just takes too much time to be done in the UI.

At a very minimum, I would delegate it to a top level dictionary that is updated periodically (say every 15 secs) to insure that any updates are kept up to date.

My preference would probably be something similar to this, where you still query the DB to get the tagPaths via Named Query, but then process the returned data to get your needed descriptions.

histPaths = ['[provider]{}.description'.format(path) for path in system.db.runNamedQuery('GetHistoricalTags').getColumnAsList(0)]
descriptions = [qv.value for qv in system.tag.readBlocking(histPaths)]

You'll then need to provide some logic to build your tree structure as needed.

I would finally recommend that you add a data property to the items, and there you can provide the historicalTagPath that will be needed to add the pen to the power chart. You can get a historical tag path like this:

from com.inductiveautomation.ignition.common import QualifiedPath, WellKnownPathTypes

qp = [QualifiedPath.Builder()
	.set(WellKnownPathTypes.HistoryProvider, "provider")
	.setDriver("driver")
	.setTag(path)
	.build()
	.toString()
3 Likes