altman80

Deleting Snapshot Event

Discussion created by altman80 on Jun 17, 2013
Latest reply on Jun 21, 2013 by Gregor

I am looking at a way to delete events on HA.  I make a connection to each node and delete the events.  This seems to work except if I try to delete the most recent event which would essentially be the snapshot.  When I try to delete the most recent event in the archive I get the error "Failed to remove one or more requested events. [0] Success."  For example if I have a value for 1:00, 2:00, and 3:00.  I can delete 1:00 and 2:00 without problem, But I cannot delete 3:00.  If I add a record at 3:01 (which causes this to be the most recent), then I can delete 3:00.  Is it possible to delete the snapshot value?  Not sure if this is related to HA but that is what we have installed.

 

Here is a shortened version of my code that recreates the error

 

 

 
Dim mySDK As New PISDK.PISDK
        Dim Collective As PISDK.IPICollective
        Dim colList As PISDK.CollectiveList
        Dim point As PISDK.PIPoint
        Dim OldValues As PIValues = Nothing
        Dim Data1 As PISDK.IPIData2
        Dim tagname As String = "SINUSOID"

        Dim myServer1 As PISDK.Server

        Collective = mySDK.Servers(Server)

        colList = Collective.ListMembers

        myServer1 = Collective.MemberOpen(colList(2), "")
        point = myServer1.PIPoints.Item(tagname)
        Data1 = DirectCast(point.Data, PISDK.IPIData2)

        Data1.RemoveValues(point.Data.Snapshot.TimeStamp, point.Data.Snapshot.TimeStamp, PISDK.DataRemovalConstants.drRemoveAll)


        myServer1.Close()

 

Outcomes