I have a VBA on an alarm banner that calls a large number of pop-ups alarms based on changes of digital PLC tag value.
Problem is that when the HMI Server switchover from Server 1 to Server 2 it calls all active alarms popups again, even if operator already closed it.
I suspect that the value in VBA changes to 0 and goes back to 1 again, but I dont know how to fix it in VBA. (Not much experience on VBA).
Any ideas?
An example of the code:
Dim WithEvents oTag1 As Tag
Dim WithEvents oGroup As TagGroup
Dim Value As Variant
[Dim TimeStamp As Date
Dim Quality As TagQualityConstants
Dim SubStatus As tagSubStatusConstants
Dim Limit As tagLimitConstants
_________________
Private Sub Display_AnimationStart ()
Set oGroup = Application.CreateTagGroup(Me.AreaName, 500)
oGroup.Add "{/DATASERVER::[SHORTCUT]AlarmPop1}"
oGroup.Active = True
Set oTag1 = oGroup.Item("/DATASERVER::[SHORTCUT]AlarmPop1}")
End Sub
______________________
Sub oTag1_Change (ByVal Value, ByVal TimeStamp As Date, ByVal Quality As tagQualityConstants, ByVal SubStatus As tagSubStatusConstants, ByVal Limit As tagLimitConstants)
If Value = "True" Then
Application.ExecuteCommand "Display HMI_Alarm_Pop1"
Else
Application.ExecuteCommand "Abort HMI_Alarm_Pop1"
End if
End Sub
Problem is that when the HMI Server switchover from Server 1 to Server 2 it calls all active alarms popups again, even if operator already closed it.
I suspect that the value in VBA changes to 0 and goes back to 1 again, but I dont know how to fix it in VBA. (Not much experience on VBA).
Any ideas?
An example of the code:
Dim WithEvents oTag1 As Tag
Dim WithEvents oGroup As TagGroup
Dim Value As Variant
[Dim TimeStamp As Date
Dim Quality As TagQualityConstants
Dim SubStatus As tagSubStatusConstants
Dim Limit As tagLimitConstants
_________________
Private Sub Display_AnimationStart ()
Set oGroup = Application.CreateTagGroup(Me.AreaName, 500)
oGroup.Add "{/DATASERVER::[SHORTCUT]AlarmPop1}"
oGroup.Active = True
Set oTag1 = oGroup.Item("/DATASERVER::[SHORTCUT]AlarmPop1}")
End Sub
______________________
Sub oTag1_Change (ByVal Value, ByVal TimeStamp As Date, ByVal Quality As tagQualityConstants, ByVal SubStatus As tagSubStatusConstants, ByVal Limit As tagLimitConstants)
If Value = "True" Then
Application.ExecuteCommand "Display HMI_Alarm_Pop1"
Else
Application.ExecuteCommand "Abort HMI_Alarm_Pop1"
End if
End Sub