Newbie Delving Into Tags and UDT

Hi All,

I’m building a project and I am curious on to how to go about the following:
I have a tag database that has a tree structure as follows:

Tags/Pumps/Pump01/CMDON
Tags/Pumps/Pump01/CMDOFF
Tags/Pumps/Pump01/Lockout
Tags/Pumps/Pump01/Pressure
Tags/Pumps/Pump02/CMDON
Tags/Pumps/Pump02/CMDOFF
Tags/Pumps/Pump02/Lockout
Tags/Pumps/Pump02/Pressure
Tags/Pumps/Pump03/CMDON
Tags/Pumps/Pump03/CMDOFF
Tags/Pumps/Pump03/Lockout
Tags/Pumps/Pump03/Pressure


.

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.

Thanks for your help and much appreciated.

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.

Hi,

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 :slight_smile:

Thanks!

I think you are talking about using indirects…

inductiveuniversity.com/video/i … ag-binding

Hi ginjaninja,

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.