Poll AVEVA PI for Event Frames

Innovapptive searches one AF database on a schedule for event frames that ended recently, then reads their attributes and values.

What is searched

  • One AF database on one AF asset server, which you choose. The search is scoped by that database's WebId; frames in other databases or on other asset servers are not read.
  • Every poll (default every 30 seconds) asks for frames whose end time falls in the lookback window. The default lookback is 60 seconds: the 30-second poll plus a 30-second overlap, so a frame that ends just as a poll runs is not missed. A longer window, such as 5m, can be agreed on request.
  • The search expression is End:>=*-60s End:<=*, where * is the current time on your PI server. It reads: frames in the database that ended in the last 60 seconds.
  • A frame that is still open (no end time) is not returned. If Innovapptive should receive open frames, use the webhook, or agree a different search before go-live.
  • The overlap can return one frame in two neighboring polls. Innovapptive keeps the first copy, identified by the event-frame WebId, and ignores the second.
  • No template, category or element filter is applied. Every frame in the database that matches the window is returned. If only some frames should reach Innovapptive, keep them in a dedicated AF database or agree a filter with Innovapptive.

Polling uses HTTP Basic (see Authentication). The account needs permission in the chosen database to search event frames, read their attributes, and read their attribute values.

Innovapptive sets the database, interval and lookback for the tenant during onboarding.

Find the AF database WebId (onboarding)

These standard PI Web API calls are for onboarding only. Innovapptive does not run them while polling. Send the resulting database WebId to Innovapptive.

Option A: look up the database by its path

GET https://pi.example-customer.com/piwebapi/assetdatabases?path=\\PIAF01\PlantA

URL-encoded:
GET https://pi.example-customer.com/piwebapi/assetdatabases?path=%5C%5CPIAF01%5CPlantA

Response (trimmed):

{
  "WebId": "F1RDbgZy4oKQ9kiBiZJTW7eugwvgV_Y00G",
  "Name": "PlantA",
  "Path": "\\\\PIAF01\\PlantA"
}

Option B: list asset servers, then the databases on one server

GET https://pi.example-customer.com/piwebapi/assetservers
GET https://pi.example-customer.com/piwebapi/assetservers/F1RSbgZy4oKQ9kiBiZJTW7eugwUElBRjAx/assetdatabases

The first call returns each asset server's WebId (here F1RSbgZy4oKQ9kiBiZJTW7eugwUElBRjAx for PIAF01). The second returns the databases on that server, each with its WebId (here F1RDbgZy4oKQ9kiBiZJTW7eugwvgV_Y00G for PlantA).

Request sequence on every poll

1. Search event frames. Readable form:

GET https://pi.example-customer.com/piwebapi/eventframes/search
?databaseWebId=F1RDbgZy4oKQ9kiBiZJTW7eugwvgV_Y00G
&query=End:>=*-60s End:<=*
&selectedFields=Items.WebId;Items.Name;Items.StartTime;Items.EndTime;Items.Links.Attributes;Items.Links.Value;Items.RefElementWebIds;Items.Links.Template;Items.Path

Exact URL sent (single line, URL-encoded):

https://pi.example-customer.com/piwebapi/eventframes/search?databaseWebId=F1RDbgZy4oKQ9kiBiZJTW7eugwvgV_Y00G&query=End:%3E=*-60s%20End:%3C=*&selectedFields=Items.WebId;Items.Name;Items.StartTime;Items.EndTime;Items.Links.Attributes;Items.Links.Value;Items.RefElementWebIds;Items.Links.Template;Items.Path
ParameterMeaning
databaseWebIdYour AF database. Only frames in this database are returned.
queryEnd:>=*-60s End:<=*. The 60s changes if a different lookback is agreed.
selectedFieldsLimits the response to the fields Innovapptive uses.

Example response (trimmed to one frame):

{
  "Items": [
    {
      "WebId": "F1FmbgZy4oKQ9kiBiZJTW7eugwqF1nZ4vD7xGoYvuP1UXqzgUElBRjAxXFBMQU5UQVxFVkVOVEZSQU1FU1tIUC0wMV0",
      "Name": "HP-01 High Discharge Pressure",
      "Path": "\\\\PIAF01\\PlantA\\EventFrames[HP-01]",
      "StartTime": "2026-10-06T16:14:10Z",
      "EndTime": "2026-10-06T16:15:00Z",
      "RefElementWebIds": [
        "F1EmbgZy4oKQ9kiBiZJTW7eugwPVA1y2Hm7xGoYvuP1UXqzgUElBRjAxXFBMQU5UQVxQVU1QLTAx"
      ],
      "Links": {
        "Attributes": "https://pi.example-customer.com/piwebapi/eventframes/F1FmbgZy4oKQ9kiBiZJTW7eugwqF1nZ4vD7xGoYvuP1UXqzgUElBRjAxXFBMQU5UQVxFVkVOVEZSQU1FU1tIUC0wMV0/attributes",
        "Value": "https://pi.example-customer.com/piwebapi/streamsets/F1FmbgZy4oKQ9kiBiZJTW7eugwqF1nZ4vD7xGoYvuP1UXqzgUElBRjAxXFBMQU5UQVxFVkVOVEZSQU1FU1tIUC0wMV0/value",
        "Template": "https://pi.example-customer.com/piwebapi/eventframetemplates/..."
      }
    }
  ]
}

Innovapptive follows Links.Attributes and Links.Value for the next two calls. It does not follow Links.Template.

2. Read the attributes of each frame (the Links.Attributes URL):

GET https://pi.example-customer.com/piwebapi/eventframes/F1FmbgZy4oKQ9kiBiZJTW7eugwqF1nZ4vD7xGoYvuP1UXqzgUElBRjAxXFBMQU5UQVxFVkVOVEZSQU1FU1tIUC0wMV0/attributes
{
  "Items": [
    {
      "WebId": "F1AbEbgZy4oKQ9kiBiZJTW7eugwqF1nZ4vD7xGoYvuP1UXqzgPressure",
      "Name": "DischargePressure",
      "Path": "\\\\PIAF01\\PlantA\\EventFrames[HP-01]|DischargePressure",
      "DefaultUnitsNameAbbreviation": "psi"
    }
  ]
}

3. Read the values of each frame (the Links.Value URL):

GET https://pi.example-customer.com/piwebapi/streamsets/F1FmbgZy4oKQ9kiBiZJTW7eugwqF1nZ4vD7xGoYvuP1UXqzgUElBRjAxXFBMQU5UQVxFVkVOVEZSQU1FU1tIUC0wMV0/value
{
  "Items": [
    {
      "WebId": "F1AbEbgZy4oKQ9kiBiZJTW7eugwqF1nZ4vD7xGoYvuP1UXqzgPressure",
      "Name": "DischargePressure",
      "Path": "\\\\PIAF01\\PlantA\\EventFrames[HP-01]|DischargePressure",
      "Value": {
        "Timestamp": "2026-10-06T16:15:00Z",
        "Value": 142.5,
        "UnitsAbbreviation": "psi",
        "Good": true
      }
    }
  ]
}

What Innovapptive keeps from each frame

From the event frameUse
WebIdUnique ID of the event
NameTitle
PathLocation in AF. Also used to build a tag path when a value has no path of its own.
StartTimeWhen the event started
EndTimeWhen it ended. A frame with an end time is treated as closed.
RefElementWebIdsThe first entry is matched to externalIds.id on the TaxonomyNode.
values (name, time, value, units, quality)The tag readings

A separate attributes object is not required; the reading comes from the values. If the same tag name is in both the attributes list and the values, the attributes list supplies the tag path and units, and the values still supply the reading.