AnsweredAssumed Answered

How to connect to PI Server hosted on a separate machine using AF SDK

Question asked by yusuf_shaikh on Jul 6, 2020
Latest reply on Jul 6, 2020 by yusuf_shaikh

Hi Team,

 

I need to create a web API that should connect to PI server not AF server and fetch tags values.

I am using the following code to connect to PI server :-

PIServer myPIserver = new PIServers()["Test"]
But i am getting the following error :-
System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'OSIsoft.PI.Configuration, Version=1.8.3.0, Culture=neutral, PublicKeyToken=c3309f0734ba2805' or one of its dependencies. The system cannot find the file specified.
Source=OSIsoft.AFSDK
StackTrace:
at OSIsoft.AF.PI.PIServersGlobal.Load(Boolean force)
at OSIsoft.AF.PI.PIServersGlobal..ctor(PISystemsGlobal systems)
at OSIsoft.AF.PISystemsGlobal.get_PIServers()
at OSIsoft.AF.PI.PIServersGlobal.GetPIServers(PISystemsGlobal systems)
at OSIsoft.AF.PI.PIServers..ctor()
at Console_App_For_PI_Tags.Program.Main(String[] args) in C:\Users\piadmin\source\repos\Console_App_For_PI_Tags\Console_App_For_PI_Tags\Program.cs:line 17
Please let me know what should be approach, thanks in advance

Outcomes