I'm looking to create some scripting to allow clients to play a sound wave file when a new unacknowledged alarm becomes active in perspective. Has anyone been able to accomplish this before and willing to share? Thanks!
You could put a custom property on a view that the clients will have open when you want the sound to play like this:
Then add an audio component and a value change scrip that activates the audio component
There may be better ways to do this.
You could use an alarm listener as @Kyle_Chase described. The topic was for a popup, but you could also use it for your needs.
I would start this a different route. It looks like you are polling for changes to alarm states, when really, we should be reacting to events relating to alarm state changes. This is going to be a long winded answer, so hear goes.
Create a new shared script. For this example, create it at shared.alarming. The following will create an object, that extends Ignition’s AlarmListener interface. This is how we get the alarm event from the gateway to the client.
Post the following code:
from c…