Alarm object in vba of integration projectnot is not working for sub-projects
Hey everybody,
I do have a problem with the Alarm object in vba of an integration project.
Using following code:
VBA Code:
Option Explicit
Dim WithEvents zAlarm As Alarm
'procedure is executed on startup of the zenOn runtime
Private Sub Project_Active()
'init the alarm object for events
Set zAlarm = thisProject.Alarm
End Sub
'procedure is executed when an Alarm comes
Private Sub zAlarm_AlarmComes(ByVal obItem As IAlarmItem)
'print specific information to Debug window...
Debug.Print obItem.Timecomes & " > " & obItem.Text
End Sub
'procedure is executed when an Alarm has gone
Private Sub zAlarm_AlarmGoes(ByVal obItem As IAlarmItem)
'print specific information to Debug window...
Debug.Print obItem.Timegoes & " < " & obItem.Text
End Sub
'procedure is executed when an Alarm was acknowledged by a user
Private Sub zAlarm_AlarmAcknowledged(ByVal obItem As IAlarmItem)
'print specific information to Debug window...
Debug.Print obItem.TimeAcknowledged & " | " & obItem.Text
End Sub
Private Sub zAlarm_AlarmListSelectionChanged(ByVal obItem As IAlarmItem)
'print specific information to Debug window...
Debug.Print "AlarmListSelectionChanged: " & obItem.Name & " - " & obItem.Projectname
End Sub
'procedure is executed on terminating the zenOn Runtime
Private Sub Project_Inactive()
'free the alarm object
Set zAlarm = Nothing
End Sub
The problem is the events of zAlarm are only fired for alarms which are from variables located in the integration project not for the alarms of variables which are located in the sub-projects of the integration project!
For example:
I do have an alarm picture in the integration project showing alarms from variables of the integration project and the sub-projects. If I am selecting in the AML an alarm of the integration project "_AlarmListSelectionChanged" is fired. If I am selecting in the same picture an alarm of a sub-project nothing happens!
I need to be able to react on all alarms of the sub-project within vba of the integration project!
What am I doing wrong?
Please advice.
Thanks for any input!
H.-P.
This is a migrated post! Originally posted on 21.05.2008 by user hp. Please be aware that information can be outdated.