Hi,
I want to make every day a report with all the alarms on a hitlist.
But my problem is, how can i detect the maximum number of data records for those alarms (because its variable).
I made the following script but i can;t detect the EOF (/ of end of the alarms).
Sub Set_limits()
Dim objAlarmControl
'create reference to AlarmControl
Set objAlarmControl = HMIRuntime.Screens("Alarmen").ScreenItems("Alarm view_1")
'Set the hitlistmaxsourceitems = 1
objAlarmControl.HitListMaxSourceItems = 1
'Select the range
If (objAlarmControl.MsgFilterSQL = "") Then
objAlarmControl.MsgFilterSQL = "DATETIME >= '2013-07-24 00:00:00.000'"
Else
objAlarmControl.MsgFilterSQL = ""
End If
'Loop for finding the end of the hitlist
Do
objAlarmControl.HitListMaxSourceItemsWarn = True
objAlarmControl.HitListMaxSourceItems = objAlarmControl.HitListMaxSourceItems + 1
SetTag "test", objAlarmControl.HitListMaxSourceItems
If objAlarmControl.HitListMaxSourceItemsWarn = True Then
SetBit "test_1"
Else
ResetBit "test_1"
End If
'Detected the last histlist item? Then end the loop
Loop Until objAlarmControl.HitListMaxSourceItemsWarn = False
End Sub
I hope someone can help me.
Thx
I want to make every day a report with all the alarms on a hitlist.
But my problem is, how can i detect the maximum number of data records for those alarms (because its variable).
I made the following script but i can;t detect the EOF (/ of end of the alarms).
Sub Set_limits()
Dim objAlarmControl
'create reference to AlarmControl
Set objAlarmControl = HMIRuntime.Screens("Alarmen").ScreenItems("Alarm view_1")
'Set the hitlistmaxsourceitems = 1
objAlarmControl.HitListMaxSourceItems = 1
'Select the range
If (objAlarmControl.MsgFilterSQL = "") Then
objAlarmControl.MsgFilterSQL = "DATETIME >= '2013-07-24 00:00:00.000'"
Else
objAlarmControl.MsgFilterSQL = ""
End If
'Loop for finding the end of the hitlist
Do
objAlarmControl.HitListMaxSourceItemsWarn = True
objAlarmControl.HitListMaxSourceItems = objAlarmControl.HitListMaxSourceItems + 1
SetTag "test", objAlarmControl.HitListMaxSourceItems
If objAlarmControl.HitListMaxSourceItemsWarn = True Then
SetBit "test_1"
Else
ResetBit "test_1"
End If
'Detected the last histlist item? Then end the loop
Loop Until objAlarmControl.HitListMaxSourceItemsWarn = False
End Sub
I hope someone can help me.
Thx