I don't see anything in the AFSDK help that shows you how to get the PI Data Archive server or collective from a PISystem object.
To connect to the PI Data Archive in AF SDK, please use PIServers object (i.e. PIServers srvs = new PIServers()). An example is below in the new AF SDK online help.
Connecting to PI Server
I'm assuming that you are looking for a method to determine which PI Server is associated to the AF Server?
Unfortunately I don't believe that there is any builtin mechanism to do this. What I've done to over come this is have an element at the root of the AF model which uses the AF Servers name to lookup the PI Server in a table. The main reason is for tag creation. The default %Server% substitution uses the users' default PI Server which can lead to some unexpected results if this user works across multiple AF Servers.
Were you able to resolve your issue from Barry or Michael's answers? If not, would you mind giving us some additional information so we can provide further assistance? Thanks.
I have been using PI-SKD for years and PI-API for years before that. The switch from PI-API to PI-SDK was not too bad, but I find it very difficult to navigate my way around AFSDK.
What I, and maybe hundreds more like me, need is a document to show me how to do common PI-SDK tasks with AFSDK. I thought I saw such a document on this site earlier today, but I didn't click on it as I was searching for something else at the moment. Now I cannot find it. It was a lot easier to find things on the vCampus website than it is on pisquare website.
Regarding the original question I can not connect to the PI server...
I also note that I cannot copy and paste into this forum... yet another move to make it harder to use.
I think the PI SDK Equivalents chapter of AF SDK help file might be useful to you:
Regarding connection to the PI Server with AF SDK, could you please share your code and errors if any. If you cannot paste it in this forum, you can email it to the firstname.lastname@example.org and refer to this forum thread.
In addition to the resource that Anna suggested, you can look into this PI Square post: AF SDK Equivalents for DataLink Functions (reference-only for PI SDK) (perhaps this was the post you came across with earlier). Even though the post is centered around DataLink functions, you might find useful information about the equivalent AF SDK functions to some PI SDK functions that you are familiar with.
Another reason for confusion might be that there is no direct relation between the AF model / AF server and the PI Server(s). In the end, a PI server is only related to in a PI Point DataReference. And within one AF model you can reference multiple PI Servers. In the AF-based world, AF becomes the center of the universe, and which PI server is serving data for an attribute is just less relevant.
Note that in practice i do not rely on the %Server% substitution, as you would want every user of the AFmodel to use the same PI data, right? Not depending on their own default PI Server settings. So i record in some way or another the PI Server to use in the AFmodel itself.
Retrieving data ...