I want to find the UDT instance name from the full tag path(include Atomic member)
For example if I have PUMP UDT Class with following member:
and instance of Pump01 from it and put in Area1 folder. Now if I have Area1/Pump01/Motor1/FLT how can I find the UDT instance name from it which is Area1/Pump01.
Note: I don’t any clue how UDT structure when I receive the full tag Path: ‘Area1/Pump01/Motor1/FLT’, so like this example I may have some nested level of folder inside of my UDT.
I want to get the instance name not typeId.
For example I have UDT called PUMP, and I create an instance called P01.
So if I have P01/Motor1/FLT how can I get the P01.
I can’t use split("/") to extract first part because the instance may be place in folder structure.
For my case because I have always reach Atomic Tag non of the solution work for me. I think of every dirty solution and it works me now. As you see in code below I’m trying to reach some Parameters of my Parent UDT which is called ‘HMI’.
UDT = tagPath
HMI = ''
p = UDT.rfind('/')
if p == -1:
UDT = UDT[0:p]
HMI = system.tag.read(UDT+'/Parameters.HMI').value