Indirect Tag in Easy Chart in a Popup

Hi all,
I have been trying (with no success) to display a popup with an easy chart that is indirectly tagged.
I have reviewed the videos about indirect tags and easy chart in a popup but I still have no luck.

I have several flow meters displayed on a window. If I click on a flow meter, I open a popup window with an “Easy chart” that will display the historic flow rate for that flow meter. If I click on another flow meter, then the popup will display the flow rate for the meter. The examples I have seen use a drop down box to select the displayed values.
I can set up individual popup windows for each meter, but I was hoping to use a single popup window and populate it with the relevant data (tag).
The Chart Title is populated correctly using “indirect tag path”
Chart Title = {1}/DeviceName/String where {1} = {Root Container.DeviceID}
If I drop the tag directly into the easy chart it works Tag Path (from Easy chart customizer)
[~]Distribution_Stage3_WarmFlow/FlowRate This tag path works. When I try indirect Tag
[~]{Root Container.DeviceID}/FlowRate where Root Container.DeviceID = Distribution_Stage3_WarmFlow
The chart has an error overlay.
I have attached a screen grab including the diagnostic report
What am I doing wrong
Thanks
Woolie

You need to use a cell update binding on the easy chart.

Click the bindings button on the Tag Pens property of the easy chart:

Then, select Cell Update. Click on the TAG_PATH property of the pen you want to be indirect, then click the plus sign:

Change the tag path reference to the indirect path that makes sense for your tag system. You can see mine in the screenshot.

Thanks Brian,
I’ll give that a try
Woolie

Even better would be to create a dataset property for tagPens in the root container of your popup window, and uni-directionally bind the easychart’s tagPens to it. Then you can pass in a tagPens dataset with your openWindow() call with any desired number of pens to display.

Also, keep in mind that in the designer, the root container property that will be holding your indirection variable might be empty when you are working with the popup in isolation. You might have to supply a value by hand in the same manner that a window calling a popup would. If it’s empty, the tag path won’t make sense to ignition and you can get errors that way.

The root container dataset approach also allows you to have different axes and pen color/stroke/whatever for different popups. And as long as the window is saved with an appropriate dataset in the root container, it always opens properly in the designer. Setting up new uses is simple: create the pens the way you wish them to appear in the chart customizer, then copy the tagPens dataset to the clipboard. Open the other window, locate the object that will launch the popup, and create a tagPens dataset for it. Paste into that dataset, and have the openWindow() call include {‘tagPens’: event.source.tagPens}.

1 Like

I’m assuming you would be using the popup for charting various different things in this case. I can see the utility of it. It does seem a bit complicated if one is only setting up a popup for a particular class of equipment.

I can see the benefits though. Good to know it’s possible.

I think if you play with it a bit, you'll find it far less complicated than a cell update binding. Every bit of chart setup is done with the chart customizer. What could be easier? Anyways, I avoid cell update bindings -- they just seem like a sledgehammer when a simple nailset is called for.

1 Like

Thanks for all the help.
I am still working on it. I’m now trying to remove the cause for all the error messages I have caused by playing around.
Maybe I need more caffeine!
Again thanks to both of you for the quick reply.
Woolie

I’ll try to play with it in the future sometime. Although, I have to say, I’m doubting a just a bit about ‘every bit of chart setup’ being done in the customizer. Wouldn’t you have to edit in the indirection bits somewhere?

I agree that other, static, elements of a pen like color, stroke style, etc. would be simply done with the customizer. But, in the couple of instances that I’ve used an easy chart, it was fine to leave those saved in the easy chart properties and just do cell update bindings to indirect the tag paths. The number of pens, and the information those pens were graphing, wasn’t changing. I was just looking at a different, identical machine.

I do know that I’ve only scratched the surface of what ignition can do, and, I’m quite likely to come around to your point of view on this. It’s a very interesting approach.

Sorry, I can't help but chuckle when I read this. Passing a complete dataset defining all the pens and properties vs using an update binding to change the one property that needs changing....

I thought that I was the one using using the nailset :sweat_smile:

The indirection path is delivered to the popup window as a string in the root container (via properties in the openWindow() call). In the originating window, it is generally a constant in the script or perhaps saved as a property of the origin object. I'm suggesting passing a dataset to the popup instead of the indirection tagpath string. Or in addition to the string if the popup has some other decoration that could use it. In the origin window and object, that dataset would be an unbound custom property -- effectively constant and saved with the window.

But it is a dataset generated by the chart customizer and simply copy and pasted to a suitable place in the origin window. Far simpler than laboriously creating and maintaining a collection of bindings, bindings that would require a completely new popup window for any variation in pen count or appearance.

If you desperately want to use a cell binding to inject a tagpath into a tagPens dataset, I suggest doing it on the origin side of the operation. That’ll let you duplicate origin objects and/or templates as needed for a particular collection of related charts, without impacting the flexibility to pass any pen configuration you need to a shared chart popup.

Ok, but wouldn't that dataset need to be scripted? At least to supply the indirect variable in the proper place?

I'm probably thinking of a different situation than you are; after pondering this a bit. My use cases thus far (in my very limited experience) for indirection on an easy chart popup have all called the popup from a template. So, if I'm looking at the chart on my popup screen in the designer, with a root container string property set to "L2" (the name of one of my furnaces), the tag path property of the easy chart will be something like "Furnaces/L2/BasicInfo/Temperature". If I copy that tag pens table and paste it to the template property that calls this popup, will not all the template instances now launch with the pens pointing to L2?

I can see the logic in simply copy/pasting the tag pens table for a static screen calling a generic, reusable chart popup. But, I'm thinking that for template instances, a bit more work will need to go into generating the dataset when templates are involved.

Put the cell binding into the template on an extra (internal or nested object) dataset property. If you paste into a dataset that has a cell binding, everything will be replaced as you suspect, but the binding in the template will fix it.

And then pass the extra dataset to the popup? How would the rest of the extra dataset get updated when pasting the pen tables? Just trying to get my head around the workflow of something like this..

Or, are you suggesting that I set the easy chart tag pen table to the pasted dataset first, then set the tag pen table to the extra, indirection dataset second? With the indirection dataset only supplying tag paths, no other properties?

So, starting with template open in the designer, preloaded with a tagpath for one of your actual units, and with the chart popup also open. Create a tagPens root container property in the popup and bind to the chart's tagPens (not bidirectional). Open the chart customizer and set up the pen for that unit and adjust the appearance of the plot. Close the customizer. Open the tagPens dataset and copy to clipboard. Return to the template and add an internal dataset property, also tagPens for convenience. Paste the dataset into it. Create a cell binding on it to inject the tagpath when template instances are created. Create/edit event script to launch popup with template's tagPens loading into the popup's tagPens.

Later if an update is needed, simply use preview to launch the popup, tweak the appearance with the chart customizer, and repeat the tagPens copy-and-paste back to the template. The cell update binding there will still correct (in instances) the tagpath in that dataset after pasting everything else about the plot appearance.

Oh, ok, the cell update binding isn’t overwritten when pasting new data into the dataset. That makes sense.

Thanks for taking the time to beat something into my head! :slight_smile:

I like Phil’s Approach of passing a dataset to the popup.