AnsweredAssumed Answered

passed timestamp is in the future datalink

Question asked by jramirez on Oct 26, 2016
Latest reply on Oct 27, 2016 by jramirez

Hi:

 

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)

        srv.Open

    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

   

errhandler:

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

    writetoPI = Err.Description

    End

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....

 

Jaime

Outcomes