# \[feature-12986, 15300\]Unacknowledged Alarm Sound

**URL:** <https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460>\
**Category:** Ignition\
**Tags:** ignition80, perspective\
**Created:** [May 31, 2019, 1:37pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460 "2019-05-31T13:37:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [May 31, 2019, 1:37pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/1 "2019-05-31T13:37:42Z")

</div>

I am working on Perspective module, 8.0.1(but I am going to be updating it to 8.0.2 today). I would like to play an alarm sound when there is an unacknowledged alarm. I have been researching this, but this scripting environment is all new to me and very greek. I am really hoping someone can give me a simple way of doing this start to finish.

One problem I am encountering is how this is going to work across platforms. I have looked into the **system.util.playSoundClip** but from everything I read so far I am not sure how that will work with different devices. I would like to have the alarm play whether someone is on a desktop pc, an android tablet, or an iPhone.

Is this doable? Seems it should be since the program is represented to be used for SCADA systems. I would assume most people with these systems would want audible alarms for the times that someone is not sitting directly in front of a screen.

I suppose that having the audible alarm sound is not detrimental to have on the mobile devices since they will mostly be used for intermediate tasks. But if it’s possible that would be great.

Thanks for the help in advance. I really want to make the switch over to this software for our system, and so far I am being able to figure out a lot of the things that will make it work for us, but little things like this seem to keep me hanging up.

---

<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:** [May 31, 2019, 3:54pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/2 "2019-05-31T15:54:16Z")

</div>

Perspective actually _doesn’t_ yet have the ability to play sounds unsolicited. `system.util.playSoundClip` only works from inside a Vision client (the `system.util` designation is a little misleading, but can’t be changed due to backwards compatibility). It’s on our feature roadmap, but at a fairly low priority. I’ll add this thread to the ticket, but another way to increase visibility would be to post on [ideas.inductiveautomation.com](http://ideas.inductiveautomation.com) so we can evaluate community interest in the idea.

---

<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:** [May 31, 2019, 7:15pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/3 "2019-05-31T19:15:57Z")

</div>

Use an invisible IFrame, and bind _src_ to (don’t take this literally 😉 ):

```auto
if(something = 1,
   'http://path/to/some/noise.mp3',
   ''
  )
```

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 4, 2019, 1:02pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/4 "2019-06-04T13:02:33Z")

</div>

Thanks for the info. I have been out the last few days so I did not have a chance to respond yet. I’ll post over there on the other site to gain some interest. Seems odd to me though, but maybe we just have a different type of SCADA system. I could not really imagine having a full fledged SCADA system that did not have sound associated with an alarm. We only have so many people on staff so sometimes they are not sitting in front of the screen. During those times its nice to have an audible alarm to let them know something is taking place so they can get back to the screen and check it out.

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 4, 2019, 1:04pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/5 "2019-06-04T13:04:32Z")

</div>

This will work inside of perspective?

If you wouldn’t mind, I am really new to scripting, if there is anyway you could give me a little more steps on how to link it to an alarm that would be a tremendous help. I am just lost in how to do that part.

Thanks

---

<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:** [June 4, 2019, 4:24pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/6 "2019-06-04T16:24:28Z")

</div>

Sure! This attachment of a view uses a checkbox to illustrate the idea.

[alarm\_test\_perspective\_view\_2019-06-04\_1217.zip](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/75cd3880e72278373b5328f56857da9e3ad337b3.zip) (2.7 KB)

In the iFrame component, named Sound, because I’m tired and lacking imagination, the src property uses an expression to bind to the selected property of the checkbox.

```auto
if({../Checkbox.props.selected},
	"http://www.reelclassics.com/Audio_Video/Music7q/clips/bernstein_greatescapemarch_clip.mp3",
	""
	)

```

If you want to tie it to a tag alarm:

```auto
if({[default]Test/TagName/Alarms/AlarmName.IsActive},
	"http://www.reelclassics.com/Audio_Video/Music7q/clips/bernstein_greatescapemarch_clip.mp3",
	""
	)

```

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 4, 2019, 4:43pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/7 "2019-06-04T16:43:45Z")

</div>

Thanks! I will play around with this. I think I get the jist of it.

Only problem(small, I think I’ll be able to figure it out) is how to import/view that file you sent. Most of all this is very new to me, I’ve only come from a windows point and click system, not a programming type one. If that makes sense.

---

<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:** [June 4, 2019, 6:41pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/8 "2019-06-04T18:41:42Z")

</div>

Go under File → Import and follow the prompts. 🙂

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 4, 2019, 7:24pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/9 "2019-06-04T19:24:10Z")

</div>

Ok, wow, I officially feel like I really don’t know anything.

I tried that earlier, but I had already unzipped the file and put it in my documents. So when I went to import(which I figured it was the thing to do) I did not see the right file extensions. Never hit me that at the bottom there it has .zip for an option…🤦‍♂️

Thanks again. I really want to make this software work for us. I love the look and feel of it for using it as our interface, but the programing/setting up of it has really been a learning curve for me.

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 4, 2019, 7:29pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/10 "2019-06-04T19:29:23Z")

