Hi everyone,
I do not know if this question has already been asked but I can not find the solution.
I have created UDTs for tags with 2 parameters and everything works very well.
I need to create an expression tag inside a UDT but referring to the value of another tag of another UDT following the rules of the parameters.
I do not know if I have correctly explained myself …
Practically:
UDT1 = Measure (parameters: C1 and C2)
UDT2 = Device (parameters: C3 and C4)
Expression boolean tag within UDT2 = TagC3_C4_UDT1 > 350
If I try to point directly to the tag it seems to work but I can not make the expression work by trying to insert the UDT parameters…
If your trying to use your parameters directly in an expression to build a tag, I don’t believe you can do that. But you can do a shared script and call it from your expression.
def ScriptCall(Var1,Var2):
val = str(system.tag.read('tag/tagpath'+str(Var1)+'_'+str(Var2)+'_UDT1').value)
return val
For the system.tag.read to work you need the full tag path. Then you’d call it from your expression using the runScript command.