I want to use de AF SDK in a computer different than the one hosting PI. How can I connect to PI Server? Examples always starts with PISystems piSystems = new PISystems(); but that's valid only in localhost, right?
No, PISystems piSystems = new PISystems() returns a reference to the collection of known AF Servers by the client machine. The client machine can be a separate machine or a server machine.
PISystem ps = piSystems["Name of AF Server"] will return a reference to an AF Server of the given name, and this AF Server can be on the machine the code is running or a remote machine.
Note that the connection is made lazily (on-demand). The above line doesn't actually connect. If you just want to test connection, you can do a ps.Connect() afterwards.
Thanks, I undestand now. But how can I set the connection to the AF I want manually (by code)? How I can add my own AF server to the list?
PISystems.Add() will add a new AF Server to the list of known servers by the local machine. PISystems.Add Method
Then you can obtain a reference to to via piSystems["AF Server Name"]
Retrieving data ...