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)

Table 1. Parameters
NameData TypeDescription
NewAlertMessageThe 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)
Table 2. Parameters
NameData TypeDescription
ChangedTagTagTag 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)
Table 3. Parameters
NameData TypeColumn Header
TagnameStringTag with the current value change reported by the server (read-only).
ValueDataValueValue 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)
Table 4. Parameters
NameData TypeDescription
NewMessageMessageMessage 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)
Table 5. Parameters
Name Data Type Description
ChangedArchive ArchiveReported 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)
Table 6. Parameters
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)
Table 7. Parameters
NameData TypeDescription
ChangedTagTagTag rename change reported by the server (read-only).
oldTagString Old tag name reported by the server (read-only).