Call an AF Data Reference Attribute from Excel

Discussion created by mrpoisse on Jun 2, 2011
Latest reply on Jun 7, 2011 by andreas



I like to use Excel as an interface to show data, because the end user can easily adapt it to its particular needs.


I am programming a custom data reference in AF (with VB.NET) in order to calculate the OEE for a given period.


The goal is for the Excel to call this reference, given a start and an end timestamp.




my challenges:


1- It appears that AFSDK is not available in VBA. What would be the best option to call the attribute from Excel?


    OPTION 1A: Write a custom dll that connect to AF


   OPTION 1B: Connect to AF through another method such as OLEDB


   Other OPTIONS?


2- For the Data Reference to return a good OEE value, the users needs to specify timestamps. How easy is it for the user to provide parameters to the data reference call?


   OPTION 2A: I could store the timestamps in Attributes and the user modifies those attribute before he calls the Data Reference calculation... however we might encounter issues when 2 different users call this at the same time.


   OPTION 2B: Given that I have a solution for #1, I could create a dynamic unique attribute in AF, which would contain the timestamps of the query, then delete this temporairy attribute once the value is returned.


OPTION 2C (answer from OSIsoft's support team): On the client side, you can use the GetValue(AFTimeRange) on an AFAttribute object configured in AF with your custom data reference. This method has an argument for the desired start and end time that is set in an AFTimeRange object. The custom data reference can then use this AFTimeRange object to apply the user desired time range to the OEE calculation.




Thank you for your help