PI Web API

AVEVA PI and FactoryTalk Historian archive right in the chat

Connect AVEVA PI and FactoryTalk Historian through PI Web API to the AI agent: snapshots and point archives. The agent names out-of-range values and archive gaps.

How the agent works with PI Web API

The gateway runs as a service on a computer on the site network and reaches PI Web API at an address such as https://pi.local/piwebapi. It reads the points of one PI Data Archive, if you name the server, or of every archive behind that PI Web API, filtered by name masks. FactoryTalk Historian SE is a PI Data Archive and is read the same way. The connection is assigned to the gateway on the Gateways tab.

The gateway reads each point's archive forward from where it stopped through streamsets/recorded: 50 points a request and up to 1000 values a point a page, with a one minute overlap so an event the PI Buffer Subsystem wrote late is not lost. The read includes the snapshot, the point's newest event, so a value is not lost before the archive compresses it. After downtime the gap is read, but no further back than a week.

Every gateway request uses GET: the batch controller, channels and stream updates are not used, since they need POST or a WebSocket. The gateway uses no proxy and follows no redirects, so the account is never carried to another host. PI AF elements and attributes are not read: the agent finds a point by its name and descriptor.

Sign-in is one of two: Basic with a login and password, if it is enabled in AuthenticationMethods, or Windows, meaning Kerberos as the gateway domain service account with an HTTP/host SPN. A fallback to NTLM is refused. Blob points are not declared, a value flagged Questionable arrives as uncertain, and a digital state is read by its name.

Integration scenarios

Current point values

The agent finds PI points by name or description and shows a snapshot of values with units, time and quality.

A period trend

The agent reads a point's archive for a shift, a day or a week and names the minimum, maximum, average and range breaches.

Gaps in the archive

The agent finds points returning system states such as No Data and shows since when there is no data.

Comparing lines

The agent compares the same points of different lines or units over a period and shows where the values part.

A threshold message

In an event task the agent tells you when a point's value crosses a threshold and holds for the set time, and when it is back to normal.

Link to the site

The agent tells you when the gateway went offline and came back. The gateway reads what it missed during the break from the PI archive.

PI Web API examples

PI Web API
Frozen chats: click a question
Есть ли дыры в архиве за неделю?

4 точки отдают No Data, самая старая дыра с понедельника 02:00.

  • Три точки одного интерфейса, данных нет с 02:00 до 06:30
  • Расходомер F-12 молчит со вторника

Системные состояния PI показываю как пропуск, а не как ноль.

How to connect

Before you connect

  • PI Web API in front of PI Data Archive or FactoryTalk Historian SE
  • Access from the gateway computer to the PI Web API address
  • An account with read access to the points and their data
  • For Windows sign-in: the gateway as a domain Windows service, HTTP/host SPN
  • Server admits listed addresses only? Allow connections from 158.160.205.91 and 87.228.27.163.
  1. 1

    Open access to PI Web API

    The gateway computer needs access to the PI Web API address such as https://host/piwebapi. The gateway uses no proxy, so give the address the server answers on directly.

  2. 2

    Choose the sign-in method

    For Basic, enable it in the PI Web API AuthenticationMethods. For Windows, the gateway runs as a domain service and an HTTP/host SPN is registered for the server.

  3. 3

    Give the account read access

    The gateway account needs read access to the PI Data Archive points and their data. No write rights are needed.

  4. 4

    Trust the server certificate

    Put a self-signed PI Web API certificate on the gateway computer in pki/pi_web_api/trusted/ in the data folder, as a .pem or .crt file.

FAQ

Install the gateway on a computer on the site network and add it on the Gateways tab. In the connection enter an address such as https://pi.local/piwebapi and the login and password of an account with read access. If you need just one PI Data Archive, name it; name masks narrow the set of points.

PI Data Archive points with their \\SERVER\TAG path, units and range, their current snapshot and value archive. A bad value comes with its system state code, such as No Data, and a digital point's value is read as the state name.

No. The gateway sends PI Web API GET requests only and does not use the batch controller or other routes through which writes are reachable. The connection account needs no write rights.

The gateway has to run as a Windows service in the domain, and an HTTP/host SPN has to be registered for the PI Web API address. Use an address by the host name the domain controller knows: otherwise Kerberos issues no ticket, and the gateway refuses a fallback to NTLM.

Category
Equipment
Connection
API key

Connect PI Web API

Connecting takes a couple of minutes, and your data stays in your own systems.

Connect