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