RohitW

Unable to Update PI annotations in PI tag using PI ACE

Discussion created by RohitW on Nov 8, 2012
Latest reply on Nov 8, 2012 by hanyong

Hello,

 

I have prepared one PI ACE calculation using PI SDK.

 

I am trying to update annotations to a tag using the snippet below and getting the error as "Failed to clone valueattribute"

 

******************************************************************************

 

 

 

 

 

 

 

 

 

 

 

Dim

 

 

myAnns As New PIAnnotations

 

 

 

 

Dim strAnnotation As PIAnnotation

 

 

 

 

 

Dim myVals As New PIValues

 

 

 

 

 

Dim valTim As New PITimeServer.PITime

 

 

 

 

 

Dim myValAttr As PISDKCommon.NamedValues

 

 

 

 

 

Dim myVal As PIValue

 

---------------------------

 

 

 

 

 

 

 

 

 

 

 

obj_PIPoint = OBJ_SERVER_TEST.PIPoints("SINUSOID

 

")

 

myAnns = N

 

ew PIAnnotations

myAnns.Add(

 

"Annotation", "Test annotation","100", False, "Data")

myVals.ReadOnly =

 

 

False

valTim.SetToCurrent()

myValAttr =

 

New PISDKCommon.NamedValues

myValAttr.Add(

 

"annotations", myAnns)

 

' add the annotations collection to the value

myVal = myVals.Add(valTim.LocalDate,"100", myValAttr)

obj_PIPoint.Data.UpdateValue(myVal, Now,

 

DataMergeConstants.dmReplaceDuplicates)

 

**********************************************************************************

 

 

 

whereas when i am trying to do the same stuff using the VB.net console application, am able to update successfully.

 

Could you please help, if i am missing some step?

 

 

Outcomes