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?
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 ";