AdvancedHMI Software
General Category => Support Questions => Topic started by: joko markono on March 12, 2020, 02:22:28 AM
-
Hi,
I need to play an alarm sound continuously. at the moment the sound will stop after a cycle.
please help.
-
How are you playing the sound currently?
-
There is an address from plc program which is triggered by certain condition i.e. high or low value.
-
Are you using the SoundPlayer component or writing code?
-
The component from AHMI toolbox.
-
Try using the attached modified version of the SoundPlayer.
Remove the current SoundPlayer component from the form, save and close the form, replace the stock version in the AdvancedHMIControls/Components folder with the modified one, rebuild the solution.
The modified version only has 2 triggers, PositiveChange and NegativeChange (AnyChange was removed) and a new LoopSound property.
The change of value will start/stop sound playback when the LoopSound property is set to True, otherwise it will play sound only once.
-
i will. hopefully the sound continuously play in loop. thanks.
-
i found the easiest solution:
1. in the solution explorer, go to Controls>Components>SoundPlayer.vb
2. right click SoundPlayer.vb>view code
3. expand the Events and see the Private Sub PlaySound()
4. Change the player.Play() to player.PlayLooping()
5. Rebuild and Save the project.
-
How do you stop the sound playback?
-
that will be from the PLC program.
so at the moment i have a BarLevel indicator with high and low setting.
if above high and below low limit, the sound alarm will activate (program in the PLC).
did i miss out anything? please let me know.