MNiedba

New PI-SDK 2010 R2 (1.4.0) - How to chek if given PI Point exist on server?

Discussion created by MNiedba on Mar 30, 2012
Latest reply on Apr 2, 2012 by MNiedba

Hello,

 

After switching to new PI-SDK (1.4) I have got a problem with checking if given PI Points exist on the PI Server.
I keep the name of the PI Point that I want to check as string variable.
Prior to 1.4 I have was just trying to get a PISDK.PIPoint object from the PISDK.PIPoints server collection by the string indexer.
When my result was null, then I was assuming that such PI Point does not exist on server.

Now after switching to 1.4 I have realized that this approach does not work.
Now calling the string indexer on PISDK.PIPoints collection returns a regular object, even for PI Points that do not exists.
Only when I will try to get any attribute from such PI Point I will get the COMException with psePIPOINTDELETED code.

I think that such approach, when I need to check an attribute to be sure that point does not exists is not very nice.
Is there any other solution which I can use to be sure that given PI Point does not exists? Or maybe I am doing something wrong?

Thank you for help.

Outcomes