</div>

Got it up. I think this will be the workaround for sure. I plan on just linking it to play only when there is an alarm that is unacknowledged.

I am going to have to definitely play around with it. I am going to have to believe there will be a way to loop a sound until the alarm is acknowledged.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [June 5, 2019, 6:32am UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/11 "2019-06-05T06:32:42Z")

</div>

> [@nathan.hooper](#):
>
> there will be a way to loop a sound until the alarm is acknowledged

I haven't had a chance to play with perspective yet, but I'm guessing you can add a time condition to the binding something like below to cause it to loop:

```auto
if({[default]Test/TagName/Alarms/AlarmName.IsActive} && {[default]Test/AlarmLoopSeconds} < 5),
	"http://www.reelclassics.com/Audio_Video/Music7q/clips/bernstein_greatescapemarch_clip.mp3",
	""
	)

```

This assumes the sound is less than five seconds long and that you have a tag that increments by one each second and resets to zero when it reaches the number of seconds you'd like for the repeat rate.

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 5, 2019, 4:18pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/12 "2019-06-05T16:18:36Z")

</div>

Thanks. I am not sure that will work for me though. I just want it to activate when there is any alarm that is not acknowledged. Seems that would be easier than binding it to each and every tag that has an alarm?

I was looking around and saw that there is a ‘while loop’ in Python? I have to wonder if that would not work.

On another note, a guy I work with brought up the idea that if we use an external sound source then we would not get an audible alarm. So I started up the Microsoft IIS web server and put the sound file on it. Now, we can loose outside internet at our facility but still have an audible alarm.

Just have to figure out a loop and this one will be solved for me.

---

<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 5, 2019, 4:23pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/13 "2019-06-05T16:23:11Z")

</div>

If you just want to trigger an event when there are _any_ active, unacked alarms, then bind to the `[System]Gateway/Alarming/Active and Unacked` tag - whenever it’s greater than 0, you have cleared, unacked alarms.

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 5, 2019, 5:09pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/14 "2019-06-05T17:09:33Z")

</div>

Thanks. I figured there was something like that because the sample Perspective project had the icon up in the corner that would flash when there was an unacknowledged alarm.

I went ahead and configured a tag that is based on a timer that resets after it reaches 5. However, I am having trouble with the expression working. When I put the script in that witman gave me, it gives me an "Error\_Configuration".

> if({[System]Gateway/Alarming/Active and Unacked} && {[Tags]Front Panel RTU/Alarm Repeater} \< 5),  
> "[http://192.168.247.213/alarm.wav](http://192.168.247.213/alarm.wav)",  
> ""  
> )

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 5, 2019, 5:23pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/15 "2019-06-05T17:23:45Z")

</div>

Eureka!!!! I played around long enough I got it. Thanks to all for the help!

Here is the final expression

> if({[System]Gateway/Alarming/Active and Unacked} && {Front Panel RTU/Alarm Repeater} \< 5,  
> "[http://192.168.247.213/alarm.wav](http://192.168.247.213/alarm.wav)",  
> ""  
> )

Also, I had to up the timer to 6 seconds as my sound clip is exactly 5 seconds. It would not repeat until I did this.

Thanks again. On to the next step in my project.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [June 5, 2019, 6:38pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/16 "2019-06-05T18:38:26Z")

</div>

> [@nathan.hooper](#):
>
> I had to up the timer to 6 seconds as my sound clip is exactly 5 seconds. It would not repeat until I did this.

Yes, for this logic to work the value must go above the less than value check by at least one otherwise the condition will not go false at the end of a cycle. The false to true transition is required to cause the repeat.

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 5, 2019, 6:41pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/17 "2019-06-05T18:41:11Z")

</div>

That makes complete sense.

Is there a way to make an internal tag count up and then reset after a certain number? This way I would not have to depend on an external tag.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [June 5, 2019, 6:48pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/18 "2019-06-05T18:48:35Z")

</div>

By internal tag I’m thinking you mean a memory or expression tag rather than an OPC tag. You could use an expression tag based on time for this–something like the following, which would loop 0-9 repeatedly, incrementing each second:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/fb9be3f23076e0a618b76da71976b7130226632d.png)  
Alternatively, you could use a memory tag and increment/reset it via a gateway timer script.

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 5, 2019, 6:51pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/19 "2019-06-05T18:51:05Z")

</div>

Yes, that is exactly what I mean. I apologize, I am still learning the Ignition language versus the other software I have used.

I am gonna try that and see how it works. Many thanks.

---

<div class="post-metadata">

**Author:** ![nathan.hooper](https://avatars.discourse-cdn.com/v4/letter/n/7993a0/32.png) [@nathan.hooper](https://forum.inductiveautomation.com/u/nathan.hooper)\
**Post date:** [June 5, 2019, 6:54pm UTC](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460/20 "2019-06-05T18:54:36Z")

</div>

Works like a charm. Thanks again.

Makes me realize I have a LOT to learn.

[Next page](https://forum.inductiveautomation.com/t/feature-12986-15300-unacknowledged-alarm-sound/25460.md?page=2)
