Quantcast
Channel: OSIsoft Users Community
Viewing all articles
Browse latest Browse all 1120

How To Loop Through The Values of AF Table Using AFSDK

$
0
0
Greetings to my fellow PI Geeks:
 
I need some help looping through an AF Table. I am not finding answers doing a variety of searches on this topic. In C# I am able to connect to the default AF database and identify the target table. Unfortunately I cannot seem to find out how to parse through it and perform operations using the retrieved values. Here is my function:
 
        public HtmlString parseAndPrintAFTable()
        {
            HtmlString theEnvelopePlease = null;
            string content = "";

            //# Connect to the default AF server:
            PISystems piSystems = new PISystems();
            PISystem thisPISystem = piSystems.DefaultPISystem;

            //# Find and select an AF Database:
            AFDatabase targetAFDatabase = thisPISystem.Databases.DefaultDatabase;

            //# Find and select an AF Table:
            AFTables thoseTables = targetAFDatabase.Tables;
            foreach (AFTable thisTable in thoseTables)
            {
                if(thisTable.Name == "theTargetTable")
                {
                    //# Here is where I need help:
                    foreach (value in theTargetTable)
                    {
                         //# perform operations on the retrieved values:
                    }
                }
            }

            //# Return the data for display in an HTML format:
            theEnvelopePlease = new HtmlString(content);
            return theEnvelopePlease;

        }

Your help with this is appreciated.

 


Viewing all articles
Browse latest Browse all 1120

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>