How to implement alarm sound signals in web clients.

In order to be able to run the alarm on a web client depending on the alarms generated on the server, it is necessary to create a permanent link that will inform the client about the state of the alarms. The PmgButton object or image (PmgCanvas, PmgRasterImage) placed in permanently opened panel (usualy Toolbar) can be easily used for such purpose.
The procedure goes by following steps:
- Create suitable Pmg object (PmgButton, PmgCanvas or PmgRasterImage)
- On the "Variables" tab of this object, create variable of the Integer type named "nAlState3".
- Bind this variable by the "PP - Data binding to Pma object property" data binding to corresponding PmaAlarmGroup object. In the "Property" configurator enter: GetStateCount("state:3;")

(This sets the calling of the GetStateCount method with parameter state:3; that will return the number of currently active (red) alarms.)

- Then create the script marked as Example in the onRefresh event.
Script in the onRefresh event of the Pmg object.
JavaScriptVBScriptSelect and copy to clipboard

if (pMe.Root.ClientType == 2)
if (pMe.Vars("nAlState3").Value > 0)
The nAlState3 variable can be used also for changing the color of text, background, image, etc. The object can also be used as button for opening the alarm viewer. See Opening the viewer of the PmaAlarmGroup object
See also:
- Pm.PlaySound (method)
- PmaAlarmGroup (object)
- PmgRoot.ClientType (property)

Pm8.03.24: Created
PROMOTIC 9.0.15 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
- How to implement alarm sound signals in web clients.
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice