This import is available since 2023.02. Only scalars are supported.
The AVEVA PI import connects to the AVEVA PI Web API (see https://docs.aveva.com/bundle/pi-web-api-reference/page/help.html) and supports importing the latest value, interpolated values and recorded values. If no relative view period is specified, a single value, which is the latest recorded, is imported. If start and end times are specified (i.e. a relative period is defined) and the timestep of the timeSeriesSet is non equidistant, recorded values are imported. If start and end times are specified (i.e. a relative period is defined) and the timestep of the timeSeriesSet is equidistant, interpolated values are imported.
Timestep type | Relative view period configured | Endpoint used | Result |
Non-equidistant | No | /getValue | Last observed value |
Non-equidistant | Yes | /getRecorded | All observations within the relative view period |
Equidistant | Yes | /gettinterpolated | Interpolated values within the relative view period |
Equidistant | No | /getValue | Last observed value and logs a warning message |
AVEVA PI has a concept of web id which is equivalent to the combination of a location and a parameter. Web ids have to be configured in an id mapping configuration file.
There are two implemented authentication methods for this import.
Since 2023.02, it is the initial authentication. No additional tags or properties need to be defined. Note that it works on Windows only.
<import> <general> <importType>pi_server_aveva</importType> <serverUrl>https://my_base_url</serverUrl> <relativeViewPeriod unit="day" start="-1" end="0" startOverrulable="true"/> <idMapId>webId_mapping</idMapId> </general> <timeSeriesSet> ... </timeSeriesSet> </import> |
Since 2024.01, it is possible to use a bearer token authentication. The <username> and <password> tags must be defined and a tokenUrl string property must be defined.
<import> <general> <importType>pi_server_aveva</importType> <serverUrl>https://my_base_url</serverUrl> <user>username</user> <password>password</password> <relativeViewPeriod unit="day" start="-1" end="0" startOverrulable="true"/> <idMapId>webId_mapping</idMapId> </general> <properties> <string key="tokenUrl" value="https://auth-my_base_url"></string> </properties> <timeSeriesSet> ... </timeSeriesSet> </import> |
To import values for a day for parameters H.m and Q.m at location Delft, both recorded values, and interpolated values every 2 hours use the following import configuration.
<import> <general> <importType>pi_server_aveva</importType> <serverUrl>https://my_base_url</serverUrl> <user>username</user> <password>password</password> <relativeViewPeriod unit="day" start="-1" end="0" startOverrulable="true"/> <idMapId>webId_mapping</idMapId> </general> <properties> <string key="tokenUrl" value="https://auth-my_base_url"></string> </properties> <!-- Interpolated values for H.m parameter --> <timeSeriesSet> <moduleInstanceId>my_module_Id</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.m</parameterId> <locationId>Delft</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="hour" multiplier="2"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> <!-- Recorded values for H.m parameter --> <timeSeriesSet> <moduleInstanceId>my_module_Id</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.m</parameterId> <locationId>Delft</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> <!-- Interpolated values for Q.m parameter --> <timeSeriesSet> <moduleInstanceId>my_module_Id</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.m</parameterId> <locationId>Delft</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="hour" multiplier="2"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> <!-- Recorded values for Q.m parameter --> <timeSeriesSet> <moduleInstanceId>my_module_Id</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.m</parameterId> <locationId>Delft</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> </import> |
The webId_mapping configuration is as follow. The location is set in the internalLocation attribute, the parameter in the internalParameter attribute, the webId in the externalLocation attribute. The value of externalParameter attribute is ignored.
<idMap> <map internalLocation="Delft" internalParameter="H.m" externalLocation="ZXhhbXBsZSB3ZWIgaWQgSC5tIERlbGZ0" externalParameter="does_not_matter"/> <map internalLocation="Delft" internalParameter="Q.m" externalLocation="ZXhhbXBsZSB3ZWIgaWQgUS5tIERlbGZ0" externalParameter="does_not_matter"/> </idMap> |
To import the latest value for parameters H.m and Q.m at location Delft, use the following import configuration.
<import> <general> <importType>pi_server_aveva</importType> <serverUrl>https://my_base_url</serverUrl> <idMapId>webId_mapping</idMapId> <!-- No relative view period --> </general> <timeSeriesSet> <moduleInstanceId>my_module_Id</moduleInstanceId> <valueType>scalar</valueType> <parameterId>H.m</parameterId> <locationId>Delft</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> <timeSeriesSet> <moduleInstanceId>my_module_Id</moduleInstanceId> <valueType>scalar</valueType> <parameterId>Q.m</parameterId> <locationId>Delft</locationId> <timeSeriesType>external historical</timeSeriesType> <timeStep unit="nonequidistant"/> <readWriteMode>add originals</readWriteMode> </timeSeriesSet> </import> |
The webId_mapping configuration is as follow. The location is set in the internalLocation attribute, the parameter in the internalParameter attribute, the webId in the externalLocation attribute. The value of externalParameter attribute is ignored.
<idMap> <map internalLocation="Delft" internalParameter="H.m" externalLocation="ZXhhbXBsZSB3ZWIgaWQgSC5tIERlbGZ0" externalParameter="does_not_matter"/> <map internalLocation="Delft" internalParameter="Q.m" externalLocation="ZXhhbXBsZSB3ZWIgaWQgUS5tIERlbGZ0" externalParameter="does_not_matter"/> </idMap> |