Mattis Seehaus Mattis Seehaus - 1 year ago 162 Question

PI ACE NextEvent() is not read in (.vb)

I am new to PI ACE Servers, but i wrote that code depending on a DataSet with Dates and Values (like "phase of X" and "Phase of Y").
The Problem is, that this code just reads in the first Date and the Phase before the Phase at t1.

I don´t see a mistake in the code so i hope you can help me out here:

Public Overrides Sub ACECalculations()

Dim t1,t2 As Date
t1= "13.05.2016 00:00"
t2= "13.05.2016 05:00"

t1 = TableStep.NextEvent(t1).LocalDate
If TableStep.Value(t1) = "Phase X" Then
Debug.Print(t1 & "" & "Phase X)
Debug.Print(t1 & "" & TableStep.Value(t1).ToString)
End If
Loop While t1<=t2

End Sub

Answer Source

oh you´re right and thx for your reply, but i fixed it myself by referring to t1 and t2 as New PITimeServer.PITime instead of Date.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download