The OSIPI interface module enables support for reading data from OSIsoft PI systems as well as data from the OSIsoft Cloud Services and provides them as Live Values within Ubik.
Features
The module allows live data from the Data Archive to be read via both the PI Web API as well as from the OCS system.
Furthermore, it supports:
Prerequesites
They vary slightly by the type of interface. For the common things, you need a functioning Ubik Server setup (Studio, Database, and Web Service).
PIWebAPI
To be able to successfully set up the system, the Ubik server/development machine needs access to the OSIPI instance. This can be easily checked in the web browser by navigating to the provided URL. OSIsoft's PiWebAPI is a REST API, from which the plugin reads data.
OCS API
The Ubik server/development machine needs access to the OCS server, which usually means internet access, as it's somewhere in the cloud. The API uses OpenID Connect for authentication, and the Ubik module supports the OAuth2 Client Credentials Flow only, so make sure to have a valid TenantID
, ClientID
and ClientSecret
ready.
Configuration in Ubik
Live value servers get added to instances of the OSIPI_SERVER metaclass, whereas the data points are objects of the OSIPI_DATAPOINT metaclass.
With that difference in mind, follow this guide: Implementing Live Values.
Not all data types of OSIPI are available to be configured in Ubik. The following table shows the matches:
OSIPI Data Type | Ubik Data Type |
Digital
|
Integer (0 or 1)
|
String
|
String
|
Int16
|
Integer
|
Int32
|
Integer
|
Float16
|
Float
|
Float32
|
Float
|
Float64
|
Float
|
The same is true for the OCS API, nullables are not yet supported.
Authentication
The following authentication methods are supported.
PI Web API
The OSIPI plugin supports two types of authentication for the PIWebAPI:
In the case of Basic authentication, put the credentials in the respective fields LOGINNAME
and PASSWORD
. Be aware that domain backslashes might need to be doubled, thanks to their escaping nature, e.g.: DOMAIN\\USER
If you leave the LOGINNAME
field empty, the client tries to authenticate against the OSIPI server with WebClient.UseDefaultCredentials
. Should this be the authentication of your choice, be aware that the Ubik Studio/Enterprise Service/Web Service needs to be started as that user that has access to the PI system.
Also, make sure that USE_OCS
is not checked.
OCS API
Only one type of authentication is supported for the OCS API:
- OAuth2.0/OpenID Connect Client Credentials Flow
For that, make sure to fill up the required fields TENANT_ID
, CLIENT_ID
, CLIENT_SECRET
, API_VERSION
, OCS_NAMESPACE
and make sure that USE_OCS
is checked.
Attributes
The OSIPI Plugin delivers the correctly formatted value (if numeric) in the Live Value Attributes collection (exposed as FORMATTED
), which can be bound to directly from XAML.
The value formatting culture can be set in the OSIPI_SERVER configuration with the FORMATTING_CULTURE
field, which defaults to EN_US
. There's also an option to trim leading zeroes (TRIM_LEADING_ZEROES
, defaulting to false
).
This functionality is available in Ubik.Server 3.5.x as well, however, the fields FORMATTING_CULTURE
and TRIM_LEADING_ZEROES
are not generated automatically. This was repaired in 3.6.0.