I have an Expression Tag called Tag Name inside the UDT. I want it to dynamically extract the device prefix from the path, which is the segment between the plant folder and the second dash:
Full Path
Expected Output
.../KCW/N-KCW1-CL1-...
N-KCW1-
.../GCW/W-GCW1-PH1-...
W-GCW1-
.../NMGD/W-NMGD1-CM1-...
W-NMGD1-
The plant folder name (KCW, GCW, NMGD etc.) and device suffix (-CL1, -CM1, -PH1) vary across instances, so the solution must be fully dynamic. Can it be done in ignition?
This is honestly not sustainable and will cause a nightmare further down the line when a site is introduced that does not have the exact same tag pathing.
I would instead add more parameters to the UDT and include a TagName or TagDescription parameter that could then be referenced in an expression tag inside the UDT i.e. {TagDescription}
You didn't use my parsePath() function at all. (Not so robust without it.)
Did you install my Integration Toolkit module? Won't work without it. And for some versions of v8.1, a gateway restart is needed for the functions to work in expression tags.
Thank you for your response! I am using Ignition v8.3.6. I was not aware of the Integration Toolkit module — that explains why your parsePath() function wasn't working in my case.
Could you please share the download link for the Integration Toolkit module compatible with v8.3.6? I would love to implement your more robust solution properly.