cjrancur

Does a PIvalue exist at a given time?

Discussion created by cjrancur on Jun 8, 2010
Latest reply on Jul 7, 2010 by spilon

I have tried the following SDK syntax to set a boolean that shows whether an archive value exists at a given time.  I am getting surprising (non-working) results.  These two options both indicate a match when none exists.  Is there a better way to determine if an archived data value exists at a given time?

 

Option 1)

objPIValue = objPIData.ArcValue(dtmDateProduced, RetrievalTypeConstants.rtAtOrBefore)

Expected result: If objPIValue.TimeStamp.LocalDate = dtmDateProduced then '...we have a match

 

or Option 2)

objPIValue = objPIData.ArcValue(dtmDateProduced, RetrievalTypeConstants.rtCompressed)

Expected result: if a comexception is not thrown, we have a match
Neither of these options works.  Both find a match when none exists.

Outcomes