General

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 valueinterpolated 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 typeRelative view period configuredEndpoint usedResult
Non-equidistantNo/getValueLast observed value
Non-equidistantYes/getRecordedAll observations within the relative view period
EquidistantYes/gettinterpolatedInterpolated values within the relative view period
EquidistantNo/getValueLast 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.


Authentication

There are two implemented authentication methods for this import. 

Kerberos authentication

Since 2023.02, it is the initial authentication. No additional tags or properties need to be defined. Note that it works on Windows only.

Example of configuration with Kerberos authentication
<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>

Bearer token authentication

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. 


Example of configuration with bearer token authentication
<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>

Configuration examples

Interpolated and recorded values

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_interpolated_and_observed_values_with_bearer_token_authentication.xml
<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. 

webId_mapping.xml
<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>


Latest value

To import the latest value for parameters H.m and Q.m at location Delft, use the following import configuration.

Import_latest_value_with_Kerberos_authentication.xml
<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.

webId_mapping.xml
<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>


  • No labels