AnsweredAssumed Answered

pithonnet AF SDK - Retreive record count

Question asked by MTaylor8 on Apr 20, 2018
Latest reply on Apr 20, 2018 by MTaylor8

We used to use an Excel based macro to retrieved large volumes of raw tag data and it wrote the results to a .csv file.  We have replaced this with a Python Script.  The scripts works using the following conneciton details:

Reading from OSIsoft PI AF framwork using pithonnet)
        # PI Data Archive
        piServers = PIServers() 
        piServer = piServers.DefaultPIServer;

        #Specify the tag to be read
        pt = PIPoint.FindPIPoint(piServer, TagList[tag])
        name = pt.Name.lower()

        timerange = AFTimeRange(PeriodStart,PeriodEnd)
        recorded = pt.RecordedValues(timerange, AFBoundaryType.Inside, "", False)

I would like to create a processbar to show the progress of the data extraction without having to loop through the tag reading function twice.  I could not see a .count attribute but is there

something like that I can use to quickly determine the number of records I would be reading for each tag and time period?

 

Thanks

Malcolm

Outcomes