Event Reference A-Z
A
AlertReceived Event (Messages Object)
The AlertReceived event fires each time an alert is reported to a client. This event fires only for those alert topics that you subscribed to by using the SubscribeAlerts method of the Messages object.
Syntax
AlertReceived(NewAlert)
Name | Data Type | Description |
---|---|---|
NewAlert | Message | The Alert reported by the Historian server (read-only). |
Example
' It is necessary to declare Messages "WithEvents" Dim WithEvents MyMessages As iHistorian_SDK.Messages Attribute MyMessages.VB_VarHelpID = -1
Private Sub Form_Load()
' Subscribe To All Alert Topics
If Not MyMessages.SubscribeAlerts(ihMessageTopic.Security, True) Then
Err.Raise 1, , "Failed To Subscribe" End If
End Sub
' Event Procedure
Private Sub MyMessages_Alert_Received(NewMessage As Message)
' We Just Received A New Alert
With NewMessage
Debug.Print "Received Alert " + CStr(.MessageNumber) + _ " " + .MessageString
End With
End Sub
C
ChangeReceived Event (Tags Object)
Fires each time a tag configuration change is reported to a client. Subscribe to data changes using the current data received event. This event fires only for tags that you subscribed to by using the SubscribeChanges method of the Tags object. You can subscribe to tag changes on a per tag basis or you can pass "" to subscribe to changes on any tag.Syntax
ChangeReceived(ChangedTag)Name | Data Type | Description |
---|---|---|
ChangedTag | Tag | Tag configuration change reported by the server (read-only). |
D
DataReceived Event (Data Object)
Fires each time a changed value is reported to a client. This event fires only for tags that you subscribed to by using the SubscribeData method of the Data object.Syntax
DataReceived(Tagname, Value)Name | Data Type | Column Header |
---|---|---|
Tagname | String | Tag with the current value change reported by the server (read-only). |
Value | DataValue | Value reported by the server (read-only). |
Example
' It is necessary to declare Data "WithEvents" Dim WithEvents MyData As iHistorian_SDK.Data Attribute MyData.VB_VarHelpID = -1
Private Sub Form_Load()
' Subscribe To Changes
If Not MyData.SubscribeData("USGB014.FIC101.F_CV", 5000, True) Then
Err.Raise 1, , "Failed To Subscribe" End If
End Sub
' Event Procedure
Private Sub MyData_DataReceived(Tagname As String, DataValue As DataValue)
' We Just Received a Current Value Update
With DataValue
Debug.Print "Received Current Value For " + Tagname + " " + _
" At " + Format$(.TimeStamp) + " With Value of " + _ CStr(.Value)
End With
End Sub
M
MessageReceived Event (Messages Object)
) Fires each time a message is reported to a client. This event fires only for message topics that you subscribed to by using the SubscribeMessages method of the Messages object.Syntax
MessageReceived(NewMessage)Name | Data Type | Description |
---|---|---|
NewMessage | Message | Message reported by the Historian Server (read-only). |
S
StatusReceived Event (Archives Object)
Fires each time a tag configuration change is reported to a client. This event fires only if the SubscribeStatus property of the Archives object is set to true.Syntax
StatusReceived(ChangedArchive)Name | Data Type | Description |
---|---|---|
ChangedArchive | Archive | Reported change for Historian server archive (read-only). |
Example
' It is necessary to declare Archives "WithEvents" Dim WithEvents MyArchives As iHistorian_SDK.Archives Attribute MyArchives.VB_VarHelpID = -1
Private Sub Form_Load()
' Subscribe To Changes
MyArchives.SubscribeStatus = True
End Sub
' Event Procedure
Private Sub MyArchives_StatusReceived(ChangedArchive As Archive)
' We Just Received An Archive Status Update
With ChangedArchive
Debug.Print "Received Update For " + .Name + " (" + .FileName + ")" End With
End Sub
StatusReceived Event (Collectors Object)
Fires each time a Collectors' status or configuration change is reported to a client. This event fires only if the SubscribeStatus property of the Collectors object is set to True.Syntax
StatusReceived(ChangedCollector)Name | Data Type | Description |
---|---|---|
ChangedCollector | Collector | Reported change for collector (read-only). |
Example
' It is necessary to declare Collectors "WithEvents"
Dim WithEvents MyCollectors As iHistorian_SDK.Collectors
Attribute MyCollectors.VB_VarHelpID = -1
Private Sub Form_Load()
' Subscribe To Changes
MyCollectors.SubscribeStatus = True
End Sub
T
TagnameChangeReceived Event (Tags Object)
Occurs each time a tag is renamed. This event occurs only for tags that you subscribed to by using the SubscribeChanges method of the Tags object. You can subscribe to tag changes on a per tag basis or you can pass "" to subscribe to changes on any tag.
Syntax
TagnameChangeReceived(ChangedTag, oldTag)
Name | Data Type | Description |
---|---|---|
ChangedTag | Tag | Tag rename change reported by the server (read-only). |
oldTag | String | Old tag name reported by the server (read-only). |