I am building a processbook that will display events based on an event pipe in a list box using PB 126.96.36.199 with PI SDK 188.8.131.523
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?