PI Web Data Receiver¶
The piweb_v1
data receiver loads tag metadata called “webid” and uses that information to load data within
the PI Web API.
Example:
{ "connections": [ { "base_url": "https://piwebserver.com/piwebapi", "start_datetime": "2022-04-01T00:00:00", "username": "username", "password": "password", "data_server_name": "PI9-5000" } ], "data_receiver_name": "osipi-receiver", "poll_interval": 10, "protocol": "piweb_v1", "streams": [ { "asset": "asset", "stream_type": "stream_type", "tags": [ { "from_regex_name": "PC:.*" }, { "from_regex_name": "SM:machine_1:.*" }, { "from_webid": "F1DP0wrwSbtoKUCTP8tooVv3eAV8cBAAUEkxLTM3MDFcMC5UT0M", "to_field": "glorious_asset_data" } ] }, ] }
Configuration:
Required and optional properties that can be configured for an Pi Web receiver:
connections: How to connect to an PI Web server and retrieve tags. An PI Web connection has the following configurable settings:
base_url: Base url for your PI Web server. It is often prefixed with /piwebapi (e.g: https://piweb-server.com/piwebapi)
data_server_name: PI Web servers have specific entities called data servers.
username: Username used along with a password to access the PI Web Server
password: Password used along with a username to access the PI Web Server
start_datetime: Initial datetime for data we want to fetch. Default is earliest datetime possible.
max_request_records: Maximum number of records retrieved when loading data.
max_request_webids: Maximum number of webids allowed for a single PI Web request when loading data. If the size is exceeded due to the number of webids, this leads to more web requests. Default is 150.
timeout: Maximum number of seconds to wait for a response from a PI web server. Default is 30
tag_load_options: Tags will need to be refreshed to remain up to date with the PI Web server metadata.
max_request_records: Number of tags to retrieve in a single PI Web server call. Default is 10000
poll_interval: The number of seconds to wait between attempts to retrieve tags from the PI Web server.
timeout: Maximum number of seconds to wait for a response when loading webids. Default is 60
streams: How to associate tags with assets and streams. Each input stream has the following configurable settings:
asset: Asset identifier
stream_type: Type of data stream
tags: A list of data fields to fetch from the PI Web server. Each data field configuration can have the following properties:
from_regex_name: A regex pattern to fetch from expected field names (e.g.
SM..*
). This parameter can be reused combine with other tag parameters. (e.g: Having bothSM.sub1..*
andSM.sub2..*
results in a logical OR, so we would fetch tags from both those patterns.)
OR
from_webid: A unique identifier used to retrieve data from specific tag in the PI Web server
to_field: Name of the field to use in the Sight Machine platform (e.g.
Painting_Oven_Fan_Speed
)
poll_interval: The number of seconds to wait between attempts to fetch new data from the PI Web server.
Note
In PI Web, we retrieve the data via Streamset Recorded and currently handle pagination by adding a millisecond to the latest timestamp.
A UTC timestamp should already be included in the retrieved data and represented as field
timestamp
.