Scripting example: triggering multiple events within Visual Basic
- Last UpdatedMar 07, 2025
- 1 minute read
In this Visual Basic script, the initialization occurs with AVEVA Historian running on a specified computer, and more than one event is invoked:
Private Sub Command1_Click()
Dim ComputerName As String
ComputerName = "Computer1"
Dim TagName As String
Dim Connected As Long
TagName = "Event1"
WWHistEvent1.InitializeEx ComputerName
WWHistEvent1.AddEventTag TagName
Connected = WWHistEvent1.IsConnected
If Connected = 1 Then
WWHistEvent1.InvokeEventEx TagName
WWHistEvent1.InvokeEventEx TagName
WWHistEvent1.InvokeEventEx TagName
MsgBox ("Sent off three events")
Else
MsgBox ("Failed To Connect")
End If
End Sub