1 Reply Latest reply on Aug 29, 2017 9:36 AM by gregor

    GetValue() in C# with same retrieval settings like in the AF Database

    AAsmus

      Hi Community,

      (my Problem ist solved)

       

      We have an AF Server with a Model, Analysis and a Cases. Each day is a new case.

      I am trying to read for each case some attribute values from AF Elements like PiPoint name,  Unit of Measure, and the value itself. For the value I am using the GetValue() Method.

      With GetValue() i didn't get the value what i see in the AF Case  rahter it seems to be the last value from the pi Point.

      In the AF DB for this Element Attribute There are settings for the Value retrival methods like Timerange (1d), Average Time Weighed, Min percent good:80.

      I use in my c# Programm following line:

      (Attr. is the attribute for example a temperature)

       

      foreach (var element in SFCase.Elements)

      ....

       

       

      new AFsdkValue(element.Attributes[Attr].PIPoint.ToString(), element.Attributes[Attr].DefaultUOM.Abbreviation.ToString(), Convert.ToDecimal(element.Attributes[Attr].GetValue().Value));

      How can i get same value which i see in the af database for this case?

       

      problem is solved, i have to give the GetValue() Method the Case ID now i get the right value.

      GetValue(CaseID, null).