oliveirae

UpdateValues is inserting duplicate values

Discussion created by oliveirae on Nov 26, 2014
Latest reply on Nov 27, 2014 by oliveirae

Hi all!

 

 

 

If I run the following code twice on the second time it should not insert any value however the last value on the list is inserted.

 

 

 
// Get PI tag
PIPoint tag = PIPoint.FindPIPoint(server, "BF_TEST");


// Buld list of values
AFValues values = new AFValues();

for (int i = 1; i <= 10; i++)
{
    AFValue value = new AFValue(i, new AFTime(new DateTime(2014, 11, i+1)));
    values.Add(value);
}

// Update PI tag values
tag.UpdateValues(values, AFUpdateOption.NoReplace);

 And if I run it again the last value on the list will be inserted again.

 

Can someone please help me with this?

 

Thanks!

Outcomes