# Dynamic Alarms: Binding not updating

**URL:** <https://forum.inductiveautomation.com/t/dynamic-alarms-binding-not-updating/61353>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [June 29, 2022, 2:41pm UTC](https://forum.inductiveautomation.com/t/dynamic-alarms-binding-not-updating/61353 "2022-06-29T14:41:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [June 29, 2022, 2:41pm UTC](https://forum.inductiveautomation.com/t/dynamic-alarms-binding-not-updating/61353/1 "2022-06-29T14:41:36Z")

</div>

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:

```auto
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](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/7/17070fc7e672ff208dc12119cb7756f2a51033be.png)

Tag Browser:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/1/116a43fafbb13681dcbdb0971034905a20371e77.png)

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

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 29, 2022, 3:09pm UTC](https://forum.inductiveautomation.com/t/dynamic-alarms-binding-not-updating/61353/2 "2022-06-29T15:09:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [June 29, 2022, 3:12pm UTC](https://forum.inductiveautomation.com/t/dynamic-alarms-binding-not-updating/61353/3 "2022-06-29T15:12:31Z")

</div>

“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.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [June 30, 2022, 11:22am UTC](https://forum.inductiveautomation.com/t/dynamic-alarms-binding-not-updating/61353/4 "2022-06-30T11:22:01Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![awaege1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/awaege1/32/28922_2.png) [@awaege1](https://forum.inductiveautomation.com/u/awaege1)\
**Post date:** [June 30, 2022, 1:09pm UTC](https://forum.inductiveautomation.com/t/dynamic-alarms-binding-not-updating/61353/5 "2022-06-30T13:09:47Z")

</div>

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.
