Hello,
For some reasons, I won't be able to use datalink formulas in my sheet, so I have to do everything thru VBA.
I am trying to implement this formula.
=PIAdvCalcExpVal("('piTAG')";"25/08/14 02:00:00";"25/08/14 05:00:00";"average";"time-weighted";"interpolated";"60m";0;1;0;"piServer")
And I am using this code
Dim srv As Server Dim pt As PIPoint Dim val As NamedValues Dim dtI As New PITimeFormat Dim dtF As New PITimeFormat Set srv = Servers("piServer") Set pt = srv.PIPoints("piTAG") dtI.InputString = CStr("25/08/2014 02:00:00") dtF.InputString = CStr("25/08/2014 05:00:00") Set val = pt.DATA.Summaries(dtI, dtF, btInside, asAverage, 3) Dim point As PIValues Set point = val("Average").Value
But I can't access the final value for this average over the time. I just want one value, like the formula gives me.
the "point" variable doesn't give me the value, only three properties: Count (3), Direction (dForward) and ReadOnly(false).
What am I doing wrong?