Now I want to create a UDT such that I can pass in a index/integer and the UDT would go to the tag database and populate itself based on the index I pass into it.
I’d suggest checking out the Inductive University videos on UDTs (inductiveuniversity.com/course/tags, then scroll down to the topic on “Creating User Defined Types”). They cover exactly how to do this, step by step.
It seems that video is a good tutorial on how to reference to a device directly via OPC, via the OPC tag path, however, what I am hoping to do is reference a tag in the tag database, which is then configured to a point in the OPC server.
For example the video informs me to reference a PLC address such using a parameter in the tag path as follows:
[DEVICE]{parameter}.status
But in my instance, I’m hoping to do something similar but instead of entering the path to the device I want to have my parameter change the tag path.
For example:
tag\Motor{parameter}.status
Lol, I’m not sure if I’m explaining what I mean here… but I hope you follow
Are you still looking for some assistance with this issue? If so let me know. You should still be able to create query tags inside of a UDT, so the idea is similar provided you know how to query your tag db.