My question is, is there any way to make this generic is captured in the Expression Tag? Something like this:
{[~]A/B{1}/C/D.AlertActive} then we refer {1} to anything we like.
As of now, I am trying to create Expression in the UDT tag itself. If it cannot be made generic, then I have to create unique expression for each Expression Tag instance instead of from UDT.
Tag paths can be made generic in expressions by using the “tag” expression function. Check out the documentation on “tag” to find out more: docs.inductiveautomation.com/display/DOC/tag
Thanks for the reply. I actually have checked the short tag() documentation which you sent before I asked but still could not find work around with my case.
The link shows that we can make use of Custom property like {Root Container.tankNum}.
In my case, the UDT is shown in a set of Components of a Template in a Template Repeater. The Template Repeater has a Repeat Behavior of Count and has Index Parameter Name “index”.
Now, the UDT I have contains some other base Tags and each base Tag is mapped to one Component in the Template, which is in the Template Repeater.
So, my question here is more like, from the base Tag in my UDT, how can I know the index in the Template Repeater it is actually referred to?
Thanks. Your reply is pretty close in solving my issue actually. Except that I have multiple levels of tags which makes it rather hard except I copy over all the parameters to the children tags.
I have tags with paths like:
A/B0/C/D
A/B1/C/D
A/B2/C/D
A/B3/C/D
Thus, I only need to put Number in my B tags as Data Type Parameter. However, I do not know how to access B Data Type Parameter from D. I could easily get D’s (assuming D is Expression Tag) Data Type Parameters in its Expression like this {Number}, but how to get C’s or B’s?
Since each C is another UDT owned by each B, I don’t know if we could get relative parent Parameters. I know that we could get our own custom parameters which are very useful indeed. But how to get the parent’s (or the parent’s parent’s). Is there a way to automatically pass down this custom parameter to all its children and its children’s children? Like inheritance protected concept in OOP like C# or Java I mean.
When you load a template into a template canvas or template repeater, the Parameters can be set as you load them. They are in a field called parameters, in a dataset called Templates which is a property of the canvas or repeater.
For example, here is a screenshot of a template canvas we use
The Parameter field passes all of the parameters for the template to the template.