Audible Alarms To Clients

How do I play an audible alarm to all of my clients. I have setup a number of alarms which should trigger a sound but I guess it is trying to play the sound on the gateway which is buried away in a server room and has no audio output. I need the alarm on the vision clients in the operator control rooms.

I saw a post here:Playing a sound when alarms go active - #4 by JordanCClark that looks like they have hijacked a graphical element to trigger the alarm but this doesn’t seem like the best way. Is there something I am missing?

Assuming you’re still using vision, you will need two things:

Perhaps if you showed us what you have so far, it would help.

So far I have a test button with a call to playSoundClip() that plays the required sound on the clients, okay. But, I need the sound to be triggered by an alarm. I put the call to playSoundClip() into the alarmActive callback on the alarmed tag but no sound is played on my clients.

Hi @Dave_Young, are you placing the script on a tag change event in the tag browser? If so, this is Gateway scoped, so the sound is playing on the Gateway and not on the clients.

You will need to use a Tag Change Client Event script so that it is client scoped.

Sorry, misread the post…

Make an expression client tag that has the conditions to trigger the sound. Then use that tag to play the sound.

These all feel a blt too much like a workaround to me. I can see in the future someone cursing my name trying to work out how the hell I’m triggering the sound on the alarm when they want to make a cahnge. I would prefer to have the audible alarm call in the same place as the actual alarm. I think I’m going to create a seperate Flask API as a dedicated audible alarm server.I can just make a call to http://my.alarm.server/warehouse2/alarm4

The other problem I’m struggling with is the ability to play different alarms in different areas which seems way beyond Ignitions capabilities. So I think I’m going to have to deal with something outside ignition to manage that anyway.

It’s actually not too bad at the client level. Running a client timer script and when it sees the proper condition fire off a sound. I’ve done it with multiple levels and alarms sounds per area.

Most of our alarms are defined in a UDT. For each tag that has an alarm defined we added custom properties (BOOL). For projects where the end user wants to use stack lights, we add one for a horn and each light color. We setup these BOOL values for the most common state needed. Then if a specific instance needs to be different we simply check or uncheck the property.

We run a gateway timer script, similar to this:

import re

#Clear/Define Counts
amberLightCount = 0
hornCount = 0
redLightCount = 0

#Edit the source value to suit your needs
source = ["*Your/Tag/Path*"]
state = ["ActiveUnacked", "ActiveAcked"] #Get both active states
alarms = system.alarm.queryStatus(state=state,source=source)

#Get Alarm Query and convert to dataset
data = alarms.getDataset()
pds = system.dataset.toPyDataSet(data)

#Iterate through dataset, if associated data matches increment counts
for row in pds:
	result = re.search('(\/tag):(.*):(\/alm)', row[1])
	childTag = re.sub(r'\[.*\]','', result.group(2))
	
	tag = system.tag.getConfiguration(childTag)
	try:
		if tag[0]['AmberLight']: amberLightCount += 1
		if tag[0]['Horn']: hornCount += 1
		if tag[0]['RedLight']: redLightCount += 1
	except:
		pass
		
#Set PLC tags for counts set above
tags = ['[default]YourTag1', '[default]YourTag2', '[default]YourTag3']
values = [hornCount, redLightCount, amberLightCount]
system.tag.writeBlocking(tags,values)

For individual alarms, we still add the properties. We generally create individual/non-UDT alarms in bulk using Excel/Text Editor, etc. Takes no time at all to do this.

For a sound played locally, it would use the same idea. You could create multiple scripts, or calls, per zone/area/source, but use client script instead of gateway.