Perspective Power Chart - Parameterised Tags?

I have built a view that uses a Power Chart.
I have 10 process units that I would like to use the same view, therefore can I use parameters or scripting or ...to reference the tags in the power chart?
e.g. on one view I want to trend Lab_Stn01_PSU_I01
using the same view for another process unit I would like to trend Lab_Stn02_PSU_I01.
This way I would not need to build 10 different views. Just use the same template.

Most Integrators have built their own wrapper for the Power Chart for this reason.
The critical part for this is generally making the correct historical tag path for the props.pens[0].data.source
An example of this is:

penTagPath = 'histprov:'+historicalDatabase+':/drv:'+gateway+':'+tagProvider+':/tag:'+tagPath

This should come out as:

histprov:DatabaseName:/drv:Gateway:default:/tag:TestFolder/TestTag

Where:
"DatabaseName" is the Historical Database
"Gateway" is the Gateway Name
"default" is the tag provider (normally seen in tag paths as [default])
"TestFolder/TestTag" is the tag path

As soon as you are dynamically creating this source, you can just change the tag path based on a parameter to the page.

2 Likes