i applied the SetValue method. The important chanllege was to identify the proper attribute. I was try to access the parent attribute, but i needed to update the child-attribute. Once this was identified, the SetValue method worked like a charm.
for future enthusiasts, my working looks like the following.
crrAtt = CurrEle[@"\\DESKTOP-945B9S8\BASTEST\Location\Pumps\P8182"].Attributes["Type"].Attributes["SourceTag"];
AFValue varing = new AFValue();
varing.Value = val;
varing.Timestamp = AFTime.Now;
1 of 1 people found this helpful
This one line also should work. Not that its preferred, but just to introduce you to alternatives:
crrAtt = CurrEle[@"\\DESKTOP-945B9S8\BASTEST\Location\Pumps\P8182"].Attributes["|Type|SourceTag"];
2 of 2 people found this helpful
If your Attribute is a Configuration Item, then SetValue would cause a check out, and then a check-in is required for non-data reference attribute values to be saved back to the PI AF Server.
crrAtt.Data.UpdateValue(varing, AFUpdateOption.Insert, AFBufferOption.DoNotBuffer);