Could you post a more elaborare snippet of code? Especially the declaration and initialisation of "value".
The code is bellow:
PIPoint tag = tagSaida.DataSource;
PIValue value = tagSaida.DataSource.Data.Snapshot;
PISDK.PointAttribute userInt1 = tag.PointAttributes["userint1"];
PISDK.PointAttribute zero = tag.PointAttributes["zero"];
PISDK.PointAttribute userReal2 = tag.PointAttributes["userreal2"];
tag.PointAttributes.ReadOnly = false;
value.Value = userReal2;
zero.Value = 1;
userInt1.Value = 1;
tag.PointAttributes.ReadOnly = true;
tag.Data.UpdateValue(value, '*', DataMergeConstants.dmReplaceDuplicates, null);
what is the data type of tagSaida.DataSource.Data.Snapshot please? I think you might need to do something to change PIValue value = tagSaida.DataSource.Data.Snapshot. My suggestion is:
PIValue value = new PIValue();
value.value = tagSaida.DataSource.Data.Snapshot; // value.value is the data that you need to stored
Please do not use value.value = userReal2, as userReal2 is an attribute. I think you might need userReal2.value = "...", or this attribute could be used the default setting.
You have set you value to be of type "PointAttribute" and not the Point Attribute's value, which is what I think you have intended to do - as Xi has mentioned. So your line should be:
value.Value = userReal2.Value;
It was resolved with the Rhys solution.