I've seen similar posts and answers that describe how to pass Easy Chart tags to a popup window. This seems straightforward enough, but I'd like to populate a simple Easy Chart in a Template from the 2 historical tags that are part of the Template's underlying UDT Tag. This seems like something that should be able to be done. Any ideas?
Easiest for me is to create internal custom properties on the template, bind them to the UDT tags, then use cell binding on the easy charts pen data set to populate what you need by binding to the custom properties.
I responded in the other topic:
(In the future, do not double-post. Per the rules.)
I'm sorry for double posting.
I saw what the other reply said but it is not the answer to my question. I don't want to create the pen tags when I open a popup, but rather when the instance of the template is created, or just a property binding that selects the database tag based on the underlying UDT tags. If the chart provides access to the historical database tags, I'd like to be able to directly, or indirectly, access the tag path to that, just like I can to any tag or property.
I think you are confused.
You should study my recommendation closer, and study the functionality of the EasyChart's tagPens
property. Learn how window parameterization works, and how to use property bindings in components to receive window parameters from root container properties.
And what we are trying to explain is that you do that with a template property that points to your base UDT path. Create internal custom properties on the template that defines whatever you need (pen tag paths, axis properties, etc) and use cell bindings on the easy chart data sets to point to those custom properties.
Yes, I am confused, but mostly because you keep talking about passing information to the template during an action. Please read my post a little closer. I did not say anything about a popup or any other action. I was able to implement what you said via an action like a popup, but I want to fill in the Tag Path of the EasyChart Tag History Pens through property bindings without an action like invoking a popup. The Tag History Pens are directly related to tags in my tag UDT and the rest of my template is filled in by accessing UDT tags and properties without any actions required to do so. Just want to do the same with these.
Yes. But how? I can choose properties and tags in my template using built-in browsers to find them. How do I do that only knowing the base UDT tag and any custom properties I've created? What is the relationship between the historical tags in the UDT tag and their tag path for the historical database provider? As @pturmel said, I'm confused, but just on this linkage.
Heres a template with a sparkline...same pricinple. The property analog_path holds the tag path to the udt root. The sparkline uses an indirect to tag history. For an easy chart, youll use cell update bindings instead to update the pens.
While this doesn't get the Tag Path directly from the underlying template UDT, it does solve my problem for the most part.
I was able to create 2 Template Parameters (Strings) that hold the Tag Path of the 2 pens in my template Easy Chart. The only other Template Parameter I have is the TagInstance, which is the binding to the UDT tag for the template. These 2 new Template Properties are Strings so I have to figure out what the Tag Paths are and enter them here, but I wish there were a way to browse for History Tag Paths like there is for tags and properties.
Thanks for the understanding and help!
No problem. As noted in the other thread, you really should not pass udt tags to popups or templates, even though Ignition made it easy to do so. Should always pass a tag path string instead, and form your bindings with indirects or properties within the popup or template.
I saw that but don't understand enough about why to comment. It does make me curious enough to wonder why that's not recommended, but passing a dataset is a common recommendation. What makes a UDT different than other tag types? If it's not too much of a detailed explanation, maybe you could explain?
If you pass a UDT, Ignition will subscribe(might not be the right word) to EVERY tag in the udt structure, instead of pulling just the ones used in a display component. This will crush performance with large UDTs being used across multiple template instances at once (imagine 100 tags x however many template instances open at once instead of 3 tags x however many active template instances)
Mainly, a UDT isn't a tag, it's a type. And that can be a performance killer if you have large UDT's or you have many bindings to smaller UDT's.
Here is an applicable topic:
I didn't say a UDT was a tag, I said it was a Tag Type. Thanks for the reply.
Thanks. Totally makes sense. My UDTs and Templates match 100% and all tags within the UDT are used by the template. I don't think this is a big killer of performance then, but maybe I'm wrong if there is more to it than that.
They also limit your usage of templates that use them. e.g. you can't pass UdtType parameters via script which is extremely limiting, you can't use them in template repeaters, etc.
If you want to design for flexibility and scalability, you shouldn't use them