Need a way to convert BasicQualifiedValue objects into UDTInstance Objects

So from an event handling script I am attempting to pass a particular UDT from the global scope. system.tag.read() returns the BasicQualifiedValue object and system.nav.swapTo() requires a UDTInstance object when passed as a parameter. I understand that event.source.UDTName would work to pull a UDT Instance from the local scope but this is unhelpful in this particular use case. How is this usually done in scripting. I would think this would be a common use case. Also it would be VERY helpful if ignition developers could begin to use the Python Docstrings functionality when writing classes as Ignition is already notoriously difficult to troubleshoot. Thank you in advance.

I would consider refactoring the display so that instead of needing to provide the UDT instance itself, you only provide the path.

This can be accomplished with indirect addressing.

I know @nminchin does this quite often so perhaps he has some pointers.

The shear volume of code that would have to be refactored makes this solution impractical. Our entire project functions via passing UDT’s to window parameters

How are you passing them now?

Your question is one of several reasons I’ve never used UDTType parameters. Currently I don’t think it’s possible to do what you’re asking, it certainly wasn’t back in 7.7.5? When I first started using Ignition and first experimented with udttype params. Your best bet is to pass the path to the UDT for templates that you want to pass via scripts 🤷

1 Like