parentPath for UDT's

I imported a bunch of tags, and was able to copy/paste them into UDT definition, but now I would like to have a script run thru and change the tags to use the UDT parameters rather than changing a bunch manually. I think the system.tag.editTag function would let me do that, but I’m not sure what parentPath to use? I tried [default] but it doesn’t seem to find the tags? Any suggestions?

Might be easier to export and do a search and replace, then import back in.

I couldn’t figure out how to import into UDT’s?

It’s essentially the same as tags, just different tab.

I agree, it’s close, but not the same.

You still use the same import/export buttons, just make sure you have the UDT definition tab selected.

What exactly can’t you figure out with it?

How in the json file to set the OPC Item Path and the OPC Server.

What I typically do is set one tag correctly then export to see how it’s done. Using something like notepad++ makes editing a bit easier.

Sorry, I thought you were having actual issues with the import process.

It’s been awhile, but I think I tried that and it wouldn’t let me import them into the UDT. You can import them as a regular tag, and then copy/paste them into the UDT, but I haven’t been able to import directly to a UDT. I’m sure there is a way to do it. I will just have to keep playing with it.

What is them? You can import UDTs. Export a UDT and then import it right back in for practice.

Yeah I was trying to import a whole bunch of tags into a UDT. I wanted to assign the OPC Item Path and the OPC Server as parameters in the UDT and then have each tag refer to them. But I had problems with it, but I’m still pretty green with Ignition so it’s not surprising! LOL

Gotcha, might want to spend a week getting more acquainted with the software. My advice is complete Inductive University first, https://inductiveuniversity.com

It might just be confusion on the terminology, I’m not quite following where you want to import a bunch of tags into a UDT. The UDT is the definition. How many UDTs do you have?

I want to create a UDT because I have several of the same device. It has probably 500 tags and I felt like creating a UDT would be the easiest thing to do. Create the UDT, put the path as a parameter so that when I create the UDT under the tags section all I would need to do is change the path parameter and then all the “new” tags would look to the correct device. I’ve done it with a couple of different ones and it works well. But they didn’t have so many tags to load so I was trying to figure out a way to do automatically. But as usual sometimes brute force is faster! But I usually learn more even if it takes more time. But even if I do, it would be handy to be able to update a tag from a script. I can do it on regular tags, but I can’t get it to find a UDT template tag and update it.

I’m unaware of a way to programmatically change a UDT definition element, but that doesn’t mean a way doesn’t exist. You can programmatically change the parameters.

You could have probably had this done in the 3 hours since you posted. :slight_smile:

Perhaps this doc will help you,
https://docs.inductiveautomation.com/display/DOC81/User+Defined+Types+-+UDTs