Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

Scripting example: triggering multiple events within Visual Basic

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

Related Links
TitleResults for “How to create a CRG?”Also Available in