PIPoint Attribute - PI Point not found - PIException

Discussion created by drausim127@spiratec on Nov 5, 2014
Latest reply on Nov 5, 2014 by drausim127@spiratec



I have written a small C# program were I use AFSDK v.2.5 (upgrade to AFSDK v.2.6 is not possible). In this code I want to read out the value of an AF Attribute wich one refers to an PI Point. To do this I use the following command. tAttribute.GetValue(lTime).Value were tAttribute is an object from type AFAttribute.


Normally the command works fine but when the refered PI Point doesn't exists on the PI Server an unhandled PIException appears in Visual Studio (in the debug mode) and I'm not capable to catch this exception. Here is a translation of this exception message: PIException was unhandled by user code. Additional Information: PI Point not found.


I know that I can exclude this exception in Visual Studio via "Debug->Exceptions->Check Thrown/User-Unhandled for Common Language Runtime Exceptions" but is there another way to catch this exception by a try catch block. Or is there a special way via AFSDK to find out if this refered PI Point exists or not?


Best regards Markus