Find Summaries Method in

Discussion created by inform2prabhat Champion on Oct 26, 2009
Latest reply on Oct 26, 2009 by inform2prabhat



can somebody help me out with this.


i am trying do some calculations (average,min,max)in using the summaries functions given in pisdk.chm in Visual basic 6.0 syntax. I tried but not able to complete the same.


Getting errors at the places where i have given RED COLOR.






            PISDK.PIPoint pt;


            PISDK.PIData pdata;


            PISDK.IPICalculation ipiCalc;


            PISDK.IPIData2 ipid2;


            PISDK.PIValues valsum;


            int i;PISDKCommon.NamedValues nvsSum;


            string strtag = "sinusoid";


            string starttime = "10/26/2009 10:00:00";


            string endtime = "10/25/2009 10:00:00";


            string interval = "1D";




            nvsSum = new PISDKCommon.NamedValuesClass();


            pt = myServer.PIPoints["cdt158"];


            pdata = pt.Data;


            ipid2= pdata; //get pointer to IPIData2 Interface.


// Error 1: Cannot implicitly convert type 'PISDK.PIData' to 'PISDK.IPIData2'. An explicit conversion //exists (are you missing a cast?




nvsSum = ipid2.Summaries2(starttime, endtime, interval, asAverage, cbTimeWeighted);


//Error 2: The name 'asAverage' and cbTimeWeighted does not exist in the current




           valsum = nvsSum("Average").Value;


//Error 3:'nvsSum' is a 'variable' but is used like a 'method'




           for (i = 1; i < valsum.Count; i++)


             {textbox1.Text = valsum(i);}


Error 4:'nvsSum' is a 'variable' but is used like a 'method






Great if somebody can help me out with the summaries functions example of PI-sdk using