Dynamic Alarms: Binding not updating

I am currently working with a bit of a complicated alarm system that I built for a client. One of the features of this system is for the alarm to only be enabled while it’s piece of equipment is running. To implement this I created two custom alarm properties: “Is Enabled” and “Is Machine Running Tag”. The actual “enabled” property on each alarm then has the following expression binding:

if({Is Machine Running Tag} = '', {Is Enabled}, tag({Is Machine Running Tag}) && {Is Enabled})

This has worked well until I noticed a weird issue this morning. One of these alarms appears to not be updating it’s enabled property. What’s weirder yet is that the diagnostics inside the tag editor show the correct value for the expression but the value in the tag browser is incorrect.

Tag Editor:
image

Tag Browser:
image

Can anyone help to explain why this might be happening and steps I could take to resolve this?

I don’t understand the logic of your expression.

if({Is Machine Running Tag} = '', {Is Enabled}, tag({Is Machine Running Tag}) && {Is Enabled})

First, is {Is Machine Running Tag} a boolean? If so, the comparison will likely never succeed.
Second, why the use of the tag() function? You’re not constructing a dynamic tag path.
Third, why the if statement at all? This looks like fairly straightforward boolean logic, something like:
{Is Machine Running Tag} && {Is Enabled} would be a complete expression with the same end result.

That doesn’t answer your actual question, but simplifying the expression may help to troubleshoot.

“Is Machine Running Tag” is a string. We also built an alarm configuration screen where they can configure all of these properties dynamically. Tag() is used to actually get the value of the tag at the path provided by the “Is Machine Running Tag” property. I should have clarified that.

I was confused as well. This definitely needs to be simplified :X

@awaege1 Let’s try to clear this up:

  • is machine running tag is a custom property on the alarm (associated data ?), that points to a boolean tag. The tag it points to comes from user input, and may be an empty string.
  • if the user doesn’t specifies a tag, is machine running tag is empty and only is enabled is used to determine whether the alarm is enabled or not.
  • if the user does specify a tag, use it and is enabled to determine if the alarm is enabled.

questions:

  • where does the value of is enabled come from ?
  • what kind of tag can/must/does is machine running tag point to ?
  • How do you pass their values to those two properties ?

The value of “Is Enabled” is also a custom property on the alarm. The machine running tag must point to a boolean tag. The values of the two properties are configured as static from a configuration screen in a perspective view. I can confirm that in this particular instance, the machine running tag is pointed at a valid boolean tag and the Is Enabled property is set to true.