onStateChange - event of object PmAlarmEvent

The event fires when alarm/event item state change.
pMe(Object) Reference to the PROMOTIC object where the event rises.
pEvent(Object) A referrence to object describing detailed information about the specific event.
pEvent.Item - (Object) The reference to the alarm/event item (to the PmAlarmEventItem object) that was changed.
pEvent.Action - (Long) Indication of the change type
0 - alarm was activated (See method PmAlarmEventItem.Activate)
1 - alarm was inactivated (See method PmAlarmEventItem.Inactivate)
2 - alarm was acknowledged (See method PmAlarmEventItem.Acknowledge)
3 - alarm has been changed by the system to NEW non-initialized inactive acknowledged (green) alarm. See the configurator "Change inactive confirmed (green) CEASED to NEW non-initialized alarms in [s] (-1=never)".
pEvent.Context - (Object) Reference to the object containig additional information about the user, that executed the action followed by calling this event. The creation and demise of the alarm is always done by the local user. The alarm confirmation can be executed both by local and network application user (e.g. from the Web). The user info can be used, for example, for enabling/disabling the action (if possible), or for entering the user info into the alarms/events.
pEvent.Context.User - reference to the User object, containing detailed information about the user (local or network), that executed the action that called the method.

Caution! In order to keep the subobject User value trustworthy it is necessary to exclude the the pseudo-groups $ANY and $ANY_NET from the appropriate permission WebRead (i.e. to ensure that the user is logged in when opening the Web pages).

pEvent.Context.Language - Returns the information about the national language. Language is determined with a text identifier, e.g. "en", "de", "ru" etc. - see Fully supported languages in the PROMOTIC system. See the configurator "PmRoot > Application > Main language of runtime".
See also:
Into the Debug_info item of the INFO system we'll write every change of each item:
VBScriptSelect and copy to clipboard

Dim sAction
Select Case pEvent.Action
Case 0
  sAction = "ACTIVATE"
Case 1
  sAction = "INACTIVATE"
Case 2
  sAction = "ACKNOWLEDGE"
Case Else
  sAction = "??"
End Select

Pm.Debug "Event onStateChange:"
Pm.Debug "Action = " & sAction
Pm.Debug "Description = " & pEvent.Item.Description
PROMOTIC 8.3.30 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