4 Replies Latest reply on Oct 27, 2016 9:30 PM by jramirez

    passed timestamp is in the future datalink




      I am getting this error: "Passed Timestamp is in the future" when using this code:


      Public Function writetoPI(Tag As String, val As Variant, timestamp As String, PIServerName As String) As String

          On Error GoTo errhandler

          Dim srv As Server

          Dim pt As PIPoint

          Dim piErr As PIError

          Dim Time_Stamp As Date


          If srv Is Nothing Then

              Set srv = PISDK.Servers.Item(PIServerName)


          End If


          Time_Stamp = CDate(timestamp)

          Set pt = srv.PIPoints.Item(Tag)

          pt.Data.UpdateValue val, Format$(Time_Stamp, "dd/MM/yyyy HH:mm"), dmReplaceDuplicates

          writetoPI = "OK"

          Exit Function



          MsgBox "Error Escribiendo a PI, Tag:" & Tag & " " & Err.Description, vbCritical, "Error En Escritura a PI"

          writetoPI = Err.Description


      End Function


      and I am passing yesterday´s timestamp...is definitely NOT in the future, any ideas?


      I am using PI 2016, datalink 2015, office 2010....