I am building a processbook that will display events based on an event pipe in a list box using PB 18.104.22.168 with PI SDK 22.214.171.1243
I have some code which looks like this which will build the eventpipes.
Private Sub ConstructEventPipes() On Error GoTo errHandle Dim objAlarm As PISDK.pipoint Dim i As Integer Set EventPipes = New Collection Set objEvents = New Collection For i = 1 To AlarmList.Count Log "Getting Event Pipe " & i & " of " & AlarmList.Count, "alarms.ConstructEventPipes" EventPipes.Add AlarmList.Item(i).Data.EventPipe VBA.DoEvents Next errHandle: If Not err.Number = 0 Then Log err.source & ": " & err.Description, "alarms.ConstructEventPipes" On Error GoTo 0 End Sub
This works well over a local connection to the PI Server. With higher latency links the code gets exponentially slower through the for next loop.
Any suggestions on a better way to do this, or improvements to the existing code?