PIAdminUnison

PI AF 2012 -  Data.UpdateValue vs SetValue

Discussion created by PIAdminUnison on Aug 21, 2012
Latest reply on Aug 22, 2012 by rgilbert

Hey all,

 

I have another question but this time it is about Data.UpdateValue.  I have an attribute I want to change and it is a configuration item.  When I try to do the following call:

 
Dim outputAFValue As New AFValue
outputAFValue.Value = afExeTime.LocalTime.AddSeconds(-1) 'Attribute is a DateTime
tmpElement.Attributes("Check Date").Data.UpdateValue(outputAFValue, Data.AFUpdateOption.Replace)

 

 

I get the following error:

 

Cannot update value for Attribute 'Check Date' in Element 'CB 3636 - Test' in Element 'Hastings' in Element 'Open Points' because it is a configuration item.

 

When I try the "SetValue":

 
tmpElement.Attributes("Check Date").SetValue(outputAFValue)

 

 

I get no error and it updates the attribute.  Can we not use the "Data.UpdateValue" for attributes that are not PI tags or am I missing a step before I try to update the value?

 

 

 

Thanks,

 

Jimmy

 

 

Outcomes