Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

COM Exception in PIValues collection

$
0
0

Hello,

 

Good Day!

 

I am using PI-SDK in .Net.

I have used PIValues collection which contains several pi values received from the PI tags. Now, if I want to fetch a certain value at a position (say 10) from the collection, it gives me COM Exception.

 

 

piValues = snapPoint.Data.RecordedValues(strStartTime, strEndTime, BoundaryTypeConstants.btInside);

 

foreach (PIValue piValue in piValues)

{

blnIsDecimal = Decimal.TryParse(piValue.Value.ToString(), out decOutNum);

if (blnIsDecimal)

{

if (piValues[iTempTurnaroundCnt].Value != piValues[iTempTurnaroundCnt + 1].Value && iTempTurnaroundCnt < piValues.Count)

{

strPiTagValue = piValues[iTempTurnaroundCnt].TimeStamp.LocalDate.ToString(Constants.DATE_FORMAT_LONGDATE4);

break;

}

}

iTempTurnaroundCnt++;

}

 

"piValues[iTempTurnaroundCnt].Value" throws COM Exception.

 

Please let me know for any details required.

 

 

Thanks,

Souvik


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>