|
|
Rank: Member Groups: Member
Joined: 6/10/2010 Posts: 16 Location: UK
|
Hello evey body! i am new in PI system so i need a little bit help!! How can use or connect pi api to c# application and how can i call a function? I tried with dllimport but it doesn`t work! So please help!
|
|
|
|
|
OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System. We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ or contact OSIsoft vCampus for more details.
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
Hi Maxim, Welcome to the forum! Is there a particular reason why you are using PI-API instead of PISDK? You need a different licence from OSI to program using PI-API in your own applications over PI-API. (I will dust off my PI-API .Net application examples...) Cheers, Rhys. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
Rank: Member Groups: Member
Joined: 6/10/2010 Posts: 16 Location: UK
|
Hello! Thanks for quick responding! So i am started to learn PI System so i decided you know to learn all about system! So if i understand right api is included in sdk? About license i have full! anywhere do you have somethign or Are you remember how to connect to api? and another question is there some examples application in c# or code?
|
|
|
Rank: Administration
 Groups: Administration
Joined: 6/20/2008 Posts: 617 Location: Cheshire, United Kingdom.
|
OK at the very basic level, you would want something like the following to get you going in C#: Code: [DllImport("piapi32.dll")] public static extern Int32 piut_setservernode(String servername);
[DllImport("piapi32.dll")] public static extern Int32 piut_login(String username, String password, out Int32 valid);
static void Main(string[] args) { Int32 hresult = piut_setservernode("localhost"); if (hresult == 0) { Int32 valid = 0 ; hresult = piut_login("", "", out valid); }
}
However, I would recommend that you use PISDK instead. Principal Consultant Real-Time Data Management @ Wipro Technologies
|
|
|
|
Guest
|