# Binding Alarm Outputs to Graphics

**URL:** <https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885>\
**Category:** Ignition\
**Created:** [January 21, 2014, 11:45pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885 "2014-01-21T23:45:13Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![downerczx](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/downerczx/32/11649_2.png) [@downerczx](https://forum.inductiveautomation.com/u/downerczx)\
**Post date:** [January 21, 2014, 11:45pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/1 "2014-01-21T23:45:13Z")

</div>

Hello,

I have an opctag that has 4 alarms defined on it, lolo, lo, hi and hihi. I want to bind the output of each of these alarms to a light. I cannot find any individualized parameters for any of these, only some strings that tell me what the highest priority alarm is, etc., but not the status of each individual alarm.

Is there a way I can do this? It seems like a common task.

thank you

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 22, 2014, 11:27am UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/2 "2014-01-22T11:27:44Z")

</div>

Actually, it’s not a common practice, since it interacts with the database and there’s a table to display alarms. But I still think it can be done! 🙂

Can you show me a screen shot of your alarm setup? I’ll get 7.6 fired up on one of my machines here and give you a hand.

---

<div class="post-metadata">

**Author:** ![diat150](https://avatars.discourse-cdn.com/v4/letter/d/a587f6/32.png) [@diat150](https://forum.inductiveautomation.com/u/diat150)\
**Post date:** [January 22, 2014, 1:23pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/3 "2014-01-22T13:23:55Z")

</div>

[quote=“downerczx”]Hello,

I have an opctag that has 4 alarms defined on it, lolo, lo, hi and hihi. I want to bind the output of each of these alarms to a light. I cannot find any individualized parameters for any of these, only some strings that tell me what the highest priority alarm is, etc., but not the status of each individual alarm.

Is there a way I can do this? It seems like a common task.

thank you[/quote]

are you using tags for your alarm setpoints? if so this should be pretty easy.

---

<div class="post-metadata">

**Author:** ![downerczx](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/downerczx/32/11649_2.png) [@downerczx](https://forum.inductiveautomation.com/u/downerczx)\
**Post date:** [January 22, 2014, 3:38pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/4 "2014-01-22T15:38:03Z")

</div>

Here’s what I’m trying to do:

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 22, 2014, 4:15pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/5 "2014-01-22T16:15:38Z")

</div>

Ok, thanks. I’ll see what I can whip up. 😃

Got meetings all afternoon, so it may take a bit…

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 22, 2014, 5:45pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/6 "2014-01-22T17:45:28Z")

</div>

Try doing this in reverse. Create 4 tags with each setpoint and set its expression to check if the alarm is true or false. Then aggregate those alarms into one “alarm tag”, with the following expression

```auto
binEnc({[.]LoLo},{[.]Lo},{[.]Hi},{[.]HiHi}})
```

Then for the alarm settings, add an alarm per bit, set its mode to bit state, and enter the bit index.

We do this on all our projects, and it works with both discrete alarms coming from the PLC, and alarms created by Ignition.

---

<div class="post-metadata">

**Author:** ![chi](https://avatars.discourse-cdn.com/v4/letter/c/0ea827/32.png) [@chi](https://forum.inductiveautomation.com/u/chi)\
**Post date:** [January 22, 2014, 5:59pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/7 "2014-01-22T17:59:15Z")

</div>

I haven’t tested this, but isn’t that what the

```auto
isAlarmActive(tagPath, [alarmName], [pollRate])
```

expression function is made for? The optional alarmName param can be used to check individual alarms of the given tag.

---

<div class="post-metadata">

**Author:** ![downerczx](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/downerczx/32/11649_2.png) [@downerczx](https://forum.inductiveautomation.com/u/downerczx)\
**Post date:** [January 22, 2014, 8:11pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/8 "2014-01-22T20:11:24Z")

</div>

I saw that function but have been unsuccessful getting it to work. I’ve tried the alarm name by itself, in quotes, in brackets, etc.

```auto
isAlarmActive({[.]Level_Sensor_Reading},"Level_Sensor_HiHi_Alarm",1)
```

or

```auto
isAlarmActive(({[~]Tester/Level_Sensor_Reading}), Level_Sensor_HiHi_Alarm, 100)
```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 22, 2014, 8:25pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/9 "2014-01-22T20:25:27Z")

</div>

[quote=“downerczx”]I saw that function but have been unsuccessful getting it to work. I’ve tried the alarm name by itself, in quotes, in brackets, etc.

```auto
isAlarmActive({[.]Level_Sensor_Reading},"Level_Sensor_HiHi_Alarm",1)
```

or

```auto
isAlarmActive(({[~]Tester/Level_Sensor_Reading}), Level_Sensor_HiHi_Alarm, 100)
```

Try:

```auto
isAlarmActive("[]Tester/Level_Sensor_Reading","Level_Sensor_HiHi_Alarm")
```

Everything needs to be in quotes. 😉

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 22, 2014, 8:34pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/10 "2014-01-22T20:34:24Z")

</div>

All of our alarming is done in the plc, so we implement it the way I described earlier. From alarms generated in Ignition, isAlarmActive makes more sense.

---

<div class="post-metadata">

**Author:** ![downerczx](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/downerczx/32/11649_2.png) [@downerczx](https://forum.inductiveautomation.com/u/downerczx)\
**Post date:** [January 22, 2014, 8:40pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/11 "2014-01-22T20:40:41Z")

</div>

```auto
isAlarmActive({[~]Tester/Level_Sensor_Reading},"Level_Sensor_HiHi_Alarm")
```

produced a green tag with a question mark but no value…

```auto
isAlarmActive("[]Tester/Level_Sensor_Reading","Level_Sensor_HiHi_Alarm")
```

produced the red x on the tag…

thanks for the suggestion, but do you see anything else wrong here?

---

<div class="post-metadata">

**Author:** ![downerczx](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/downerczx/32/11649_2.png) [@downerczx](https://forum.inductiveautomation.com/u/downerczx)\
**Post date:** [January 22, 2014, 9:42pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/12 "2014-01-22T21:42:29Z")

</div>

Woohoo! I’m up and running! (Also thanks to Greg @ tech support)

```auto
isAlarmActive("[.]Level_Sensor_Reading", "Level_Sensor_Hi_Alarm")
```

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 22, 2014, 9:48pm UTC](https://forum.inductiveautomation.com/t/binding-alarm-outputs-to-graphics/7885/13 "2014-01-22T21:48:19Z")

</div>

Good to hear!
