Hello All,
I am working on my first project in Ignition.
I have a UDT defined representing a generator. The UDT has multiple tags with alarms.
I would like to parameterize the alarm labels to avoid editing each alarm string individually. I have three parameters:
{num} is defined on the root in the UDT,
{signal} and {phase} are defined on each tag in the UDT that has the alarms.
On each tag with the alarms I have set the label binding expression as:
"GEN " + {num} + " " + {signal} + " " + {phase} + HIGH" (or low, etc.)
{num} is correctly updating to the parameter value on the UDT root, but {signal} and {phase} appear exactly as shown above instead of being replacing with the tag parameters.
Any pointers on what I'm doing wrong?
I would also like to dynamically inhibit the alarms when the generator is not running. The UDT has a boolean RUN_STATUS OPC tag. I tried to bind the alarm enable property on the tags in question to RUN_STATUS, but alarm enable appears to only allow parameter binding.
Is there a way that I can dynamically disable alarms on UDT tags based on the value of a sibling tag in the same UDC?
Thanks!
Do you mean num
is an UDT parameter and the other two are custom data properties on the tags ?
like foo
in the screenshot below ?
If that's the case, in the alarm's label, you can access your custom data with tag({PathToTag}.signal)
.
There might be a better way, but while you wait for someone with more knowledge to chime in, it should get it working.
If you meant something else, you'll have to be more accurate.
Thank you for the suggestion.
You are correct in your assumption the {num} is a UDT parameter, {signal} and {phase} are custom properties on tags that defined as part of the UDT. Apologies for the incorrect terminology.
I modified the label expression binding as you suggested but the label property on an instantiated UDT evaluates to NULL.
When the label property is set to only {PathToTag}, the instantiated label correctly evaluates to a string containing the correct tag path. When I try to access the custom property using {PathToTag}.signal or tag({PathToTag}.signal), the label evaluates to NULL. I have verified that the signal custom property is not NULL.
I'm not sure where you can go from here... Maybe try with tag({PathToTag} + ".signal")
, or with "/signal
" instead of ".signal
".
1 Like
Agreeing with @edward.fowler
See: Using the {this} keyword
You are also missing the opening double quote around High
in the example.
Becomes
"GEN " + {num} + " " + {this.signal} + " " + {this.phase} + " HIGH"
1 Like