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}
to workaround, but we would like to use direct reference with {..}
I think that tag() in expression are managed with readBlocking with more load than subscription mecanism. subject to confirmation of @mgross or @paul-griffith
Moreover, we often delete all udt/tag and generate them, and it seems that using tag() in expression results in a very long udt instance creation process with lots of readBlocking Error in the gateway, probably because in the creation process tag referenced by tag() expression are not always existing, it depends from creation order...
I suppose that this is not a problem with subcription used for {..} member in expression.
In case of tag() used in gateway expression tags ? Ignition use suscription ?
So what why is their use discouraged, especially if the path provided to the tag() does not change ?