OxleyCreek

RawPIPoint strange behaviour

Discussion created by OxleyCreek on Jul 14, 2011
Latest reply on Jul 15, 2011 by dtakara

If I put a breakpoint on the IF statement  the PIPoints ptMw and ptMVAR are null. If I put the breakpoint on the first line starting with List and then after a pause run the rest of the code, the PIPoints are valid and I can use them to access data later in the function.

 

It seems like there is a time delay in the RawPIPoint attribute getting a connection to the PI Point object ... Does anyone know what is going on <<here?

 

Thanks

 

Michael Jones

 

List <List<double>> list = null;
PISDK.PIPoint ptMW = (PISDK.PIPoint)Tx.Elements["MW"].Attributes["Value"].RawPIPoint; 
PISDK.PIPoint ptMVAR = (PISDK.PIPoint)Tx.Elements["MVAR"].Attributes["Value"].RawPIPoint; 

if (ptMW == null || ptMVAR == null)
{
   ErrorMessage = "There is a problem finding the PI tags for MW or MVAR "; 
   return null;
}

 

Outcomes