How-to
What a PI System Picker connection needs on the client
Short answer
PISystemPicker and PIServerPicker never discover or create server connections; they list the connections already defined for that Windows login on that workstation. A remote PI server appears in the picker only after the client-side AF connection exists with Host set to the server's DNS name, and the server holds an AF Mapping or PI Mapping for the account that runs the application. Configure both layers, then test under the running account.
On this page
- What each picker selects
- Map the connecting identity on each server
- Define the connection on the client, under the login that runs the application
- DNS belongs on your DNS servers, not in the picker
- Worked example: one login, one workstation, two PI servers
- Hand customers a working first run
- The decision, in order
- Questions asked
The picker is the last step of the setup, not the first. PISystemPicker and PIServerPicker do not discover remote servers, create connections, or grant access: they list the connections already defined for the Windows login that launches the application, on the workstation it runs on. A remote PI server appears in that list only when two layers exist: a client-side connection whose Host entry carries the server's DNS name, and a server-side mapping that ties the account running the application to a PI identity. Set both layers up in that order, then test one real read under the account that actually runs the application.
What each picker selects #
PISystemPicker selects an AF system: the asset server. PIServerPicker selects the PI Data Archive, the data server that stores process history. Both controls expect the connections to have been defined already, for that particular Windows login, on that particular workstation. A definition made under your developer account on your work computer does nothing for the customer's login on another machine, which is why a demo that worked in the office can show an empty picker at the customer site.
An application that reads both asset data and history uses both pickers, and the two are separate setups. An AF connection can succeed while the data connection fails, and the reverse, so keep the two results distinguishable in your interface; a single "server connection failed" message hides the one distinction the technician on site needs.
The behavior follows from the design, and it gives you a sorting rule for every fault: an empty picker list means that login owns no connection definitions, which is a client-side gap. A server that is listed but refuses the connection means the mapping, the permissions or the network is missing, which is a server-side or network gap. Every check below sorts into one of those two buckets.
Map the connecting identity on each server #
Remote access is granted on the server, to an identity, not to an application. The asset server needs an AF Mapping for the connecting entity; the data server needs a PI Mapping. The entity to map is the account that runs the AF SDK application: your interactive login during development, the service account in production, not necessarily the person looking at the screen. The vendor's trusted-domain guidance makes the association explicit by mapping the Windows domain account (its example names it User1) to a PI identity (Identity1 in the same example). PI System Explorer's Mappings tab is where mappings on the PI AF server are reviewed, added, edited and removed.
A mapping establishes the association used for authorization; permissions on the AF objects and the PI data still decide what an authenticated connection may read. Test one real attribute read and one real data read under that account instead of treating a successful connection as permission. When a data-server login is refused at connection time, before any query runs, the mapping or trust layer is the usual cause; PI ODBC reports that same refusal as SQLSTATE 08004, which why PI ODBC fails with SQLSTATE 08004 before a query runs works through step by step.
Confirm on the server that connections arrive under the identity you mapped. The tooling that shows third-party client connections to a PI Server tells you which accounts are connecting and when, so a mismatch between the mapped identity and the connecting one becomes visible instead of silent.
One caution: do not widen server access toward anonymous access to make an empty picker list go away. The mapping is the supported mechanism for exactly this situation, and it keeps the audit trail meaningful.
Define the connection on the client, under the login that runs the application #
- Sign in to the client workstation with the Windows account that will run the application.
- Open PI System Explorer and choose
File > Server Properties; the vendor notes the picker uses this same interface for its connections. - Set the connection's Host entry to the AF server's DNS name, spelled exactly as your DNS infrastructure answers it.
- Connect, and read one attribute the application is meant to use.
- If the application also reads history, define the data-server connection the same way; definitions do not carry over between the two pickers.
- Launch the application and check what
PISystemPickerlists under that login.
The class documentation lives in the AF SDK help file AFUIRef.chm, installed under %PIHOME%\help; the PISystemPicker Class topic documents the connection-management behavior, so read it there rather than guessing method or field names.
If PI System Explorer connects but the picker inside your application lists nothing, the two processes are not running under the same context. Identify the execution context first, whether interactive login, service account or scheduled task, and give that context its own definitions before changing anything on the server.
DNS belongs on your DNS servers, not in the picker #
There is no DNS entry in AFSDK.config and none in the picker. DNS translates the Host name into a network address and grants nothing on its own. If the server already has a name the client resolves, create no new record just because an application now uses a picker; if a new name is required, the DNS administrator creates it in the DNS infrastructure the client uses. The picker never creates records.
Verify from the workstation that will run the application: resolve the exact configured name, compare the returned address against the intended server, and confirm the server's documented service is reachable. Name resolution and reachability are separate checks, because a name can resolve while a firewall blocks the port, and a server can answer by address while the configured name fails. The same logic sits behind why the PI SDK needs a real PI Server endpoint for cloud tests: a stand-in proves the code, not the deployment, so test from the client's real position.
Worked example: one login, one workstation, two PI servers #
Inputs, with their sources:
- 1 client workstation and 1 Windows login on it, the account that launches the downloaded application; the pickers require definitions per login per workstation.
- 2 server roles, an AF asset server and a PI Data Archive, because the application reads both asset data and history, the two-server case in the scenario above.
- 2 Host entries, one per connection, each set to that server's DNS name; for example
af-server.plant.example.comfor the asset server, an example name your DNS administrator would replace.
The rule in words: every server role a picker must list needs exactly one client-side connection definition, owned by that login on that workstation, plus exactly one server-side mapping for the connecting identity.
The arithmetic: 2 server roles × (1 connection definition + 1 server-side mapping) = 4 configuration objects. If both Host names already resolve from the client, the number of new DNS records is 0. The virtual-machine test variant changes nothing in the count: a data archive on the VM still needs its PI Mapping and its connection definition under the client login.
The result: with fewer than all 4 objects in place, PISystemPicker lists no remote system for that login; with all 4 in place, the picker lists the AF system and PIServerPicker lists the data archive.
The decision, with its threshold: before writing any picker-handling code, sign in as the running account and count the objects, both definitions and both mappings, 4 in all. Fewer than 4 means the empty list is a configuration gap that no application change can fill; at 4, anything still failing is access, meaning object permissions, or the network, and the read tests in the sections above separate those two.
Hand customers a working first run #
Client connection configuration is stored in AFSDK.config on each client machine, which is what the vendor points to for setting up AF client computers without dialogs. That gives the customer-download scenario a concrete shape: prepare the definitions once on a reference machine under a representative login, deploy the resulting configuration to customer workstations with your software distribution method, and rely on each customer's server holding mappings for the accounts that connect to it. The vendor documents the file and its role; the push mechanism itself is your deployment decision.
Roll the first customer workstation out as the test: sign in as the application's login there, open the picker, and read one attribute. A pass means the deployed definitions and the customer's mappings match; a failure points at whichever layer the earlier sections assign it to.
The decision, in order #
Work top to bottom, and let each step gate the next:
- Identify the Windows account that actually runs the application: interactive login or service account.
- On each server the application uses, confirm a mapping exists for that identity: AF Mapping on the asset server, PI Mapping on the data server.
- On the client, signed in as that identity, confirm the connection exists with its Host entry set to the server's DNS name;
File > Server Propertiesin PI System Explorer shows the definitions that login owns. - Resolve that DNS name from the workstation and confirm the server's documented service is reachable; add a DNS record only if no resolvable name exists.
- Open the picker. The system appears only after the steps above; listed but refused points at mapping, permissions or network, and still empty points at a missing definition for this login.
Commit to the split: server-side identity work (mappings and permissions) and client-side context work (login, connection definitions, DNS) fail independently, and each leaves a different fingerprint, an empty list for a missing definition and a refused connection for a missing mapping. Configure both layers, prove one read under the running account, and the picker becomes the formality it was designed to be.
Questions asked
My application runs as a service. Which Windows login do I configure?
The service account, not the account at the screen. Sign in to the workstation as that service account, define the connection in PI System Explorer under it, and confirm the server holds the mapping for that identity too. Definitions made under your interactive login are invisible to the service, which is why the picker inside a service-run application can list nothing while your own sessions work.
Does the PI System Picker create the DNS entry for the remote server?
No. The picker only presents connections that already exist for the current login. The Host entry in Server Properties names the server; translating that name into an address is the job of the DNS servers the client uses. If the server already has a resolvable name, no new record is needed. If one is required, the DNS administrator creates it, and you confirm resolution from the client workstation before testing anything else.
Do I need both an AF Mapping and a PI Mapping?
One mapping per server role the application uses. A program that reads both asset data and history needs an AF Mapping on the asset server and a PI Mapping on the data archive. Map the identity that actually connects: the interactive account for a desktop run, the service account for a service. The mapping grants the association; permissions on the requested objects decide what the connection may read.
What part of the setup can I predefine for customers, and what must exist on their side?
You can predefine the client-side part: the connection definitions, stored in AFSDK.config on each machine and deployable with your software distribution method. The server-side part cannot ship with your program: each customer's asset server and data archive need mappings for the accounts that will connect there, and the DNS names must exist in the customer's infrastructure. Verify one workstation under the customer's login before treating the setup as repeatable.
What is the fastest way to prove the whole chain works?
Run one read end to end under the account the application uses: resolve the server's DNS name from the workstation, connect in PI System Explorer, read one attribute the application needs, then open the picker in the application. If PI System Explorer connects but the picker still lists nothing, the application is executing under a different identity or profile, so fix the execution context before touching server security.