On all but the OpenVMS platform, PI-API supports multiple simultaneous connections to different PI Servers through the connection utility calls (piut_xxx calls). On Microsoft Windows platforms an additional PI Login services provide a convenient layer over the PI-API piut_xxx calls that allow a user to examine current connections, modify personal default connection parameters, and provides transparent login to previously connected servers from multiple applications.
To effectively use PI Login services, connections should no longer be made through piut_connect, piut_setservernode, or piut_setdefaultservernode, though these functions continue to be supported. Instead, by using the pilg_login function, all connections will appear in the connections dialog and a user can transparently (without a login prompt) connect in different applications to servers where a login has already been performed. A call to pilg_disconnectnode will terminate all connections to a particular server for all applications connecting through pilogin services. Calling pilg_disconnect terminates all server connections of the current application only. To switch among servers where connections have already been established, use pilg_setservernode. Unlike the similarly named piut_setservernode, pilg_setservernode will not make initial connections.
A call to pilg_connectdlg displays the list of servers to which the user typically connects (stored in their pilogin.ini file) and the current connection state and access permissions. This dialog also provides the user a means to add and modify connections and connection parameters modifying the pilogin.ini file.
Specific information regarding current connections can be obtained through the functions pilg_getservername, pilg_getconnectedserver, pilg_getdefserverinfo and pilg_getnodeid. Node IDs provide a numeric alias for a server, which can be stored with points in an application instead of a full node (server) name. This saves space and provides a level of abstraction that supports moving server installations to new nodes, renaming nodes, and moving applications among nodes. The mapping of node IDs to the node names is stored in the users login.ini file and can be edited by the user to support node changes.
32-Bit Version Limitations
The 32 bit library, pilog32.dll, currently does not share information between loaded instances of the DLL. This means connections within one application are not reflected in the connection dialog of other applications using the 32-bit pilogin library. Also the transparent connection to servers to which a user has already connected only works within an application, not between applications using the 32-bit pilogin library. These same limitations apply between an application using the 16-bit version of the library and another application using the 32-bit version.