How-To: Connect to AVEVA PI System
This article provides basic instructions for installing and upgrading the PI Connection Agent
What Does This Article Cover?
Intelligence Hub includes a configurable Connection that allows Intelligence Hub solutions to exchange data with the AVEVA PI System including Asset Framework and Data Archive. The PI System Connection supports reading and creating PI Assets and PI Points. The process to configure the PI System Connection is provided below. This article covers the following.
- What is PI Asset Framework?
- What is PI Data Archive?
- Installing the PI System Connection Agent
- Upgrading the PI System Connection Agent
- Configuring the PI System Connection
- Configuring a Connection Input
- Other related material
What is PI Asset Framework?
AVEVA PI Asset Framework is software that allows you to model either physical or logical industrial objects. It is typically based on an asset model of your plant that you define for your company. The model consists of elements and attributes. You can model your plant by organizing and structuring the data according to how you work with your company's process data. The PI System Connection enables Intelligence Hub solutions to leverage the configuration performed in Asset Framework.
What is PI Data Archive?
AVEVA PI Data Archive is a historian or specialized high speed time series database that stores timestamps and values for process information. The PI System Connection enables Intelligence Hub solutions to to exchange real-time and historical data with the PI Data Archive.
Installing the PI System Connection Agent:
The Intelligence Hub PI System Connection uses an agent software to communicate with AVEVA PI System. The agent is a separate application and installation in addition to the primary Intelligence Hub runtime. The agent is a .Net application and it uses the PI System AF SDK to communicate with the PI Asset Framework and Data Archive server. The following are the prerequisites for the host where the agent is installed.
- The host must have a Windows Operating System.
- The PI AF Client must be installed on the host.
- Microsoft .NET 4.8 or greater must be installed on the host.
The following are the steps to install the PI System Connection Agent.
-
Copy the contents of the HighByte-Intelligence-Hub-#.#.# OSIsoft Agent folder to a folder on the local host machine. For example, C:\Intelligence_Hub\piAgent.
-
Run the agent by running the intelligencehub-osisoft.exe or as a Windows service. When running standalone, it’s recommended to run the executable with Administrator permissions. To install as a service, run the following command. Run the Command Prompt with administrative privileges (right-click and select "Run as administrator") to ensure the installutil command has the necessary permissions to install/uninstall services. The InstallUtil is found in the .NET installation directory: %windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe.
For example,
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> installutil C:\Intelligence_Hub\piAgent\intelligencehub-osisoft.exe -
The agent opens a port to receive requests from the HighByte Intelligence Hub instance. This communication occurs using secure websockets. On the first run the agent creates a settings.json file. The file contains the port and token. The port controls the port that the agent listens the HighByte Intelligence Hub instance on. This port must be open and available to the Intelligence Hub connecting to the agent. The token is a random security token created by the agent. This token must be applied to the Intelligence Hub PI System connection settings to authenticate the Hub. Any changes to these settings require restarting the agent.
{ "port":45290, "token": "randomtoken" }
-
On the first run the agent also creates a self-signed certificate called intelligencehub.pfx.
-
The agent connects to the default PI Data Archive Server and Asset Framework Server configured by the AF Client using the PI System Explorer.
- In the Intelligence Hub PI System connection settings, enter the IP address and port for the agent, as well as the value of the token found in the settings.json file.
- Select the proper value for the PI Agent Authentication setting. In Windows mode the PI Agent authenticates with the PI Server using the Windows credentials used to run the agent (Windows Service). Credentials mode requires a PI System username and password to be entered.
- At this point connectivity can be verified by browsing the Asset Framework databases.
The installations steps are covered in the following video.
Configuring a Connection Input:
The Intelligence Hub PI System Connection supports reading and creating PI Assets and PI Points. The following is a simple configuration example of obtaining current values for an PI Asset Framework asset.
- Select the Input tab and press the Browse button. Select a database and an asset.
- Select "Current Value" for the Get option.
- View data using the Test Input button.
Upgrading the PI System Connection Agent
The following are the steps to upgrade the PI System Connection Agent if it has been installed as a Windows Service.
-
Stop the Windows Service.
-
Uninstall the Windows Service. Run the Command Prompt with administrative privileges (right-click and select "Run as administrator") to ensure the installutil command has the necessary permissions to install/uninstall services. The InstallUtil is found in the .NET installation directory: %windir%\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exe.
For example,
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> installutil /u C:\Intelligence_Hub\piAgent\intelligencehub-osisoft.exe -
Copy the new files into the directory and do not replace these existing files intelligencehub-osisoft.exe.config and settings.json.
-
Install the new Windows Service using the steps described previously.
The upgrade steps are covered in the following video.