Initial parametrized values in a power chart

Hello everyone, i’m working on a project where i have to show the value from a tag with history in a power chart. The tag path is dynamic, and this value is set passing a parameter to this page with an On Click action, changing the “object or machine” where the value from tag is pulled. I have already tried in the way Inductive University does it and it doesn’t worked, so maybe you have another idea.

My question,

  1. How can I change the path where the data is pulled with the parameter, so it takes it from different objects or machines?
  2. Is there any form where i can set values to the power chart so it always shows the tag data in the chart without having to select it in the tag browser?

Try binding props.pens.0.data.source to the view parameter containing the tag path.

Power Chart data source

I’m trying to bind it with this structure:

{LiveAnalysisEquipmentPath}/OEE Performance

Where {LiveAnalysisEquipmentPath} is the parameter that brings the path and is not working, it shows nothing.

I bound the parameter to the label that is down on the left to be sure the parameter is passing correctly to the page and it’s working.

It’s not clear what exactly you have done.

Try this:

  • Run the Power Chart in Developer preview mode.
  • Add one of the history tags you are interested in monitoring.
  • Stop the preview and examine the historian tag path. See if that matches the one in your label.

I suspect you may be passing in the live tag instead of the historian. For example, I have a simulation tag on my test gateway with actual tag path,
[default]Machine1/Compressor1 motor amps

Its historian tag is
histprov:Historian:/drv:ignition-desktop-l2q5jpp:default:/tag:compressor1 motor amps

You need the second format.

1 Like

Where do I get the format from? Is there an easy way to get the format and whats the best way to have it dynamic?

Technically, you do not need the second (historical tag path) format anymore. Since v8.1.14 the perspective Power Chart will accept the first format (non-historical tag paths) and convert it internally.

However, if one wanted to change the format, something like this works.

from com.inductiveautomation.ignition.common.tags.paths.parser import TagPathParser
from com.inductiveautomation.ignition.common import QualifiedPathUtils

def getQualifiedPath(path_string):
	myBasicTagPath = TagPathParser.parseSafe(path_string)
	myQualifiedPath = QualifiedPathUtils.fromTagPathNew(myBasicTagPath)
	return myQualifiedPath.toString()
	
path_string = "[System]Gateway/UptimeSeconds"
qualifiedPath_string = getQualifiedPath(path_string)
print path_string 
print qualifiedPath_string
>>> 
[System]Gateway/UptimeSeconds
prov:System:/tag:Gateway/UptimeSeconds
>>>

For further study, this is a good reference: Javadocs & Notable API Changes
Pick an Ignition version then use the search feature to look up the details of the imported classes.

2 Likes

Well, except for the gotcha with remote tag providers discussed over here:

1 Like

Thanks, so I can use a regular tag path unless i a remote tag provider?

1 Like