Out of curiosity, apart from the version of the audio component that can still play audio while its display property is set to false, what is the expected use case for this component? I have always just used the video player component for this.
Functionally between the two there is no difference if I take advantage of theming and set the video components video display to none but keep the controls displayed. There may be some file format differences, potentially MP3, that may not be recommended to be used in the underlying video element of the component. However, I’ve yet to find hard evidence to support this. Perhaps the only difference is aesthetics, whether you’d prefer our custom-built UI or the user agent’s (browser’s) UI for controls.
Can this be used to play an alarm sound every time there is an unknowledged active alarm?
Should be doable with an expression binding on the play property using isAlarmActiveFiltered
I didnt test this, may have gotten the flags wrong:
isAlarmActiveFiltered("[default]*", "*", "*", 0, 4, 0, 0, 0)
Meh i couldnt get that to work, try this:
runScript('len(system.alarm.queryStatus( state=["ActiveUnacked"]))', 2500)
Sure, adding onto what @josborn has already provided. Once you’ve set up a way to detect unacked alarms, you can also call self.play() or self.getSibling(…).play() in a scripting function, depending on where your script is defined.
Don’t call this on your view though unless you will only have a very small number of clients. It’s scales horribly, and never call this in Vision
A fair point. I actually wouldn’t do this at all, i handle all of this in the PLC and have a Boolean that triggers the sound player.
Ok, so now i am curious. I did both of these on a dev environment to see what the impact was, and i found nothing. It may be that my setup just didnt have much going on but loading multiple vision clients with the binding above and 30+ perspective sessions there was no appreciable change in memory, cpu , or ui responsiveness. Just for my understanding can you tell me what you would expect to see performance wise?
At a customer of ours with 120 clients (~80 vision ~40 perspective), calling system.alarm.queryStatus would kill the gateway. You can see this with the load that the alarm status tables in older 8.1 versions place on the gateway which call this. Last year we were using these in 8.1.5 on a single gateway system and the CPU usage was through the roof and was crashing the server all the time, not to mention destroying client performance. In later versions I think after 8.1.10? they added caching to reduce the need to query the alarm table every time.
Back in my old Ignition days, in my naive wisdom I created an alarm summary Template in Vision which called
system.alarm.queryStatus to count the number of alarms given a tagPath. This was on a very small 3-client system with decently-resourced clients, and I had maybe 5-10 of these templates on the page at any one time. Operators complained for weeks about terribly slow performance; clicking nav links or opening popups would take 5-10s to even start to load, very slow to write to tags. In the end, I removed these templates from the screens and all of a sudden no more issues.
Thanks for the background Information. All of my setups would be extremely small compared to what you have described which is probably why i didn’t notice the hit. My cpu usage is nearly always in single digit territory.
Need help configuring the source to be a file on the local hardrive of the computer where the gateway resides. I have tried using “https://localhost/c:/Sound/Alarm10.wav” and doesn’t work.
I have tested with a URL from a website and works good.
Looks like the path provided is not where the audio file actually is. If you need to use local file paths I’d suggest trying
file:///<image path> (you can open an audio file with a browser and inspect the URL for reference); otherwise, you can upload the file onto WebDev and reference it that way.
Hi I am transforming my iFrames to this component because it looks more suited but I have the same problem with the source.
I used File:/// but it is not doing anything.
The exact link works when entered in a browser directly.
Am I missing something? Thanks
Do you see anything in the browser’s console. I haven’t had a chance to test this personally, but my hunch is this is probably some security measure to prevent users from arbitrarily loading files, or the file path isn’t resolving correctly. If possible, I recommend using the WebDev module to store your audio files. If for whatever reason, that is not possible, I can ask the team to see if there are other options. Thanks.
If you store the audio as blob data in a database, my Blob Server module should be able to deliver it.
Hi Ayu, Thanks for the tip, I checked the console and you were right, the server is preventing me from loading a file from it’s directory directly, image below:
My company does not have the WebDev module, I’ll try to talk to them to and see if we can get it but it’ll take sometime for the gears to turn, in the meantime, are there other solutions? I am trying to avoid using iframe as java seems to lock down files after being played and I can’t delete them unless I restart the gateway…
I’ll look into storing audio as blob, but Ideally a file is still much more easier to manage, especially if it needs to be used by other applications. Thanks
I’m not aware of any other solutions other than the ones listed above. Let me get in touch with the team to see if there are other avenues available or if this is a feature we can potentially implement. Thanks!
Hi folks, just to update, we tried the WebDev Module on trial mode and it’s a good workaround with the folder mount function, solved all our problem
It does however adds alot to the budget to get the WebDev licences, especially since we are only using it to access local gateway files (and we do have a lot of gateways), so I hope there is a way around the security issue.
I’ll also look into @pturmel 's solution in using Blob from the database
Thanks for the help
Can you try copying your files to:
C:\Program Files\Inductive Automation\Ignition\webserver\webapps\main\YourFolder
and using the url:
http://<Ignition IP or hostname>:8088/main/YourFolder/YourAudio.wav
This is how we store cached versions of map tiles locally without webdev, but i believe this might be wiped when upgrading? Not sure… However we recently did a patch update from 8.1.9? to 8.1.15 and these files weren’t deleted.
@Paul.Scott had some words around this here:
I agree though that the web dev module is expensive when you have a very basic use for it
I have a solution for that, i made a seperate post so people will find it easier when having the same problem