Practice exercise: Create an example variable end time
- Last UpdatedJan 07, 2025
- 1 minute read
- PI System
- PI Server 2018
- PI Server
This example creates a data reference with a variable end time.
-
Create an enumeration set, MyEnumSet, that contains these three values:
-30m
-1h
-2h
Note: Values must be valid relative time expressions, as described in Understand relative time.
-
Create an attribute, called TimeRangeAttribute, that references the MyEnumSet enumeration set.
You specify the enumeration set when configuring the attribute. From the Value Type list, select Enumeration Sets > MyEnumSet.
-
Create another attribute, called DataReferenceAttribute with a configured PI point data reference:
-
For the PI point, choose any point that has a numeric value.
In this example, we will use the sinusoid point on a Data Archive named PISRV1.
-
From the By Time list, select Time Range Override.
-
In the Relative Time box, type: %@TimeRangeAttribute%
-
From the By Time Range list, select Average.
-
The TimeRangeAttribute attribute lets you choose the time interval for the calculation.