AnsweredAssumed Answered

AFSDK references

Question asked by Javier91 on Feb 18, 2016
Latest reply on Mar 7, 2016 by rdavin

I'm using AFSDK.dll to connect and retrieve data from a remote AF Server. I can connect to the server a retrieve the structure (elements and attributes) but I can't retrieve values.

 

OSIsoft.AF.PISystem s = new OSIsoft.AF.PISystems()["JCVM"];
OSIsoft.AF.AFDatabase db = s.Databases["Fleet Generation"];
OSIsoft.AF.Asset.AFElement e = db.Elements["CENTRAL"].Elements["Albertsville"].Elements["GAO01"];
OSIsoft.AF.Asset.AFAttribute a = e.Attributes["Gas Turbine Speed"];


Console.WriteLine(a.GetValue() + " " + a.DefaultUOM.ToString());

 

If a call to a.DefaultUOM.ToString() returns "revolution per minute" and its ok. But if I try to call a.GetValue() following error appears:

 

error.png

 

So far I copied from AF the the file Program Files(x86)/PIPC/AF/Public Assemblies/4.0/OSIsoft.AFSDK.dll and I tried to copy PISDK.dll and OSIsoft.AF.Asset.DataReference.PIPoint too but without results (I'm using Visual Studio 2013 so I add new .dll to the project using "Add Reference" option)

Outcomes