I want to check the PI Tag exists or not ?.which method to check ?
Are you trying to programmatically determine whether a PI Tag exists or not? With PI AF SDK, you can use the PIPoint.TryFindPIPoint static method to find a PIPoint on a PIServer without throwing an exception if the point is not found.
see: PIPoint.TryFindPIPoint Method
For your information, the Master PI > Developing Applications with PI AF SDK space is used for posting questions about the Developing Applications with PI AF SDK class. I have moved this question over the PI Developers Club > PI .NET Framework for continued discussion.
It looks like Daphne Ng beat me to it. I see this was updated as I started typing.
PIServer piServer = new PIServers()["ServerName"];
if( PIPoint.TryFindPIPoint(piServer, "TryThisPointName", out point))
You also could use the static method of PIPoint method and catch the exception if the PiPoint is not found. We both gave you AF SDK methods, but are you using PI SDK or AF SDK to do this?
Here is a way if you want to use PI SDK. You can use the Server.GetPoints call.
Server srv = sdk.Servers.DefaultServer;
PointList ptlist = srv.GetPoints("tag='cdt158'");
if (ptlist.Count ==0)
Console.WriteLine("No points found!");
Retrieving data ...