I have a UDT that has custom property at root level and inside UDT I have some tags inside a folder.
I want those tags access root custom property in expression. What is the correct syntax?
In following code the first two dots is used to access root level and the next one is for custom property and API is the name of the custom property. But this is not resolve.
{[.]...API}
If I have a tag in the root of UDT this syntax works:
{[.].API}
So what is correct syntax to read UDT root custom property inside a Tag Expression?
I had a ticket open on something very similar to this. The resolution from support was what @Markus_Oosthuizen suggested. I don't remember if it was marked as a bug, or just the way it works right now.
InstanceName means something different at different times. We created a tag on the parent UDT as an anchor for all other embedded UDTs that are used in the parent UDT. I believe it is an expression tag that is the InstanceName. That way the embedded UDT can grab that as a reference to the parent and then get the data that it needs. I would rather have the ability to read the property directly as you can a tag, but that isn't how it is as the moment.
The only workaround for this dot problem syntax is to create a tag as reference and put all customs properties on that tag and then easily the udt expression tag reference is work. Note that even folder custom property doesn't have option in designer UI to edit custom property right now.
Unfortunately with an expression tag then there's no way. tag() is likely your best bet but if you want to avoid that then your options are:
Use a derived tag: [.]../../{InstanceName}.API and then put your expression in the read expression
Move the custom prop into a parameter and reference the parameter
Move all your custom props down onto a tag called properties and then you can reference it with {[.]../properties.API}
Use a reference tag: [.]../../{InstanceName}.API
Use #3 as a reference tag and then use that in your expression tag but then you have two tags (effectively same as #1 but split)
Define the UDT instance name in the path, but then every instance would need to be overridden to put the correct instance name which defeats the purpose, but technically works: {[.]../../udtA.API}