A part of our application is attempting to convert a bunch of our in-house representation of Tag values into AFValues and writing them back to the server. In order to test this, we have predefined a Tag with 108 values, that we attempt to write to a given PIPoint with the following line:
var errors = _server.UpdateValues(afValues, afUpdateOption);
Stepping through the program with the debugger confirms that afValues contains the 108 values we expect it to, afUpdateOption is AFUpdateOption.Replace, and that there are no errors after the line has executed.
So, here's what's weird:
If the tag is empty and we run this once, all values get inserted as they should.
If we then run it again, we'd expect the 108 values to remain in the tag, but that their "substituted" flag should be changed. What happens, however, is that there's just one value - the last one - left, and all the others are gone, seemingly without any trace.
Any idea why this is? Looking at the documentation, it doesn't seem like this is the expected behaviour of UpdateValues with the Replace option. We also tried to insert without any compression, and got similar results, though then it looked like we could insert twice before values started disappearing.
Thanks in advance for all your help.