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. A button or image (PmiCanvas, PmiRasterImage) placed in permanently opened panel (usualy Toolbar) can be easily used for such purpose.
The procedure goes by following steps:
- Create suitable graphic item (PmiButton, PmiCanvas or PmiRasterImage)
- On the Variables page of this item, create Integer type variable named nAlState3.
- Bind this variable by PP - Binding to PROMOTIC object property binding to corresponding PmAlarmEvent object. In the Property configurator enter: GetStateCount("state:3;")

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

- Then insert the script marked as Example into the onRefresh event.
Script in the onRefresh event of the graphic item.
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 item can also be used as button for opening the alarm viewer - The example of alarm viewer opening
PROMOTIC 8.3.26 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice