I'm trying to figure out how to best create a paramterised UDT that automatically selects the OPC Server based on the folder that the instance of the UDT resides in. I am aware of the predefined {PathToParentFolder} parameter, but what I want right now is effectively a {ParentFolder} parameter. This is because my current ideas of tag organization are:
Tags
|-Devices
|
|-Device1
| |- UDT Instance
|
|-Device2
| |- UDT Instance
..
I believe that the {PathToParentFolder} will give me "\Devices\Device1" etc as it defined as:
The full path to the folder that this Tag is in.
when what I want is simply "Device1" as I am planning on a series of OPC UA connections called Device1, Device2 .. etc.
Is there anyway to do what I want?
My fall back is to eliminate the top level folder, but keeping that folder fits in with other patterns I want to following in order to best organize things.
Just to confuse things a bit, I just created a UDT with a string tag inside of it, and set the value to be {PathToParentFolder}, and the result was surprising. It was:
Devices/Device1/UDT InstanceName
Which is technically correct if you treat the instance as another level of folder. But this is not what I was expecting. So what I thought of as the parent is not the parent.