The following code should bring back a list of tags
private static void GetTags()
{
try
{
// open pi server connection
mySDK = new PISDK.PISDKClass();
myServer = mySDK.Servers["PI"];
myServer.Open(String.Empty);
string tagFilterSql = "pointsource='M'";
//string tagFilterSql = "tag='*power.meter*'";
PISDK.PointList myPointList = new PISDK.PointList();
//aSynch = new PISDKCommon.PIAsynchStatus();
myPointList = myServer.GetPoints(tagFilterSql, new PISDKCommon.PIAsynchStatus());
Console.WriteLine("Number of points: "+myPointList.Count.ToString());
}
catch (System.Exception ex)
{
WriteToLog(ex.ToString(), true);
}
}
When I run it from the console I get the following:
C:\svn\VisualStudio\EnergyMeters\EnergyMeters\bin\Debug>energymeters
Number of points: 0
Here is the screenshot of the tags I should be getting back
https://mail.ghplp.com/Pub/PiTagList.JPG