AnsweredAssumed Answered

trying to use UpdateValue for a string PiPoint but do not want to add duplicate values

Question asked by mdspath on Sep 29, 2015
Latest reply on Oct 1, 2015 by mdspath
Hello:
I'm trying to write a utility to add string values into a string PiPoint. I have that part working but I'm not sure how to prevent the user from adding duplicate values.
I've been looing into the AFUpdateOption Enum but since the time is sent into UpdateValue from the timedate control with no seconds and milliseconds but the values in PI have seconds and milliseconds, there is never the "same time".

 

  Member nameValueDescription
Replace0Add the value to the archive. If any values exist at the same time, will
overwrite one of them and set its Substituted flag.
Insert1Add the value to the archive. Any existing values at the same time are not
overwritten.
NoReplace2Add the value to the archive only if no value exists at the same time. If a
value already exists for that time, the passed value is ignored.
ReplaceOnly3Replace an existing value in the archive at the specified time. If no
existing value is found, the passed value is ignored.
InsertNoCompression5Add the value to the archive without compression. If this value is written
to the snapshot, the previous snapshot value will be written to the archive,
without regard to compression settings. Note that if a subsequent snapshot value
is written without the InsertNoCompression option, the value added with
the InsertNoCompression option is still subject to compression.
Remove6Remove the value from the archive if a value exists at the passed time.

Outcomes