AVEVA PI Server 2023 PI System Explorer User Guide-En
AVEVA PI Server 2023 PI System Explorer User Guide-En
User Guide
With Asset Framework (PI AF), you can represent assets and processes as PI AF objects and structure them to
provide value to your business.
PI System Explorer (PSE) and PI Builder are the primary tools that you use to create and manage PI AF objects.
Both tools include support for the following features:
• Event frames
With event frames, you can capture important process events and collect relevant data around
them to help analyze why they occurred. See Event frames in PI AF for more information.
• Asset analytics
Integrated into PI System Explorer, you can use asset analytics to create calculations and set up
conditional statements involving asset values. See the "Asset analytics" topic in the Analytics and
Notifications publication for more information.
• Notifications
Integrated into PI System Explorer in PI AF 2016 R2, you can use notifications to create rules by
which users can be alerted in real time to anomalous conditions in the system. See the "Introduction
to notifications" topic in the Analytics and Notifications publication for more information.
PI System Explorer
PI System Explorer provides a graphical user interface for creating, editing, and managing PI AF objects. Use PI
System Explorer to create and manage your asset framework, including PI AF databases, elements, and
templates.
Random and Ramp Soak interfaces removal
Starting with PI Server 2018 SP3, the Random and Ramp Soak interfaces are no longer installed by default with a
new PI Data Archive installation. Optionally, you can install them by using separate install kits: the PI Interface for
Ramp Soak Simulator Data and the PI Interface for Random Simulator Data. After installing these interfaces,
follow the instruction provided by the interface install kits to create default PI points and then receive simulated
data from these interfaces. For upgrades, previous versions of Random and Ramp Soak interfaces will remain and
the default PI Points will continue to retrieve simulated data.
Prior to PI Server 2018 SP3, the following default PI points are created automatically with the PI Data Archive
install kit:
• BA:ACTIVE.1
• BA:CONC.1
• BA:LEVEL.1BA:PHASE.1
• BA:PHASE.1
• BA:TEMP.1
• CDEP158
• CDM158
• CDT158
• SINUSOID
• SINUSOIDU
PI System Explorer versions
On computers with a 64-bit operating system, both a 32-bit and a 64-bit version of PI System Explorer are
available after a PI AF client installation. Beginning with PI AF 2017, the 32-bit version is labeled PI System
Explorer Legacy 32-bit, whereas the 64-bit version is labeled simply PI System Explorer.
The legacy 32-bit version is available should you need to continue to use the legacy version of Notifications (prior
to the 2016 R2 version) and its contact editor. This version of the contact editor is required to work with legacy
delivery channels. For more information on notifications, see the "Notifications" topic in the Analytics and
Notifications publication.
Support for FIPS
Beginning with PI AF 2017 R2, PI AF supports Windows environments that enforce the use of U.S. Federal
Information Processing Standards (FIPS) cryptographic algorithms. No additional configuration is required once
the local security policy System cryptography: Use FIPS compliant algorithms for encryption, hashing, and
signing has been enabled.
To be in compliance with FIPS, users who need to use passwords to link to external tables can only use PI AF
2017 R2 or later clients and servers. Furthermore, users cannot export data from a PI AF database that contains
table passwords created with a PI AF 2017 R2 or later client and import those passwords to PI AF clients on older
releases. For more information on linking to external table data references, see Data references from outside the
PI System.
Sign on with OpenID Connect (OIDC)
You can use claims-based authentication via Open ID Connect (OIDC) to sign on to PI System Explorer. OIDC uses
an Identity Management service to verify a user's identity and then grant access to AF client and Data Archive
resources via access tokens. The AVEVA Identity Manager is the provided identity service for PI Server 2023.
Once you have successfully signed on with OIDC, the same access token is used to authenticate and gain access
to other PI server resources. If a server does not use OIDC authentication, it defaults to Windows authentication.
When first opening PSE, the initially selected authentication mode is used for all default and implicit connections
made during that session. To switch the authentication mode used to connect to a specific PI Server resource,
you can use the Connect As command. See Connect to a PI AF server, Connect to Data Archive, and Connect to a
database on a different PI AF server.
If OIDC is not enabled on a resource, Windows authentication is the default authentication mode.
Prerequisite
You must have created and assigned a user account to an Identity Server role, set permissions, and created a
mapping.
Procedure
1. Open PI System Explorer.
The Authentication Mode dialog opens.
2. Select the Authentication down arrow, then select OpenID Connect Authentication.
Note: If you selected Windows authentication to log on, PI System Explorer opens.
3. Optional: Select Remember my Choice in the Authentication Mode dialog to preserve your preferred
authentication method, and bypass the dialog for future server connections.
4. Select OK.
The AVEVA Identity Manager browser window opens and then a second browser window opens and
prompts for your sign-on credentials.
5. Enter your OIDC credentials in the browser window, then click OK.
6. In the pop up message box, select Yes/Allow.
The PI System Explorer window opens.
Note: User permissions are set up via role assignments in AVEVA Identity Manager.
7. Optional: To verify the authentication mode assigned to a user, select File, then select Connections.
The Servers dialog opens and lists server connections by user and authentication method: AIM (claims-
based) or Windows.
1. Menu bar
2. Toolbar
3. Browser
4. Navigator
5. Status bar
6. Palette
7. Viewer
Videos
For information on PI System Explorer browser and navigator, watch this video:
For information on PI System Explorer palette and viewer, watch this video:
Feature suggestions
Beginning with PI AF 2017, you can make suggestions on features you would like to see added to the AVEVA™ PI
System™. You can also review suggestions that other users have already submitted and vote for those you
approve of. You can select from the following categories for your suggestion:
• Analytics and Calculations
• Asset Framework
• Data Archive
• Event Frames
• General
• Help/Documentation/Videos
• Installation
• Notifications
• PI Builder
• Security
• System Management
To provide feedback, you select Help > Give Us Feedback and click Sign in. You can type your feedback into the
Enter your idea field, select an appropriate category, and provide additional details as needed.
PI System Customer Experience Improvement Program
The Customer Experience Feedback Option on the Help menu enables you to participate in the telemetry
program that collects anonymous usage data to improve the PI System and to prioritize new features. The
collected data does not include business data or logic, but can include information such as IP addresses, host
names, and names of PI System objects.
To participate in the telemetry program, you select Yes, I would like to participate (Recommended) and click OK.
Shortcut Browser
CTRL+1
CTRL+2
CTRL+3
CTRL+4
CTRL+7
CTRL+0
Add attributes from a template a. Select the Add Attributes from Template
option.
b. Select a template from the list.
To ... Do this ...
Add attributes from an element or event frame a. Select the Add Attributes from Element/
Event Frame option.
Note: You cannot add attributes from a Transfer
Searches collection b. Choose from the following actions:
To• search for an element or event
frame, click and enter criteria to
locate attributes in the Element
Search or Event Frame Search
window.
To• select an element or event frame
from the browser tree, click and
select from the Element Browser or
EventFrame Browser window.
c. Click OK.
Add other attributes a. In the Others field, enter attribute names
separated by a semicolon, or click
and enter criteria to locate attributes in
the Attribute Search window.
b. Click Add.
Selected attributes are displayed in alphabetical order in the left-hand Attributes or Attribute Templates list. For
added convenience, you can group them by category or template by selecting one of the Group by check boxes.
You can also filter them if necessary with further search criteria.
6. From the Attributes or Attribute Templates list, select the attributes you want to display in the viewer.
a. Use standard Windows selection keystrokes (such as SHIFT+<click> and CTRL+<click>) to select
contiguous and non-contiguous attributes in the list, as described in Select multiple objects in the
viewer.
b. Click to move selected items or to move all items to the right-hand Attributes list.
7. Optional. Adjust the order that attributes will be displayed in viewer columns:
To ... Do this ...
Move an attribute up the list Select an attribute below the top row and click .
Move an attribute down the list Select an attribute above the bottom row and click
Object duplication
You can copy individual objects or multiple rows of objects and paste the information for those objects into a
spreadsheet in a tab-separated format.
The Copy option is available on context menus throughout PI AF. The Copy Path and Copy Cell options are
available where appropriate.
Note: When you drag and drop, the clipboard always contains the path information, which renders the data
compatible with other client applications, such as PI ProcessBook.
Copy
In any PI AF browser, use Copy on a context menu to place the full path of the selected object on the clipboard:
\\Kaboom\Chocolate Milk Tutorial\ChocolateMilkModel\MixFlow
In any viewer grid or list, use Copy to place the content of each displayed column in the selected row on the
clipboard. If you select multiple PI AF rows, Copy places multiple data rows separated by a new line. In attributes
lists, the copied data includes strings that correspond to the Configuration ( ), Quality ( ), Template ( ), and
Hidden ( ) column icons, in addition to other displayed columns:
Name
Value
Path
Copy Path
The Copy Path option places the full path for each selected object on the clipboard. If multiple PI AF objects are
selected, Copy Path places multiple paths separated by a new line:
\\ABACUS-CURRENT\NuGreen\NuGreen\Houston\Cracking Process\Equipment\F-321|Model
\\ABACUS-CURRENT\NuGreen\NuGreen\Houston\Cracking Process\Equipment\F-321|Motor Amps
Copy Cell
In any viewer grid or list containing multiple columns, such as attributes, referenced elements, child event
frames, and so on, the Copy Cell option places the contents of the selected cell on the clipboard.
Is the default.
Is a search.
Is a template.
Is arranged by category.
As you work, you can choose from these options to save your changes:
• Click File > Check In.
• On the toolbar, click Check In.
• In the browser, right-click an object and click Check In to save changes in the database for that object only.
The first two options allow you to save changes for all modified objects. The Check In window opens and displays
objects that have been modified. You can select them all in or select some to check in, and allow others to
remain checked out. Click Session to select objects modified only in the current session. You can still check in
objects modified in other sessions.
Undo Check Out
If you decide not to save your changes, you can use the File > Undo Check Out option. In the Undo Check Out
window, you clear any items in the list you do want to check in, and click Undo Check Out.
Undo Check Out for all users
Occasionally, you may be unable to modify a PI AF object because the element is checked out to another user.
You see the following message types that inform you that an object is locked by a user:
• In notifications, when you attempt to stop, rename, delete, or otherwise change a notification, the error
message Notification 'Notification_name' with Unique ID 'ID' is locked by user Windows_account is displayed.
• In PI AF, when you attempt to work with an object, the error message AF Object Name 'Object_name' with
UniqueID 'ID' is locked by user Windows_account is displayed.
To undo the lock, a user who has the Admin permission on the object set to Allow can select Show All Users in
the Undo Check Out window, select All and then click Undo Check Out. For more information, see PI AF access
rights.
Videos
For information on the check in/check out mechanism of a PI AF object, watch this video:
For information on how to check in modifications to PI AF objects, watch this video:
For information on how to undo check out of PI AF objects, watch this video:
Delete PI AF objects
PI AF database objects are deleted from the PI System Explorer browser. You can delete any object that is
checked in or checked out, as well as delete references between elements, event frames and elements, and
event frames. For more information on references, see Element references in the asset hierarchy.
1. To delete a PI AF database object, click the Element, Event Frame or Library button in the navigator.
2. In the browser, navigate to the object you want to delete.
3. Right-click the object, then click Delete.
4. In the Delete window, you can delete objects that have references to other objects, as well as those that do
not.
• If the object has references to other objects...
To... Do this...
Delete an object and all the references pointing to it Click Delete this object and all references to it. Check
without immediately checking in the changes. in is required to complete this action.
Delete the currently selected reference only without Click Only delete this reference to the object. Check
immediately checking in the changes. in is required to complete this action.
Delete the object permanently from your PI asset Click Permanently delete; this action is irreversible.
model.
Caution: This option results in the immediate
deletion of the object and its references from the
database.
Caution: If the object is an event frame, selecting any of the options in the Delete window results in the
immediate deletion of the event frame.
• If the object does not have references to other objects...
To... Do this...
Delete an object without immediately checking in the Click Delete this object. Check in is required to
changes. complete this action.
Delete the object permanently from your PI asset Click Permanently delete; this action is irreversible.
model.
Note: This option results in the immediate deletion of
the object from the database.
Tip: By default, PI AF automatically deletes analyses and notifications that reference a deleted element. You can
change this behavior by disabling the /EnablePropogationOfTargetDeletion parameter in the PI AF Diagnostics
utility. For more information, see Deletion of elements.
1. Click OK.
Note: If you did not permanently delete the object, remember to click the Check In button to apply and save
your changes to the database.
Keyboard shortcuts
PI System Explorer provides keyboard shortcuts for navigation and other tasks that require a mouse or other
pointing device.
Shortcut Action
CTRL+END Selects the last cell of the current page in the viewer.
ALT+HOME Selects the first page of objects in the viewer.
ALT+END Selects the last page of objects in the viewer.
CTRL+PAGE UP Selects the previous page of objects in the viewer.
CTRL+PAGE DOWN Selects the next page of objects in the viewer.
CTRL+ENTER If the viewer contains multiple pages of objects,
displays the Select Page Number window.
ALT+ENTER In the browser, displays the properties of the selected
object.
SPACE Presses the currently selected button.
or
ENTER
Left, Right, Up, and Down Arrows Navigate objects in the viewer or browser.
F2 Edits the selected object on the viewer. For complex
objects, displays the edit window for the object.
F4 Displays the choices in the selected list box. For
layered lists, displays the complete hierarchy of
or
choices.
ALT+Up Arrow
or
ALT+Down Arrow
CTRL+1 Navigates to the Elements browser.
CTRL+2 Navigates to the Event Frames browser.
CTRL+3 Navigates to the Library browser.
CTRL+4 Navigates to the Unit of Measure browser.
CTRL+5 Navigates to the MyPI browser.
CTRL+6 Navigates to the Notifications browser.
CTRL+7 Navigates to the Contacts browser.
CTRL+0 Navigates to the Analyses browser.
Change the language
You can change the language for PI System Explorer on your computer if you have a Language Pack and the
desired language resources have been installed. The language setting is per user locale, so if others want to use
PI System Explorer on the same computer under a different login, they can use different language resources if
available.
1. Run the Language Pack and select the language resources you want to install, if they are not already
available.
2. Click View > Language Settings.
3. In the Language Settings Tool window, select the target language and click OK.
4. Quit and restart PI System Explorer.
PI System Explorer appears in the specified language.
Note: The language setting is account-specific, so users who log in under a different account see the language
specified for that account.
PI time
You can use a special syntax, called PI time, to specify inputs for time stamps and time intervals. PI time uses
specific abbreviations, which you combine to create time expressions.
PI time abbreviations
When specifying PI time, you can use specific abbreviations that represent time units and reference times.
Time-unit abbreviations
* Current time
t today 00:00:00 (midnight) of the current day
y yesterday 00:00:00 (midnight) of the previous day
The first three letters sunday 00:00:00 (midnight) on the most recent Sunday
of the day of the
week. For example:
sun
The first three letters june 00:00:00 (midnight) on the current day in June of the current
of the month. For year
example:
jun
dec DD december DD 00:00:00 (midnight) on the DDth day of December in the current
year
YYYY 00:00:00 (midnight) on the current day and month in year YYYY
M-D or M/D 00:00:00 (midnight) on the Dth day of month M in the current
year
DD 00:00:00 (midnight) on the DDth day of the current month
PI time expressions
PI time expressions can include fixed times, reference-time abbreviations, and time offsets. A time offset
indicates the offset direction (either + or -) and the offset amount (a time-unit abbreviation with a value).
For example, PI time expressions can have the following structure:
Structure Example
Include at most one time offset in an expression; including multiple time offsets can lead to unpredictable
results.
Time-stamp specification
To specify inputs for time stamps, you can enter time expressions that contain:
• Fixed times
A fixed time always represents the same time, regardless of the current time.
Input Meaning
Time-interval specification
Time-interval inputs define intervals for collecting or calculating values during a time period. For example, you
might specify a 60-minute interval to compute an hourly average over a 12-hour period. To specify time-interval
inputs, enter a valid value and time unit:
• Positive values define intervals that begin at the earlier time in the period and that finish at or before the
later time in the period.
Start time 2:00:00
After a PI AF Client installation, an administrator needs to configure a PI AF server for general use. Configuration
includes the following tasks:
• Connect to a PI AF server and set up a default.
• Set up PI AF identities.
• Map Windows user accounts to one or more PI AF identities.
• Select a default Data Archive, if one was not selected during PI AF Client installation.
• Create (or import) PI AF databases.
• Specify PI System Explorer connection preferences, if PI AF collectives are defined.
• Configure access permissions for identities to the PI AF Client server and databases. For more information,
see Security configuration in PI AF.
Video
For information on how to connect to and search an AVEVA™ PI System™, watch this video:
PI AF server connections
An administrator needs to select the PI AF servers to which to connect and establish the default. Additionally, an
administrator needs to set up PI AF identities and mappings to PI AF servers.
Connect to a PI AF server
Use the Servers window to review PI AF server connections, connect to different servers as needed, and change
the authentication mode used to connect to the PI AF server.
1. From the PI System Explorer menu bar, choose File > Connections.
In the Servers window, you see a list of known servers, identified by the following icons.
A disconnected PI AF server in the Known Server Table
A connected PI AF server
Note: The icon and a warning indicates that the PI AF client is connected to an unsupported version of Data
Archive, such as version 3.4.375 or 3.4.370. The PI AF client cannot connect to a Data Archive server that is
running software earlier than version 3.4.370.
1. To connect to a PI AF server, choose from the following actions:
To ... Do this ...
Connect to a different PI AF server Select a server in the list and click Connect.
Connect to a server as a different user (for example, a. Right-click a server in the list and click
from a shared computer) Connect As.
Ifi.OIDC is not enabled, the Connect to PI
AF servers window opens. Enter a
Windows user account name and
password.
Ifii.OIDC is enabled, the Authentication
Mode dialog opens. Select the
authentication mode you want to use
for the connection: OpenID Connect
or Windows.
b. Click OK.
Connect to a server that is not displayed on the Click Add Asset Server. For more information, see
Known Servers Table Add a PI AF server to the connection list.
Set a default PI AF server Right-click a connected PI AF server in the list and
click Set as local default Asset Server.
A icon appears next to the default server.
Connect to a collective a. Right-click a collective in the list.
b. Choose one of the following actions:
To• connect to the primary server in the
collective, click Connect to Primary.
To• connect to a specific collective
member, click Connect to Collective
Member, as described in Switch to a
specific collective member.
2. Click Close.
Add a PI AF server to the connection list
If the PI AF server you want to connect to is not currently displayed on the Known Servers Table, you can add it in
the PI AF Server Properties window.
1. In PI System Explorer, click File > Connections.
2. Click Add Asset Server.
3. In the PI AF Server Properties window, enter the PI AF server properties.
4. The Name field does not have to match the host name. After you connect to a PI AF server, you can change
the server name by clicking Rename and entering a new name.
Caution: Renaming the PI AF server impacts all clients.
5. The Account field is typically not needed in normal installations and should be left blank.
By default, PI AF clients such as PI System Explorer attempt to use a Service Principle Name (SPN) registered
by the PI AF server to establish a secure connection to the server. If an SPN cannot be created by the PI AF
server, a secure connection can be established via Microsoft NTLM if the server is running under a system
account, such as Network Service. In each case, the Account field is not needed and should be left blank.
If the PI AF server is run under a domain account, however, and an SPN is not successfully created by either
the PI AF server or an administrator, the domain account of the server must be specified so that the PI AF
client can securely identify the server.
6. The default Timeout value of 300 seconds is acceptable in most cases. If you experience timeout errors as
you work in PI System Explorer, increase the time in the Timeout box.
7. Optional. Aliases are alternate names for the PI AF server which users can use to look for the server. When
configured, PI AF server aliases are stored locally on the client only.
8. Optional. The Configure Active Directory link is for setting up the notifications contacts list. This is a PI AF
system administrator function.
9. Click Connect.
Note: If an error message opens saying that you cannot connect to the PI AF server, you need to enter the
domain account of the server in the Account field.
10. After a server if connected, you can click Security and set up security for the server. For more information,
see the PI System Explorer topic Security hierarchy.
11. Click OK.
PI AF server properties
You manage the configuration of the currently connected PI AF server in the PI AF Server Properties window.
The following tabs are available:
• General. For more information, see View properties of the connected PI AF server.
• Plug-Ins. For more information, see View installed plug-ins.
• Libraries. For more information, see Review properties of loaded libraries.
• Identities. For more information, see Manage identities in PI AF.
• Mappings. For more information, see Manage mappings in PI AF.
• Counts. For more information, see View PI AF server object counts.
• RPC Metrics. For more information, see View RPC metrics.
• Connections. For more information, see View PI AF server connections.
Change the default data server a. Click the arrow next to the Default Data
Server field.
b. Select the data server to be invoked when
you are using the %Server% substitution
parameter for templated attributes that
are tied to the PI point or PI point array
data references.
c. Click OK.
Note: To use the client's local default data server,
select <Inherit local default Data Server>.
To … Do this …
Manage identities in PI AF
Use the Identities tab to review identities that are currently assigned to the PI AF server. You can also add,
remove, and edit identities.
Note: Using permissions, you can restrict the identities and mappings visible on the Identities tab except for
three built-in identities: Administrators, Owner, and World. Those identities are always visible. You can also use
permissions to make identities editable or read only. For more information on granting permissions to PI AF
identities, see the PI System Explorer topic Security configuration in PI AF.
Manage mappings in PI AF
Use the Mappings tab to review mappings that are currently set up on the PI AF server. You can also add,
remove, and edit mappings.
1. On the PI System Explorer toolbar, click .
2. In the PI AF Server Properties window, click the Mappings tab.
3. Review the alphabetized list of mappings. If necessary, scroll rightward to see mapped identities and
Windows accounts.
4. You can choose from the following actions:
To ... Do this ...
RPC Name The name of the client process executed by the server
Calls The number of total calls for the individual RPC since
the server was last started
Total Duration The total length of all the calls to the server from a
particular client
Per Call The average length of each call
Calls (Delta) A count of the number of calls since the list was last
displayed or refreshed
Duration (Delta) The total length of the calls to each RPC since the list
was last displayed or refreshed
Per Call (Delta) The average length of the calls to each RPC that
occurred since the list was last displayed or refreshed
Calls (Client) The number of calls to each RPC that was made by
the client retrieving the RPC metrics
Duration (Client) The length of the RPC call made by the client
retrieving the RPC metrics
Per Call (Client) The average length of the calls to each RPC that was
made by the client retrieving the RPC metrics
Retries The number of times the client process has been
attempted
Note: Use the Refresh button to update the RPC Metrics page with the latest RPC call data.
View PI AF server connections
You can view, sort, and copy details about PI AF server connections on the Connections page.
Note: Only users with administrator privileges can view information on the Connections page.
• 1. Current AF database
• 2. PI AF server
• 3. Local client machine
1. PI AF checks to see if the current PI AF database's default Data Archive is specified. If specified, PI AF looks
there for stored templated attributes that are tied to PI point or PI point array data references. See View or
edit properties of PI AF databases for more information.
2. If one is not specified for the current database, it resolves to the PI AF server's default Data Archive setting.
See View properties of the connected PI AF server for more information.
3. If none is specified at the PI system level, it resolves to the local default Data Archive.
You can view the default data server for the database and PI AF server using the following methods:
• Use the Database Properties window to view and set the default PI AF server for the database.
• Use the PI AF Servers Properties window to view and set the default Data Archive server for the system.
Note: If the default Data Archive is not specified on the PI AF server or PI AF database, it can resolve to a
different Data Archive for different client machines depending on their configuration.
A connected PI AF server
Note: A warning icon ( ) beside a server indicates that Data Archive is running an unsupported version, such as
version 3.4.375 or 3.4.370. The PI AF client cannot connect to a Data Archive server that is running software
earlier than version 3.4.370.
1. To connect to a Data Archive, choose from the following actions:
To ... Do this ...
Connect to a different Data Archive Select a server in the list and click Connect.
Connect to a server as a different user (for example, a. Right-click a server in the list and click
from a shared computer) or change the Connect As.
authentication mode used to access the server
Ifi.OIDC is not enabled, the Connect to PI
Data Archive server window opens.
Enter a Windows user account name
and password.
Ifii.OIDC is enabled, the Authentication
Mode dialog opens. Select the
authentication mode you want to use
for the connection: OpenID Connect
or Windows.
b. Click OK.
Connect to a server that is not displayed on the Click Add Data Server. For more information, see Add
Known Servers Table PI Data Archive servers to connected server lists.
Set a local default Data Archive Right-click a server in the list and click Set as local
default Data Server. An icon appears next to the
local default data server.
2. Click Close.
Insufficient privilege to access Data Archive. Default User connections are enabled in PI SDK.
No Access - Secure Object
Default User connections to Data Archive are
currently enabled from this client but are not
supported from PI AF.
Insufficient privilege to access Data Archive. No Default User connections are the only authentication
supported authentication methods are enabled. method enabled in PI SDK.
No Access - Secure Object
Default User connections to Data Archive are
currently enabled from this client but are not
supported from PI AF.
Insufficient privilege to access Data Archive. Explicit logins setting was not set in registry.
No Access - Secure Object
The explicit login prompt is not configured on this
computer and therefore not allowed.
Review differences between a digital state set and its See Review differences between digital state sets and
equivalent enumeration set in the current database enumerations sets.
Export digital state sets on a Data Archive to the See Create enumeration sets from digital state sets.
current database
Refresh the list of digital state sets Right-click the grid and click Refresh.
6. To close the PI Data Archive Properties window, click OK.
Create one or more enumeration sets from digital a. Use standard Windows selection
state sets on the selected Data Archive keystrokes (such as SHIFT+<click> and
CTRL+<click>) to select contiguous and
non-contiguous digital state sets in the
list, where the Enumeration Set cell is
empty and the Conflicts column
displays EnumerationSet 'EnumName'
not found.
b. Right-click and select Create Enumeration
Set from State Set.
c. In the Create EnumerationSets window,
click Yes.
Create enumeration sets from all digital state sets a. Right-click and select Select All.
on the selected Data Archive
b. Right-click and select Create Enumeration
Set from State Set.
c. In the Create EnumerationSets window,
click Yes.
Enumeration sets that already exist are
ignored, but those that do not exist are
created.
4. Click OK.
5. To exit the Servers window, click Close.
6. Check in your changes.
PI AF database connections
PI AF stores the asset framework objects (elements, templates, and so on) in PI AF databases. You can have
multiple databases in PI AF, although you can connect to only one at a time. You typically work with PI AF
databases in PI System Explorer or in PI Builder. When you start PI System Explorer for the first time, it connects
to the default PI AF database. If no databases are defined, PI System Explorer prompts you to create a new
database.
Note: The Configuration database is used by PI AF clients, such as PI Web API, as they interact with PI AF. Do not
use this database for your own application data.
Videos
For information on how to create PI AF databases, watch this video:
For information on how to work with multiple PI AF databases, watch this video:
For information on the configuration database, watch this video:
Create PI AF databases
You can create an empty PI AF database with no pre-configured content, or you can load a library that has been
saved on a connected PI AF server.
1. Choose one of the following actions:
▪ Press Ctrl+O.
▪ On the PI System Explorer toolbar, click .
▪ Click File > Database.
2. From the Asset server drop-down list in the Select Database window, select a connected server on which you
have administrator access rights to create a database. Alternatively, click and select a server from the PI
AF Servers window.
3. Click New Database.
4. In the Database Properties window, enter a unique name in the Name field.
5. Optional. Enter a description in the Description field.
6. Choose from the following actions:
To ... Do this ...
Create a new database with no configured content Leave the Load Library field (if displayed) set to
<None>.
Create a database with configured objects from a Select a library from the Load Library drop-down list.
saved library For more information, see PI AF saved libraries.
Create extended properties See Storage of application-specific information.
Set up access permissions for the new database See Configure security for a single PI AF database.
7. Click OK.
The new database is added to the Database list in the Select Database window.
Review the number of objects in the database Click the Counts tab.
Review or modify the database name and description On the General tab, make changes as needed in the
Name and Description fields.
Review or modify extended properties a. On the General tab, click Extended
Properties.
b. In the Extended Properties window, make
changes as needed in the Name and
Value fields. To create a new property,
click New Extended Property. For more
information, see Create extended
properties.
Review or modify database security a. On the General tab, click Security.
b. In the Security Configuration window, make
changes as needed. For more
information, see Configure security for a
single PI AF database.
Review the properties of the connected server a. On the General tab, click .
b. In the PI AF Server Properties window, review
properties on the General tab, as
described in View properties of the
connected PI AF server.
Change the default data server a. Click the arrow next to the Default Data
Server field.
b. Select the data server to be invoked when
you are using the %Server% substitution
parameter for templated attributes that
are tied to the PI point or PI point array
data references.
c. Click OK.
Note: To use the PI AF Server's default data
server, select <Inherit from PI AF
Server>.
To ... Do this ...
Select the server where the database is located Double-click on a connected ( ) server. The PI AF
Servers window closes and the selected server is
displayed in the Asset server field.
Check the properties of a server Select a server and click Properties.
Connect to a server Right-click a server that is not connected ( ) and
click Connect.
Connect to a server as a different user (for example, a. Right-click a server that is not connected and
from a shared computer) or change the click Connect As.
authentication mode used to access the server
Ifi.OIDC is not enabled, the Connect to PI
AF servers window opens. Enter a
Windows user account name and
password.
Ifii.OIDC is enabled, the Authentication
Mode dialog opens. Select the
authentication mode you want to use
for the connection: OpenID Connect
or Windows.
b. Click OK.
To ... Do this ...
Review access permissions for a connected server a. Right-click a connected server and click
Security.
b. In the Security Configuration window, check
the settings for the listed identities, as
needed.
Note: If you have administrative privileges on the
server, you can also modify the security configuration.
See Configure security for new PI AF databases.
On the other hand, if you have multiple plants in different locations, that same maintenance engineer might
want to see all the equipment located at his own plant. The following illustration shows the same elements
organized by plant.
Asset model organized by location
You are not restricted to only one organizational strategy. You can use an element reference to include the same
asset in more than one place in the tree. For example, you could choose to organize by equipment type and by
plant as well. In the following illustration, the hierarchy includes the geographical tree and the equipment tree
side by side.
Mixed asset model
You could alternatively nest the equipment organization under the geographical organization.
Note: Limit the depth of your asset hierarchies to 10 levels or less to maintain the performance and
interpretability of your asset data.
Rename databases
You can change the name of a PI AF database as needed.
1. On the PI System Explorer toolbar, click .
2. In the Select Database window, right-click a database and click Rename.
3. Enter a valid name for the database. For rules on object names, see Valid characters in PI AF object names.
4. Click OK.
The Search icon changes to the Searching icon . Results filter corresponding to how many letters you
type.
3. Select a database in the list and click OK.
The window closes, and you will be working in the selected database.
4. To return to the full list of available databases, press ESC.
The window closes.
Database deletion
When you delete a database, all information contained within that database is removed. Before you delete a
database, therefore, ensure that you have selected the database that you want to delete.
Caution: You cannot undo a deletion. However, you can recover data by restoring your last SQL Server backup.
Connection preference Use this preference to influence the selection of a collective member
when a connection is made to a PI AF collective.
• Prefer Primary
PI System Explorer attempts to connect with the primary server
in the collective, and if it is not available, uses the individual
priority settings of the collective member to influence
selection of the server connection. This is the default
setting.
• Require Primary
PI System Explorer is required to connect with the primary
server in the collective. If the primary server is not
available, the connection fails.
• Any
PI System Explorer can connect with any available member of
the collective, and uses the individual priority settings of
the collective member to influence selection of the server
connection.
Server name resolution behavior Use this preference to inform PI System Explorer what action to
perform when it attempts to communicate with one or more PI AF
servers that are not in the Known Servers Table.
• Auto Add
Adds a server to the Known Servers Table automatically if the
computer name is valid and PI System Explorer can find the
server's computer name on the network.
• Auto Add If Resolvable
Adds a server to the Known Servers Table only when the server
name is successfully resolved by a DNS server.
• Do Not Auto Add
Makes no attempt to find a server if it cannot be found in the
existing collective.
Allow login prompt Select this option if you want a login prompt to appear when a
connection to the server fails because of a security exception.
3. In the PI Data Archive Connection Settings in PI System Explorer section, define how PI System Explorer
should connect to Data Archive:
Setting Description
You can export a database from PI System Explorer in XML and then restore it from that XML file by importing it
back to PI AF.
To export the database without having to manage XML files, you export the database as a library, as described in
Save databases as libraries.
Videos
For information on how to import and export databases with PI System Explorer, watch this video:
For information on how to import and export databases with import and export utilities, watch this video:
Include All Referenced Objects Causes dependent references to be exported, as detailed in the All
Referenced Objects table. Use this option to facilitate moving objects
between different PI AF databases.
Include Security Settings Causes the security settings of individual objects to be exported. This
option increases the amount of time required for the export and
subsequent import operations. You must have Administrative privileges
to import objects that have the security setting specified.
Export option Result
Flatten XML Exports hierarchical objects in a flat format. Exporting in a flat style can
make editing in some tools simpler. Hierarchical objects that will be
exported flat are attributes, attribute templates, elements, and event
frames.
Simplify Configuration Strings Removes Data Archive and tag identifiers from configuration strings for
PI point data references. Additionally, substitution parameters will be
resolved.
Note: This option slows the export process because it requires
evaluation of the saved configuration strings.
Include Default Values Includes the default values assigned to objects. Without this option, a
property that has not been changed from its default setting is not
included in the output. This saves considerable space and time when
you are exporting large amounts of data.
Include Unique IDs Includes the unique ID of each object in the export. By including this
option, you can rename existing items during an import to the same
database. Unless rename is required, it is more efficient to leave this
option turned off.
Library Objects Only Limits the database export to include only library objects (templates,
enumeration sets, reference types, tables, table connections,
categories, and UOM databases).
Include Event Frames, Transfers, Exports event frames, transfers, and cases.
and Cases
AFAnalysisTemplate in Template
AFElementTemplate in CaseTemplate
AFElement in Target
AFElementTemplate in CaseTemplate
AFElement in Target
AFContacts referenced
AFNotificationContactTemplates referenced
AFElementCategories referenced
AFElementCategories referenced
AFElementCategories referenced
AFElementTemplate in Template
AFElementTemplate in CaseTemplate
AFElement in Target
AFAnalysisTemplate
AFNotificationContacts
AFAnalysis
Child AFNoticationContacts
AFContact referenced
AFNotificationRule AFNotificationRuleTemplate
Child AFNoticationContacts
AFContact
AFDeliveryFormat
AFNotificationRuleSubscriber AFNotificationContactTemplate
Child AFNoticationContacts
AFContact
Child AFNoticationContacts
AFContact
AFDeliveryFormat
AFTableCategories referenced
AFElementCategories referenced
UOMClass
UOM
Preserve Unique IDs Retains any unique IDs that exist in the source XML.
This option is only valid when the Allow Create and
Automatic Check In options are also selected. The
performance of the import operation is negatively
affected when this option is selected. There is no
guarantee that PI AF will preserve unique IDs of
attributes derived from templates because unique IDs
of such attributes are generated based on the
template's unique ID.
Note: Because PI AF servers maintain a cache of
rowids to ids, the import with Preserve Unique IDs
option affects load-balanced PI AF servers differently
from non-load balanced PI AF servers. In a non-load
balanced scenario, removed items will cause the
cache of rowids to ids to be updated. However, in a
load-balanced scenario, the non-connected server
will need to be restarted to have the cache updated
after items are removed, and before the import with
Preserve Unique IDs option is used to restore items
to the same system.
Disable New Analyses and Notifications When enabled (the default), any new analyses or
notifications that are created by the import are
disabled by the import, regardless of the value of the
Enabled property on the analysis or notification. The
Status settings in the XML for existing analyses and
notifications are ignored and they are not modified
when the option is selected.
Export of library objects to another database
You can export library objects (templates, formulas, UOM, and so on) from one database into another.
PI AF saved libraries
A PI AF saved library provides a collection of application- or domain-specific objects that you can import into a PI
AF database. Saved libraries typically include categories, element templates, enumeration sets, reference types,
tables, as well as the unit-of-measure database, which is always included. You also have the option to include
other objects, such as elements and notifications.
Note: Libraries are stored as XML files in the PI AF SQL Server database (PIFD), where they are easily accessible
to other users. By contrast, the Export to File option enables you to export an entire database of objects as an
XML file to your computer or network. The exported file can be imported to a different server altogether.
AFExport utility
The AFExport utility is a command line application that you can use to archive PI AF databases into an XML
format that you can restore later. Use this utility to archive elements, templates, event frames, transfers, and
other objects from a PI AF database. You can also export collections of PI AF objects from the PI System Explorer.
See Export a database to XML.
The AFExport.exe utility is located in the \PIPC\AF folder.
To run the PI AF Export utility you open a command window and navigate to the PIPC\AF folder. Use the
following syntax: AFExport.exe and choose from the parameters listed in AFExport utility parameters. To display
all parameters, type: AFExport /?
AFImport utility
The AFImport utility is a command line application that you can use to restore PI AF objects into a database. You
can also use Import from File in PI System Explorer to restore database objects. See Restore databases from
exported XML files.
The AFImport.exe utility is located in the \PIPC\AF folder.
To run the AFImport utility, you open a command window and navigate to the PIPC\AF folder. Use the following
syntax: AFImport.exe and choose from the parameters listed in AFImport utility parameters. To display all
parameters, type:
AFImport /?
Syntax Example #1
To import database objects from an XML file into a PI AF database and create or update PI point configuration for
newly created elements, enter:
AFImport "\\AFServer\database" /File:"C:\Filename.xml" /P
Note: Using the /P (/CreateUpdatePIPoints) parameter may significantly impact import performance.
Syntax Example #2
To import database objects from an XML file into a PI AF database and disable the validation of configuration
string settings for data references and delivery channels, enter:
AFImport "\\AFServer\database" /File:"C:\Filename.xml" /D
Note: Use the /D (/DisableConfigStringValidation) parameter to improve the speed of an import operation. Keep
in mind that using this parameter bypasses looking up PI points, which corrects or adds server IDs and point IDs
to configuration strings.
Syntax Example #3
To import database objects from an XML file into a sub-element under a PI AF database, enter:
AFImport "\\AFServer\database\element" /File:"C:\Filename.xml"
PI System Explorer provides a variety of methods that you can use to locate and review the assets in your PI AF
database, including a browser, search windows, trends to verify formulas and calculations, and version
management. You can also review time series data for attributes that contain or reference such data.
Asset browsing
You use the PI System Explorer browser to display asset objects in the PI AF database. The browser displays the
following assets, depending on the asset type that you have selected in the navigator pane:
• Elements
Displays element assets and element searches in a tree format. You can control how many elements are
displayed per page.
• Event Frames
Displays event frame and transfer search collections. Because asset models can comprise thousands of event
frames or transfers, these objects are not displayed in a hierarchy in the browser. Instead, each has a search
collection in the browser. Recent searches are also listed under the search collection.
• Library
Displays object collections for Templates (for elements, event frames, models, and transfers), Enumeration
Sets, Reference Types, Tables, Table Connections, and Categories (for analyses, attributes, elements,
notification rules, reference types, and tables). To see all the objects of a particular type, you expand the
collection for that type.
• Unit of Measure
Displays all UOM classes in the Unit of Measure database. When you select a class, UOMs belonging to that
class are listed in both the viewer and the conversion calculator.
• Contacts
Displays a list of contact searches, escalation teams, groups, and stand-alone delivery endpoints for use with
notifications.
Element browsing
Elements are displayed as a tree in the browser. The structure of the element tree is different for each
organization. The asset model designer chooses structure that is relevant to the users in the organization. In the
following illustration elements are organized by plant location. If you were in charge of all the equipment for a
particular plant, then such a model might make sense for you. A different model might be more useful for
someone with a different role.
The element tree can include different sub trees that provide different context for the same assets. This allows
users to find elements in the context that makes the most sense for the task at hand. For example, in addition to
the organization by plant location shown above, you might also have an organization by equipment
manufacturer, as shown in the following illustration.
The elements representing the pumps appear in both the Manufacturers and the Plant Location hierarchies. In
the Manufacturer hierarchy, the pump elements are not new separate elements, rather they are references to
the elements that already existed in the Plant Location tree. To indicate that they are element references, they
are represented by the referenced element icon .
Quick search
You can use the quick search box at the right end of the PI System Explorer toolbar to find elements, event
frames, element templates, or UOM (unit of measure) types.
1. Make a selection in the navigator pane to set the context for quick search.
For example, select Event Frames to set quick search to search for event frames.
2. In the quick search box, select a search constraint from Actions , enter search criteria, and press Enter.
Search results are displayed in the viewer, as well as in the browser.
Note: Search results that are displayed in the browser remain there for easy access in the event you need them
again. You can right-click and delete them from the browser; they are also removed when you exit PI System
Explorer. You can right-click and save them to keep them until you delete them.
Type a query directly in the search text box a. Type the first character of the query.
b. Select from the list of matching point
attributes and values, or continue typing
a point attribute or value manually.
c. Enter the criteria to be matched.
Include common PI point attributes in a query a. Click .
b. Enter criteria in any of the following fields:
Name
• (alias for tag attribute)
Point
• Source
Data
• Type (alias for pointtype attribute)
Point
• Class (alias for ptclassname
attribute)
c. To enter criteria for engineering units and
description, click Add Criteria or press
ALT+C. Then click Engineering Units
and/or Description.
Criteria are appended to the string in the
search text box, separated by a space.
Note: The search query returns only PI points that
match all criteria.
To ... Do this ...
Review time series data Right-click a PI point and click Time Series Data. For
more information, see View time series data.
To ... Do this ...
Review current PI point values, time stamps, and Right-click a PI point and click Properties.
attributes
Create a PI point data reference For search results displayed in the palette only.
Drag a PI point onto the Attributes grid. For more
information, see Create direct PI point data
references from Tag Search results.
Change the columns in the results table Click and clear the columns that you want to
remove.
Add attribute columns to the results table a. Right-click a column heading and click Add
Column.
b. In the Select Point Attributes window, select
the point attributes to be added.
c. Click OK.
Restore original columns in the results table Right-click a column heading and click Restore
Original Columns.
7. Click OK.
The results are displayed in the viewer. Each search is temporarily listed in the browser with a Tag Search
Results label. To differentiate between searches, you can change a label by right-clicking and clicking
Rename.
Name Tag
DataType PointType
Description Descriptor
PointClass PtClassName
Starting in PI AF 2017, you can query based on values, in addition to querying PI points based on attribute.
However, you cannot use the OR condition to query a PI point value. For example, you would generate an error if
you were to enter the following queries:
• IsGood:false OR Annotated:true
• PointType:Float AND Value:>10 because PointType:Float is implicitly translated to
'PointType:=Float16 OR PointType:=Float32 OR PointType:=Float64'
• PointType:Int AND Value:>10 because PointType:Int is implicitly translated to 'PointType:=Int16
OR PointType:=Int32'
• sin* AND Value:>10 because sin* is implicitly translated to 'tag:=sin* OR Descriptor:=sin*' if the
default filter setting for Include Description in Search is selected. To be valid, you would need to clear the
Include Description in Search filter.
Wildcard characters
You can use the following special characters in a PI point query.
In PI point value queries with a String data type, you cannot use the following operators: <, <=, >, or >=.
Furthermore, when boolean values are expected (as with Substituted, Questionable, Annotated, and IsGood
point value queries), you can only use the = and <> operators.
Syntax restrictions
• You cannot query future point attributes, such as creationdate:>y-1d AND future:true, on Data Archive
servers older than 3.4.395.
• You cannot query security point attributes, such as PtSecurity and DataSecurity, on Data Archive servers
older than 3.4.380.
Save a search result Right-click an unsaved search result name and click
Save.
Rename a search result a. Right-click a search result name and click
Rename.
b. Type a new search result name.
Copy a search result Right-click the search result name and click Copy.
Edit criteria for a search result a. Right-click a search result name and click
Properties. (In the viewer, you can also
double-click a search result name.)
b. Modify search criteria as needed and click
OK.
To ... Do this ...
4. From the Actions list, select the type of filter to apply: Contains, Exact Match, Starts With, or Ends With.
5. Choose from the following actions:
To ... Do this ...
Type one or more filter conditions directly into the Enter element criteria field • Use the : or := operator t
• Use special characters as
• Enclose strings that cont
To ... Do this ...
• Separate filter condition
Category:"Processing
Beginning with PI AF 2018 SP2, y
• "Name:’ElementName’
• "Description:’TestDe
Filter elements under Criteria Enter values in the following field
• Name
Enter the name of the element to retrieve, based on the filter type. You can enter special characters to
match part of a name. See Special characters in name searches.
• Element Search Root
Enter the element that you want to use as the root or base level for the element search. Type the exact
name or click to open the Element Browser window, where you can view the element hierarchy
and select an element. You cannot include wildcard characters in the entered name. If you do not
specify an element, you set the main level of the element hierarchy as the root.
Depending on your PI AF hierarchy, specifying an element in the Element Search Root field can improve
search performance.
• All Descendants
Select True to retrieve any sub-element in the hierarchy that matches the specified criteria. Select False
to retrieve only root-level elements that match the specified criteria.
• Template
Select the template that retrieved elements must be based on. After you select a template, you can add
criteria to find elements by attribute value.
• Category
Select the category that retrieved elements must match.
• Attribute Value
You can specify up to three conditions for an attribute value. For each condition, specify an attribute
name, operator, and attribute value, such as Temperature >= 98.
In•versions prior to PI AF 2018, only available when you specify a template. For more details, see
Configure search conditions for attribute values when a template is specified.
In•PI AF 2018 and later versions, you can specify attribute values without needing to specify a
template. For more details, see Configure search conditions for attribute values when no
template is specified.
• Description
Enter a string (of up to 440 characters) that retrieved elements must match.
• Element Type
Select the type that retrieved elements must match.
• Is Annotated
(PI AF 2017 or later versions.) Set to True to retrieve only elements that have annotations. Set to False
to retrieve only elements that do not have annotations.
• Creation Date
(PI AF 2017 or later versions.) Select an operator and enter a date or a PI time abbreviation ( >= *-30d
is the default) to retrieve elements that were created in the specified period. You can also click to
select a date in the Date and Time Picker window. You can select Creation Date a second time and
filter the search for results between two values (< *+1d is the default).
• Modify Date
(PI AF 2017 or later versions.) Select an operator and enter a date or a PI time abbreviation ( >= *-30d
is the default) to retrieve elements that were modified in the specified period. You can also click
to select a date in the Date and Time Picker window. You can select Modify Date a second time and
filter the search for results between two values (< *+1d is the default).
Note: An element's modify date is updated whenever an annotation or child element is added, as well
as when a change to its configuration is checked into the database.
Most template changes, or any modification to an attribute value that is not a configuration item, will
not affect an element's modify date.
• Results per Page
Enter the maximum number of elements to show on a single page of the search results.
6. Optional. Specify how you want results to be displayed in the Results table.
To ... Do this ...
Change column selections a. Right-click the column heading in the Results table or the white space b
b. Click Column Visibility.
c. Select or clear column selections as needed.
Display attributes as columns a. Click and click Select Attributes.
b. In the Select Attributes window, use standard Windows keystrokes to hi
c. Click .
d. Click OK.
Display full paths of elements a. Right-click the column heading in the Results table or the white space b
b. Click Show Full Paths.
To ... Do this ...
Conceal full paths of elements a. Right-click the column heading in the Results table or the white space b
b. Click Hide Full Paths.
7. Select any of the results you want to use and click OK.
The results are displayed in the viewer and in the browser tree. For more information on working with
search results, see Manage search results.
8. Select any of the results you want to use and click OK.
The results are displayed in the viewer and in the browser tree. For more information on working with
search results, see Manage search results.
1. Click (Display attribute choices) and select an attribute from the list of possible attribute categories:
Option Description
To complete the search query, you would append the name of the Health Status enumeration set to the
string already displayed in the Enter element criteria field:
as 'Health Status'
The completed search query in the Enter element criteria field would look as follows:
Note: Keep in mind the following guidelines when appending to search queries:
• Append As String or As Numeric whenever the value type of an attribute does not match what the
query search value appears to be.
• For example, if the value type of an attribute were String and the search value were 55 (which looks like
a numeric), you would need to append As String to the query.
• Use uppercase and lowercase combinations when you append to search queries: As String, as
string, and as STRING are all equivalents.
• Use either ' or " to enclose enumeration sets and strings that contain space characters.
Type one or more filter conditions directly into the Enter Event Frame Criteria field
Group by template
Group by category
Change column selections
7. Click Search to retrieve the matching event frames into the Results table.
8. Click OK.
The results are displayed in the viewer and in the browser tree. For more information on working with
search results, see Manage search results.
Enter or click to open the Element Browser window, where you can view the element hierarchy and
select the source element for transfers you want to include in the search. Click the Any button to reset to
the default <Any>.
• Destination
Enter or click to open the Element Browser window, where you can view the element hierarchy and
select the destination element for transfers you want to include in the search. Click the Any button to
reset to the default <Any>.
• Template
Select the template of the transfers you want to search for.
• Maximum results
Enter the maximum number of matching transfers to retrieve.
If you specify values for multiple settings, the search returns only those transfers that match all the
specified settings.
4. Click Search to retrieve the matching transfers into the Search results table.
You can limit the results further to list only those transfers that match the text entered into the Search
results field.
5. Click OK.
The results are displayed in the viewer and in the browser tree. For more information on working with
search results, see Manage search results.
Create trends
OSIsoft recommends you use visualization tools, such as AVEVA PI Vision, PI ProcessBook, and PI WebParts, to
create and save trends that you plan to use more than once.
To verify formulas, calculations, and other measurements in PI AF, create a trend.
1. From the PI System Explorer menu, select View > Show Trend.
2. In the Trend window, choose from the following actions.
To ... Do this ...
3. In the Create Version window, enter an Effective Date for the version or click to select a date.
PI System Explorer creates a new version.
4. Optional. In the Comment field, enter information on the new version.
5. Click OK.
To indicate that more than one version exists, the icon in the browser changes to for an element or for
a model.
3. In the Create Version window, enter an Effective Date for the version or click to select a date.
PI System Explorer creates a new version.
4. Optional. In the Comment field, enter information on the new version.
5. Click OK.
To indicate that more than one version of the table exists, the icon in the browser changes to .
All PI System Explorer objects PI System Explorer uses the latest PI System Explorer uses versions of
versions, even if those versions are objects that are in effect at that
in the future; it excludes any object time.
with an obsolete date, even if that
date is in the future.
Element, model, and table versions PI System Explorer returns the PI System Explorer returns the
in search latest versions, even if those versions that are in effect at that
versions are in the future. time.
Relative times in searches PI System Explorer defines the PI System Explorer defines the
current time (*) as the time of the current time (*) as the time
search. specified by the Query Date.
PI data PI data is returned at its latest PI data returned is the value for the
snapshot value. timestamp specified by the Query
Date.
Query Date Time Displays the current setting for Query Date (defaults
to Latest Available). You can specify a different
date time setting for Query Date, to enable PI System
Explorer to evaluate which versions of objects to
retrieve from the PI AF database.
Alternative Time Displays the time context for data retrieval after
applying the current Query Date setting. The default
is the current time (*), but you can enter a new time
context to use for displayed attribute values.
Time Range Enter Start and End times to specify a new time range
to use for displayed attributed values that require a
time range.
3. Optional. Click Set as Default to register the current settings as the default time context, or click Restore
Default to restore the time context for Query Date Time to Latest Available.
4. Click Apply to see your changes and OK to keep them. The revised time context settings are displayed in the
PI System Explorer title bar.
Boundary type
Specify a boundary type to determine how the searches for data values are handled near the start and end times
of the value range:
• Inside (default)
Returns values at start and end times, if they exist, or the nearest values occurring within the range.
• Outside
Returns the closest values occurring immediately outside the range.
• Interpolated
Returns interpolated values at start and end times.
Filter expression
Add a filter expression to filter event values using a mathematical expression, eliminating data for which the
expression evaluates as false. For example, the simple filter expression:
‘.’ < 70
Note: Be sure to place filter expressions within two straight apostrophe symbols (Unicode character
'APOSTROPHE' (U+0027)).
would remove all values over 70 from the calculation. You can also use any valid PI performance equation in the
filter expression to build more complex expressions to remove atypical peaks in data values, for example.
Expression variables are limited to attributes or PI points which originate from a single Data Archive. Attributes
which resolve to a static value (no data reference configured), are also acceptable. See Indirect PI point
references for a complete description of possible reference syntax.
Attribute variable examples
Statistics
The Summary tab provides the following statistics for attributes that support such statistics:
• Percent Good
Displays the percentage of time for which good values are returned over the total time range. Good values
are event values determined to be valid and not in an error state.
• Average
Computes the average of values during the interval.
• Minimum
Returns the minimum value during the interval.
• Maximum
Returns the maximum value during the interval.
• Range
Computes the maximum value minus the minimum value during the interval.
• Standard deviation
Computes the standard deviation of values during the interval.
• Population standard deviation
Computes the population standard deviation of values during the interval.
• Count
Returns the number of values stored during the interval.
Weighting
The Summary tab allows you to select the Weighting for the statistical calculations:
• Time-weighted
Default. Weights each event value by the length of time over which it applies.
• Time-weighted continuous
Time-weights values, but does all interpolation between values as if the values represent continuous data,
(standard interpolation) regardless of whether the attribute is stepped.
• Time-weighted discrete
Time-weights values, but does all interpolation between values as if the values represent discrete, unrelated
values (stair step plot) regardless of the attribute is stepped.
• Event-weighted
Weights each event equally. This method requires at least one event in a time range (two events for standard
deviation calculations). By default, events at the boundary of the calculation are handled as follows:
• use events at both boundaries when there is only one calculation interval
• include events at start time in multiple intervals and the intervals are in ascending time order
• include events at the end time in multiple intervals and the intervals are in descending time order
• Event-weighted - Exclude Earliest Event
EventWeighted, except that the event at the start time (earliest time) of an interval is not used in that
interval.
• Event-weighted - Exclude Most Recent Event:
EventWeighted, except that the event at the end time (most recent time) of an interval is not used in that
interval.
• Event-weighted - Include Both Ends:
Events at both ends of the interval boundaries are included in the event-weighted calculation.
Event horizon mode
Event horizon mode controls when events for attributes that support future data are returned in the PI AF data
pipe. Possible values are described in the following table.
Value Description
Data function Simply Archive Relative time Time range Time range
configured retrieval only with relative
time
InterpolatedValue
InterpolatedValues
InterpolatedValuesAtTimes
RecordedValue
RecordedValues
RecordedValuesAtTimes
RecordedValuesByCount
Async
PlotValues
Summary
Summaries
FilteredSummaries
UpdateValue
UpdateValues
Annotations
Filters
AFDataPipe
Filters Code2
AFDataPipe OptIn1 Code2
1
Indicates that a custom data reference can be written with one method to declare which attributes it uses as inputs, and another
method that transforms inputs to outputs. With input support, the AF SDK uses these methods to emulate the others, using a time
series generated from input data.
2
Indicates that code is needed for each method, if the time series comes from the system of record that is being connected to.
Chapter 5
The goal of your asset model organization is to make assets easy to find for your users. The main method of
organization is the element tree. PI AF elements are organized in a tree structure. Individual elements can be
organized and regrouped within the tree, without limitations. If you are just getting started with PI AF, then start
by creating the element hierarchy.
You can additionally organize through categories to speed up and simplify browsing and searching information.
Think of categories as labels that you can apply to PI AF objects. Each object can have multiple categories.
Note: You can also organize assets within a process. See Process models in PI AF.
On the other hand, if you have multiple plants in different locations, that same maintenance engineer might
want to see all the equipment located at his own plant. The following illustration shows the same elements
organized by plant.
Asset model organized by location
You are not restricted to only one organizational strategy. You can use an element reference to include the same
asset in more than one place in the tree. For example, you could choose to organize by equipment type and by
plant as well. In the following illustration, the hierarchy includes the geographical tree and the equipment tree
side by side.
Mixed asset model
You could alternatively nest the equipment organization under the geographical organization.
Note: Limit the depth of your asset hierarchies to 10 levels or less to maintain the performance and
interpretability of your asset data.
Reference types
When you add an element reference to an element hierarchy the exact relationship between the referenced
element and the element to which you add it depends on the type of reference. PI AF provides three system-
defined reference types:
• Parent-Child
• Composition
• Weak Reference
You can also create your own custom reference types, as described in Creation of custom reference types and
Child templates.
Videos
For a 5-minute tutorial on how to use reference types, watch this video:
For more information on how to use reference types, watch these longer videos:
For information on how to build custom reference types, watch this video:
For the conclusion of the reference type example, watch this video:
Example
A meter belongs to a company and is attached to a building. You would use a parent-child reference between the
Company element and the child Meter element, and another parent-child reference between the Building
element and the child Meter element. If the reference between the Meter and the Building element is deleted,
the Meter element continues to exist because it has a parent-child reference to the Company element. However,
if the child Meter element is also deleted from the Company element, it no longer exists because all parent-child
references have been removed.
Example
Use a composition reference when the two objects in the relationship are considered one item. For example, a
meter might be composed of two sensors, and so you would use a composition reference between the Meter
element and each of its two child Sensor elements. When you delete the Meter element, the child Sensor
elements are also automatically deleted.
4. Optional. In the Categories field, click and select one or more categories to which the reference type
belongs from the Categorize window. You can also enter one or more reference type categories directly,
separated by a semicolon.
5. In the Reference Strength field, select Strong, Weak, or Composition from the list. See Reference types for
definitions of reference type strengths.
6. In the Allowed Parent Element Template and Allowed Child Element Template fields, select a template to
which the reference type parent and child belong from the list.
Categorization of objects
PI System Explorer allows you to organize objects into categories. Categories are essentially object groups that
you define yourself. Their purpose is to help you find objects more easily. When you search for an object, you can
use the category as a filter to reduce the list of results. Define as many categories as you like. Objects can belong
to multiple categories.
For example, suppose you have a set of elements representing tanks. Half of the tanks are manufactured by
ACME company, and the other half are manufactured by EMCA company. To locate tanks by manufacturer, create
an ACME category and an EMCA category.
Each object type has its own categories. You cannot apply categories from one object type to an object of
another type. For example, you cannot apply an element category to a table. PI AF supports the following
category types:
• Analysis
• Attribute
• Element
• Notification Rule
• Reference Type
• Table
Videos
For information on how to create categories, watch this video:
For information on how to assign categories, watch this video:
For information on how to group by category, watch this video:
Representation of assets in PI AF
Each physical object that you include in your model is represented by a PI AF element. Physical objects are
typically pieces of equipment, such as pumps or tanks. To associate data with an element, you create attributes
on the element. Attributes can hold simple values representing fixed information, such as the diameter of a tank.
An attribute can alternatively reference a PI point, a formula, a value from an external relational database, and
more.
Templates
You can create each element individually, but it is recommended to base individual elements on an asset
template that represents the type of equipment. Element templates enable you to:
• Configure the template once; no need to individually configure each element based on the template.
• Update element structure across all elements belonging to the template.
• Maintain consistency in the asset model.
• Enable powerful features in PI AF client applications.
Now, suppose you need to make a change to the pump objects. You simply make the change in the template,
and PI AF automatically propagates the change to all the pump objects that are based on that template.
Templates are a powerful tool, not only for creating new objects, but for keeping existing objects consistent and
up to date.
A further advantage is that visualization tools can provide special features for objects based on templates. For
example, suppose you build a trend for a pump based on a template. A visualization tool might let you swap or
add in any other pump that is based on the same template. Assets based on the same template are sometimes
called related assets.
Note: You can also create templates for event frames, transfers, models, and notifications.
Template strategy
In almost every case, it is best to base your elements on templates. You not only save time but also ensure that
you have consistent definition across all of the elements based on that template. Any changes that you make to
an element template are propagated to every element that is based on that template. A single template
modification can alter hundreds of elements. This allows you to make changes to your model in a single place;
you don't need to update every element.
You do not have to plan and create all your templates at once. A good approach is to start by modeling a single
type of asset. Create a template for the asset type. Decide what data, calculations, and other properties you
need to store for that type of asset. Each of these items requires an attribute template.
Base templates
Template usage can be very broad or very specific. A template can define a specific type of measurement device,
such as a brand-name instrument, or it can be a broad-use template specifying a particular role, such as a liquid
mass meter. Depending on how broadly you define the template, you might find that the list of attributes is
slightly different for different subsets of assets. In this situation, consider using a base template (for more
information, see Base and derived templates). The alternative is to use a different template for each asset
subset.
Extensions
You can also set up element templates to include attributes (as well as ports) that are not defined or maintained
by the template (for more information, see Extensions). You can add simple, asset-specific attributes without the
need to add them on all instances of the template.
Note: Categories, analyses and notifications are not affected by whether the Allow Extensions check box is
enabled.
Element templates
An element template is a model of an asset type that saves you time and promotes consistency. Element
templates make creating displays, notifications, calculations, and analytics much simpler because equipment of
the same type can share the same implementation. Typically, you create a base template that represents a type
of equipment, such as a tank or pump and assign common attributes to that asset. Then, you create one or more
derived templates based on the base template and assign additional attributes to each asset subset.
You can easily create elements based on a derived template because most of the element configuration is
defined in the template.
When you change an element template, those changes propagate to all elements derived from it.
Deleting an element template deletes any notification or analysis templates that target it.
Note that:
• An element derived from a template gets its initial definition of categories from the template. An element's
attributes and ports are derived from its template.
• If the template allows extensions, then a derived element can contain ports and attributes that are not
defined in the template.
• Element templates can specify the allowed parent and child references (Parent Reference Types and Child
Reference Types) for an element created from the template. This restricts the allowed relationships between
elements in the hierarchy.
• An element cannot be derived directly from a Base Template Only template.
Video
For information on how to create element templates, watch this video:
Default attribute
The default attribute is an attribute that is most representative of the element. For example, if a user were to
reference a tank, perhaps Level would be the single best attribute to use. For an electrical meter, the best
attribute to use could be Voltage. The attribute must be at the top level of the attribute hierarchy of the element.
Notifications and asset analytics can take advantage of the default attribute to simplify some tasks. For example,
if you were to create a comparison between two electrical meters, and had not specified which attributes to
compare, the comparison would be performed using the Voltage attribute of the meters because you had made
Voltage the default attribute.
Extensions
You can allow some attributes to be defined in the element itself, independent of the template. To do this you
configure the template to allow extensions. Attributes that are created as extensions do not change when the
template changes.
Note: If you have a template that allows extensions and you later change it to disallow extensions, no new
extended element attributes can be added to elements based on that template. However, all existing extended
element attributes remain.
Extensions permit flexibility in cases where assets are similar in many areas, but a number of small variations
exist. For example, suppose you build a template for a specific model of a car. All the cars of this model have the
same core set of features: four tires, a steering wheel, and so on. However, one car may have a spoiler while the
other car may not. One might have air conditioning, while another does not. Extensions are intended to handle
this type of variation.
When extensions are enabled, you can base all the elements on a template, while adding additional information
to each element as required. However, if you have multiple elements that are very similar to the template
definition, but all require the same extra attributes, a base template might be a better approach than allowing
extensions.
Note: Categories, analyses and notifications are not affected by whether the Allow Extensions check box is
enabled.
Naming patterns
Naming pattern substitution parameters
When you define naming patterns for element, event frame, transfer, and model templates, you can use the
substitution parameters described in the following table. These naming pattern shortcuts are available in
addition to the substitution parameters that are listed in the Naming Pattern field when you click .
Description parameters
%DESCRIPTION:path% The object's description represented by the path to the object. If the
path is not specified, the description of the current object is used.
%\ELEMENTDESCRIPTION% The description of the object's root element, or the description of the
primary referenced element of the object's root event frame.
%..\ELEMENTDESCRIPTION% The description of the object's parent element, or the description of the
primary referenced element of the object's parent event frame. Use ..\
notation, such as %..\..\ELEMENTDESCRIPTION%, to retrieve further
ancestors.
%\EVENTFRAMEDESCRIPTION% The description of the object's root event frame.
%..\EVENTFRAMEDESCRIPTION% The description of the object's parent event frame. Use ..\ notation,
such as %..\..\EVENTFRAMEDESCRIPTION%, to retrieve further
ancestors.
ID parameters
%ANALYSISID% The ID of the object's analysis.
%ATTRIBUTEID% The ID of the object's attribute or attribute template.
%|ATTRIBUTEID% The ID of the object's root attribute or attribute template.
%..|ATTRIBUTEID% The ID of the object's parent attribute or attribute template. Use ..|
notation, such as %..|..|ATTRIBUTE%, to retrieve further ancestors.
%DATABASEID% The ID of the object's PI AF database.
%ELEMENTID% The ID of the object's element, or the ID of the primary referenced
element of the object's event frame.
Parameter name Substitution
%\ELEMENTID% The ID of the object's root element, or the ID of the primary referenced
element of the object's root event frame. Use ..\ notation, such as
%..\..\ELEMENTID%, to retrieve further ancestors.
%..\ELEMENTID% The ID of the object's parent element, or the ID of the primary
referenced element of the object's parent event frame.
%EVENTFRAMEID% The ID of the object's event frame.
%\EVENTFRAMEID% The ID of the object's root event frame.
%..\EVENTFRAMEID% The ID of the object's parent event frame. Use ..\ notation, such as
%..\..\EVENTFRAMEID%, to retrieve further ancestors.
%ID:path% The object's ID represented by the path to the object. If the path is not
specified, the ID of the current object is used.
%MODELID% The ID of the object's PI AF model.
%SYSTEMID% The ID of the object's PI AF server.
%TRANSFERID% The ID of the object's PI AF transfer.
Name parameters
%ANALYSIS% The name of the object's analysis.
%DATABASE% The name of the object's PI AF database.
%\ELEMENT% The name of the object's root element, or the name of the primary
referenced element of the object's root event frame.
%..\ELEMENT% The name of the object's parent element, or the name of the primary
referenced element of the object's parent event frame. Use ..\ notation,
such as %..\..\ELEMENT%, to retrieve further ancestors.
%\EVENTFRAME% The name of the object's root event frame.
%..\EVENTFRAME% The name of the object's parent event frame. Use ..\ notation, such as
%..\..\EVENTFRAME%, to retrieve further ancestors.
%NAME:path% The object's name represented by the path to the object. If the path is
not specified, null is returned since it references the name of the
current object.
%SYSTEM% The name of the object's PI AF server.
%\TEMPLATE% The name of the root template of the object's element or event frame.
%..\TEMPLATE% The name of the parent template of the object's element or event
frame. Use ..\ notation, such as %..\..\TEMPLATE%, to retrieve further
ancestors.
Path parameters
Parameter name Substitution
%ELEMENTPATH% The path of the base element, the element of an attribute, or the
primary referenced element of an event frame.
%..\ELEMENTPATH% The path of the object's parent element, or the path of the primary
referenced element of the object's parent event frame. Use ..\ notation,
such as %..\..\ELEMENTPATH%, to retrieve further ancestors.
%EVENTFRAMEPATH% The path of the event frame or the element of an attribute of an event
frame.
%..\EVENTFRAMEPATH% The path of the object's parent event frame. Use ..\ notation, such as
%..\..\EVENTFRAMEPATH%, to retrieve further ancestors.
Time parameters
Note: You can specify a format string with all time substitutions. The format string is separated from the
substitution name by a colon. For example, %TIME:d% uses the short date pattern, whereas
%UTCTIME:yyyy/MM/dd HH:mm:ss.fff% specifies the format in full.
%ENDTIME:yyyy-MM-dd The current local end time of the object using the specified formatting.
HH:mm:ss.fff% If no formatting is specified, the default formatting is used. The
formatting uses standard format strings supported by the
DateTime.ToString method, as described in Format strings for time
substitution parameters.
%UTCENDTIME:yyyy-MM-dd The current Coordinated Universal Time (UTC) end time of the object
HH:mm:ss.fff% using the specified formatting. If no formatting is specified, the default
formatting is used. The formatting uses standard format strings
supported by the DateTime.ToString method, as described in Format
strings for time substitution parameters.
Base Template You can base the template on an existing template. Select the base template
from the list. For more information on base templates, see Base and derived
templates.
Type You can base the template on an element type. Select the element type from the
list. For more information on element types, see Element types in models.
Option Description
Categories Optional. You can organize objects by grouping them into categories. To browse
available categories or to create a new category, click . See Categorization of
objects.
Default Attribute Optional. Select a default attribute from the drop-down list. See Default
attribute.
Naming Pattern Optional. You can enter a text string, or click to choose from the following
substitution parameters to define a naming pattern.
• %TIME:yyyy-MM-dd HH:mm:ss.fff%
The current local time of the object using the specified formatting. If no
formatting is specified, the default formatting is used. The formatting
uses standard format strings supported by the DateTime.ToString
method, as described in Format strings for time substitution
parameters.
• %UTCTIME:yyyy-MM-dd HH:mm:ss.fff%
The current Coordinated Universal Time (UTC) time of the object using
the specified formatting. If no formatting is specified, the default
formatting is used.
• %TEMPLATE%
The name of the object's template.
• %@Attribute%
The value of the object's attribute, represented by the path.
You can also use other naming pattern substitution parameters. For
example, if you want an element path included in the naming
pattern, enter %ELEMENTPATH% as a substitution parameter. For a
complete list of naming pattern substitution parameters, see
Naming patterns.
Each element derived from the template will have a unique, identifiable
name. To ensure that new elements created from the template have
an incremental number, enter * at the end of any pattern you enter
here.
If left blank, PI System Explorer uses the element template Name field
and adds an asterisk to add an incremental number as needed.
Some substitution parameters may not be applied when a derived
element is created. To ensure a derived element's name fully reflects
the naming pattern, right-click the element and click Reevaluate
Naming Pattern.
Note: The name generated by the naming pattern must be less than the
maximum name length of 260 characters.
Option Description
Allow Extensions Select this checkbox to enable additional attributes (as well as ports) to be
defined for an element, beyond those defined in its template. See Extensions.
Note: Categories, analyses and notifications are not affected by whether the
Allow Extensions check box is enabled.
Base Template Only Select this checkbox to assign the Base Template Only (BTO) property to an
element template. Elements cannot be derived directly from BTO templates. For
more information, see Base and derived templates.
Extended Properties This link is an advanced feature. For more information, see Storage of
application-specific information.
Location Click this link if you wish to set up location attribute traits for the element.
However, you can also set them on an attribute if you prefer. Note that you can
only assign one set of location attributes per element. For more information, see
Attribute traits.
Security Click this link if you wish to set up custom access permissions to the element
template beyond those already established at the server and database level. For
more information, see Configure security for objects.
3. Use the Attribute Templates tab to create an attribute template for each property or data item for the
template. See Create attribute templates.
4. If you are creating a model, use the Ports tab to specify ports, which define end-points for connections
between elements within a model. See Process models in PI AF.
5. Optional. Use the Analysis Templates tab to create an analysis template for the element template. For more
information, choose from the following:
▪ To create an expression analysis template, see Create an expression analysis template.
▪ To create a roll up analysis template, see Create a rollup analysis template.
▪ To create an event frame generation analysis template, see Create an event frame generation analysis
template.
▪ To create an SQC analysis template, see Create an SQC analysis template.
6. Optional. Use the Notification Rule Templates tab to select or create a notification rule template for the
element template. For more information, see Create a notification rule template.
7. To save your work, press CTRL+S or click Check In.
Event frames derived from the template Click Derived Event Frames.
The Find Derived Event Frames for
Event_Frame_Template window displays all event
frames that have been created from the selected
template, as well as from any template that is derived
from it.
Note: To display the full path to derived event frames,
right-click on the column header (or below the search
results grid) and click Show Full Paths.
Child templates
In some cases, you might want to create a template that has one or more child templates. For example, suppose
you have a template representing a motor and you want a separate template for the shaft. You want the shaft
template to be a child of the motor template. You cannot directly create a child template in the same way that
you would create a child element. Instead, you create a new referenced template below the Motor template.
This also creates a new reference type in the Reference Types collection.
Now, suppose you create an element based on the Motor template. PI System Explorer does not automatically
create the child element, Shaft. However, when you manually create a child element on the motor element, the
Motor-Shaft reference type is added to the list of reference types and the Shaft template appears in the Element
Template list.
Parent elements Click the Parents link. The Parents of Element window
opens.
Child elements a. Click the Children link.
b. In the Element Search window, enter
element name text in the search field. To
refine your search, you can enter
additional criteria in the Criteria section.
c. Click Search.
Matching elements are displayed in the
Results section.
Event frames connected to the element Click the Event Frames link.
• If a match is found, the Find Event Frames for
Element displays a list of all event frames
that reference the element.
• If no match is found, a No Event Frames
Found message is displayed.
Deletion of elements
When you delete an element, PI AF automatically deletes the notifications and analyses that target that element.
If you wish to repurpose a notification attached to an element that you plan to remove, ensure you do so before
you remove the element.
Alternatively, you can change the default behavior so that PI AF does not automatically delete notifications and
analyses when you delete the targeted element.
You use the afdiag command line utility with the /EnablePropagationOfTargetDeletion parameter, as described
in AFDiag utility parameters:
afdiag /EnablePropagationOfTargetDeletion-
Be aware that disabling the setting can cause problems, such as:
• Notifications are left open (and remain active)
• New notifications are not created
• Expected emails are not sent
To associate data with an asset, you create attributes on the element that represents that asset.
Attributes can hold simple values that represent fixed information, such as the diameter of a tank. They can also
hold values from PI points, be derived from formulas, or hold data from outside the PI System through the use of
PI AF tables.
Enumeration sets
If you need an attribute to hold only predefined values, you can use an enumeration set. An enumeration set
maps an ordered set of user-defined constant values to a set of strings. You can use the strings to provide brief,
descriptive text to use within your PI AF model.
Videos
For information on how to create element attributes, watch this video:
For information on how to create child attributes, watch this video:
Attribute templates
Attribute templates are associated with element templates. Just as an element template represents a type of
asset, an attribute template represents a type of data configuration. When you create an instance of the element
template, that element contains an attribute for each attribute template. These attributes inherit all properties
configured on the attribute template.
Rather than create attributes on each element, create attribute templates in an element template. Whenever
you create elements based on that template, PI AF automatically creates the attributes for you. You still need to
give each attribute a value.
Modification of attribute descriptions created from attribute templates
Beginning with 2017 R2, you can modify the descriptions of attributes that are created from a template. You may
find this helpful when differentiating between attributes that use the same attribute template. For example, in a
series of pumps, each pump has a Flowrate attribute with a PI point data reference. The template description for
Flowrate is simply Pump flowrate. To make that description unique for each instance of the pump, you could use
PI Builder to load the descriptor attribute for each pump flowrate PI point and incorporate that value into each
Flowrate description, thereby customizing it.
To modify descriptions created from an attribute template, you must use a PI AF client and server that are
running PI AF 2017 R2 or later. Older clients that connect to a PI AF server running 2017 R2 or later continue to
see only the description from the attribute template.
Note: Because extra memory is used to store descriptions for attributes that have been overridden, loading them
into client applications can take a little longer.
Video
For information on how to create attribute templates, watch this video:
Attribute properties
You need to set up the properties for each element attribute. After you assign properties in an attribute
template, users can only modify the Exclude property on individual attributes.
Attribute traits
Attribute traits identify commonly held characteristics or related behaviors of a parent attribute. PI AF supports
attribute traits for limit conditions, forecasted values, geolocation information, reason codes, asset health, and
analysis start triggers. Users and client applications like AVEVA PI Vision can then find, display, and analyze such
related attributes more effectively.
To set and access attribute traits, both the PI AF client and server need to be running PI AF 2016 or later.
Limit attribute traits
You use limit attribute traits to identify the expected range of a process variable or a measurement attribute.
Limit attribute traits are often set elsewhere (for example, on a control system), or represent inherent properties
of the parent attribute, such as temperature. A typical usage would be to set up conditions for an alarm. AVEVA
PI Vision, for example, uses most limit attributes as input when configuring multi-state behavior for a visual
alarm.
Limit attribute traits are child attributes of the measurement they describe and have the same value type and
UOM as the parent. The only exception is when the value of a limit attribute trait is obtained from a data
reference, in which case the source UOM of a defined data reference can be different. You can also only set limit
attribute traits for parent attributes that are numeric. Note that you can only assign a specific limit attribute trait
once to a parent attribute.
The following limit traits are defined:
Minimum Indicates the very lowest possible measurement value or process output.
LoLo Indicates a very low measurement value or process output, typically an abnormal one
that initiates an alarm.
Lo Indicates a low measurement value or process output, typically one that initiates a
warning.
Target Indicates the aimed-for measurement value or process output.
Hi Indicates a high measurement value or process output, typically one that initiates a
warning.
HiHi Indicates a very high measurement value or process output, typically an abnormal one
that initiates an alarm.
Maximum Indicates the very highest possible measurement value or process output.
Video
For information on how to set limit attribute traits, watch this video:
Forecast attribute traits
In general, you use forecast attribute traits as predicted values to compare with the actual value of the parent
attribute. Typically, such attribute traits represent future PI points but that is not a requirement. Client
applications can very easily relate these attributes and trend them together.
Forecast attribute traits are child attributes of the attribute they describe and have the same value type and
UOM as the parent. The only exception is when the value of a forecast attribute trait is obtained from a data
reference, in which case the source UOM of a defined data reference can be different. You can also create
forecast attribute traits for parent attributes that are of any value type. Note that you can have multiple forecast
attribute traits defined for a parent attribute.
Location attribute traits
You use location attributes to define longitude, latitude, and altitude information for an asset. You can use this
information to identify the location of the asset on a map.
You can create location attribute traits on an element, an event frame, a model, or on their child attributes.
However, you can create only one of each attribute trait per element, event frame, or model. The UOM for the
latitude and longitude attribute traits should be degree (the default) or at least an angle, whereas the altitude
attribute trait can be meter (the default) or another UOM in the Length class. The value type for all location
attribute traits must be numeric (double).
Reason attribute traits
You use reason attribute traits on event frames and transfers to enable users to select a reason code for
excursions, downtime, and other events. You can set a single reason attribute trait on an event frame or transfer
template or an event frame or transfer instance. The reason attribute trait must be an enumeration set that is
previously defined, or a system enumeration set delivered with PI AF.
Health attribute traits
You use health attribute traits on elements and models to enable users to set a numeric health score and a
health status (for example, healthy, out of service, in maintenance, warning, or error). The HealthStatus attribute
trait uses values from the Health Status enumeration set, which is delivered with PI AF. Administrators can
modify the Health Status enumeration set as required.
Analysis start-trigger attribute traits
When users configure analytics to generate event frames, they can optionally elect to store the name of the start
trigger in the value of an attribute (string) and mark that attribute with the analysis start trigger trait. This
enables clients like AVEVA PI Vision to indicate the start trigger that created that particular event frame. For
more information, see Event frame generation analyses.
Event frame or transfer attribute If the Allow Extensions check box has been selected
for an event frame or a transfer template, and no
attribute template has previously been designated as
a reason attribute trait, you can either create a new
attribute and establish it as the reason attribute trait,
or choose an existing attribute.
a. In the Event Frames or Transfer browser,
select an event frame or transfer.
b. Click the Attributes tab.
c. Choose one of the following actions:
Right-click
• an existing attribute and click
Reason for Event Frame or Reason
for Transfer.
Right-click
• below the attribute table and
click Reason for Event Frame or
Reason for Transfer.
2. In the Reason window, select the check box beside the Reason trait you want to apply.
3. In Attribute, choose one of the following actions:
▪ Leave the default attribute name as Reason.
▪ If an attribute already exists that you want to designate as the reason trait, select it from the list.
Note: Reason traits that have already been defined are displayed in bold typeface.
4. Choose from the following actions:
To set a ... Do this ...
Default value for the reason trait a. In Value Type, select Enumeration Value >
Enumeration Sets and select an
enumeration set to use for the reason
trait. The default is the built-in System
enumeration set.
b. In Default Value, select the default reason
trait value from the selected enumeration
set.
To set a ... Do this ...
Default value from a data reference a. In Data Reference, select a data reference
type.
Note: The data reference must be to a digital states
tag. b. In Settings, click to configure the data
reference.
c. Click OK to close the data reference window.
The result of the evaluated data reference is
displayed.
5. Click OK when the assignment of a default reason trait for the selected event frame or transfer is complete.
Value for the HealthScore trait In Default Value (for a template) or Value (for an
element) , enter a numeric value.
Value for the HealthStatus trait In Default Value, select a Health Status enumeration
value:
• Healthy
• Out of Service
• In Maintenance
• Warning
• Error
• Other Health Status enumeration set values
added by an administrator
Value from a data reference a. In Data Reference, select a data reference
type.
b. In Settings, click to configure the data
reference.
c. Click OK to close the data reference window.
The result of the evaluated data reference is
displayed.
5. Click OK when your list of health attributes for the selected element (or model) is complete.
Default UOM Select a UOM from the list. For more information on
UOMs, see Units of measure in PI AF.
Note: Although a user can change the UOM that is
displayed for an attribute in PI System Explorer, the
UOM that is defined in the template does not change.
PI AF data types
The following table contains definitions of the data types in use in .
Attribute Click to open the Attribute Search window. Enter search criteria, as described
in Search for attributes on elements.
Element Click to open the Element Browser window, where you can locate and select
an element.
File Click and select Upload. Locate and select a file in the Open window. For
acceptable types of attachment files, see /FileExtensions in AFDiag utility
parameters.
Caution: Before you upload a file, run an anti-virus check and ensure that the file
size does not exceed your storage space. Some file types can pose a security risk,
and a warning message will be displayed, asking if you are sure you want to
continue. The list of file types that PI System Explorer considers unsafe can
change. As a guideline, look at Microsoft's list of file types blocked by Outlook.
2. Click OK.
When you check in your changes, PI System Explorer sends the resulting value to PI AF.
Create a new child enumeration value in a. In the browser, click an existing enumeration
Enumeration Value Properties window set.
b. In the viewer, right-click an existing value to
which you want to add a child
enumeration value, and click New Child
Enumeration Value.
c. In the Enumeration Value Properties window,
verify that the value selected in the
Parent field is correct. Otherwise, select a
different parent from the list.
d. In the Value field, either enter a unique
number manually, or click to increase
or lower the value.
e. In the Name field, enter a unique string that
describes the condition or state being
represented. This string is used as the
displayed value when an enumeration set
is selected as the value type for an
attribute.
f. Optional. In the Description field, enter a
description for the enumeration value.
Create a new child enumeration value manually a. In the browser, click an existing enumeration
set.
b. In the viewer, click an empty row and enter a
unique number manually in the Value
field.
c. In the Name field:
Enter
i. the original enumeration value for
which you want to create a child
value.
Enter
ii. a | character.
Enter
iii. a unique string that represents the
child enumeration value.
d. Optional. In the Description field, enter a
description for the child enumeration
value.
To ... Do this ...
You can configure an attribute or attribute template to obtain a value from a specified source. This configuration
is called a data reference. Attributes that include them are called data reference attributes. You create a data
reference for the following sources:
• PI point
Produces a value from a PI point, or the summary, or other operation on the point value, depending
on how you configure it.
• PI point array
Produces a single value from an array of PI points.
• Formula
Produces a value from a calculation result. The calculation itself can include attributes, as well as
other data reference attributes.
• String builder
Produces a string value from text-manipulation functions and substitution parameters.
• Table lookup
Produces a value from:
• Internal table
• Imported value from an external (non-PI) table
• Linked value in an external table
• URI builder
Produces a dynamic link for attributes from attribute values and substitution parameters. You can
use the attribute in a notification or in a client application, such as AVEVA PI Vision.
Formula =Density;V=Volume;[D*V]
A=Attribute3;[A*3];UOM=cm
PI Point \\MyPIDataArchiveServer\sinusoid
\\192.168.0.255\ChocMilkMeter;TimeMethod=TimeRange;
RelativeTime=-1h;TimeRangeMethod=Total;ReadOnly=False
ptclassname classic
pointtype Float32
pointsource R
location4 1
location5 2
span 200
zero 1100
\\%Server%\%Element%.%Attribute%;ptclassname=classic;pointtype=Float32;
location4=1;location5=2;pointsource=R;span=200;zero=1100
Assume you want to reference an attribute called pressure, belonging to the NewTank element. You can type:
\Tanks\Tank1\NewTank|pressure
If you want to represent a child attribute of pressure called temp, the reference is:
\Tanks\Tank1\NewTank|pressure|temp
Attributes relative to containing element
You can reference attributes relative to the containing element of the attribute that you are configuring. Use
backslashes (\) to move down the element hierarchy and .. to move up the element hierarchy.
In the above illustration, each element (Tank1, Tank2, Tank3, and NewTank) has a pressure attribute:
These examples demonstrate the syntax to:
• Reference a sibling element:
To refer to the Tank2 attribute pressure from Tank1, type:
..\Tank2|pressure
• Reference a parent element:
To refer to the Tank1 attribute pressure from NewTank, type:
..\|pressure
• Reference a child element:
To refer to the NewTank attribute pressure from Tank1, type:
.\NewTank|pressure
Path syntax for dynamic objects
Paths to dynamic objects are also supported. To create a PI point array attribute with Sinusoid and Sinusoidu
values, for example:
PI Point Array.\\piserver2\sinusoid|sinusoidu
If a path is to a PI point, a dynamic attribute is created. To create an attribute with the data reference configured
to read values from the PI point Sinusoid, for example:
\\piserver2\sinusoid
@ References the value of the object • Attribute value at same level as attribute:
instead of its name.
• %@Attribute%
Note: Only PI point data references • Attribute value at root level of same element:
use attribute value substitution
syntax. Other data references, such • %@|Attribute%
as formula, table lookup, and String • Attribute value at parent attribute level:
Builder have a simpler syntax for
referencing attribute values. • %@..|Attribute%
• Attribute value at parent element level:
• %@..\|Attribute%
• Attribute value of child attribute of same
element:
• %@.|Attribute%
• Attribute value of child element attribute:
• %@.\ChildElement\ChildOfChild|Attribute%
• Attribute value of primary element of event
frame:
• %@.\Elements[.]|Attribute%
Name substitutions
When you use a name substitution, PI AF performs a direct substitution of the substitution parameter for
whatever that particular parameter represents.
The table in List of PI AF substitution parameters lists the available substitution parameters and what they
represent. For example, %Element% is a substitution parameter that represents the element name. After you
create an element based on that template, you tell PI AF to create the data reference (Attribute-value updates
from PI point data references). When PI AF creates the reference, it substitutes the current element name
wherever the configuration says %Element%.
Suppose you have a data reference template that references the PI point name:
%Element%_TT
You create an element named Tank1 that is based on that template. The attribute data reference points to a PI
point named:
Tank1_TT
%..\Element% Name of the parent element of the element in which the attribute
resides. To retrieve further ancestors, use the ..\ notation, such as
%..\..\Element%.
%EventFrame% Name of the event frame in which the attribute resides.
%\EventFrame% Name of the root event frame in which the attribute resides.
%..\EventFrame% Name of the parent event frame of the event frame in which the
attribute resides. To retrieve further ancestors, use the ..\ notation,
such as %..\..\EventFrame%.
%Model% Name of the model, if obtainable from the context.
%Name:path% Name of the object represented by the path to the object. If the path is
not specified, null is returned since the name of the current object is
being referenced.
%Server% Name of the default Data Archive. It first resolves to the current PI AF
database's default Data Archive if one is specified; otherwise, it resolves
to the PI AF server's default Data Archive if one is specified. If one is not
specified there, it resolves to the local default Data Archive.
Note: If the default Data Archive is not specified on the PI AF server or
PI AF database, it can resolve to a different Data Archive for different
client machines depending on their configuration.
%Source% Name of the source element for the transfer in which the attribute
resides.
%System% Name of the PI AF server or collective where the attribute resides.
%Template% Name of the template on which the element or event frame is based.
For example, if you created element Valve101 from a template called
Valve, then the substitute text would be Valve.
%\Template% Name of the root template on which the element or event frame is
based.
%..\Template% Name of the parent template on which the element or event frame is
based. To retrieve further ancestors, use the ..\ notation, such as
%..\..\Template%.
%Transfer% Name of the transfer in which the attribute resides.
Time substitution parameters
PI AF supports substitution parameters that specify a particular time and time zone, depending on the context.
Optionally, you can augment these supported parameters by including a format string that specifies the format
of the time string. See Format strings for time substitution parameters.
The following table lists the time substitution parameters that supports.
Parameter name Substitution
%Duration% Time span between the start time and end time, if it can be obtained
from the time context. In open event frames, obtains the time span
from start time to the current time. The time span uses a different
format from other time substitution parameters.
• You can use standard formats such as "c" (constant), "g" (general,
short), or "G" (general, long), for example: %Duration:c%. For more
information, see the MSDN article Standard TimeSpan Format
Strings.
• You can also use a custom time span format, as described in the
MSDN article Custom TimeSpan Format Strings.
Note that you need to define the symbols that separate days from
hours, and so on with a string literal. For example,
%Duration:d\.hh\:mm\:ss% defines a period (.) as the separator
between days and hours, and a colon (:) as the separator between
hours, minutes, and seconds.
%EndTime% Local end time, if obtainable from the time context. For event frame-
based objects that do not have an end time yet specified, the result is
an empty string.
%StartTime% Local start time, if obtainable from the time context.
%Time% Local time, if obtainable from the time context.
%UtcEndTime% Coordinated universal (UTC) end time, if it can be obtained from the
time context. For event frame-based objects that do not have an end
time yet specified, the result is an empty string.
%UtcStartTime% Coordinated universal (UTC) start time, if it can be obtained from the
time context.
%UtcTime% Coordinated universal (UTC) time, if it can be obtained from the time
context.
ID substitution parameters
The following table lists the ID substitution parameters that supports.
%ElementId% ID of the element in which the attribute resides. For event frames, this
refers to the ID of the primary referenced element.
%\ElementId% ID of the root element in which the attribute resides. For event frames,
this refers to the ID of the primary referenced element of the root event
frame in which the attribute resides.
%..\ElementId% ID of the parent element in which the attribute resides. For event
frames, this refers to the ID of the primary referenced element of the
parent event frame in which the attribute resides. Further ancestors can
be retrieved by using the ..\ notation, such as %..\..\ElementId%.
%EventFrameId% ID of the event frame in which the attribute resides.
%..\EventFrameId% ID of the parent event frame in which the attribute resides. Further
ancestors can be retrieved by using the ..\ notation, such as
%..\..\EventFrameId%.
%Id:path% ID of the object represented by the path to the object. If the path is not
specified, the ID of the current object is used. .
%ModelId% ID of the model in which the attribute resides.
%\EventFrameDescription% Description of the root event frame in which the attribute resides.
%..\EventFrameDescription% Description of the parent event frame in which the attribute resides.
Further ancestors can be retrieved by using the ..\ notation, such as
%..\..\EventFrameDescription%.
Path substitution parameters
Path substitutions cannot generally be used to create references to other attributes, because they contain
backslash characters. The Path substitution parameters are most useful with String Builder data references when
you construct paths for output into strings. The path that is produced does not include the PI AF server or
database.
The following table lists the path substitution parameters that supports.
%ElementPath% Path of the base element, the element of an attribute, or the primary
referenced element of an event frame.
%..\ElementPath% Path of the parent element in which the attribute resides. For event
frames, this refers to the path of the primary referenced element of the
parent event frame in which the attribute resides. Further ancestors can
be retrieved by using the ..\ notation, such as %..\..\ElementPath%.
%EventFramePath% Path of the event frame, or the element of an attribute of an event
frame.
Parameter name Substitution
%..\EventFramePath% Path of the parent event frame in which the attribute resides. Further
ancestors can be retrieved by using the ..\ notation, such as
%..\..\EventFramePath%.
Environment variable parameter
The following table lists the environment variable parameter that supports.
To … Do this …
View the default data server for the current database a. On the PI System Explorer toolbar, click
.
b. In the Select Database window, click
Database Properties.
c. Locate the Default Data Server field on the
General page to view the default data
server.
d. Click OK twice.
To … Do this …
View the default data server settings for the system a. Click on the PI System Explorer toolbar, or
click File > Server Properties.
b. Locate the Default Data Server field on the
General page to see the default data
server for the PI system.
c. Click OK.
View the name of the default data server a. From the PI System Explorer menu bar,
choose File > Connections.
b. Locate the icon to identify the default
Data Archive data server.
c. Click Close.
Relative paths
To reference another attribute, the configuration string uses a relative path. The relative path identifies a data
reference attribute based on its name and its place in the hierarchy of elements and attributes. For the PI point
data reference, the path must include an attribute path designation (| or ..) in the configuration string so that it
is distinguished from a PI point reference.
The following table shows typical configurations for indirect references:
Top level attribute of |topLevelAttribute See "Full path from top-level ancestor" in
same element Examples of references to attributes of the
same element.
Parent attribute .. See "Parents and grandparent attributes"
in Examples of references to attributes of
the same element.
Child attribute .|childAttribute See "Descendant attributes" in Examples
of references to attributes of the same
element.
Object Syntax Example
Create a direct PI point data reference a. Leave the default server, or choose a
different Data Archive from the Data
server list.
Note: If the desired Data Archive does not
appear in the list, click and select a
Data Archive from the PI Data Archives
window.
b. In the Tag name field, type the point name,
or click to search for a point on the
selected Data Archive.
Tip: You can enter a substitution parameter
instead of the tag name. If you are
creating a reference in an attribute
template, you can use substitution
parameters in both the Data server and
Tag name fields. See List of PI AF
substitution parameters.
Relative time
Relative time expressions are some number of a number of days (d), hours (h), minutes (m), or seconds (s),
specified with either a leading plus sign (+) or a leading minus sign (-). The Relative time field in the PI Point Data
Reference window shifts the time context by the specified offset. For example, if a client requests an attribute
value at the current time where the relative time expression is -8h, PI AF returns data from eight hours before
the current time.
Fractional times are supported. For example, use -1.5d to indicate one and one-half days.
Relative time expressions can contain only one operator, either + or -. For example, the following is not
supported:
-1d+1h
The following are all valid relative times:
+1d
-24h
-3.25m
+24s
Option Description
After Returns the first recorded value after the time requested by the client
application.
At or After Returns a recorded value at the time requested by the client application. If no
value exists at the specified time, returns the next recorded value.
At or Before Returns a recorded value at the time requested by the client application. If no
value exists at the specified time, returns the previous recorded value.
Automatic A continuous point (step attribute = 0) is treated as Interpolated, whereas a
discrete point (step attribute = 1) is treated as At or Before.
Before Returns the first recorded value before the time requested by the client
application.
Exact Time Returns a recorded value at the time requested by the client application. If no
recorded value exists at that time, an error is returned.
Interpolated Returns an interpolated value for the time requested by the client application.
Discrete points (step attribute = 1) carry the previous value forward.
Not Supported Used in time range calculations only. If the client application sends a time
instead of a time range, PI AF returns an error message as the attribute value.
Option Description
Time Range Used in time range calculations only. Creates a default time range to use if the
client application sends a time instead of a time range. If you choose this option,
you must type a PI relative time expression in the Relative Time field. See Create
default time ranges for element attributes for details.
Time Range Override Used in time range calculations only. Specifies a time range that always overrides
the time range supplied by the client application. You can specify:
• A fixed duration, as described in Create ranges of configurable durations.
• A dynamically calculated duration, as described in Configure dynamic time
range calculations.
Option Description
Population Standard Returns the population standard deviation over the time range.
Deviation
Range Returns the range of values over the time range (Maximum-Minimum)
Standard Deviation Returns the standard deviation over the time range.
Start Time Returns the value at the start time of the time range.
Total Returns a totalization over the time range.
Configure value retrieval by time
A client application request for an attribute value includes a time. Specify how to interpret that time to retrieve
values for the attribute.
1. Select an option from the By Time list. The default option is Automatic. For more information, see Time
retrieval options.
2. Optional. If an attribute is configured to return the value at a specific time, you can configure a time delay
from the time requested. This can be useful when you are creating dead-time delayed attributes.
In the Relative Time field, type the relative time of the delay. Use a PI relative time expression, as described
in Relative time.
Note: You can also use substitution parameters to read the relative time from the value of another attribute,
as described in References to attribute values, References to attribute values.
3. Select an option from the By Time Range list. The default option is End Time. For more information, see
Range retrieval options.
4. Click OK.
Event Weighted Evaluates values with equal weighting for each event.
No interpolation is done. At least one event must be
within the time range to perform a successful
calculation. Two events are required for standard
deviation.
In handling events at the boundary of the calculation,
PI AF uses the following rules:
• Events at both boundaries are used when
there is only one calculation interval.
• Events at start time are included when
multiple intervals exist and the intervals
are in ascending time order.
• Events at the end time are included when
multiple intervals exist and the intervals
are in descending time order.
Event Weighted Exclude Most Recent Event Behaves the same as Event Weighted, except in the
handling of events at the boundary of summary
intervals in a multiple intervals calculation. Use this
option to prevent events at the intervals boundary
from being double count at both intervals. With this
option, events at the end time (most recent time) of
an interval are not used in that interval.
Event Weighted Exclude Earliest Event Similar to the Event Weighted Exclude Most Recent
Event option. Events at the start time (earliest time)
of an interval are not used in that interval.
Event Weighted Include Both Ends Events at both ends of the interval boundaries are
included in the event-weighted calculation.
Time Weighted Weights the values in the calculation by the time over
which they apply. Interpolation is based on the step
attribute of the point. Interpolated events are
generated at the boundaries if necessary.
Time Weighted Continuous Applies weighting as in Time Weighted, but does all
interpolation between values as if they represent
continuous data (standard interpolation), regardless
of the step attribute of the point.
Time Weighted Discrete Applies weighting as in Time Weighted but does
interpolation between values as if they represent
discrete, unrelated values (stair-step plot), regardless
of the step attribute of the point.
4. In the Min percent good field, enter a value between 0 and 100. This is a percentage representing the
minimal amount of time a value must be good before a summary value is returned. For time weighted
calculations, the percentage is based on time. For event weighted calculations, the percent is based on event
count.
5. Click OK.
The attribute is associated with a template that contains point Configuration Item Indicator
creation rules. Use the Create or Update PI Point option to create
the tag configuration based on the template. Additionally, the column ( )
point name and ID is resolved.
Specifies if an attribute's data reference configuration differs from Configuration Item Indicator
what is stored in the specified data server. This can occur when a
point is renamed, when an attribute's data reference is tied to a PI column ( )
point without a value (floating) or when the underlying PI Data
Archive is replaced. Use the Create or Update PI Point option to
update the configuration.
The data reference has returned a system digital state rather than Quality Indicator column ( )
a typical value from the source. An example is when a PI point has
been created, but doesn't have any data.
The value returned from the data reference has a bad quality. An Quality Indicator column ( )
example is when a PI point has been created, but it does not yet
have any data.
Icon Description Column
The attribute is a configuration item. See Configuration Item Configuration Item Indicator
attribute property for more information.
column ( )
Note: The Create or Update Data Reference option is not
applicable for configuration item attributes.
When you review element attributes on the Attributes tab, the first entry in the column at left of a data
reference attribute's name indicates whether you can run the Create or Update Data Reference option. You
initiate the Create or Update Data Reference option by right-clicking an element or an attribute and clicking
Create or Update PI Point.
The Create or Update Data Reference operation updates a PI point data reference with any changes that have
occurred to the PI point; substitution parameters are resolved, and server and point IDs are updated. If the PI
point does not yet exist, and the configuration contains a point creation option, it is created.
Attribute update example
When you see the indicator displayed for an attribute, you can update its configuration by right-clicking and
clicking Create or Update PI Point.
Note: The icon does not determine beforehand if any changes to the tag or its configuration will occur.
Attribute indicator with tooltip
As the tooltip shown above indicates, when you update the configuration, point name substitution rules are
resolved and the point ID is stored into the attribute's metadata. This results in faster subsequent initialization.
Note: You can use the Column List button to add columns to or remove columns from the Attributes window.
Note: If the desired Data Archive does not appear in the list, click and select a Data Archive from the PI
Data Archives window.
6. In the Tag name field, choose from the following actions:
▪ To enter PI points directly, enter point names separated by the pipe symbol (|). For example:
CDM158|CDT158|SINUSOID
▪ To search for PI points, click and enter search criteria in the Tag Search window. Select multiple PI
points on the selected Data Archive.
7. Optional. Specify the units that the referenced PI points use. See Unit of measure considerations.
8. In the Value retrieval methods section, specify how the attribute gets its value. For example, the attribute
value could be the same as the point values, or it could be a result of a calculation on the point values. See
Configuration of retrieval methods for attribute values.
9. Use the Read Only check box to specify whether you want PI AF to write the attribute value back to the
source points. By default, PI AF does not write data to the referenced PI points (the Read Only check box is
checked). See PI point value updates from a data reference.
Formula data references
You use formula data references to create custom calculations based on other element attributes. Calculations
can be a single formula or a sequence of calculations. Formula data references can have multiple input
attributes.
Videos
For information on how to create formula data references, watch this video:
For information on UOMs in formula data references, watch this video:
Unary Minus 8
^ 7
* / mod 6
+- 5
NOT 3
AND 2
OR 1 (calculated last)
You cannot use the assignment operator = at the beginning of any formula.
Note: Formula data reference syntax uses == (two equals signs) to indicate equality and = (single equals sign) for
assignment. Analytics (and performance equation) syntax uses = to indicate equality and := for assignment.
Compound operators
You can choose If-Then-Else, a compound operator with operands used as follows:
If expr0 Then expr1 Else expr2
where expr0, expr1, and expr2 are expressions. If expr0 is true, the value of expr1 is returned; otherwise, the
value of expr2 is returned.
Formula example
This sample formula calculates the daily average cost of reagent per tonne processed, as shown in the Value field
for Grinding Media in the following mineral processing illustration:
A=.|Addition (Daily Total);B=.|Unit Cost;C=Tonnage (Past 24 Hours);[if C ==0 then
digstate("No Data") else A*B/C]
Sample formula data reference
Function Description
badval(x) Returns 1 if the value has a bad status, has a floating point value of not a number
(NaN), or is not a numeric value, otherwise returns 0.
ceiling(X) Smallest integer not less than X.
cos(X) Cosine of X.
cosh(X) Hyperbolic cosine of X.
cot(X) Cotangent of X.
coth(X) Hyperbolic cotangent of X.
csc(X) Cosecant of X.
csch(X) Hyperbolic cosecant of X.
digstate() Returns a system digital state value.
• If successful, the system digital state is returned as a system enumeration
value. For PI AF Client versions older than 2.4, the value is returned as a PI
SDK digital state, because the system enumeration value set did not exist.
• If unsuccessful, the value is returned as a string.
In both cases, the AFValue.IsGood flag is set to false, and the attribute is
flagged in the Attributes Viewer with the icon.
e() Value of the natural logarithm base.
exp(X) Natural logarithm base e raised to power of X.
floor(X) Largest integer not greater than X.
ln(X) Natural logarithm of X.
log(X) Logarithm of X using base 10.
logbase(X,Y) Logarithm of X using base Y.
max(X,Y) Greater of X and Y.
min(X,Y) Lesser of X and Y.
normalrnd(X,Y) Random number that maps the normal distribution curve. X is the mean and Y is
the standard deviation.
pi() Value of pi.
poisson(X) Random number that maps the Poisson distribution. X is the mean.
pow(X,Y) X raised to the power of Y.
rand() Uniform random number. The values can be between 0 and less than 1.0
rand(X,Y) Uniform random number. The values can be between X-Y/2 and less than X+Y/2.
Function Description
5. If your equation requires an attribute value, click to add it as a parameter (Define parameters for
formula data references).
6. Select the Default Values Allowed check box to enable PI AF to use attribute default values in the
calculation. Default values are specified on the attribute template. If you clear the check box, the calculation
fails when the data for one or more attributes is not available.
7. Click to begin defining the equation. For more information, see Define equations for formula data
references.
8. In the Unit of Measure field, specify the unit of measure the result of the formula or calculation sequence
will produce, as described in Units of measure in formula data references.
9. In the Minimum field, enter an appropriate value for the minimum returned value. If the calculated value is
less than this minimum, the data reference returns the minimum value you specify. If there is no minimum
value for this calculation, leave the Minimum box blank.
10. In the Maximum field, enter an appropriate value for the maximum returned value. If the calculated value is
greater than this maximum, the data reference returns the maximum value you specify. If there is no
maximum value for this calculation, leave the Maximum box blank.
Note: Select the Stepped check box for the value to be stepped when plotted.
11. Click Evaluate to test the data reference. The value returned by the calculation sequence appears in the
adjacent box. When the formula data reference is configured under a template attribute, the calculation uses
the default values for the template attributes. When the configuration is done under an element attribute
the actual data is used for the calculation.
12. Click OK.
13. Configure the rest of the attribute settings as you would for any other attribute.
3. To add another row to the formula, click and continue the formula. Repeat as needed until you have
completed the formula.
4. To change the formula, choose from the following actions:
To ... Do this ...
Remove the selected equation from the calculation Select the row you wish to remove and click .
sequence
Remove all equations from the calculation sequence Click .
Move an equation up or down in the calculation Select the row to be moved and click or .
sequence
Object Syntax
In the child element Equipment, you would use the syntax ..\|myAttribute and enter '..\|Environment' in the
String Builder Data Reference window:
Left(string, length) Returns a string that contains the specified number of characters
(length) from the left of the input (string).
Example: Left("Temperature",4) returns Temp
Right(string, length) Returns a string that contains the specified number of characters
(length) from the right of the input (string).
Example: Right("GasTemp",4) returns Temp
Mid(string, start, [length]) length is optional. Returns a sub-string from the specified position
(start) of the input (string). When number of characters (length) is
included, returns the specified number of characters.
Example: Mid("GasPressure",4,8) returns Pressure
UCase(string) Converts string to uppercase.
Example: UCase("Temperature") returns TEMPERATURE
LCase(string) Converts string to lowercase.
Example: LCase("TEMPERATURE") returns temperature
Trim(string) Removes blanks on both sides of string.
Example: Trim(" Temperature ") returns Temperature
RTrim(string) Removes trailing blanks from string.
Example: RTrim(" Temperature ") returns " Temperature"
LTrim(string) Removes leading blanks from string.
Example: LTrim(" Temperature ") returns "Temperature "
Replace(string1, string2, string3) The function searches string1 for string2, then replaces string2 with
string3.
Example: Replace("Temperature","Temp","External Temp")
returns "External Temperature"
You can also nest text manipulation functions.
• For example, for an attribute named GasPressure, you can use the Mid function in combination with the
UCase function to return the following expression: GASPR
Mid(UCase("%Attribute%"), 1, 5);
• Alternatively, for the same attribute, you can use the Mid function in combination with the LCase function to
return the following expression: pressure
Mid(LCase("%Attribute%"), 4, 8);
Note: Beginning with PI AF 2018, you can nest functions in any position, not the first position only. For example,
Replace(Mid("abc",1,3),"b","2");
Replace("abc",Mid("abc",2,1),"2");
Replace("abc","b",Mid("123",2,1));
all return the expression: a2c
Format function
The Format function enables you to convert real numbers, integers, and time stamps to a string according to the
format and optional culture specification.
Note: Unlike other string functions, the syntax of Format(DateTime, ... ) follows C# syntax.
The syntax for Function implementation in String Builder is described in the following table:
In the parent element Power and Steam Generation, you would create an attribute named Condenser Service
Date. Use the syntax .\childElement|Attribute, and enter '.\Condenser|In Service Date' in the String
Builder Data Reference window:
The In Service Date value is retrieved and displayed in the Value field: 2/25/2009 12:00:00 AM.
To change the format from the US default to Universal full date in German culture format, you would alter the
expression to read Format(.\Condenser|In Service Date,"U","de"). The Condenser Service Date attribute
value format is converted accordingly:
7. Build your expression further. You can either type a semicolon (;) and continue in the same row, or click
to continue on another row. You can use the following icons to manipulate the expression:
To ... Do this ...
1.
For more examples, see Function implementation in String Builder.
Create PI AF tables
You create a table profile so that attributes can obtain their values from an internal or external table.
1. In the Library browser, right-click the Tables collection and click New Table.
2. In the General tab, enter a Name and Description for the table.
3. Optional. Assign one or more categories to the table. Enter table category names directly, separated by a
colon, or click and select them from the Categorize window.
4. Decide how DateTime values should be stored in the table. By setting the value for the table overall, you
need not specify it every time you create a table lookup data reference.
a. In the Time Zone field, select a time zone from the list.
b. Select or clear the Convert To Local check box. Choose from the following options:
▪ To convert DateTime values to the local time, select the Convert To Local check box.
▪ To display DateTime values in the time zone selected in the Time Zone field, clear the Convert To
Local check box.
Note: When a client application queries the table, the time zone in which DateTime values are
displayed depends on whether the Convert To Local check box is selected. PI System Explorer uses
this setting to determine the precise DateTimeMode to use in a Microsoft .NET data table, as
described in Conversion settings for time zones.
5. In the Cache Interval field, enter the amount of time until the table's cached data is automatically refreshed.
From the list, choose whether the value is in seconds, minutes, hours, or days. The default value is zero,
which indicates a manual refresh.
Note: Automatic refreshing is disabled if the table has changes that have not been saved to the server.
Note: With manual refreshes, you refresh table data by right-clicking the table in the Library browser and
clicking Refresh. Otherwise, table data that is being queried by client applications is refreshed only when the
application is restarted. For example, when PI System Explorer is opened or whenever the Microsoft Internet
Information Services (IIS) application pool recycles the client (the default is every 29 hours).
6. Check in your work.
Note: The Connection and Query fields are read-only. PI AF populates these fields when you link to or import
an external table.
Define and populate the table in one of three ways:
• Manually define and populate the table in PI System Explorer. First, create column definitions on the Define
Table tab, as described in Create table column definitions. Next, enter data on the Table tab, as described in
Populate tables manually.
• Import a table from outside the PI AF server. See Access to Microsoft Access or Excel data.
• Link to a table outside the PI AF server. See Access to Microsoft Access or Excel data.
None Internal Fields that contain DateTime data type are automatically
adjusted for time zone differences and return local times on
the client.
External Fields that contain DateTime data type are assumed to be in
the time zone of the PI AF server and are adjusted to the
client's local time.
None Internal Fields that contain DateTime data type are not translated.
Useful for storing date fields where translation is not desired,
such as birth date.
External Fields that contain DateTime data type are not translated.
Useful for storing date fields where translation is not desired,
such as birth date.
UTC or Internal Fields that contain DateTime data type are adjusted to local
times on the client.
GMT
External Fields that contain DateTime data type are externally stored
as UTC, but adjusted to local time on the client, represented
as UTC.
UTC or Internal Fields that contain DateTime data type are always
represented as UTC.
GMT
External Fields that contain DateTime data type are externally stored
as UTC, and left as UTC on the client.
Time zone Convert to Internal/ Behavior
local external
TZ Internal Fields that contain DateTime data type are adjusted for time
zone differences and are local time on the client. This
combination is not normally needed except when external
data is being imported into PI System Explorer.
External Fields that contain DateTime data type are adjusted for time
zone differences, and are adjusted to local time on the client,
represented as UTC.
TZ Internal Fields that contain DateTime data type are left in the time
zone specified. A table lookup data reference adjusts as
appropriate; however, other applications may not.
External Fields that contain DateTime data type are left in the original
time zone specified, represented as UTC. A table lookup data
reference adjusts as appropriate; however, other applications
may not.
Enter a new row Right-click in the table grid and click Insert or New.
Copy and paste rows from an Excel spreadsheet a. In the spreadsheet, copy the rows you want.
b. In the table grid, right-click a new row or a
range of rows and click Paste.
Replace data for specific cells a. Use standard Windows selection keystrokes
(such as SHIFT+<click> and CTRL+<click>)
to select contiguous and non-contiguous
cells in the table, as described in Select
multiple objects in the viewer.
b. Right-click and click Clear Cell(s).
c. Enter new data in the cleared cells.
Remove a row Right-click the row you want to remove and click
Delete.
3. To save your work, press CTRL+S or click Check In.
▪ Click (Manage Tables) to open a list of tables you can search or filter. To select a table, highlight it in
the list and click OK.
▪ Click (Table Properties) to view or edit properties for the selected table.
UOM=uom Specifies the unit of measure for the value returned by the result column.
Note: You can also set the unit of measure in the table column definition, so
that you do not need to specify it with each table lookup.
RWM=value Specifies the value to return when there is no column match. If the value is
No Data, the digital state of No Data is returned.
RWN=value Specifies the value to return when the result column is null. If the value is No
Data, the digital state of No Data is returned.
• Parameters
You can enter parameters in a list separated by semicolons. Begin each parameter name with the @
character in @parameter=value format (value is described in "Attribute or Value" in WHERE clause syntax).
For additional information on using parameters, see Parameters for linked table queries.
Example
SELECT [Installation Date] FROM [Equipment Specifications] WHERE [Asset ID] = '%Element%'
Examples of linear and bilinear interpolation in table lookup data references
Linear interpolation example
In a tank strapping table that contains a Level column and a Volume column, the following configuration string
interpolates the volume based on the level reading:
SELECT Volume FROM MyTable WHERE INTERPOLATE(Level, @MyLevelReading)
Assume the sample table has the following rows:
Level Volume
1 0.0
2 20.0
3 30.0
4 40.0
5 60.0
6 70.0
• A Level reading of 2.2 results in a returned Volume of 22.0.
• A Level reading of 2.7 results in a returned Volume of 20.0 when Stepped is selected (true).
• Extrapolation: A Level reading of 6.5 results in a returned Volume of 75.0 when Stepped is cleared (false).
• Extrapolation: A Level reading of 6.5 results in a returned Volume or 70.0 when Stepped is selected (true).
Bilinear interpolation example
In an air velocity table that contains an X Horizontal Position column, a Y Vertical Position column, and a Velocity
column, the following configuration string interpolates the velocity based on the X horizontal and Y vertical
positions.
SELECT Velocity FROM Table1 WHERE INTERPOLATE([X Horizontal Position], @X) AND
INTERPOLATE([Y Vertical Position], @Y)
Assume the sample table has the following rows:
UOM=uom Specifies the unit of measure for the value returned by the result column.
Note: You can also set the unit of measure in the table column definition, so that
you do not need to specify it with each table lookup.
RWM=value Specifies the value to return when there is no column match. If the value is No
Data, the digital state of No Data is returned.
RWN=value Specifies the value to return when the result column is null. If the value is No
Data, the digital state of No Data is returned.
• Parameters
You can enter parameters in a list separated by semicolons. Begin each parameter name with the @
character in @parameter=value format (value is described in "Attribute or Value" in WHERE clause syntax).
For additional information on using parameters, see Parameters for linked table queries.
TZ=time zone Not supported at the column level. You need to specify the time zone in the
Time Zone field on the General tab for the overall table.
UOM=uom Specifies the unit of measure for the value returned by the result column.
Note: You can also set the unit of measure in the table column definition, so that
you do not need to specify it with each table lookup.
RWM=value Specifies the value to return when there is no column match. If the value is No
Data, the digital state of No Data is returned.
RWN=value Specifies the value to return when the result column is null. If the value is No
Data, the digital state of No Data is returned.
• Parameters
You can enter parameters in a list separated by semicolons. Begin each parameter name with the @
character in @parameter=value format (value is described in "Attribute or Value" in WHERE clause syntax).
For additional information on using parameters, see Parameters for linked table queries.
Example
In the following example,
SELECT [Installation Date] FROM location; WHERE RowID =@id; TZ=China Standard Time;
TC=Installation Date
A dynamic web link Modify the components of the pasted URI as needed.
• You can choose between Scheme values of
http and https.
• You can change the Port value to any number
between 1 and 65535. The default values
for http and https schemes are 80 and
443 respectively.
• To make portions of the Path field dynamic,
select a segment. Then click and select
from the following options:
A•list of other attributes for the selected
object. Note that attributes must
appear in single quotes.
A•list of attribute references. You can also
select Search to enter search criteria
in the Attribute Search window.
A•list of commonly used substitution
parameters. For more information,
see List of PI AF substitution
parameters.
• In the Query table, you can modify Key and
Value settings as needed.
To• add a key, click . In the Key and
Value fields, type a value or click
and select from the same options as
above.
To• delete a parameter, select a key or
value and click .
To configure ... Do this ...
Units of measure in PI AF
PI AF ships preloaded with numerous standard unit-of-measure classes and conversion factors. You can extend
these classes by adding new units of measure, as well as new measurement classes. The implementation of the
units of measure (UOM) feature in PI AF is based on the International System of Units (SI).
UOM database
All PI AF databases use the same set of UOMs, which are defined in the UOM database. All UOMs have the Read
permission set, but other permissions can be set for the UOM database as a whole, as described in Configure
security for the UOM database.
Beginning with PI AF 2017 R2, users with administration privileges can review audit trail data on the UOM
database by selecting File > Audit Trail Events after they have clicked Unit of Measure in the navigator. For more
information, see Track PI AF changes with Audit Trail.
UOM classes and canonical units
In PI AF, each unit of measure is based on a UOM class. Classes represent measurable properties, such as
temperature, length, time, and mass. Each class has a canonical unit. This is the base unit from which PI AF
converts values to other units when required. For example, the canonical unit for the Length class is meter, and
the abbreviation is m.
UOM conversions in client applications
The UOM feature enables automatic unit conversions in client applications. For example, suppose a PI AF
attribute has a UOM of meter. A PI ProcessBook user who is viewing that attribute value can choose to view the
value in a different unit, such as foot. PI AF automatically converts the data from meters to feet.
UOM abbreviations
By default, UOM abbreviations within PI AF are case insensitive. Beginning in PI AF 2015 R2 (v2.7.5), you can
configure the PI System to support case-sensitive UOM abbreviations, which enables you to define abbreviations
that differ only by case, such as MV (megavolt) and mV (millivolt), or s (second) and S (Siemens).
Note: All PI AF clients must be upgraded to PI AF 2015 R2 or later before they can access a PI AF server on which
case-sensitive UOMs are enabled.
Time integral UOMs
Beginning with PI AF 2017, you can view the UOMs associated with a time-weighted total (Automatic and Per-
Day) of rate UOMs. Rate UOMs are from classes that contain time in the denominator of their Base Units of
Measure (for example, Mass Flow Rate contains Time-1, Pressure contains Time-2). Each time-weighted total
property displays the name of the UOM that will result from a summary Total (Per-Day) or TotalWithUOM
(Automatic) data call.
UOM groups
Beginning with PI AF 2017 R2, UOM groups such as Metric, and US Customary are available so that you can map
UOMs in a UOM class to the setting that is most appropriate for your location. By selecting the Display UOM
Group option in Tools > Options, you can then see attribute values displayed in the preferred unit of measure
instead of the value selected in an attribute template's Default UOM field. For more information on the US
Customary UOM group, see the Wikipedia article United States customary units.
UOM origin
Beginning with PI AF 2017 R2, you can check the origin of a UOM definition in the UOM database. Possible
values shown in the Origin column are:
Origin Description
Name Abbreviation
UOM1_name UOM1
UOM2 uom1
UOM3 Uom1
The following is invalid and generates the error message: 'uom1' already exists in Unit of Measure 'UOM1' in
Unit-of-Measure Database.
Name Abbreviation
UOM1 uom
UOM2 uom1
Option Description
Factor None.
Factor with offset For delta conversion calculations, you need to define a separate UOM.
See the Temperature (Delta) UOM class for examples.
Formula • Delta calculations are not assigned UOMs.
• Summary calculations over a range of data are not assigned UOMs.
This affects analysis expression functions, such as Maximum,
Minimum, Popular Standard Deviation, Range, Standard Deviation,
and Total. It also affects programmatic Summary data calls against
PI point data references with a UOM assigned.
• Searches for attribute values exclude attributes whose value is
measured in formula UOMs.
UOM formula evaluation
PI AF uses C# for UOM formula evaluation. Follow these guidelines:
• Write all Units of Measure in terms of the UOM abbreviation. If an abbreviation is not a valid C# variable
name, enclose it in brackets.
• Adhere to C# evaluation rules.
• You can optionally invoke standard .NET static methods, such as Math.Log10(), to perform the computation.
You are limited to what is available in the System Assembly (.NET Framework Math Class).
Formula conversion method example
As an example, watts (W) is the canonical UOM in the Power class. To create a UOM of Decibel-milliwatts (dBm)
in the Power class, you could enter the following formula:
W = Math.Pow(10,(dBm - 30)/10)
dBm = 10 * Math.Log10( W ) + 30
UOM groups
Beginning with PI AF 2017 R2, units of measure that are included as part of PI AF are mapped to UOM groups,
such as Metric and US Customary. Once you have selected which UOM group you prefer to use at your location,
you can display all attribute values with units of measure mapped to that UOM group rather than the default
UOMs that are defined in attribute templates.
You select which UOM group you prefer in Tools > Options. When no preferred UOM group is selected, all
attribute values are displayed with the default UOM defined in attribute templates, unless Use Source Unit-of-
Measure for attribute display is also selected. For more information, see PI System Explorer customization
options.
Sample mappings for a UOM class
As an example, the table below illustrates mappings for the Length UOM class.
centimeter inch
foot meter
inch centimeter
international nautical mile
kilometer mile
meter yard
millimeter sixteenth of an inch
sixteenth of an inch millimeter
yard meter
If a mapping is not defined, such as international nautical mile, a UOM is not mapped and uses the original UOM
setting.
UOM database
UOM groups are available to all users and are stored on the PI AF server as part of the UOM database. Each
user's UOM group selection in Tools > Options is also stored in the UOM database.
Users with permission to modify the UOM database can modify the UOM groups and mappings, including those
shipped by default. For more information, see Configure security for the UOM database.
UOM database import/export
You can import and export UOM groups, as well as their mappings, with File > Export to File and File > Import
from File. When you export, ensure that Include All Referenced Objects option is selected.
Origin of UOMs
Beginning with PI AF 2017 R2, you can check the origin of a UOM definition in the UOM database. The Origin
field is included in the Unit of Measure Properties window, as well as the UOM viewer. It is also supported in PI
Builder.
Possible values shown in the Origin column are:
Origin Description
System Modified The UOM was system-defined but the Name and/or Description fields have been
modified.
System Replaced The UOM retains its original system-defined abbreviation and canonical UOM
values but other fields besides Name and Description have been modified.
User Defined The UOM was created by the user.
If a UOM is modified that results in Origin being set to either System Modified or System Replaced, but is later
reset to the original definition, Origin also reverts to System Defined.
Chapter 10
Security configuration in PI AF
PI AF supports both claims-based authentication via OpenID Connect (OIDC) and integrated Windows security for
authentication. PI AF also provides its own authorization to PI AF objects through PI AF identities and mappings.
You can map roles to PI AF identities on claims-aware PI AF servers. See Map a role to a PI AF identity for more
information.
Note: The security configuration information described in this section presumes a PI AF 2015 server and a PI AF
2015 client.
The PI AF security model enables administrators to configure access for PI AF identities at each level of the PI AF
hierarchy. PI AF uses Windows integrated security to grant or deny connection to the PI AF server, view or edit
databases, and change collections.
For detailed information on how security is implemented on Data Archive, see Data Archive security.
Video
For information on how to create, map, and grant permissions to PI AF identities on a PI AF server that uses
Windows authentication, watch this video:
Built-in PI AF identities
The following table includes a list and descriptions of all the built-in PI AF identities.
PI AF identity Description
Administrators By default, this identity has all access permissions to every collection
and object on the PI AF server, including all databases. It cannot be
modified or deleted. Mappings, however, can be added and removed,
and this identity can be denied access permissions to objects if the
need arises.
Access to this identity should be restricted to only a few users.
PI AF identity Description
Asset Analytics (Part of PI Analysis Service installation.) This identity has the necessary
access permission to work with analyses. By default, the account used
to run PI Analysis Service is mapped to this identity during installation.
Mappings to this account can be added or removed.
Asset Analytics Recalculation (Part of PI Analysis Service installation.) This identity has Execute
permission, allowing users mapped to it to backfill and recalculate
analyses.1
Engineers This identity has the same privileges as Administrators, with the
exception of the Admin (a) permission. This identity is also not allowed
to delete PI AF databases.
This identity should be restricted only to users who are defining the
asset database. Additional identities should be created to narrow the
scope of access within PI AF.
Notifications (Part of PI Notifications Service installation.) This identity has the
necessary access permission to work with notification rules. By default,
the account used to run PI Notifications Service is mapped to this
identity during installation. Mappings to this account can be added or
removed.
Owner This read-only identity can be explicitly added to the security
configuration of specific PI AF objects to enable administrator users to
configure privileges for the owner of an object. The following
restrictions apply:
• You cannot add mappings to this identity.
• You cannot modify, disable, or delete this identity.
• Beginning with PI AF 2018 SP2, this identity no longer automatically
has Read and ReadData permission. Read and ReadData permission
must be set in another of the user's mapped identities.
World This identity has read access permissions to every collection and object
on the PI AF server. It cannot be modified or deleted. Mappings,
however, can be added and removed.
By default, this identity is mapped to the Windows Everyone users
group.
1
If you have installed 2017 (version 2.9) or later versions for the first time, users need to be added to the Asset Analytics Recalculation
identity in order to backfill or recalculate. If you are upgrading from versions prior to 2017 (version 2.9), all users will automatically be
mapped to Asset Analytics Recalculation identity. It is recommended that upon upgrading, such automatic mapping for all users is
removed and users that require backfilling or recalculation permissions are explicitly mapped.
Note: In a typical installation, for security reasons, we recommend providing users with identities that grant
them the minimum viable permissions to perform the tasks for their business needs.
Security hierarchy
PI AF supports both OpenID Connect (OIDC), used for implementing claims-based authentication, and Windows
integrated security to authenticate users and establish their PI AF identities through mappings.
If you use OIDC for authentication, you can map Identity provider roles to PI AF identities to assign a group of
users to one or more PI AF identities.
PI AF uses the PI AF identities to control read, write, delete, and various other permissions on PI AF components
shown in the following illustration. Each securable PI AF object (element, event frame, and notification, and so
on) throughout the hierarchy has an associated security descriptor that contains the access permissions
information for that object.
All PI AF objects of the same type belong to a collection. For example, every PI AF element in a database belongs
to the Elements collection for that database. Each collection also has an associated security descriptor that
contains access permission information. Security descriptors for some collections are configured for an entire PI
AF server (such as Identities and Mappings), whereas others (such as Analyses, Elements, and Event Frames) can
be configured for a specific database.
PI AF hierarchy of securable collections
For more information on collection security, see PI AF collection security.
Element A child element inherits the security of its parent element if it is added as a Parent-
Child (strong) or Composition reference. For more information, see Permission
inheritance of element objects.
The security rights of an element created at the database level are derived from the
Element collection associated with a PI AF database. For more information, see PI AF
collection security.
Event frame A child event frame inherits the security of its parent event frame if it is added as a
Parent-Child (strong) reference. If an event frame does not have a Parent-Child
reference, security rights are derived from the event frame template if it was created
from a template. If it was not created from a template, security rights are derived
from the Event Frame collection associated with a PI AF database.
Note: To allow users to make changes to event frames that are based on a template,
but prevent them from modifying the source template, you configure security rights
on the event frame template by setting the following access permissions for the
associated PI AF identities:
• To prevent users from accessing or modifying an event frame template, clear the
Allow check box on the Write permission in the Security Configuration window.
See Configure security for objects to learn how to set access permissions for PI AF
identities.
• Select the Write Data permission to enable users to make changes to event frames
that are based on the template.
• Select the Read Data permission to give users the ability to view and read the
event frame object. Granting the Read Data permission on an object also grants
the Read permission.
See PI AF access rights for more information on access permissions.
Transfer If a transfer is created from a template, security rights are derived from the template.
If it was not created from a template, security rights are derived from the Transfer
collection associated with a PI AF database.
Case Security rights are derived from the analysis that owns the case.
For all other types of objects, initial security access rights are calculated from the corresponding collection
associated with a PI AF database. For example, security access rights for a notification are initially derived from a
PI AF database's Notification Rule collection.
Note: When an analysis or analysis template is associated with a legacy notification or notification template,
(Notifications 2012 or earlier), security access rights for the two objects are synchronized.
Permission inheritance of element objects
When you change access permissions for an element, the access permissions for any parent or child elements
might also change. The behavior depends on the reference type.
Parent-child reference type
When an object or collection is created, a default set of access permissions is assigned, based on the access
permissions that are set on the parent. When access permissions are set on a parent, the following Child
Permission settings on the Permissions page of the Security Configuration window are evaluated:
Option Description
Do not modify child permissions Prevents access permissions that have been set for the current object
or collection from being replicated to child collections and objects in
the PI AF hierarchy.
This option is the default when the connected PI AF server is running
2.5 and earlier versions.
Update child permissions for For each selected item on the Items to Configure list in the Security
modified identities Configuration window, replicates the access permissions for all child
collections and objects for each identity on the Identities list whose
access permissions have been modified.
This option is the default when the connected PI AF server is running
2.6 and later versions. This option is not available when the connected
PI AF server is running 2.5 and earlier versions.
Replace child permissions for all For each selected item on the Items to Configure list in the Security
identities Configuration window, replaces all child permissions for every identity
on the Identities list with the parent access permissions.
Note: Before you apply this option, be sure to review access permission
settings for all items on the Items to Configure list to avoid
unintentionally overwriting custom permissions that may have been
applied elsewhere in the collection hierarchy. Review the following
example for clarification.
Examples
The following hierarchy has three elements, each with a different access permissions setting.
Sample element hierarchy
• The Administrators and World identities have access permissions to all three elements: EasternUS,
SavannahSite, and ProductionLine1.
• The Savannah_IT identity has access to the SavannahSite element.
• The SavnEngineers identity has access to the ProductionLine1 element.
Access permissions for sample hierarchy
Suppose you want to add a CorporateEngineering identity to each element in the hierarchy. You would add the
identity to the parent element EasternUS:
Add identity to parent element
To replicate the parent permissions without affecting identities already assigned access permissions, you would
set the Child Permissions option to Update child permissions for modified entries. The security string for all
three elements shows that the CorporateEngineering identity has been added, but the other identities remain
unchanged:
Replicate identity and modify existing access permissions
To replicate the parent permissions for all identities down the hierarchy, you would set the Child Permissions
option to Replace child permissions for all identities. The security string for all three elements shows that the
CorporateEngineering identity has been added, but has replaced the access permissions with those assigned to
the EasternUS element:
Replicate identity and replace existing access permissions
Notice that the Savannah_IT and SavnEngineers identities no longer appear in the security string for the
SavannahSite and ProductionLine1 elements because they were not included in the Identities list of the parent
EasternUS element.
Composition reference type
Access permissions for child and parent are always the same.
If you change the access permissions for the child, the parent access permissions are automatically changed to
match the child permissions. Similarly, if you change the access permissions for the parent, the child access
permissions are automatically changed to match the parent permissions. These changes cascade down (and up)
through the hierarchy.
Weak reference type
Access permissions are never inherited.
PI AF access rights
The following table describes the access permissions you can assign to PI AF identities for all objects in the
hierarchy.
Access right Security string Definition
abbreviation
Read r Enables a user to view the object. Read security rights are
required to view the object in client applications. The Read
permission also enables a user to view configuration values
from attributes of elements.
The following objects always have Read permission
regardless of their security settings, so long as the logged-
in user has Read access to the PI System and the PI AF
database. The one exception is the notification contact
template, where the logged-in user only requires Read
access to the PI System:
• Analysis template
• Categories
• Element template
• Enumeration set
• Event frame template
• Model template
• Notification contact template
• Notification template
• Reference type
• Transfer template
• UOM database
Write w Enables a user to create and modify an object. The
exception is that event frames and transfers also require
Write Data permission on the element template from
which they are created, and cases require Write Data
permission on the analysis in which they are contained.
Read/Write Not applicable Enables a user to read and write to the associated object.
When selected, automatically selects the Read and Write
permissions.
Access right Security string Definition
abbreviation
Permissions tab
You can view and configure access permissions for individual or multiple items by a PI AF identity on the
Permissions tab of the Security Configuration window.
Note: If you signed on using OpenID Connect (OIDC), the Effective Access tab displays the current user's
permissions on PI AF objects.
Items to Configure list
The content of the Items to Configure list is determined by the hierarchy context and indicates whether you can
configure access permissions for the entire PI AF hierarchy, a single database and containers, or a single
container and single object.
To configure access permissions for only some of the items, you can clear those you do not want to configure.
Identities list
The Identities list contains a list of identities that have permissions for all checked items in the Items to
configure list. You use the Add and Remove functions to manage which identities appear on the list.
If the currently connected PI AF server does not support identities (PI AF 2014 or earlier), the Security
Configuration window displays access permissions for Groups or Users and you can add and remove Windows
accounts using standard Active Directory windows.
Permissions list
As each identity is selected in the Identities list, the permissions associated with that identity for the checked
entries in the Items to Configure list are shown in the Permissions list. You can allow or deny permissions as
desired for each identity without losing the changes. The access permissions you set for each identity are
retained until you click the OK, Cancel, or Apply button.
Note: If more than one Items to Configure entry is selected and the currently selected identity has one of the
permissions in one or more, but not all entries selected in the Items list, the checkbox for that permission
displays a dot ( ) to indicate some entries in the Items list have the permission set whereas some do not.
Account section
The Account section is where you enter a Windows domain user name, for example rsmith, to begin viewing his
or her permissions on items. The user's security identifier and identity mappings are also displayed in this
section.
Note: If you are using OpenID Connect (OIDC) for claims-based authentication and role mapping, the Effective
Access tab shows the OIDC user's permissions on PI AF objects. The User SID field is not shown.
Items to View Access list
The Items to View Access list is based on the items selected for security configuration on the Permissions tab. To
view a user's permissions on an item, select the item in the Items to View Access list.
Permissions list
You can view a user's specific access permissions on a selected item in the Permissions list. For more information
about assigned permissions, see PI AF access rights.
Note: You can click next to the Domain User or OIDC User field to search for a user's Windows domain
name.
The fields and lists on the Effective Access page are populated with the following information:
• User SID field: Displays the user's security identifier
• Identities list: Lists all the PI AF identities that are mapped to the Windows domain user account entered
in step 3
• Items to View Access list: Displays the item(s) selected for security configuration. This list is reflective of
the item(s) shown in the Items to Configure list on the Permissions card.
• Permissions list: Displays the access permissions for the currently selected item in the Items to
Configure list.
Note: If you are using OpenID Connect (OIDC) for claims-based authentication and role mapping, the
Effective Access tab shows the OIDC user's permissions on PI AF objects. The User SID field is not shown.
5. Click-and-drag the horizontal splitter bar up or down to adjust the amount of information shown in the list
boxes.
6. Select a different item in the Items to View Access list.
The user's access permissions for the selected item are displayed in the Permissions list. To learn more about
access rights, see PI AF access rights.
7. Repeat step 6 as needed to view access permissions for other items.
8. Click OK to exit the Security Configuration window.
PI AF server security
When PI AF Server is first installed, admin access (all permissions) is given to the built-in Administrators identity,
and read access to all objects and collections is given to the World identity. For all other identities that are
mapped to Windows users and groups, an administrator needs to configure appropriate access to the PI AF
server, databases, collections and objects.
Add or modify permissions of existing identities a. Select an identity in the Identities list.
b. In the Permissions for Identity list, select or
clear the Allow or Deny check boxes
beside the permissions you wish to set.
Add another identity to the Identities list a. Click Add.
b. In the Select Identity window, select the
identity you wish to add.
c. Click OK. The identity is added to the list.
d. In the Permissions for Identity list, set the
access permissions as needed (the
default setting is all are selected).
Tip: If you need to create a new identity and
mapping, click New Identity. For more information,
see Manage identities in PI AF.
Remove an identity from the Identities list a. Select an identity in the Identities list.
b. Click Remove.
4. Select one of the Child Permissions options. For more information, see Permission inheritance of element
objects.
5. Optional. To view all of a user's access permissions on items in PI AF based on his or her current PI AF
identity mappings, click the Effective Access tab.
6. Optional. In the Domain User field, enter a user's Windows domain name whose permissions you want to
view. If you are using OIDC, enter the user's name in the OIDC User field.
7. Optional. Press Tab or Enter to validate your entry.
8. Click OK.
Note: If you are using OpenID Connect (OIDC) for claims-based authentication and role mapping, the
Effective Access tab shows the OIDC user's permissions on PI AF objects. The User SID field is not shown.
PI AF database security
To view a PI AF database, an identity must have at least read permissions to the database object. You configure
permissions individually for each database, or for the entire databases collection.
Beginning with PI AF 2017 R2, it is no longer necessary for users to have write permission on a PI AF database in
order to have write permission on other objects in the database. Users need only be assigned an identity with
write access to objects such as elements to be able to edit them. To prevent users from having write access to
specific objects, assign them to an identity with read-only access to those objects.
Add or modify permissions of existing identities a. Select an identity in the Identities list.
b. In the Permissions for Identity list, select or
clear the Allow or Deny check box beside
each permission you wish to set.
c. Repeat for each identity.
Add another identity to the Identities list a. Click Add.
b. In the Select Identity window, select the
identity you wish to add.
c. Click OK. The identity is added to the list.
d. In the Permissions for Identity list, set the
access permissions as needed (the
default setting is all are checked).
Tip: If you need to create a new identity and
mapping, click New Identity. For more information,
see Manage identities in PI AF.
Remove an identity from the Identities list a. Select an identity in the Identities list.
b. Click Remove.
5. In the Child Permissions section, choose one of the permission inheritance options. For more information,
see Permission inheritance of element objects.
6. Optional. To view all of a user's access permissions on items in PI AF based on his or her current PI AF
identity mappings, click the Effective Access tab.
7. Optional. In the Domain User field, enter a user's Windows domain name whose permissions you want to
view. If you are using OIDC, enter the user's name in the OIDC User field.
8. Optional. Press Tab or Enter to validate your entry.
9. Click OK.
Note: If you are using OpenID Connect (OIDC) for claims-based authentication and role mapping, the
Effective Access tab shows the OIDC user's permissions on PI AF objects. The User SID field is not shown.
Add or modify permissions of existing identities a. Select an identity in the Identities list.
b. In the Permissions for Identity list, select or
clear the Allow or Deny check boxes
beside the permissions you wish to set.
c. Repeat for each identity.
Add another identity to the Identities list a. Click Add.
b. In the Select Identity window, select the
identity you wish to add.
c. Click OK. The identity is added to the list.
d. In the Permissions for Identity list, set the
access permissions as needed (the
default setting is all are checked).
Tip: If you need to create a new identity and
mapping, click New Identity. For more information,
see PI AF identities and mappings.
Remove an identity from the Identities list a. Select an identity in the Identities list.
b. Click Remove.
5. In the Child Permissions section, choose one of the permission inheritance options. For more information,
see Permission inheritance of element objects.
6. Optional. To view all of a user's access permissions on items in PI AF based on his or her current PI AF
identity mappings, click the Effective Access tab.
7. Optional. In the Domain User field, enter a user's Windows domain name whose permissions you want to
view. If you are using OIDC, enter the user's name in the OIDC User field.
8. Optional. Press Tab or Enter to validate your entry.
9. Click OK.
Note: If you are using OpenID Connect (OIDC) for claims-based authentication and role mapping, the
Effective Access tab shows the OIDC user's permissions on PI AF objects. The User SID field is not shown.
PI AF collection security
The security descriptor for a PI AF collection determines access permissions to that collection, as well as default
access permissions for new objects in the collection. For example, the Elements collection permissions
determine which identities can create and delete elements. The Elements collection permissions are replicated
as the security descriptor for any newly-created Element objects.
You can configure access permissions to collections at several points in the PI AF hierarchy. You can set them at
the server level so that permissions assigned to identities on the server are also assigned to the same identities
for every collection in every database (see Configure security for a PI AF server). You can set them at the
database level so that permissions assigned to identities in a database are also assigned to the same identities
for every collection in that database (see Configure security for a single PI AF database).
Note: Library objects (Templates, Enumeration Sets, Reference Types, Tables, Table Connections, and Categories)
always have Read (r) permission regardless of their security settings.
Add or modify permissions of existing identities a. Select an identity in the Identities list.
b. In the Permissions for Identity list, select or
clear the Allow or Deny check box beside
each permission you wish to set.
c. Repeat for each identity.
Add another identity to the Identities list a. Click Add.
b. In the Select Identity window, select the
identity you wish to add.
c. Click OK. The identity is added to the list.
d. In the Permissions for Identity list, set the
access permissions as needed (the
default setting is all are selected).
Tip: If you need to create a new identity and
mapping, click New Identity. For more information,
see Manage identities in PI AF.
Remove an identity from the Identities list a. Select an identity in the Identities list.
b. Click Remove.
3. In the Child Permissions section, choose one of the permission inheritance options. For more information,
see Permission inheritance of element objects.
4. Optional. To view all of a user's access permissions on items in PI AF based on his or her current PI AF
identity mappings, click the Effective Access tab.
5. Optional. In the Domain User field, enter a user's Windows domain name whose permissions you want to
view. If you are using OIDC, enter the user's name in the OIDC User field.
6. Optional. Press Tab or Enter to validate your entry.
7. Click OK.
Note: If you are using OpenID Connect (OIDC) for claims-based authentication and role mapping, the
Effective Access tab shows the OIDC user's permissions on PI AF objects. The User SID field is not shown.
PI AF object security
You can set specific access permissions for an identity that differ from the default settings inherited from
elsewhere in the PI AF hierarchy on any object (or object group) and collection in a database.
Add or modify permissions of existing identities a. Select an identity in the Identities list.
b. In the Permissions for Identity list, select or
clear the Allow or Deny check boxes
beside the permissions you wish to set.
c. Repeat for each identity.
To ... Do this ...
Remove an identity from the Identities list a. Select an identity in the Identities list.
b. Click Remove.
3. In the Child Permissions section, choose one of the permission inheritance options. For more information,
see Permission inheritance of element objects.
4. Optional. To view all of a user's access permissions on items in PI AF based on his or her current PI AF
identity mappings, click the Effective Access tab.
5. Optional. In the Domain User field, enter a user's Windows domain name whose permissions you want to
view. If you are using OIDC, enter the user's name in the OIDC User field.
6. Optional. Press Tab or Enter to validate your entry.
7. Click OK.
Note: If you are using OpenID Connect (OIDC) for claims-based authentication and role mapping, the
Effective Access tab shows the OIDC user's permissions on PI AF objects. The User SID field is not shown.
Configure access permissions for an analysis a. In the Elements browser, select the element
that contains the analysis.
b. Click the Analyses tab.
c. Right-click the analysis name and click
Security.
To ... Do this ...
Configure access permissions for an analysis template a. In the Library browser, select the element
template that contains the analysis
template.
b. Click the Analysis Templates tab.
c. Right-click the analysis name and click
Security.
Configure access permissions for all analyses in a PI a. On the toolbar, click Database.
AF database
b. In the Select Database window, right-click
the database name and click Security.
c. In the Security Configuration window, clear
the Item check box above the Items to
Configure list.
d. Select the database - Analyses item.
Configure access permissions for all analysis a. On the toolbar, click Database.
templates in a PI AF database
b. In the Select Database window, right-click
the database name and click Security.
c. In the Security Configuration window, clear
the Item check box above the Items to
Configure list.
d. Select the database - Analysis Templates
item.
2. In the Identities list, review the identities and validate their permissions. You can also add to and remove an
identity from the list, as described in Configure security for objects.
3. In the Child Permissions section, choose one of the permission inheritance options. For more information,
see Permission inheritance of element objects.
4. Optional. To view all of a user's access permissions on items in PI AF based on his or her current PI AF
identity mappings, click the Effective Access tab.
5. Optional. In the Domain User field, enter a user's Windows domain name whose permissions you want to
view. If you are using OIDC, enter the user's name in the OIDC User field.
6. Optional. Press Tab or Enter to validate your entry.
7. Click OK.
Note: If you are using OpenID Connect (OIDC) for claims-based authentication and role mapping, the
Effective Access tab shows the OIDC user's permissions on PI AF objects. The User SID field is not shown.
Event frames in PI AF
Capturing important events in your process and collecting relevant data around those events can help analyze
why they occurred. For example, you can closely monitor events such as asset downtime, process excursions,
equipment startup or shutdown, and environmental excursions to identify possible causes or potential points of
failure.
Collecting data around repeatable time periods such as product tracking batches, product runs, or operator shifts
can help make those processes more efficient. The capture of comprehensive data associated with such an event
helps track, compare, or analyse the process or event.
Just as elements allow you to collect and store data about assets, event frames allow you to collect and store
data about events. It is recommended you use asset analytics to track your events using event frames. PI
Datalink, AVEVA PI Vision, and PI WebParts are the client tools that support event frame visualization.
Sample event data
An event frame encapsulates the time period of the event with relevant, comprehensive asset data:
Videos
For information on event frames, watch this video:
Alternatively, you can view all the videos on the event frames playlist:
Structure of event frames
Each event frame has a name, start time, end time, one or more attributes, and one or more referenced PI AF
elements. As with elements, you should create event frame templates to standardize and manage the attributes
for different types of events.
With event frames you can easily search the PI System for the events themselves, rather than search for events
by time. You can configure event frames to return all related event data automatically in real-time so that you do
not need to query multiple systems for event and process data, and then merge them together manually. You
can also set up event frames to retrieve historical data.
When to use event frames
There are two categories of trackable events that would fit an event frame profile:
• "Good" events: Events that you want to track as a normal part of business, such as product tracking, shifts,
and so on.
• "Bad" events: Events that are unexpected and need to be analyzed and perhaps fixed quickly if they ever
occur, such as expected shutdowns or excursions. These are events that you want to track and report in
aggregate, over a period of time.
Asking questions such as these can help identify events or conditions that must be tracked:
• What are all the times that event X occurred on this type of asset?
• Can I associate data from different tags for a time-range, or for a single point in time?
• What is the associated data for a particular time period when a problem occurred or may occur in the
future?
• What are the critical process events that someone needs to be notified on?
• Are there digital states for PI tags that are significant when they change, and must they trigger other actions?
Example Explanation
.\Elements[.]\..\|Price
If the Price attribute were two levels up the hierarchy, you would use:
.\Elements[.]\..\..|Price
You can obtain the value of the Inflow PI point attribute that is assigned to the Pump 1 child element with the
following syntax:
.\Elements[.]\Pump 1|Inflow
If the Pump 1 child element were based on the Pump element template, you would use:
.\Elements[.]\[@Template=Pump]|Flow
Base Template You can base the template on an existing event frame template, which you select
from the drop-down list. For more information on base templates, see Base and
derived templates.
Severity Select a severity setting for event frames based on the template. You can choose
None (default), Information, Warning, Minor, Major, and Critical.
Note: Event frames that have already been created with a specific severity
setting are not updated automatically if the Severity setting in an event frame
template is later changed.
Categories Optional. Organize event frame templates by grouping them into element
categories. To browse available categories or to create a new category, click .
Default Attribute Optional. After you have created attributes for the template, you can select a
default attribute from the drop-down list. For more information, see Default
attribute.
Option Description
Naming Pattern Optional. You can enter a text string, or click to choose from the following
substitution parameters to define a naming pattern.
• %STARTTIME:yyyy-MM-dd HH:mm:ss.fff%
The current local start time of the object using the specified formatting.
If no formatting is specified, the default formatting is used. The
formatting uses standard format strings supported by the
DateTime.ToString method, as described in Format strings for
time substitution parameters.
• %UTCSTARTTIME:yyyy-MM-dd HH:mm:ss.fff%
The current Coordinated Universal Time (UTC) start time of the object
using the specified formatting. If no formatting is specified, the
default formatting is used.
• %TEMPLATE%
The name of the object's template.
• %@Attribute%
The value of the object's attribute template, represented by the path.
• %ELEMENT%
The name of the primary referenced element of the object's event
frame.
• %ELEMENTDESCRIPTION%
The description of the primary referenced element of the object's event
frame.
You can also use other naming pattern substitution parameters. For
example, if you want an event frame generation analysis name
included in the naming pattern, enter %ANALYSIS% as a substitution
parameter. For a complete list of naming pattern substitution
parameters, see Naming patterns.
Each element derived from the template will have a unique, identifiable
name. To ensure that new elements created from the template have
an incremental number, enter * at the end of any pattern you enter
here.
Naming patterns are re-evaluated on an event frame when the Start
time, End time, or primary referenced element is modified after it
has been created. It will not be re-evaluated when loaded from
another application. To force an element or event frame to re-
evaluate its naming pattern, right-click the object and click
Reevaluate Naming Pattern.
Some substitution parameters may not be applied when a derived event
frame is created. To ensure a derived event frame's name fully
reflects the naming pattern, right-click the event frame and click
Reevaluate Naming Pattern.
Note: The name generated by the naming pattern must be less than the
maximum name length of 260 characters.
Option Description
Allow Extensions Select this check box to enable additional attributes to be defined for an event
frame, beyond those defined in its template. For more information, see
Extensions.
Note: Categories, analyses and notifications are not affected by whether the
Allow Extensions check box is enabled.
Can Be Acknowledged Select this check box to enable users to acknowledge an event frame. For more
information, see Acknowledgment of event frames.
Note: This setting only affects event frames that are created after a template is
created or modified.
Base Template Only Select this checkbox to assign the Base Template Only (BTO) property to an
event frame template. An event frame cannot be created directly from a BTO
template. For more information, see Base and derived templates.
Extended Properties This link is an advanced feature. For more information, see Storage of
application-specific information.
Location Click this link if you wish to specify location attribute traits for the event frame
template. For more information, see Set location attribute traits.
Reason Click this link if you wish to set up reason attribute traits for the event frame
template so that users can select reason codes for downtime, excursions, and
other events. For more information, see Set reason attribute traits.
Security Click this link if you wish to set up custom access permissions to the event frame
template beyond those already established at the server and database level. For
more information, see Configure security for objects.
6. Use the Attribute Templates tab to create an attribute template for each property or data item for the
template. See Create attribute templates.
Capture values
You capture values to save event frame or transfer attribute values to a table in the PI AF database. This can
improve performance since PI AF does not execute any data references.
Note: If you add new attributes to event frames or transfers with captured values, you should recapture those
values to ensure that values are also captured for the new attributes.
1. In the navigator, click Event Frames.
2. In the Event Frames browser, choose from the following actions.
To capture values for ... Do this ...
All transfers or parent event frames in a collection a. Right-click a search or recent collection.
b. Click Capture or Recapture Values.
Alternatively, follow these steps.
c. Click a search or recent collection.
d. In the viewer, right-click below the list of
event frames or transfers.
e. Click Capture or Recapture Values.
Child event frames in a collection a. Click a search or recent collection.
b. In the viewer, click beside each event frame
for which you want to capture values.
The child event frames are displayed.
c. In the viewer, use Windows selection
keystrokes to select event frames and
child event frames:
To• select contiguous objects, press
SHIFT+<click>.
To• select non-contiguous objects, press
CTRL+<click>.
To• select all displayed objects, press
CTRL+A.
d. Right-click a selected event frame.
e. Click Capture or Recapture Values.
A single event frame a. Expand a search or a recent event frame
collection.
b. Select the event frame.
c. Choose from the following actions.
In•the General tab, click the Capture
Values link.
Right-click
• and click Capture or
Recapture Values.
Note: For subsequent value captures, the link
changes to Recapture Values.
To capture values for ... Do this ...
Transfers
Transfers are a type of event frame. They mark movement of material in discrete quantities. They have a start
time and an end time. Transfers are unique in a model because they are temporal and appear in a model only
when a transfer of material has taken place. For example, use transfers to track material movements in and out
of the facility, track raw materials used in the process and finished product being stored, and track tank-to-tank
material transfers.
Base Template You can base the template on an existing transfer template, which you select
from the list. For more information on base templates, see Base and derived
templates.
Categories Optional. Organize transfer templates by grouping them into element categories.
To browse available categories or to create a new category, click .
Default Attribute Optional. After you have created attributes for the template, you can select a
default attribute from the list. For more information, see Default attribute.
Option Description
Naming Pattern Optional. You can enter a text string, or click to choose from the following
substitution parameters to define a naming pattern.
• %TIME:yyyy-MM-dd HH:mm:ss.fff%
The current local time of the object using the specified formatting. If no
formatting is specified, the default formatting is used. The formatting
uses standard format strings supported by the DateTime.ToString
method, as described in Format strings for time substitution
parameters.
• %UTCTIME:yyyy-MM-dd HH:mm:ss.fff%
The current Coordinated Universal Time (UTC) time of the object using
the specified formatting. If no formatting is specified, the default
formatting is used.
• %STARTTIME:yyyy-MM-dd HH:mm:ss.fff%
The current local start time of the object using the specified formatting.
If no formatting is specified, the default formatting is used.
• %UTCSTARTTIME:yyyy-MM-dd HH:mm:ss.fff%
The current Coordinated Universal Time (UTC) start time of the object
using the specified formatting. If no formatting is specified, the
default formatting is used.
• %TEMPLATE%
The name of the object's template.
• %@Attribute%
The value of the object's attribute template, represented by the path.
• %SOURCE%
Name of the source element for the transfer.
• %DESTINATION%
Name of the destination element for the transfer.
You can also use other naming pattern substitution parameters. For a
complete list of naming pattern substitution parameters, see
Naming patterns.
Each transfer derived from the template will have a unique, identifiable
name. To ensure that new transfers created from the template have
an incremental number, enter * at the end of any pattern you enter
here.
Naming patterns are re-evaluated on a transfer when the Start time is
modified after it has been created. It will not be re-evaluated when
loaded from another application. To force a transfer to re-evaluate
its naming pattern, right-click the object and click Reevaluate
Naming Pattern.
Some substitution parameters may not be applied when a derived
transfer is created. To ensure a derived transfer's name fully reflects
the naming pattern, right-click the transfer and click Reevaluate
Option Description
Allow Extensions Select this check box to enable additional attributes to be defined for a transfer,
beyond those defined in its template. For more information, see Extensions.
Note: Categories are not affected by whether the Allow Extensions check box is
enabled.
Base Template Only Select this checkbox to assign the Base Template Only (BTO) property to a
transfer template. BTO templates can only be used to create derived templates.
Transfers cannot be created directly from BTO templates. For more information,
see Base and derived templates.
Extended Properties This link is an advanced feature. For more information, see Storage of
application-specific information.
Reason Click this link if you wish to set up a reason attribute trait for the transfer
template. For more information, see Set reason attribute traits.
Security Click this link if you wish to set up custom access permissions to the transfer
template beyond those already established at the server and database level. For
more information, see Configure security for objects.
6. Use the Attribute Templates tab to create an attribute template for each property or data item for the
template. See Create attribute templates.
7. Optional. Use the Ports tab to define additional ports that define end-points for connections between
transfer elements, or to modify the default In and Out ports. See Create transfer ports.
Create transfers
Default In and Out transfer ports with Boundary and Node connection types are automatically created for every
transfer.
You create a transfer in the Event Frames browser.
1. In the navigator, click Event Frames.
2. In the Event Frames browser, click the Transfer Searches (or Recent Transfers) collection.
3. To create a new transfer, choose one of the following actions:
▪ On the toolbar, click the New Transfer button.
▪ In the Event Frames browser, right-click the Transfer Searches collection and click New Transfer.
▪ In the viewer, right-click and click New Transfer.
4. In the Choose Transfer Template window, choose an existing template for the transfer. Although not
recommended, you can also choose <None>.
▪ Optional. To assign the transfer to a category, select one from the Templates of category list.
5. Click OK.
The new transfer is displayed in the viewer with three tabs for configuring the transfer. In the General tab, a
default name for the new transfer is displayed based on the naming pattern, as well as a default start time.
6. Optional. Replace the default name with a unique name and enter a description for the transfer in the Name
and Description fields.
7. Optional. You can organize objects by grouping them into categories. To browse the available categories, click
. See Categorization of objects for more information.
8. In the Start time and End time fields, enter the start and end times for when the transfer takes place. To
browse for a date, click .
9. In the Source and Port fields, select the element and port providing the material of the transfer.
10. In the Destination and Port fields, select the element and port receiving the transfer.
11. If the transfer is based on a template, a read-only value is displayed in the Default Attribute field. However, if
you are creating a transfer manually, you can select a default attribute after you have added attributes in the
Attributes tab.
12. Optional. To add an annotation to the transfer, click Annotations. For more information, see Add annotations
to transfers.
If the Allow Extensions check box is selected in the transfer template or you are creating a transfer manually,
follow these additional steps.
• Use the Attributes tab to define an attribute for each property or data item. See Create attribute templates.
• Use the Ports tab to define additional ports that define end-points for connections between transfer
elements, or to modify the default In and Out ports. For more information, see Create transfer ports.
Field Description
Allowed Categories The categories to which the port belongs. To assign categories, click and
select categories in the Categorize window.
Maximum Connections The maximum number of connections that can be made to the port. The default
number of connections for a transfer is 1. A value of zero indicates an unlimited
number of connections.
Connection Type The type of connections to which the port can connect. The default connection
types for a transfer are Boundary and Node. For more information on
connection type values, see Element types in models.
Allowed Template Defaults to all element templates, but you can select a specific template from
the list.
Chapter 12
Annotations in PI AF
Beginning with PI AF 2016, the annotation feature is used by client applications such as AVEVA PI Vision, but can
easily be used by administrators to make notes on the following objects:
• Case
• Element
• Event frame
• Model
• Transfer
File attachments
Users can attach a single file to an annotation. By default, the following file types are allowed:
File type Allowed extension
Element annotations
Users can annotate an element, as well as upload a file to link to an annotation.
Setup of element annotations
You set up an annotation by opening an Annotations window for a specific element that you have selected in the
Elements browser or viewer. In the Annotations window, you can add, edit, and delete annotations, as well as
upload, change, and delete an attachment for an annotation.
Review of element annotations
You review annotation status for an element in the Elements viewer, where an Is Annotated column is displayed
( ).
To view the content of an annotation, move the mouse pointer over the icon beside an element to see the
annotation text. If a file is attached, the name of the file is also displayed.
Asset analytics
Asset analytics is the feature in Asset Framework (PI AF) that you use to create and manage analyses. An analysis
reads values of PI AF attributes, performs calculations, and writes results to other attributes. Within PI System
Explorer, you can access asset analytics when you work with elements and element templates.
Introduction to analyses
An analysis performs calculations on a specified schedule. An analysis takes existing PI AF attribute values as
inputs and produces new outputs, either new calculated values or new event frames. Every analysis has an
associated element or element template.
The following types of analyses are available:
• Expression
Calculates one or more output values from specified functions, operators, and input values.
• Rollup
Calculates standard statistical functions for a group of selected attributes. This group is selected from
attributes on an element or from the set of all attributes on its sub-elements.
• Event frame generation
Starts or ends event frames based on specified conditions.
• SQC
Uses Statistical Quality Control (SQC) methods to monitor that attribute values lie within predetermined
boundaries.
All analyses can be created from analysis templates with either Enabled or Disabled status; by default, analyses
will be enabled when created. To create an analysis with Disabled status, make sure to clear the Enable analyses
when created from template check box in the analysis template.
For event frame generation analyses and SQC analyses with event frame outputs, you can create a notification
rule template by clicking Create a new notification rule template for Analysis Template Name.
For expression analyses and event frame generation analyses, you specify inputs in expressions.
For event frame generation analyses (running PI Analysis Service 2017 R2 or later versions), expression and
rollup analyses, you can map analysis outputs to PI AF attributes. If you map outputs to attributes configured as
PI point data references, the analysis saves the history of the output to a PI point. We recommend you save
analysis outputs to PI points. You can use the PI point in visualization tools to view the trend of the analysis.
Saving outputs to PI points also results in better PI AF performance than saving outputs to attributes without
data references.
Note: PI Analysis Service does not use exception reporting while writing to output configured as PI point data
references. Although exception settings for the output PI point are not used, compression settings for the output
PI point will be used to determine the outputs that are written to Data Archive.
Starting from PI AF 2018 SP2, analyses will honor the display digits configured on an attribute or attribute
template. Values you see when you evaluate an analysis or preview results will display the same number of digits
as your output attribute so long as you have mapped your output attribute. For more information, see Control
the display of attribute and attribute template values.
Analysis templates
To apply an analysis to an element, you specify the element directly as you create the analysis. However, to apply
an analysis to a group of elements (created from the same element template), it is much more efficient to use an
analysis template than to apply the analysis individually to each element.
An analysis template defines the form of an analysis. Analyses derived from it are all similar but have specific
input and output attributes. Analysis templates let you take advantage of your PI AF hierarchy. Every element
derived from an element template automatically acquires analyses from its analysis templates.
You create an analysis template on an element template in much the same way you create an analysis on an
element. When you add or change an analysis template on an element template, those changes propagate to
every element derived from the element template. Deleting an analysis template deletes all analyses derived
from it, except for analyses tied to notifications.
With PI Server 2015 R2 and later versions, while creating an analysis template on an element template that is
derived from a base element template, you can choose input attributes from attribute templates that are
defined on derived as well as base element templates. Similarly, you can map analysis outputs to derived as well
as base template attributes.
Note: An analysis derived from an analysis template cannot be removed from an element directly.
To create specific types of analysis templates, see:
• Create an expression analysis template
• Create a rollup analysis template
• Create an event frame generation analysis template
• Create an SQC analysis template
Analysis scheduling
Each analysis requires you to specify scheduling. Scheduling indicates when to evaluate an analysis automatically.
There are two types of scheduling:
• Periodic
With periodic scheduling, evaluation occurs based on clock time (DateTime object expressed as
Coordinated Universal Time (UTC)). You can specify a specific time for evaluation each day or the
time between evaluations. With PI Server 2015 R2 and later versions, the maximum frequency you
can set for analyses is 120 times per second.
Note: If you have analyses that are previously configured to run more than 120 times per second, you must
reduce the period to less than the allowed maximum, else they will generate errors while running with PI
Server 2015 R2. Similarly, if you are setting periodic scheduling outside of the PI System Explorer user
interface, make sure that the period is set to less than the allowed maximum.
If the period is not divisible by the 24, 7 minutes for example, the evaluation time will reset at the beginning
of each day. Let's say you have scheduled the analysis to run every 7 minutes and the last evaluation was at
11:56pm. The next evaluation will be at midnight (4 minutes later), not at 12:03am the next day.
• Event-Triggered
With event-triggered scheduling, evaluation occurs based on events. You can specify one or more
input attributes that trigger an evaluation whenever the attribute value changes.
Note: When auto-backfilling is enabled, triggering events with time stamps before analysis service start-time
are ignored for the purpose of real-time evaluation. For more discussion on real-time evaluation and auto-
backfilling, including the setting of the AutoBackfillingEnabled configuration parameter, see Analysis service
configuration.
By default, analyses use event-triggered scheduling, triggered on changes to any input.
Many factors affect the speed that an analysis runs and writes output values:
• System architecture, including inputs and outputs
• Network configuration
• Load and performance of different computers
Monitor and test your analyses, especially those scheduled at high frequencies, to ensure the system resources
support the configuration.
Output time stamps for analyses
For any scheduled analysis, the default time stamp for output values is the trigger time. For periodic scheduling,
the trigger time is the scheduled evaluation time, and for event-triggered scheduling, the trigger time is the time
that a specified attribute changes values.
You can specify the time stamp of analysis output values. By specifying an output time stamp, you can:
• Produce results that are time-stamped at a specified offset from the trigger time.
• Produce results that are time-stamped at a particular time each day, regardless of when the analysis is
actually evaluated. For example, you can ensure a 6:00 p.m. time stamp for the output of an analysis that
calculates results for a daily production shift ending at 6:00 p.m., even if the analysis is not actually evaluated
until 10:00 p.m.
• Repeatedly evaluate an analysis to calculate a forecast value for a particular date and time, as input
conditions change. The results of each evaluation have the same timestamp: the analysis output values
reflect results from the most recent evaluation.
V1 'Att1'/2
V2 'Att2' - 'Att3'
Result V1 + 3*V2
Analyses with multiple expressions evaluate the expressions in order: the top row first, the one below it next,
and so on. Because expressions in lower rows may depend on results from higher rows, you can reorder the rows
to evaluate them in the proper order.
You can click Add a new variable to add a row and the icon to delete it.
Tip: You can add a line break within the expression by clicking shift+enter.
You can make your expressions easier to read by adding comments next to or within an expression. Use double
slash (//) to introduce a comment or place the comment between slash asterisk (/*) and asterisk slash (*/).
// Add comments here
IF x THEN y ELSE /*Do this if x is false*/ z
Expression specification
To create an expression, click in the Expression column of a row and then specify the input attributes, variables,
and functions that define a calculation. You can do the following:
• Select and insert attributes and functions into the expression from the Functions and Attributes panels to
the right of the expression.
• Enter the text directly into the expression. As you type, functions, attributes, and variables that match what
you entered appear in a selection list at the cursor: you can select an item you want to insert.
• Attributes and time expressions are enclosed in single quotes.
• Strings are enclosed in double quotes.
Name Expression
You can refactor the expression into the following three rows that contain simpler expressions. Note that the
third row uses the names of the earlier rows as variables.
Name Expression
Variable1 'LongAttributeName'
Expression analyses
Expression analyses calculate one or more output values from specified functions, operators, and input values.
You specify the inputs and calculations for these analyses in expressions. You can map any output that an
expression calculates to an attribute. You must map at least one output to an attribute.
You can map the output to an existing attribute or you can create a new attribute when you map the output. If
you create a new attribute when you map the output (from the Analyses tab in PI System Explorer), you must
choose whether or not to save the output history; the system creates the appropriate type of attribute:
• If you choose to save output history, the system creates an attribute with a PI point data reference and
creates a PI point in the specified Data Archive. With the output saved in a PI point, you can use visualization
tools to see the trend associated with the calculation, and you can retrieve the value for any time that the
analysis performed the calculation. The analysis calculates and stores a value as specified by the analysis
schedule.
• If you choose not to save output history, PI System Explorer creates an attribute with an analysis data
reference. An analysis only calculates the value for expressions mapped to attributes with an analysis data
reference when requested. For best performance, map output attributes to attributes with analysis data
references if you only need to know the most recent value and do not need previous values.
Map the output to an existing attribute template Click the name of the attribute template.
Select an attribute template with a PI point data
reference to store the history of the calculation. For
best performance when you do not require history,
use an attribute template with an analysis data
reference.
To ... Do this ...
Map the output to a new attribute template 1. Click New Attribute Template to open the
Attribute Template Properties window.
2. Indicate whether the attribute should save the
history of the output:
▪ Click Yes to create an attribute with a PI point
data reference. This attribute saves the
history of the output.
▪ Click No to create an attribute with an
analysis data reference. This attribute
calculates a new value when requested.
3. Configure the attribute template to create:
▪ Name
Name of created attribute.
▪ Description
Optional text that describes the attribute.
▪ Data Server
For attributes that save output history,
the Data Archive server that stores the PI
point data reference. By default, this is
set to %Server%, which sets to the default
Data Archive server.
▪ Value Type
The data type the attribute stores.
After creating the attribute template, you can
refine its definition from the Attribute
Templates tab.
4. Click OK to create the attribute template.
1. Optional. If you specified an example element, click Evaluate to verify that output values of individual
expressions.
Specify scheduling for the analysis. See Analysis scheduling.
2. Optional. If you specified an example element, verify the analysis by reviewing the results produced with
historical data:
a. In the analysis list, right-click the analysis and then click Preview Results.
b. Enter a start time and end time not later than the current time, and click Generate Results to see a list of
results.
3. To apply changes and save your work locally, click on the toolbar.
4. Click Check In on the toolbar to save the analysis template to the PI AF server and to create the analysis for
any element based on the element template.
Map the output to an existing attribute Click the name of the attribute.
Select an attribute with a PI point data reference to
store the history of the calculation. For best
performance when you do not require history, use
an attribute with an analysis data reference.
Map the output to a new attribute 1. Click New Attribute to open the Attribute
Properties window.
2. Indicate whether the attribute should save the
history of the output:
▪ Click Yes to create an attribute with a PI
point data reference. This attribute saves
the history of the output.
▪ Click No to create an attribute with an
analysis data reference. This attribute
calculates a new value when requested.
3. Configure the attribute:
▪ Name
Name of created attribute.
▪ Description
Optional text that describes the
attribute.
▪ Data Server
For attributes that save output history,
the Data Archive server that stores the
PI point data reference. By default, this
is set to %Server%, which sets to the
default Data Archive server.
▪ Value Type
The data type the attribute stores.
After creating the attribute, you can refine
its definition from the Attributes tab.
4. Click OK to create the attribute.
1. Optional. Click Evaluate to verify the output values at both Value at Last Trigger and Value at Evaluation
times.
Specify scheduling for the analysis. See Analysis scheduling.
2. Optional. To verify the analysis, review the results produced with historical data:
a. In the analysis list, right-click the analysis and then click Preview Results.
b. Enter a start time and end time not later than the current time, and click Generate Results to see a list of
results.
3. To apply changes and save your work locally, click on the toolbar.
This does not run the analysis.
4. Click Check In on the toolbar.
PI System Explorer saves and checks in your analysis, and then starts running the analysis.
Rollup analyses
A rollup analysis calculates statistical values such as sum and average for selected attributes associated with an
element. For example, a rollup analysis on a factory element might use temperature attribute values for all
pumps in the factory to calculate their average temperature.
You can choose either of two sources for attributes to include in a rollup analysis:
• Attributes of the element
For example, you want to verify that the level of a tank is constant by checking that all inflows and outflow
sum to zero. From the list of the tank element's attributes, select its inflow and outflow attributes for a
summation calculation. A rollup using an element's own attributes is also known as an aggregation.
• Attributes of the element's child elements
For example, you want to calculate average energy consumption for a group of pumps in a refinery. To do
that, you create a roll-up analysis on the parent element (the refinery) that averages energy consumption
attributes from its child elements (pumps).
Use selection criteria to select attributes for rollup. You can select attributes that match attribute name text you
enter or that are associated with a category or element template you specify.
With PI Server 2015 R2 and later versions, you can select child attributes for rollup analyses. For more
information, see Create a rollup analysis.
You must specify one or more functions to calculate statistics on the selected attributes in the rollup (see Rollup
analysis functions). Be sure each output is mapped to an output attribute.
Be aware that:
• You should select attributes carefully to obtain sensible results. Avoid selecting a set with mixed units of
measure (UOM; such as temperature and mass) or value types (such as numeric values and time stamps). As
long as the inputs and outputs have different units within the same UOM class, the system makes reasonable
effort to convert the input units to that of the output for calculation.
• You can add or delete elements or attributes in your hierarchy without the need to update roll-up analyses.
Because a rollup identifies input attributes each time it is executed, it automatically includes any new
attributes that meet its selection criteria.
• Some selected attributes (such as those with string values) will not participate in rollup calculations, which
operate only on numeric or DateTime values.
This element To the left of the table, specify criteria that select
attributes to roll up:
• Attribute Name
Type an entire attribute name or part of
a name with wildcard characters. For
example, type temp* to select all
attributes that begin with "temp",
such as Temperature and Temp1.
Note: The selection of attributes
depends on whether Attribute Level
is set to "Root Level" or "Child Level".
• Attribute Level
Select Root Level to choose from top-
level attributes or Child Level for
child attributes. You cannot choose
both child attributes and top-level
attributes in a single roll-up analysis.
• Attribute Category
Select a category to limit selected
attributes to that category.
The table shows a check mark next to any displayed attribute included in the rollup.
10. In the functions table, specify the rollup calculations and output:
a. Select the check boxes next to any statistical function you want the rollup to calculate.
b. Click Map to store results from a calculation to an output attribute.
You can map the output to an existing attribute or map the output to a new output attribute.
c. Optional. At the top of the table, click Evaluate to verify the output values of the selected functions.
11. Optional. To verify the analysis, examine the results produced with historical data:
a. In the analysis list, right-click the analysis and then click Preview Results.
b. Enter a start time and end time not later than the current time, and click Generate Results to see a list of
results.
12. To apply changes and save your work locally, click on the toolbar.
13. Click Check In on the toolbar to save the analysis template to the PI AF server and to create the analysis for
any element based on the element template.
Child elements a. From the Sample Child Element list, select the elemen
you want to view attributes.
The table shows attributes of the selected element
performance, the table only shows a limited nu
attributes. You can click the Show more attribu
below the table to show additional attributes fr
selected element.
b. To the left of the table, specify criteria that select attrib
up:
Attribute
• Name
Type an entire attribute name or part of a name wi
characters. For example, type temp* to select a
that begin with "temp," such as Temperature a
Note: The selection of attributes depends on whet
Level is set to "Root Level" or "Child Level".
Attribute
• Level
Select Root Level to choose from top-level attribut
Level for child attributes. You cannot choose bo
attributes and top-level attributes in a single ro
analysis.
Attribute
• Category
Select a category to limit selected attributes to tho
category.
Element
• Category
Select an element category to limit selected attribu
attributes that have parent elements in that cat
Element
• Template
Select an element template to limit selected attribu
attributes that have parent elements based on
template.
Note: The criteria apply to all attributes of the
child element, not just those shown in the
You can specify criteria that select attributes not sh
table. For example, if you set Sample Child Elem
element from category CatX but set Element Ca
CatY, you will select none of the attributes in th
the analysis will still include the attributes in th
If rollup attributes come from ... Do this ...
This element To the left of the table, specify criteria that select attributes to r
• Attribute Name
Type an entire attribute name or part of a name wi
characters. For example, type temp* to select a
that begin with "temp," such as Temperature a
Note: The selection of attributes depends on whet
Level is set to "Root Level" or "Child Level".
• Attribute Level
Select Root Level to choose from top-level attribut
Level for child attributes. You cannot choose bo
attributes and top-level attributes in a single ro
analysis.
• Attribute Category
Select a category to limit selected attributes to tha
The table shows a check mark next to any displayed attribute included in the rollup.
10. In the functions table, specify the rollup calculations and output:
a. Select the check boxes next to any statistical function you want the rollup to calculate.
b. Click Map to store results from a calculation to an output attribute.
You can map the output to an existing attribute or map the output to a new output attribute.
c. Optional. At the top of the table, click Evaluate to verify the output values of the selected functions.
11. Specify scheduling for the analysis. See Analysis scheduling.
12. Optional. To verify the analysis, review the results produced with historical data:
a. In the analysis list, right-click the analysis and then click Preview Results.
b. Enter a start time and end time not later than the current time, and click Generate Results to see a list of
results.
13. To apply changes and save your work locally, click on the toolbar.
This does not run the analysis.
14. Click Check In on the toolbar.
PI System Explorer saves and checks in your analysis, and then starts running the analysis.
SQC analyses
Using PI System Explorer, you can create SQC analyses that use standard Statistical Quality Control (SQC) tests to
determine if the value of a PI AF attribute lies within user-specified margins of error. Further, you can specify
either attributes or event frames as outputs of your SQC analysis.
The following SQC pattern tests may be selected:
• Outside Control:
Counts the number of samples outside the control limit on one side of the center line.
• Outside 2 Sigma:
Evaluates the sample against a limit drawn 2/3 of the way between the center line and the control limit.
• Outside 1 Sigma:
Evaluates the sample against a limit drawn 1/3 of the way between the center line and the control limit.
• One Side of Center Line:
Counts the number of samples on one side of the center line.
• Stratification:
Counts the number of samples that fall within the upper and lower One Sigma limits on both sides of the
center line.
• Mixture:
Counts the number of samples that fall outside the upper and the lower One Sigma limits on both sides of
the center line.
• Trend:
Counts the number of samples which are increasing or decreasing in a monotonic sequence.
Sample analyses
The sample analyses in this section perform the following calculations in the same PI AF database:
1. Uses an expression type analysis to track the deviation from target efficiency for the asset and processes
represented by the element, Ethylene.
2. Creates a template to generate a set of rollup analyses that aggregate the total power draw of all processes
at a refinery. The element template from which the element for each refinery was created is called Refinery.
3. Creates event frames to capture data any time the 15-minute running-average efficiency for the element,
Ethylene, drops below 90%.
Management of analyses
The Management feature enables you to use analyses and notification rules. For information on how to manage
notification rules, see Management of notification rules.
When you select the Analyses option in the Management window, information about your analyses is shown on
the Analyses tab. Information about your PI Analysis Service's performance is found on the Performance,
Service Summary, and Service Details tabs.
You can also manage, search for, backfill or recalculate, and enable or disable analyses from this window. See
Management window to learn more.
Note: The Management feature is only available if your installation of PI System Explorer includes the
Management plug-in.
Management window
The Management window is where you view and manage your analyses and notification rules.
Analyses option
The Analyses option allows you to see performance details for both analyses and the PI Analysis Service. It also
provides access to search and operations features.
The table below lists the sections in the Management window when the Analyses option is selected.
Numbered section Description
1. Analysis Searches Allows you to search for analyses. See Search for analyses.
2. Management tabs Provides access to information about performance for both analyses and the
service statistics.
3. Analyses list Contains a list of all the analyses in the current AF database.
4. Analysis Details Lists configuration details and error and warning messages for the selected an
5. Operations Provides access to enable/disable, automatic calculation, and other operation
6. Pending Operations Shows the status of bulk operations for analyses when the Analyses tab is op
Note: The Analyses tab lists details for analyses in the currently selected AF database only. The other three tabs
-- Performance, Service Summary, and Service Details -- provide details on analytic performance across the
entire AF server.
Analyses tab
The Analyses tab displays information about analyses in these columns:
• Status
• (Automatic recalculation)
• (Analysis Type)
• Element
• Name (of analysis)
• Template
• Backfilling (status)
Note: Click one or more column headers to sort analyses by element, name or template.
On the Analyses tab, you may see the number of analyses depicted with the "~" character, or with the word
"about"; for example: "~1000" or "1-500 of about 1000". In certain cases, the exact number of analyses is
unknown until they all are loaded.
• Analysis selection
Each page of results can contain up to 500 individual analyses.
Use the following techniques to quickly select analyses on the Analyses tab:
To• select one or more analyses: Select the check box to the left of an analysis.
To• select all analyses on the current page: Click the checkbox on the top-left corner.
To• select all analyses in the results (when more than 500 analyses exist): Click the checkbox on the
top-left corner then click the Select all analyses on all pages link.
Note: Clearing specific analyses automatically makes your subsequent operation page-based. For
example, if you first select all 1000 analyses, and then clear two, the operation will be performed
on 498 (500 minus 2) and not 998 (1000-2) analyses.
• Operations
You can enable, disable, or backfill/recalculate the analyses you have selected. For specific selection
criteria, see the "Analysis selection" section above. From PI AF 2017 R2 and later, you can enable or
disable automatic recalculation of the analyses you selected. For more information, see Enable or
disable automatic recalculation for multiple analyses.
Execute permission on analyses you wish to backfill/recalculate data is required. Proper permission can
be obtained by mapping your account to the Asset Analytics Recalculation identity. Manual
recalculation is only available for PI Analysis Service 2016 R2 or later. In addition, the PI Data Archive
that stores PI points must run version 2016 R2 or later. For more information, see Backfill or
recalculate data for multiple analyses.
Expression, rollup, or Statistical Quality Control (SQC) analyses can backfill or recalculate data if the
analysis outputs are mapped to PI point attributes. If PI points already have data for the backfill time
period, you can retain existing data and fill in missing data, or delete the data and recalculate.
Event frame generation analyses can also recalculate event frames over a specified time period. The
recalculation process, regardless of the selected option, automatically deletes all existing event
frames for that time period, as well as annotations on affected event frames.
• Pending Operations
See the status of following bulk operations: enable, disable, backfill or recalculate a group of analyses.
• Analysis details
Select an analysis to view detailed information.
To• see a summary of the analysis configuration and status, click the Overview tab.
To• see error details, click the Errors and Warnings tab.
To• view or edit the selected analysis, click Analysis Configuration to go to the Analyses tab of its
associated element.
Sort analyses by element, name or template. Select a column header to sort analyses data by the co
order.
Filter all analyses on the current page by keyword(s). Enter search criteria in the Filter text box, then press E
Note: Use the Filter text box to search only analyses o
Remove a search filter from the current page. Delete the search criteria in the Filter text box.
Filter all analyses in the current AF database. See Search for analyses.
View an analysis' type, description, name, element path, Select the checkbox to the left of an analysis in the tab
template, schedule, and any assigned categories.
Note: Information is displayed on the Overview tab of
View error or warning messages for an analysis. Select the checkbox to the left of an analysis in the tab
Enable or disable an analysis. Select the checkbox to the left of an analysis in the tab
Enable or disable an automatic recalculation for an analysis. Select the checkbox to the left of an analysis in the tab
View or edit a selected analysis. Select an analysis in the table, then select the Analysi
Opens the Analyses tab of the associated element.
Note: To enable or disable a group of analyses, select the checkbox to the left of the first analysis, then navigate
to the last analysis and [SHIFT+Click] the checkbox next to it. You can then select and apply the desired operation
from the right pane under the Operations heading.
See Backfilling and recalculation of analyses and Backfill or recalculate data for multiple analyses to learn more
about these tasks.
Performance tab
The Performance tab in the Management window provides helpful insights into individual analytic and group
analyses performance. The metrics on this tab can help identify potential issues and problematic analyses.
Note: The analyses on the Performance tab are retrieved from the default PI AF Server, not just the current AF
database.
From this tab, you can perform the following tasks:
• View analysis performance
• Sort analyses by column headers
• Add and remove column headers
• Filter analyses
• Export table data to a file
By default, analyses are grouped by element template with the following column headers and data shown:
Default column heading Shows...
Template path The path of the AF element template where an analysis is stored.
Indicates the depth of the analysis or analysis group in a dependency chain. Analyses wh
do not come from any other analyses are rank 0. For example, an analysis with 1 or more
that are outputs of rank 0 analyses is rank 1. An analysis with 1 or more input attributes
Rank
rank 1 analyses is rank 2. The rank of a given analysis corresponds to the deepest input a
dependency chain, no rank N analyses will be evaluated until every related analysis of ra
been evaluated for that same timestamp.
Total Evaluation Count The total number of times an analysis was evaluated.
The average amount of lag time in milliseconds between when the analysis should have
Average Lag (ms)
actually ran.
Average Success Ratio The ratio of the average number of times an analysis successfully ran.
Average Error Ratio The ratio of the average number of times an analysis failed due to an error.
Skipped Evaluation Count The count of the number of times an analysis evaluation was skipped.
When an analysis is triggered at a timestamp that is prior to the latest trigger time, that
Out of Order Ignored Count out of order and discarded. This indicates that one or more input attributes received trig
out-of-order with respect to one or more other triggering input attributes.
Column heading Shows...
This indicates that the Analysis or group received a triggering event that matched exactly
trigger time. This may be harmless and simply indicate that one or more inputs received
Duplicate Ignored Count
the same time with the same timestamp, or it could indicate that one of the triggering in
data.
Skipped Evaluation
The percentage of skipped evaluations since the Analysis Service started.
Percentage
The amount of time in milliseconds between the expected time an analysis was suppose
Current Lag (ms)
trigger or schedule and the actual time it executed.
The amount of lag time in milliseconds that an analysis execution was delayed due to wa
Current Scheduling Lag (ms)
evaluation queue.
The lag time in milliseconds between how long it took the Analysis Service to start and fi
Current Evaluation Lag (ms)
evaluation.
Indicates the average number of analyses running in the group since the service started
Average Analysis Count will stay constant at the number of analyses that belong to the group, but can fluctuate i
enabled or disabled over time.
First Trigger Time The time that the first trigger executed an analysis for evaluation.
Last Trigger Time The time that the last trigger executed an analysis for evaluation.
Select a column header to sort analyses data in ascending order (A-Z or highest
Sort analyses by a
to lowest value). Select the column header again to sort analysis data in
column header
descending order.
Reorder columns Drag-and-drop a column header to a new position.
To... Do this...
Filter analyses by
keyword or character Enter search criteria in the Filter text box, then press Enter.
string
Remove a search filter Delete the search criteria in the Filter text box.
Show or hide column Select the icon, then select a column header to add or remove it from the
headers table.
Display all column
headers Select the icon, then select Show All Columns.
Ungroup or group
analyses by AF element Select the Group by: Template checkbox to clear or select this option.
template
Export analytic data to a Select the Export button to open the Save As dialog, navigate to the desired
CSV file folder location, enter a file name in the File name text box, then select Save.
Use a provided search Select All, Enabled or Disabled. These are view-only
and cannot be modified, as indicated by the (View
selected search) icon.
To Then
Create a custom search Note: Customized search is only visible to the user
who created it on the computer where it was created.
Creating your own search is a new feature in PI AF
2017. Refer to the previous versions of PI System
Explorer User Guide if you are using an earlier version
of PI AF.
Service Startup The amount of time between the initial startup of the AF Analysis Service and when
Time the calculation of analytics began.
Calculations per
The average number of analytics calculations evaluated per second.
Second
Skipped
The total number of calculations skipped by the AF Analysis Service since its startup.
Calculations
Max. Calculation The latency of the worst-performing analysis since the startup of the AF Analysis
Lag Service. This metric includes a built-in wait time of 5 seconds.
Cache Hit to Miss The ratio of the number of AF analysis inputs retrieved from the cache to the number
Ratio of analysis inputs not in the cache.
Max. Update
The time taken to update the cache for any AF analysis input.
Duration
The AF analysis template with the highest average trigger ratio. This ratio should be
Highest Trigger
less than 1. This ratio is defined as the template's average elapsed time divided by its
Ratio
average trigger time.
Service Details tab
The Service Details tab contains statistics on PI Analysis Service operations and installed PI AF plug-ins. The
amount of information shown on this tab depends on which version of the PI Analysis Service is installed. To
ensure access to the newest statistics and improvements, we strongly recommend you upgrade to the latest
version. See also View analysis service statistics.
The following table provides a description of the main sections shown on this tab.
Note: Do not use the information on this tab to troubleshoot performance issues. Instead, use the Performance
and Service Summary tabs. See View analyses details and View analytic performance data.
Expression, rollup, or SQC analyses only Decide how existing data should be treated:
• To ensure that existing data is retained and
only missing data is backfilled, select Leave
existing data and fill in gaps.
• If input data or analysis algorithms have
changed and you want to delete existing
output data, select Permanently delete
existing data and recalculate.
To backfill or recalculate ... Do this ...
A mix of analyses that includes event frame Perform one of the following actions:
generation analyses
• Keep Leave existing data and fill in gaps
or selected and acknowledge that event frames in
the time range will be permanently deleted
More than a page of analyses selections
along with all annotations on those event
frames.
• Select Permanently delete existing data and
recalculate. All annotations on event frames
will be lost.
• Optional. Check the box next to
Recalculate dependent analyses to queue
all dependent analyses for manual
recalculation.
• Selecting this option may cause
recalculation to occur multiple times
for dependent analyses
• The recalculation time range for
dependent analyses may be different
than the time range you selected when
queuing recalculation
There are three factors affecting the recalculation time range of dependent analyses:
• Time range of the original analysis
• How the output of the original analysis is used in the dependent analyses
• Whether or not the output time override is configured in the original analysis
8. Click Queue to start multiple backfills or recalculations.
9. Review the Pending Operations pane for details on the backfill or recalculation status.
Abs
Return the absolute value of an integer or real number.
Syntax
Abs(x)
Arguments
• x
An integer or real number
Returns
The absolute value of x
Exceptions
Return an error value if x is not an integer or real number
Notes
Unit of measure of the argument, if it exists, is carried over to the result
Example
• Abs(-2.2)
[Returns 2.2]
• Abs('att1')
[Return the absolute value of 'att1' at trigger time]
Acos
Return the inverse cosine (arccos) of an integer or real number. The inverse cosine of x is the angle in radians
whose cosine is equal to x.
Syntax
Acos(x)
Arguments
• x
Must be a real number between -1.0 and 1.0, inclusive
Returns
The inverse cosine of x, in radians
Exceptions
If x is not a number, or is less than -1.0 or greater than 1.0, returns an error value
Example
• Acos(-0.5)
[Returns 2.0944]
• Acos(0.75)
[Returns 0.72273]
AND
The logical conjunction of two expressions that returns True if both expressions are true and False otherwise.
Syntax
expression1 AND expression2
Arguments
• expression1, expression2
Any expression that evaluates to true or false
Returns
True if both expressions are true (non-zero) and False (zero) otherwise
Exceptions
None
Notes
If the inputs are numeric, AND can do bitwise operations.
Example
• ('att1' > 50) AND ('att2' = "good")
ArrayLength
Get the length of an array.
Syntax
ArrayLength(a1)
Arguments
• a1
a variable representing the array to operate on
Returns
The number of values in the array
Exceptions
None
Notes
None
Example
• ArrayLength(Data)
[Return the number of values in an array named Data]
Ascii
Return the ASCII character code of the first character of a string.
Syntax
Ascii(s1)
Arguments
• s1
Any expression evaluating to a string
Returns
The character code of the first character of the string
Exceptions
If the argument is not a string, an error value is returned
Example
• Ascii("D")
[Returns 68, the ASCII character code for D]
• Ascii("Program")
[Returns 80, the ASCII character code for the first letter of the string]
Asin
Return the inverse sine (arcsin) of a number. The inverse sine of x is the angle in radians whose sine is equal to x.
Syntax
Asin(x)
Arguments
• x
Must be a real number between -1.0 and 1.0, inclusive
Returns
The inverse sine of x, in radians
Exceptions
If x is not a number, or is less than -1.0 or greater than 1.0, an error value is returned
Example
• Asin(-0.5)
[Returns -0.5236]
• Asin(TagVal('att1','y+8h'))
[Return the inverse sine of the value of 'att1' at 8am yesterday]
• Asin('att1')
[Return the inverse sine of the value of 'att1' at trigger time]
Atn
Return the inverse (or arc) tangent of an integer or real number. The inverse tangent of x is the angle in radians
whose tangent is equal to x.
Syntax
Atn(x)
Arguments
• x
Must be an integer or real number
Returns
The inverse tangent of x, in radians
Exceptions
Returns an error if x is not an integer or real number
Example
• Atn(1)
[Returns 0.7854]
• Atn(-2.2)
[Returns -1.1442]
• Atn('att1')
[Return the inverse tangent of the value of 'att1' at trigger time]
• Atn('att1' - 'att2')
[Return the inverse tangent of the difference of 'att1' and 'att2' at trigger time]
Atn2
Return the inverse tangent (arctan) of a tangent value a/b. The inverse tangent is the angle measured in radians
from the positive x-axis to a line whose endpoints are the origin and the Cartesian coordinates (b, a).
Syntax
Atn2(x, y)
Arguments
• x
An integer or real number
• y
A non-zero integer or real number
Returns
The inverse tangent in radians of the tangent value x/y
Exceptions
Returns an error if x or y is not an integer or real number
Example
Atn2(1,2)
• [Returns 0.46365]
Atn2('att1', 'att2')
• [Return the inverse tangent in radians of the tangent value 'att1'/'att2' at trigger time]
Atn2(TagVal('att1','y+8h'), TagVal('att2', 'y+8h'))
• [Return the inverse tangent in radians of the tangent value 'att1'/'att2' at 8am yesterday]
Avg
Return the time-weighted or event-weighted average from a set of one or more values.
Syntax
Avg(x1 [, ... xn])
Avg(array [, calculationBasis])
Arguments
• x1, ... xn
Arguments or a single array of same value type (integers and real numbers, time expressions, or time
intervals)
• calculationBasis
Optional. The type of calculation to be performed enclosed in double quotes. Choose between
"EventWeighted" or "TimeWeighted." If omitted, the default is event-weighted. If you select
"TimeWeighted," the earliest timestamp of the value marks the start time and the latest timestamp the end
of a time range
Returns
The average of one or more values. The result is of the same data type as arguments
Exceptions
Arguments whose run-time values are character strings or digital states are not included in the average. If all
values are character strings or digital states, Avg returns an error value. Returns an error if the array does not
consist of same value type
Notes
• Unit of Measure (UOM) of the arguments is carried over to the result when at least one argument has a
defined UOM while others don't. The returned value lacks a UOM if arguments have different UOMs
Example
• Avg(14, 'att1', 14.5, TagVal('att2', '14-Dec-16'))
[Find the average of these values: 14, the current value of 'att1', 14.5, and the value for 'att2' at the start of
day (12:00am) on Dec 14, 2016]
• Avg('*', 'y+8h', 'Saturday')
[Find the average of these time stamps: now, 8:00am yesterday, and start of day (12:00am) last Saturday]
• Avg('*'-'*-1h', 't+4h'-'y+8h', 'y+2h'-'20')
[Find the average of these time periods: from 1 hour ago to now, from 8:00am yesterday to 4:00am today,
and 2:00am yesterday to the start of day (12:00am) on the 20th of this month]
• Avg(Variable1)
Name Expression Value at Evaluation
Variable 2 Avg(Variable1) 5
[Find the average of values in an array named Variable1]
• Avg(Data)
[Return the event-weighted average of values for an array named Data]
• Avg(Data, "EventWeighted")
[Return the event-weighted average of values for an array named Data]
• Avg(Data, "TimeWeighted")
[Return the time-weighted average of values for an array named Data using the earliest timestamp of the
value as the start time and the latest timestamp as the end time]
BadVal
Test a value to see if it is bad. For an attribute associated with a PI point, any system digital state value is
considered bad (No Data or Calc Failed, for example).
Syntax
Badval(x)
Arguments
• x
any expression evaluating to a value
Returns
True if the value is bad
False if the value is not bad
Exceptions
Returns True for blob PI points. Returns False for string PI points
Example
• BadVal(1/0)
[Returns True]
• BadVal(10)
[Returns False]
• BadVal('att1')
[Returns True if the value of 'att1' is bad]
• BadVal(FindEq('att1', 't', '*', 10))
[Returns True if the embedded function (FindEq in this example) has no result or has error for any reason]
Bod
Return a timestamp for beginning of the day from a time expression.
Syntax
Bod(t1)
Arguments
• t1
A time expression, enclosed in single quotes
Returns
Timestamp for the start of the day
Exceptions
None
Notes
This function is useful for establishing a time at a unique clock time independent of the length of particular days.
Example
• Bod('*')
[Return a timestamp for beginning of the day today]
• Bod('y')
[Return a timestamp for beginning of the day yesterday]
• Bod(FindEq('att1', '-3d', '*', 50))
[Return a timestamp for beginning of the day when 'att1' value was first equal to 50 in the past 72 hours]
Bom
Return a timestamp for midnight on the first day of the month from a given time expression.
Syntax
Bom(t1)
Arguments
• t1
A time expression
Returns
Timestamp for the start of the month
Exceptions
None
Notes
This function is useful for establishing a time at a unique clock time independent of the length of particular days.
Example
• Bom('*')
[Return a timestamp for midnight on the first day of this month]
• Bom(PrevEvent('att1', '*'))
[Return a timestamp for midnight on the first day of the month when 'att1' had a value before the current
one]
• Bom(FindEq('att1', '-60d', '*', 50))
[Return a timestamp for midnight on the first day of the month when the value of 'att1' was first equal to 50
in the past 60 days]
Bonm
Return a timestamp for midnight on the first day of a following month from a given time expression.
Syntax
Bonm(t1)
Arguments
• t1
Time expression, enclosed in single quotes
Returns
Timestamp for the start of the next month
Exceptions
None
Notes
This function is useful for establishing a time at a unique clock time independent of the length of particular days.
Example
• Bonm('*')
[Return a timestamp for midnight on the first day of next month]
• Bonm('y')
[Return a timestamp for midnight on the first day of the following month from yesterday's date]
• Bonm(FindEq('att1', '-60d', '*', 50))
[Return a timestamp for midnight on the first day of the following month when the value of 'att1' was first
equal to 50 in the past 60 days]
Ceiling
Return the nearest integer greater than or equal to x.
Syntax
Ceiling(x)
Arguments
• x
integer or a real number, an attribute whose value evaluates to a number
Returns
The nearest integer greater than or equal to x
Exceptions
Returns an error if x is a digital state, time expression, time interval or a string
Notes
Unit of measure of the argument, if it exists, is carried over to the result
Example
• Ceiling(2.3)
[Returns 3]
• Ceiling(-2.3)
[Returns -2]
• Ceiling(TagVal('att1', '12/30/16'))
[Return the nearest integer to the value of 'att1' at the start of day (12:00am) on December 30, 2016]
Char
Build a string from ASCII character codes.
Syntax
Char(x1, ... xn)
Arguments
• x1, ... xn
Integers
Returns
A string built from the 80 character codes
Exceptions
Returns an error if an argument is not a number
Example
• Char(80, 73)
[Returns "PI"]
• Char(65)
[Returns "A"]
• Char(5 * 10)
[Returns "2"]
Compare
Compare two strings using wildcard characters ("*" and "?") or compare two operands using logical operators
and deadband value.
Syntax
Compare {[(s1, s2 [, caseSensitive])]|[x1, x2, op, deadband]}
Arguments
• s1, s2
string (s2 can contain wildcard characters)
• caseSensitive
Optional flag indicating if the comparison is case sensitive. If False (the default), the comparison is not case-
sensitive. If True, the comparison is case-sensitive
• x1, x2
Numeric value (integer or real number) or time expression
• op
An operator used for comparison. Must be one of the following operators, or a variable defined as one of
these: <, >, <=, >=
• deadband
Numeric value (integer or real number) or timespan. Deadband specifies a buffer (tolerance) around x2 and
prevents repeated alerts when the value fluctuates within the deadband range
Returns
• True if s1 = s2
• True if x1 <op> x2 is true, and uses deadband value for subsequent evaluations
False otherwise
Exceptions
Wildcard characters in s1 are treated literally and not as wildcards
The deadband value is applied to x2, not x1
Example
• Compare('att1', 100, "<=", 5)
[Returns True if 'att1' is less than or equal to 100, and uses the deadband value of 5 for subsequent
evaluations]
• Compare("What", "what", True)
[Returns False]
• Compare("b", "a")
[Returns False]
• Compare("What", "wha?")
[Returns True]
• Compare("What", "wh")
[Returns False]
Concat
Concatenate two or more strings.
Syntax
Concat(s1, s2 [, ... sn])
Arguments
• s1, ... sn
Must be character strings, or expressions yielding character strings.
Returns
The character strings, concatenated together. This function does not insert blanks between its arguments. To
include a space in the concatenated string, add an argument consisting of a string that has a single space
enclosed in double quotes.
Example
• Concat("shut", "down")
[Returns "shutdown"]
• Concat("shut ", "down")
[Returns "shut down"]
Contains
Determine if first string contains second string and return True or False.
Syntax
Contains(s1, s2 [,caseSensitive])
Arguments
• s1
Primary string
• s2
Substring searched for in primary string
• caseSensitive
Optional: Boolean that indicates whether the search is case sensitive. If False (or omitted), the search is not
case sensitive. If True, the search is case sensitive
Returns
True if the primary string (s1) contains the substring (s2) and False otherwise
Exceptions
If either of the first two arguments (s1 or s2) is not a string, the function returns an error value
If the optional third argument (caseSensitive) is not a Boolean, the function returns an error value
Example
• Contains("What","Hat",True)
[Returns False]
• Contains("What","Hat")
[Returns True]
• Contains("What","at")
[Returns True]
• Contains("hat","what")
[Returns False]
Convert
Convert a value from its current unit of measure (UOM) to a specified UOM; for a value with no UOM, assign the
specified UOM.
Syntax
Convert(x, toUnit)
Arguments
• x
Any expression that resolves to a numeric value, including the name of a numeric attribute enclosed in single
quotation marks, a variable name, or a constant value
• toUnit
The output UOM enclosed in double quotation marks
Returns
The numeric value converted to the specified UOM
Exceptions
Returns an error if toUnit and the initial UOM for x are not in the same UOM class
Example
• Convert('MetricWeight', "lb")
• Convert('Ambient Temperature', "degC")
Note: PI AF substitutes deg with °, if not otherwise found in the lookup.
Cos
Return the trigonometric cosine of an integer or real number.
Syntax
Cos(x)
Arguments
• x
Must be an integer or real number, which represents an angle in radians
Returns
The cosine of x
Exceptions
If x is not an integer or real number, returns an error value
Example
• Cos(1.1)
[Returns 0.4536]
• Cos(1)
[Returns 0.5403]
• Cos('att1')
[Return the trigonometric cosine of the value of 'att1' at trigger time]
Cosh
Return the hyperbolic cosine of a number.
Syntax
Cosh(x)
Arguments
• x
Must be an integer or real number
Returns
The hyperbolic cosine of x
Exceptions
If x is not an integer or real number, returns an error
Example
• Cosh(1)
[Returns 1.5431]
• Cosh(-1)
[Returns 1.5431]
• Cosh('att1')
[Return the hyperbolic cosine of the value of 'att1' at trigger time]
Cot
Return the trigonometric cotangent of a number.
Syntax
Cot(x)
Arguments
• x
Must be an integer or real number, which represents an angle in radians
Returns
The cotangent of x
Exceptions
If x is not a number, returns an error
Example
• Cot(1)
[Returns 0.64209]
• Cot(1.1)
[Returns 0.50897]
• Cot('att1')
[Return the trigonometric cotangent of the value of 'att1' at trigger time]
Coth
Return the hyperbolic cotangent of a number.
Syntax
Coth(x)
Arguments
• x
Must be an integer or real number
Returns
The hyperbolic cotangent of x
Exceptions
If x is not a number, returns an error value
Example
• Coth(1)
[Returns 1.313]
• Coth(1.1)
[Returns 1.2492]
• Coth('att1')
[Return the hyperbolic cotangent of the value of 'att1' at trigger time]
Cov
Determine the covariance between two sets of values given by attributes over a specified time range.
Syntax
Cov(x, y, mode, starttime, endtime, type [, pctgood])
Arguments
• x
an attribute with the first set of time series data (such as PI point data reference) enclosed in single quotes
• y
an attribute with the second set of time series data (such as PI point data reference) enclosed in single
quotes
• mode
a number that specifies how to align time-stamped values
choose from 0, 1 or 2 where:
0 represents the combination of time-stamped values from x and y
1 represents values from both attributes according to x's time stamps
2 represents values from both attributes according to y's time stamps
• starttime
a time expression representing the beginning of a time range enclosed in single quotes; can be a relative
time (such as '-3h') in reference to an absolute endtime
• endtime
a time expression representing the end of a time range enclosed in single quotes; can be a relative time
(such as '+1h') in reference to an absolute starttime
• type
a number specifying the covariance type: use 0 for "population" and 1 for "sample"
• pctgood
Optional. Minimum percentage of time during the time range that attribute values must be good.
You can set pctgood as a threshold to ensure that there are sufficient good values to calculate Cov.
Returns
Covariance of x and y
Exceptions
If the attribute has no good values or the pctgood minimum is not reached for the given time range, returns an
error value
Notes
Bad values are excluded from Cov calculation
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the values is good
Example
• Cov('att1', 'att2', 0, 't', '+1h', 1, 80)
[Return the sample covariance of 'att1' and 'att2' between 12:00 and 1:00am today when at least 80% of the
values were good. Return an error when minimum pctgood is not reached]
• Cov('att1', 'att2', 1, 't', '+1h', 1)
[Return the population covariance of 'att1' and 'att2' based on time stamps of 'att1' between 12:00 and
1:00am today]
Csc
Return the trigonometric cosecant of a number.
Syntax
Csc(x)
Arguments
• x
Must be an integer or real number, which represents an angle in radians
Returns
The cosecant of x
Exceptions
If x is not a number, returns an error
Example
• Csc(1)
[Returns 1.1884]
• Csc(1.1)
[Returns 0.7487]
• Csc('att1')
[Return the trigonometric cosecant of the value of 'att1' at trigger time]
Csch
Return the hyperbolic cosecant of a number.
Syntax
Csch(x)
Arguments
• x
Must be an integer or real number
Returns
The hyperbolic cosecant of x
Exceptions
If x is not a number, returns an error value
Example
• Csch(1)
[Returns 0.85092]
• Csch(1.1)
[Returns 0.748]
• Csch('att1')
[Return the hyperbolic cosecant of the value of 'att1' at trigger time]
Curve
For a given x, returns the value of a piecewise linear interpolation function defined by the set of n points (x1,y1)...
(xn,yn).
Syntax
Curve(x, (x1,y1) (x2,y2) … (xn,yn))
Arguments
• x
Expression evaluating to a number
• x1, y1
The first point on the curve. The xi's and yi's are numeric constants evaluated at compile time. The values set
for xi's must be in ascending order.
Returns
For a given x, returns the value of a piecewise linear interpolation function defined by the set of n points (x1,y1)...
(xn,yn). If the value of x is less than x1 then y1 is returned and if it is greater than xn, yn is returned. The points are
assumed to be ordered in the x direction from smallest to largest.
Exceptions
If the value of x is not an integer or real number, an error value is returned
Example
• Curve(3, (0,100) (100,0))
[Returns 97]
• Curve('att1', (25,25) (75,75))
Day
Extract the day of the month from a time expression.
Syntax
Day(t1)
Arguments
• t1
time expression enclosed in single quotes
Returns
The day of the month of a time expression in the range 1 through 31
Exceptions
None
Example
• Day('*')
[Return what day of the month today is]
• Day('y')
[Return what day of the month yesterday was]
• Day(FindEq('att1', '-28d', '*', 50))
[Return what day of the month it was when the value of 'att1' was first equal to 50 in the past 28 days]
DaySec
Return the total time in seconds between the start of day (midnight) and the time denoted in the argument.
Syntax
DaySec(t1)
Arguments
• t1
A time expression, enclosed in single quotes
Returns
Total seconds since the start of day (midnight) till t1, in the range 0-86399
Exceptions
None
Example
• DaySec('*')
[Return the number of seconds from the start of day (midnight) until now]
DeltaValue
Return the difference between the current and immediately previous values or evaluations of an attribute with a
numeric or DateTime value type.
Syntax
DeltaValue(x [, prevEval])
Arguments
• x
An attribute or expression of a numeric or DateTime value type
• prevEval
(Boolean) If False or not specified, x must be an attribute, and DeltaValue returns the difference between its
current value and immediately previous value.
If True, DeltaValuereturns the difference between the current and immediately previous evaluations of x,
which can be any expression with a numeric or DateTime value type
Returns
Returns the difference between the current value and the immediately previous value of an attribute with a
numeric or DateTime value type, or the difference between the current and immediately previous evaluations
for any expression with a numeric or DateTime value type
Notes
When x is of DateTime data type, DeltaValue returns the time interval (in seconds) between two DateTime
values. If the time interval value is output to an attribute, make sure the attribute data type is set to double
This function may use input values from PI points. If the compression is on for a PI point, all of its values may not
be preserved in PI Data Archive. Before you try to validate the results of this function using a client tool such as
PI Datalink, make sure the compression is turned off. This is to ensure that all associated PI point values are
included for validation. When validation is complete, be sure to turn the compression back on again as a best
practice
Unit of measure of the argument, if it exists, is carried over to the result
Example
• DeltaValue('att1' [, FALSE])
[Return the difference between the current and immediately preceding value of 'att1']
• DeltaValue('att1', TRUE)
[Return the difference between the current and last evaluated value of 'att1']
DigState
Convert a string into a corresponding Data Archive digital state object, either based on the attribute's digital
state enumeration or on a system enumeration set values (for example, Calc Failed). Use DigState embedded in
other functions when Data Archive digital state object is required for input (such as with StateNo) or in
conjunction with other functions for comparison with digital state attributes.
Syntax
DigState(s1 [, x])
Arguments
• s1
A string representing a digital state in double quotes
• x
Optional: An attribute with PI point digital state reference or of value type enumeration set. If omitted, only
the system digital set is searched for the given string.
Returns
An enumeration value
Exceptions
If the string does not represent a digital state of the specified attribute, the function returns Calc Failed. If the
attribute is omitted and string does not represent a system digital state, Calc Failed is returned.
Example
• 'att1' > DigState("Program", 'att1')
[Returns True if current digital state of 'att1' is greater than the digital state represented by "Program" value]
• DigState("No Result")
[Construct a value with system digital state No Result]
DigText
Obtain the text corresponding to the digital state.
Syntax
DigText(digstate)
Arguments
• digstate
An argument that evaluates to a digital state
Returns
The text for the digital state
Exceptions
Returns an error if the argument is not a digital state
Example
• DigText(TagVal('enum_att1', 'y'))
[Returns the digital state value in string]
• DigText('enum_att1')
[Returns digital state value in string. Returns an error message if 'enum_att1' is not a PI point attribute with
digital state value]
E
Return the value for e (the base of the natural logarithm).
Syntax
E()
Arguments
None
Returns
The value for e (the base of the natural logarithm)
Exceptions
None
Example
• E()
ELSE
Operator that returns the second of two specified values when the conditional expression in IF-THEN-ELSE
statement is True.
Syntax
IF (expression) THEN (x) ELSE (y)
Arguments
• expression
Any expression that evaluates to true or false
• x, y
An expression that evaluates to an output value
Returns
x when the conditional expression is true and y when the expression is false
Exceptions
None
Example
• IF ('att1' > 50) THEN ('att2') ELSE ('att3')
[If the value of 'att1' is greater than 50, then return the value of 'att2'; otherwise return the value of 'att3']
EventCount
Find the number of events for an attribute during a specified time range.
Syntax
EventCount(attname, starttime, endtime [, pctgood])
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• pctgood
Optional: Minimum percentage of good values for events within the specified time interval.
Returns
Number of events for the attribute during a specified time range.
Exceptions
Returns an error if the pctgood minimum is not reached for the given time interval.
Notes
If the attribute has very few good values during the time range, this function's result may not be trustworthy.
Use the PctGood function to find out what percentage of the values is good.
Example
• EventCount('att1', 't', '+1h')
[Return the count of events between 12:00 and 1:00am today.]
• EventCount('att1', 't', '+1h', 80)
[Return the count of events between 12:00 and 1:00am today when at least 80% of the values were good.]
EventFrame
Return the value of event frame properties.
Syntax
EventFrame(parameter)
Arguments
• parameter
parameter string StartTime, EndTime or Duration enclosed in double quotes; not case-sensitive
Returns
The value of the parameter
Exceptions
If the event frame is not active or still open, returns No Results
Notes
• This function is only to be used when configuring output expressions in an event frame generation analysis
• The output can be mapped to an attribute with value type DateTime for StartTime and EndTime. For
Duration, select double (time returned in seconds)
• You can preview results by right-clicking the analysis
Example
• EventFrame("Duration")
[Return the duration of an event frame. Time is returned in seconds]
• TagAvg('att1', EventFrame("StartTime"), EventFrame("EndTime"))
[Find the time-weighted average of the values of 'att1' during an event frame]
Exit
Stop the analysis from running further evaluation.
Syntax
Exit()
Arguments
None
Notes
• It is important to include the parentheses after this function. Use Exit() instead of Exit.
• Suppose you have multiple expressions within a single analysis or a sequence of analyses that forms a
dependency chain. The calculation ends when it hits Exit.
• Unlike Exit, which immediately exits out of the analysis, NoOutput will continue until it goes through every
expression in an analysis.
Example
• IF 'att1' < 100 OR 'att1' > 200 THEN 'att1' ELSE Exit()
Exp
Return the exponential of an integer or real number. This is the number ex, where e = 2.7182818...
Syntax
Exp(x)
Arguments
• x
Must be an integer or real number
Returns
The exponential of x
Exceptions
If x is not an integer or real number, returns an error value
Example
• Exp(11)
[Returns 59874]
• Exp('att1')
[Return the exponential of the value of 'att1' at trigger time]
• Exp(TagVal('att1','t'))
[Return the exponential of the value of 'att1' at the start of day (12am) today]
FilterData
Get all the values in an array that satisfy a given condition.
Syntax
FilterData(a1, condition($val))
Arguments
• a1
a variable representing the array to operate on
• condition($val)
any supported PE statement, as a function of $val, that returns a true or false. $val is a placeholder for each
value in the array
Returns
An array of all the values that satisfy the given condition
Exceptions
None
Notes
None
Example
• FilterData(Data, (NOT BadVal($val) AND $val > 50))
[From an array named Data, return a new array of values where none are bad values and all are greater than
50]
FindEq
Find the timestamp closest to starttime within a specified time interval when the attribute is equal to a specified
value.
Syntax
FindEq(attname, starttime, endtime, x)
Arguments
• attname
name of an attribute enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as "-3h") in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as "+1h") in reference to an absolute starttime
• x
The value to search for; must be an integer or real number or digital state (character string)
Returns
The timestamp closest to starttime within the specified interval when the attribute was equal to the specified
value
Exceptions
If the attribute was never equal to the specified value, an error value is returned
Notes
• If needed, interpolation is done between attribute values to determine when the attribute was equal to the
specified value
• Interpolation occurs when:
• the underlying PI point has step attribute turned off
• there is no recorded value with the specified timestamp
• The interpolated value will be based on the values before and after the timestamp
• No value will be interpolated if the step attribute is turned on. In this case, the value of record will be that at
the time of the event (if it exists) or the previously-recorded value
• If endtime is earlier than starttime, the time interval is searched backwards
Example
• FindEq('att1', '-1h', '*', 40)
[Return the timestamp of the first time since an hour ago (starttime) when ' att1' was equal to 40]
• FindEq('enum_att1', '30-March-17', '*', "On")
[Return the timestamp of the first time since the start of day (12am; starttime) on March 30th, 2017 when
enumeration value 'enum_att1' was equal to "On"]
FindGE
Find the first time within a time interval when an attribute is greater than or equal to a specified value.
Syntax
FindGE(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as "-3h") in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as "+1h") in reference to an absolute starttime
• x
The value to search for; must be an integer or real number or digital state (character string)
Returns
The timestamp closest to starttime within the specified interval when the attribute was greater than or equal to
the specified value. Returns the corresponding system digital state (No Result, No Data, and the like) if the
attribute was always less than the specified value.
Exceptions
None
Notes
• If needed, interpolation is done between attribute values to determine when the attribute was greater than
or equal to the specified value
• Interpolation occurs when:
• the underlying PI point has step attribute turned off
• there is no recorded value with the specified timestamp
• The interpolated value will be based on the values before and after the timestamp
• No value will be interpolated if the step attribute is turned on. In this case, the value of record will be that at
the time of the event (if it exists) or the previously-recorded value
• If endtime is earlier than starttime, the time interval is searched backwards
Example
• FindGE('att1', 'y', '+2h', 40)
[Return the timestamp between midnight and 2:00 am yesterday when 'att1' was first greater than or equal
to 40]
FindGT
Find the first time within a time interval when an attribute is greater than a specified value.
Syntax
FindGT(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as "-3h") in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as "+1h") in reference to an absolute starttime
• x
The value to search for; must be an integer or real number or digital state (character string)
Returns
The timestamp closest to starttime within the specified interval when the attribute was greater than the
specified value. Returns the corresponding system digital state (No Result, No Data, and the like) if the attribute
was never greater than the specified value.
Exceptions
None
Notes
• If needed, interpolation is done between attribute values to determine when the attribute was greater than
the specified value
• Interpolation occurs when:
• the underlying PI point has step attribute turned off
• there is no recorded value with the specified timestamp
• The interpolated value will be based on the values before and after the timestamp
• No value will be interpolated if the step attribute is turned on. In this case, the value of record will be that at
the time of the event (if it exists) or the previously-recorded value
• If endtime is earlier than starttime, the time interval is searched backwards
Example
• FindGT('att1', 't', '*', 40)
[Return the timestamp of the first time after midnight today when 'att1' was greater than 40]
• FindGT('att1', '-1h', '*', TagVal('att1', 'y+18h'))
[Return the timestamp of the first time since an hour ago when the value of 'att1' was greater than its value
at 6pm yesterday]
FindLE
Find the first time within a time interval when an attribute is less than or equal to a specified value.
Syntax
FindLE(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as "-3h") in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as "+1h") in reference to an absolute starttime
• x
The value to search for; must be an integer or real number or digital state (character string)
Returns
The timestamp closest to starttime within the specified interval when the attribute was less than or equal to the
specified value. Returns the corresponding system digital state (No Result, No Data, and the like) if the attribute
was always greater than the specified value.
Exceptions
None
Notes
• If needed, interpolation is done between attribute values to determine when the attribute was equal to the
specified value
• Interpolation occurs when:
• the underlying PI point has step attribute turned off
• there is no recorded value with the specified timestamp
• The interpolated value will be based on the values before and after the timestamp
• No value will be interpolated if the step attribute is turned on. In this case, the value of record will be that at
the time of the event (if it exists) or the previously-recorded value
• If endtime is earlier than starttime, the time interval is searched backwards
Example
• FindLE('att1', 't', '*', 40)
[Return the timestamp of the first time after midnight today when att1 was less than or equal to 40]
FindLT
Find the first time within a time interval when an attribute is less than a specified value.
Syntax
FindLT(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as "-3h") in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as "+1h") in reference to an absolute starttime
• x
Must be an integer or real number or digital state (character string), the value to search for
Returns
The timestamp closest to starttime within the specified interval when the attribute was less than the specified
value. Returns the corresponding system digital state (No Result, No Data, and the like) if the attribute was never
less than the specified value.
Exceptions
None
Notes
• If needed, interpolation is done between attribute values to determine when the attribute was lower than
the specified value
• Interpolation occurs when:
• the underlying PI point has step attribute turned off
• there is no recorded value with the specified timestamp
• The interpolated value will be based on the values before and after the timestamp
• No value will be interpolated if the step attribute is turned on. In this case, the value of record will be that at
the time of the event (if it exists) or the previously-recorded value
• If endtime is earlier than starttime, the time interval is searched backwards
Example
• FindLT('att1', 'y', 't', 40)
[Return the timestamp of the first time between midnight yesterday and midnight today that 'att1' was less
than 40]
• FindLT('att1', '-1h', '*', TagVal('att1', 'y+18h'))
[Return the timestamp of the first time since an hour ago when the value of 'att1' was less than its value at
6pm yesterday]
FindNE
Find the first time within a time interval when an attribute is not equal to a specified value. "No Data" events will
be skipped.
Syntax
FindNE(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as "-3h") in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as "+1h") in reference to an absolute starttime
• x
The value to search for; must be an integer or real number or digital state (character string)
Returns
The timestamp closest to starttime, within the specified interval, for which the attribute was not equal to the
specified value. "No Data" events will be skipped
Exceptions
If the attribute was always equal to the specified value, an error value is returned
Notes
• If needed, interpolation is done between attribute values to determine when the attribute was not equal to
the specified value
• Interpolation occurs when:
• the underlying PI point has step attribute turned off
• there is no recorded value with the specified timestamp
• The interpolated value will be based on the values before and after the timestamp
• No value will be interpolated if the step attribute is turned on. In this case, the value of record will be that at
the time of the event (if it exists) or the previously-recorded value
• If endtime is earlier than starttime, the time interval is searched backwards
Example
• FindNE('att1', '-1h', '*', 40)
[Return the timestamp of the first time since an hour ago when ' att1' was not equal to 40]
• FindNE('enum_att1', '30-March-17', '*', "On")
[Return the timestamp of the first time since the start of day (12am) on March 30th, 2017 when
enumeration value 'enum_att1' was not equal to "On"]
FirstValue
Get the first value in an array that satisfies a given condition.
Syntax
FirstValue(a1 [, condition($val)])
Arguments
• a1
a variable representing the array to operate on
• condition($val)
any supported PE statement, as a function of $val, that returns a true or false. $val is a placeholder for each
value in the array
Returns
The first value that satisfies the given condition
Exceptions
None
Notes
None
Example
• FirstValue(Data)
[Return the first value from an array named Data]
• FirstVal(Data, $val < 90)
[From the array named Data, return the first value in the array that is less than 90]
Float
Convert a string to a number.
Syntax
Float(x)
Arguments
• x
A string or a number, or an attribute whose value evaluates to a number at time of evaluation
Returns
A number for a numeric string. If x is already a number, x is returned
Exceptions
If x is not a number or a numeric string, returns Calc Failed
Notes
Unit of measure of the argument, if it exists, is carried over to the result. Float also takes timespan and boolean
as argument. Note, however, that Float only converts timespan format to the number of seconds from 12:00am
Jan 1, 1970.
Example
• Float("12.3")
[Converts string to a number and returns 12.3]
• Float(12.3)
[Returns 12.3]
• Float('*')
[Return the total number of seconds passed since Jan 1, 1970]
Floor
Return the nearest integer less than or equal to x.
Syntax
Floor(x)
Arguments
• x
Integer or a real number, or an attribute whose value evaluates to a number at time of evaluation
Returns
The nearest integer less than or equal to x
Exceptions
Returns an error if x is a digital state, time expression, time interval or a string
Notes
Unit of measure of the argument, if it exists, is carried over to the result
Example
• Floor(3.14)
[Returns 3]
• Floor(-3.14)
[Returns -4]
• Floor(TagVal('att1', '*'))
[Return the nearest integer less than or equal to the current value of 'att1']
Format
Convert a number to string according to a format expression.
Syntax
Format(x, format [,culture])
Arguments
• x
An integer or a real number
• format
Format-control string, similar to that used by the C language function Sprintf
• culture
Optional. Culture name string, enclosed in double quotation marks. Example values include "de-DE", "ja-jp",
"pt-br", "zh-cn". Use "" to specify the culture-invariant setting (the default setting).
Returns
A formatted string
Example
• Format(1234.567, "%10.2f", "de-DE")
[Returns "1234,57", a formatted string]
• Format(45, "%3.3d")
[Returns "045"]
Frac
Return the fractional part of a real number. Returns 0 for integers.
Syntax
Frac(x)
Arguments
• x
Must be an integer or real number
Returns
The fractional part of x
Exceptions
If x is not an integer or real number, returns an error value
Notes
By definition: Int(x) + Frac(x) = x
Unit of measure of the argument, if it exists, is carried over to the result
Example
• Frac(1)
[Returns 0]
• Frac(1.3)
[Returns 0.3]
• Frac(TagVal('att1', '*'))
[Return the fractional part of the value of 'att1' at current time.]
HasChanged
Return True if an attribute has had any event in the specified time period; otherwise return False.
Syntax
HasChanged(attname, t1)
Arguments
• attname
The name of an attribute enclosed in single quotation marks
• t1
The start of a time period ending at execution time; can be any relative time expression in single quotation
marks (such as 't - 4h')
Returns
True if attname has any event in the specified time period; otherwise returns False
Example
• HasChanged('att1', 't-4h')
[Returns True if 'att1' received any updates since 8 p.m. last night, regardless of whether the update changed
the actual attribute value]
HasValueChanged
Determine if the value of an attribute or expression has changed since it was last evaluated during an analysis.
Syntax
HasValueChanged(x)
Arguments
• x
attribute or expression
Returns
True if the value of x has changed since last evaluated during the analysis; otherwise returns False.
If x is an expression that this function has not yet evaluated during the analysis, then the function returns False.
If x is an attribute that this function has not yet evaluated during the analysis, then the function finds the
previous recorded value and compares the current value to that previous value. If there is no previous value,
then the function returns False.
Notes
HasValueChanged is a "stateful" function. Previous evaluations are stored in memory and compared against the
new value to see if there has been a change in state. If PI Analysis Service restarts during an analysis, memory is
flushed and any previous evaluations are lost.
Example
• HasValueChanged('att1')
• [Returns True if the value of att1 has changed since last evaluated during the analysis]
• HasValueChanged('att1'+'att2')
[Returns True if the value of sum of att1 and att2 has changed since last evaluated during the analysis]
Hour
Extract the hour from a time expression.
Syntax
Hour(t1)
Arguments
• t1
A time expression, enclosed in single quotes
Returns
The hour of time, in the range 0-23
Exceptions
None
Example
• Hour('*')
[Return the hour portion of current time]
• Hour('Saturday')
[Returns 0]
• Hour(FindEq('att1', '-1d', '*', 50))
[Return the hour of the time when the value of 'att1' was first equal to 50 in the past 24 hours]
IF
Operator that introduces the condition in IF-THEN-ELSE statement. Return the first of two specified values if the
conditional expression is true. Otherwise, return the second value.
Syntax
IF (expression) THEN (x) ELSE (y)
Arguments
• expression
Any expression that evaluates to true or false
• x, y
An expression that evaluates to an output value
Returns
x when the conditional expression is true and y when the expression is false
Exceptions
None
Example
• IF ('att1' > 50) THEN ('att2') ELSE ('att3')
[If the value of 'att1' is greater than 50, then return 'the value of 'att2'; otherwise return the value of 'att3']
IN
Return True if a value is included in a set or a range of inclusive values.
Syntax
x In (y1 [, ... yn])
x In (y1...yn)
Arguments
• x
numeric value or string
• y1 [, ... yn]
a set of numeric or string values
• y1 ... yn
a range of numeric values
Returns
True when x is included in a set or a range of values
Exceptions
None
Notes
If y1 is a decimal number that defines a range (as in the second syntax), use 2 dots instead of 3 between y1 and
yn.
Example
• 1 In (9, 10)
[Returns False since 1 is not included in a set of 9 and 10]
• 2 In (1...10)
[Returns True since 2 is included in a range of 1 to 10]
• 2 In (1.5..10)
• [Returns True since 2 is included in a range of 1.5 to 10]
InStr
Return the location within a string where a sub-string match is first found.
Syntax
InStr([start,] s1, s2 [,caseSensitive])
Arguments
• start
Optional: An integer specifying which character in s1 to start the comparison. Must be larger than or equal
to 1.
• s1, s2
Two strings to be compared.
• caseSensitive
Optional: A flag indicating if the comparison is case-sensitive. If 0 (the default) the comparison is case-
insensitive, if 1, the comparison is case-sensitive.
Returns
0 if s2 is not a sub-string of s1 starting from the start position; otherwise, the location of character where s2 first
matches the characters in s1 from the start position.
Exceptions
Wildcard characters are not treated as wildcards.
Example
• InStr("What", "At")
[Returns 3]
• InStr("What What What", "What")
[Returns 1]
• InStr("what", "At", 1)
[Returns 0]
• InStr(4, "what", "At")
[Returns 0]
• InStr('att1', "Error")
[Returns 1 if the value of att1 is "Error"]
Int
Return the integer part of an integer or real number.
Syntax
Int(x)
Arguments
• x
Number, Boolean, numeric string, timespan, or an attribute whose value evaluates to a number at time of
evaluation
Returns
If x is a number, the integer part of x is returned. If x is a string, it is first converted into a number. If x is a
timespan, the number of seconds from 12:00am January 1, 1970 is returned
Exceptions
Returns error if the variable is not assigned
Notes
Int('*') returns UTC time in seconds from 12:00am January 1, 1970
Example
• Int('att1')
[Return the integer part of the value of 'att1' at current time]
• Int('*'-'t')
[Return how many seconds have passed since the start of day today]
• Int(2.1)
[Returns 2]
• Int("2.1")
[First converts the string to a number and returns 2]
• Int(true)
[Returns 1]
InterpolatedValues
Obtain interpolated values over a specified time range using the specified time step.
Syntax
InterpolatedValues(attname, starttime, endtime, timestep)
Arguments
• attname
attribute of time series data (such as PI point data reference) enclosed in single quotes
• starttime
a time expression representing the beginning of a time range enclosed in single quotes; can be a relative
time (such as '-3h') in reference to an absolute endtime
• endtime
a time expression representing the end of a time range enclosed in single quotes; can be a relative time
(such as '+1h') in reference to an absolute starttime
• timestep
a time interval enclosed in single quotes (such as '+1m' or '-10s') representing the incremental change in
time between the specified range to obtain the interpolated values
Returns
An array of the values obtained within the specified range in intervals of the time step
Exceptions
If the attribute does not support range calls or interpolated values of range calls, the function returns an error
indicating as such
Notes
• If the starttime is earlier than the endtime, the resulting values will be in time-ascending order, otherwise
they will be in time-descending order.
• When a positive timestep is specified, the interval calculation begins at the earliest bounding time in the
time range and applies the interval repeatedly in the time-ascending direction to generate the calculation
intervals.
• If a negative timestep is specified, the interval calculation begins at the latest bounding time in the time
range and applies the interval repeatedly in the time-descending direction to generate the calculation
intervals.
• Note that the order of values returned will still be reflected by the time range, regardless of the timestep
sign.
Example
• InterpolatedValues('att1', 't', '+1h', '+10m')
[Return the values of 'att1' between 12:00 and 1:00am today in 10-minute intervals]
• InterpolatedValues('att1', 't', '+1h', '-14m')
[Return the values of 'att1' between 12:00 and 1:00am today in 14-minute intervals, anchoring from 1:00am
(that is, 12:04,12:18,12:32,12:46,1:00)]
IsSet
For an attribute associated with a PI point, determine if the point is annotated, substituted, or questionable.
Syntax
IsSet(attname, select)
Arguments
• attname
An attribute associated with a PI point of value type integer, real number, enumeration value, or string
• select
A string but only the first character is considered: "a" for annotate, "s" for substituted and "q" for
questionable. Not case-sensitive.
Returns
True or False
Exceptions
None
Example
• IsSet('att1', "a")
[Returns True if the value of 'att1' is annotated]
• IsSet('att1', "s")
[Returns True if the value of 'att1' is substituted]]
• IsSet('att1', "q")
[Returns True if the value of 'att1' is questionable]
LastValue
Get the last value in an array that satisfies a given condition.
Syntax
LastValue(a1 [, condition($val)])
Arguments
• a1
a variable representing the array to operate on
• condition($val)
any supported PE statement, as a function of $val, that returns a true or false. $val is a placeholder for each
value in the array
Returns
The last value that satisfies the given condition
Exceptions
None
Notes
None
Example
• LastValue(Data)
[Return the last value from an array named Data]
• LastValue(Data, $val > 90 and $val < 105)
[From the array named Data, return the last value in the array that is greater than 90 and less than 105]
LCase
Convert a string to a lowercase string.
Syntax
LCase(s1)
Arguments
• s1
string
Returns
A string that has been converted to lowercase
Exceptions
If the argument is not a string, returns an error value
Example
• LCase("String")
[Returns "string"]
Left
Return a specified number of characters of a string from the left.
Syntax
Left(s1, len)
Arguments
• s1
String
• len
Integer
Returns
The first len characters of the string, starting from the left
Exceptions
If the arguments are not of the required types, returns an error
Example
• Left("String_att", 3)
[Returns "Str"]
Len
Return the length of a string.
Syntax
Len(s1)
Arguments
• s1
string
Returns
The length of a string
Exceptions
If the argument is not a string, returns an error value
Example
• Len("String")
[Returns 6]
• Len('sinusoid')
[Returns Calc Failed]
LinRegr
Apply linear least squares fitting to two sets of values given by attributes over a specified time range. The output
is a one-based array with the values of the slope, intercept and R2.
Syntax
LinRegr(x, y, mode, starttime, endtime [, pctgood])
LinRegr(y, starttime, endtime [, pctgood])
Arguments
• x
an attribute with the first set of time series data (such as PI point data reference) enclosed in single quotes
• y
an attribute with the second set of time series data (such as PI point data reference) enclosed in single
quotes
• mode
a number that specifies how to align time-stamped values
• choose from 0, 1 or 2 where:
0 represents the combination of time-stamped values from x and y
1 represents values from both attributes according to x's time stamps
2 represents values from both attributes according to y's time stamps
• starttime
a time expression representing the beginning of a time range enclosed in single quotes; can be a relative
time (such as '-3h') in reference to an absolute endtime
• endtime
a time expression representing the end of a time range enclosed in single quotes; can be a relative time
(such as '+1h') in reference to an absolute starttime
• pctgood
Optional. Minimum percentage of time during the time range that attribute values must be good.
You can set pctgood as a threshold to ensure that there are sufficient good values to calculate LinRegr.
Returns
One-based array with the values of slope, intercept and R2.
Exceptions
If the attribute has no good values or the pctgood minimum is not reached for the given time range, returns an
error value
Notes
Bad values are excluded from LinRegr calculation.
For LinRegr(y, starttime, endtime [, pctgood]), the unit of the output slope is unit of y/second.
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the values is good.
Index the slope, intercept and R2 outputs from [1].
Example
• LinRegr('att1', 'att2', 0, 't', '+1h', 80)
[Return a one-based array of slope, intercept and R2 based on time-stamped values of 'att1' and 'att2'
between 12:00 and 1:00am today when at least 80% of the values were good. Return an error when
minimum pctgood is not reached]
• LinRegr('att1', 'att2', 1, 't', '+1h')
[Return a one-based array of slope, intercept and R2 based on time-stamped values of 'att1' between 12:00
and 1:00am today]
• LinRegr('att1', 't', '+1h', 80)
[Return a one-based array of slope, intercept and R2 of 'att1' between 12:00 and 1:00am today when at least
80% of the values were good. Return an error when minimum pctgood is not reached]
• LinRegr('att1', 't', '+1h')
[Return a one-based array of slope, intercept and R2 of 'att1' between 12:00 and 1:00am today]
Log
Return the natural logarithm (base e = 2.7182818...) of an integer or real number.
Syntax
Log(x)
Arguments
• x
Must be an integer or real number greater than zero
Returns
The natural logarithm of x
Exceptions
If x is zero or negative, or not a number, returns an error value
Example
• Log(14)
[Returns 2.6391]
• Log(TagVal('att1', '14-Dec-16'))
[Return the natural log of the value of 'att1' at 12:00am on Dec 14, 2016]
Log10
Return the base 10 logarithm of an integer or real number.
Syntax
Log10(x)
Arguments
• x
Must be an integer or real number greater than zero
Returns
The base 10 logarithm of x
Exceptions/Errors
If x is zero or negative, or not a number, returns an error value
Example
• Log10(100)
[Returns 2]
• Log10(TagVal('att1', '14-Dec-16'))
[Return the base 10 logarithm of the value of 'att1' at 12:00am on Dec 14, 2016]
Logbase
Return the logarithm of positive numeric value x to a specified base y.
Syntax
Logbase(x,y)
Arguments
• x
An integer or real number greater than zero
• y
A positive integer indicating the base of the logarithm
Returns
The logarithm of x to base y
Exceptions
If x is zero or negative, or not a number, returns an error value
Example
• Logbase(256, 2)
[Returns 8]
• Logbase(1000, 10)
[Returns 3]
• Logbase(TagVal('att1', '14-Dec-16'), 16)
[Return the logarithm of the value of 'att1' at 12:00am on Dec 14, 2016 to base 16]
LTrim
Remove the leading blanks from a string.
Syntax
LTrim(s1)
Arguments
• s1
string
Returns
A string with leading blanks removed
Exceptions
If s1 is not a string, an error value is returned.
Example
• LTrim(" String")
[Returns "String"]
• LTrim("String ")
[Returns "String "]
MapData
Apply a function to each value in an array.
Syntax
MapData(a1, function($val))
Arguments
• a1
a variable representing the array to operate on
• function($val)
any supported PE statement, as a function of $val, that performs an operation. $val is a placeholder for each
value in the array
Returns
The transformed array of all the values
Exceptions
None
Notes
The output array has the same timestamps as the input array.
Example
• MapData(Data, (IF BadVal($val) THEN 0 ELSE $val))
[From an array named Data, return a new array with bad values set to 0]
Max
Return the time-weighted or event-weighted maximum from a set of values.
Syntax
Max(x1, ... xn)
Max(array [, calculationBasis])
Arguments
• x1, ... xn
Arguments or a single array of same value type (integers and real numbers, enumeration values, time
expressions, or time intervals)
• calculationBasis
Optional. The type of calculation to be performed enclosed in double quotes. Choose between
"EventWeighted" or "TimeWeighted." If omitted, the default is event-weighted. If you select
"TimeWeighted," the earliest timestamp of the value marks the start time and the latest timestamp the end
of a time range
Returns
The maximum from a set of arguments. The result is of the same data type as the arguments
Exceptions
Arguments whose run-time values are digital states are ignored. If all values are digital states, Max returns an
error. Returns an error if the array does not consist of same value type
Notes
• Unit of Measure (UOM) of the arguments is carried over to the result when at least one argument has a
defined UOM while others don't. The returned value lacks a UOM if arguments have different UOMs
Example
• Max(14, 'att1', 14.5, TagVal('att2','14-Dec-16'))
[Find the maximum from these values: 14, value of 'att1' at trigger time, 14.5, and the value for 'att2' at start
of day (12:00am) on Dec 14, 2016]
• Max('enum_att1', 'enum_att2', 'enum_att3')
[At trigger time, find the highest value from an enumeration set and return its name]
• Max('*', 'y', 'Saturday')
[Find the most recent timestamp. Returns current time from the example above]
• Max('*'-'*-1h', 't+8h'-'y+4h', '*'-'t')
[Find the longest interval from these time periods: from 1 hour ago to now, from 4:00am yesterday to today
at 8am, from 12:00am yesterday to 12:00am on 20th of this month, and from the beginning of day today
(12:00am) till now]
• Max(Variable1)
Name Expression Value at Evaluation
Median
Return the time-weighted or event-weighted median (middle value) of one or more values.
Syntax
Median(x1 [, ... xn])
Median(array)
Arguments
• x1 [, ... xn]
Arguments and single array of same value type (integers and real numbers, time expressions, or time
intervals)
Returns
The median value of the input argument(s). If there are even number of arguments, the average of the two
middle values is returned. Returns an error if the array does not consist of same value type
Exceptions
Arguments whose run-time values are digital states are ignored. The function must have one or more arguments
that evaluate to non-digital states; otherwise, Median returns an error value. Also returns an error if the array
does not consist of same value type
Notes
Arguments must be of same value type. The data type of the first argument sets the tone for the rest
Unit of Measure (UOM) of the arguments is carried over to the result when at least one argument has a defined
UOM while others don't. The returned value lacks a UOM if arguments have different UOMs
Examples
• Median(14, 'att1', 14.5, TagVal('att2', '14-Dec-16'))
[Find the median of these values: 14, the current value of att1, 14.5, and the value for att2 at midnight on
Dec 14, 2016]
• Median('*', 'y', 'Saturday')
[Find the median of these timestamps: now, 12:00am yesterday, and 12:00am last Saturday]
• Median('*'-'*-1h', 't+4h'-'y+8h', 'y+2h'-'20')
[Find the median of these time periods: from 1 hour ago to now, from 8:00am yesterday to 4:00am today,
and 2:00am yesterday to the start of day (12am) on the 20th of this month]
• Median(Variable1)
Name Expression Value at Evaluation
Mid
Return a sub-string within a string.
Syntax
Mid(s1, start [,len])
Arguments
• s1
string
• start
An integer specifying the position of the first character within the string. The first character in the string is
number 1
len
Optional: The maximum length of the returned string. The default is the length of the string
Returns
len characters of the string to the right of (and including) the first character whose position is specified by start
Exceptions
If the arguments are not of the required types, an error value is returned. The maximum number of characters
that can be returned is 999
Example
• Mid("String", 3)
[Returns "ring"]
• Mid("String", 3, 2)
[Returns "ri"]
Min
Return the time-weighted or event-weighted minimum from a set of values.
Syntax
Min(x1, ... xn)
Min(array [, calculationBasis])
Arguments
• x1, ... xn
Arguments or a single array of same value type (integers and real numbers, enumeration values, time
expressions, or time intervals)
• calculationBasis
Optional. The type of calculation to be performed enclosed in double quotes. Choose between
"EventWeighted" or "TimeWeighted." If omitted, the default is event-weighted. If you select
"TimeWeighted," the earliest timestamp of the value marks the start time and the latest timestamp the end
of a time range
Returns
The minimum from a set of arguments. The result is of the same data type as arguments
Exceptions
Arguments whose run-time values are digital states are ignored. If all values are digital states, Min returns an
error. Returns an error if the array does not consist of same value type
Notes
• Unit of Measure (UOM) of the arguments is carried over to the result when at least one argument has a
defined UOM while others don't. The returned value lacks a UOM if arguments have different UOMs
Example
• Min(14, 'att1', 14.5, TagVal('att2','14-Dec-16'))
• [Find the minimum from these values: 14, value of 'att1' at trigger time, 14.5, and the value for 'att2' at start
of day (12:00am) on Dec 14, 2016]
• Min('enum_att1', 'enum_att2', 'enum_att3')
• [At trigger time, find the lowest value from an enumeration set and return its name]
• Min('*', 'y', 'Saturday')
[Find the oldest timestamp from a set]
• Min('*'-'*-1h', 't+8h'-'y+4h', 'y'-'20', '*'-'t')
[Find the shortest interval from these time periods: from 1 hour ago to now, from 4:00am yesterday to today
at 8am, from 12:00am yesterday to 12:00am on 20th of this month, and from the beginning of day today
(12:00am) till now]
• Min(Variable1)
Name Expression Value at Evaluation
Variable1 RecordedValues('att1', '*-10m', [1, 3, 5, 7, 9]
'*')
Variable 2 Min(Variable1) 1
[Find the minimum of values in an array Variable1]
• Min(Data)
[Return the event-weighted minimum of values from an array named Data]
• Min(Data, "EventWeighted")
[Return the event-weighted minimum of values from an array named Data]
• Min(Data, "TimeWeighted")
[Return the time-weighted minimum of values from an array named Data using the timestamps of the
earliest and latest values of the array as the start time and end time respectively]
Minute
Extract the minute from a time expression.
Syntax
Minute(t1)
Arguments
• t1
A time expression, enclosed in single quotes
Returns
The minute of time, in the range 0-59
Exceptions
None
Example
• Minute('*')
[Extract the minute from current time]
• Minute(FindGT('att1', '-1h', '*', 5)
[Extract the minute from a timestamp when the value of 'att1' was first greater than 5 in the past hour.
Return error if it was never over 5]
Mod
The modulus operator (mod) returns the remainder from the quotient of two numeric values. For x Mod y, this is
the remainder from x/y.
Syntax
x Mod y
Arguments
• x
Any expression that evaluates to a numeric value
• y
Any non-zero numeric value
Returns
Remainder from x/y
Exceptions
None
Notes
UOM of x, if it exists, is carried over to the result
Example
• 11 Mod 3
[Returns 2]
Month
Extract the month from a given time expression.
Syntax
Month(t1)
Arguments
• t1
A time expression, enclosed in single quotes
Returns
The month of time, in the range 1-12
Exceptions
None
Example
• Month('*')
[Return the current month]
• Month(FindEq('att1', '-10d', '*', 5')
[Return the month from a timestamp when the value of 'att1' was first equal to 5 in the past 10 days]
NextEvent
Find the timestamp of the next recorded value after a specified time.
Syntax
NextEvent(attname, t1)
Arguments
• attname
The name of an attribute, enclosed in single quotation marks
• t1
A time expression
Returns
The timestamp of the next recorded value after the specified time for the specified attribute
Exceptions
If there is no recorded value after the specified time, then the function returns No Data
Example
• NextEvent('att1', 't')
[Find and return the timestamp of the next recorded value of 'att1' since the start of day (12am) today]
NextVal
Find the next recorded value after a specified time.
Syntax
NextVal(attname, t1)
Arguments
• attname
The name of an attribute, enclosed in single quotation marks
• t1
A time expression
Returns
The next recorded value after the specified time for the specified attribute
Exceptions
If there is no recorded value after the specified time, the function returns an error.
Example
• NextVal('att1', 't')
[Find and return the next recorded value of 'att1' since the start of day (12am) today]
Noon
Return a timestamp for noon on the day of a given time expression.
Syntax
Noon(t1)
Arguments
• t1
A time expression enclosed in single quotes
Returns
A timestamp corresponding to noon of the day of the input time
Exceptions
None
Notes
This function is useful for establishing a unique clock time independent of the length of particular days.
Example
• Noon('*')
[Return the timestamp for noon of current day]
• Noon(FindEq('att1', '-3d', '*', 50))
[Return the timestamp for noon of the day when 'att1' was first equal to 50 in the past 3 days]
NoOutput
Do not write current calculation result.
Syntax
NoOutput()
Arguments
None
Notes
It is important to include the parentheses after this function (use NoOutput() instead of NoOutput as NoOutput is
an invalid syntax). This function applies only to the current calculation.
Example
• If 'att1' < 100 or 'att1' > 200 then 'att1' else NoOutput()
Normalrnd
Return a random number that maps the normal distribution curve using a specified mean and standard
deviation.
Syntax
Normalrnd(x, y)
Arguments
• x
A real number specifying the mean of the normal distribution curve
• y
A real number specifying the standard deviation of the normal distribution curve
Returns
A random number that maps the normal distribution curve with a specified mean and standard deviation
Exceptions
None
Example
• Normalrnd(300, 2.5)
NOT
Return the negation of an expression. Return True if the truth value of an expression is false and False if the truth
value of an expression is true.
Syntax
NOT expression
Arguments
• expression
Any expression that evaluates to true or false
Returns
True when the expression is false and False when the expression is true
Exceptions
None
Example
• NOT (1 In (1...10))
[Returns False since (1 In (1...10)) is true]
NumOfChanges
Return the number of changes in value for an attribute within a specified time range.
Syntax
NumOfChanges(attname, starttime, endtime)
Arguments
• attname
The name of an attribute
• starttime
A time expression that specifies the start of a time range, or a time span (such as '-3h') that specifies the
start time relative to endtime; entries must be enclosed in single quotation marks
• endtime
A time expression that specifies the end of a time range, or a time span (such as '+3h') that specifies the end
time relative to startime; entries must be enclosed in single quotation marks
Returns
The count of changes in value for attname in the specified time range excluding bad values
Example
• NumOfChanges('att1', 't', '*')
[Return the number of times the value of 'att1' changed since midnight until now]
OR
The logical disjunction of two expressions that returns True if either expression is true and False if both are false.
Syntax
expression1 OR expression2
Arguments
• expression1
Any expression that evaluates to true or false
• expression2
Any expression that evaluates to true or false
Returns
True if either expression is true and False if both are false
Exceptions
None
Notes
If the inputs are numeric, OR can do bitwise operations.
Example
• ('att1' > 50) OR ('att2' = "good")
ParseTime
Translate a PI time expression to a timestamp. Use regular time expression inside single quotes for better
performance.
Syntax
ParseTime(s1)
Arguments
• s1
A character string or an array of strings in PI time format, enclosed in double quotes
Returns
The timestamp corresponding to s1
Exceptions
If s1 is not a character string, or if there is a syntax error, returns an error value.
If the array does not consist of strings in a time format, returns an error.
Notes
Use of the time expression '01-Jan-2018' over the string "01-Jan-2018" is strongly recommended.
Example
• ParseTime(Concat("12", "-31", "-16"))
[Returns 12/31/2016 12:00:00 AM, which is the same as '12/31/16']
• ParseTime("14-Dec-16")
[Renders the same result as '14-Dec-16'. Use only when string operations are necessary]
• ParseTime("*")
[Renders the same result as '*'. Use only when string operations are necessary]
• ParseTime(Variable1)
Name Expression Value at Evaluation
Variable1 'TimeStringArray' [t, t+3h, t+14h]
Variable 2 ParseTime(Variable1) [3/14/2018 12:00:00 AM,
3/14/2018 3:00:00 AM,
3/14/2018 2:00:00 PM]
[Renders the array results in a proper PI Time format, assuming today is 3/14/18]
PctGood
Find the time-weighted or event-weighted percentage, over a specified time range, for which the attribute had
good values.
Syntax
PctGood(attname, starttime, endtime [, calculationBasis])
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as'-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• calculationBasis
Optional. A string indicating the type of calculation to be performed enclosed in double quotes. Choose
between "TimeWeighted" or "EventWeighted". If omitted, the default is time-weighted
Returns
An integer or real number from 0 to 100: time-weighted or event-weighted minimum time percentage during a
specified time range for which the attribute had good values
Example
• PctGood('att1', 't', '+1h')
[Return the time-weighted percentage between 12:00 and 1:00am today for which 'att1' had good values]
• PctGood('att1', '-1h', '*')
[Return the time-weighted percentage between now and hour ago today for which 'att1' had good values]
• PctGood('att1', '-1h', '*', "EventWeighted")
[Return the event-weighted percentage between now and hour ago today for which 'att1' had good values]
Pi
Returns the value for pi.
Syntax
Pi()
Arguments
Returns
The value for pi
Exceptions
None
Example
• Pi()
Poisson
Return a random number that maps a Poisson distribution with a specific mean.
Syntax
Poisson(x)
Arguments
• x
Must be an integer or real number
Returns
A random number that maps a Poisson distribution with a specified mean
Exceptions
None
Example
• Poisson(15)
Poly
Return the polynomial c0 + c1x + c2x2 + … +cnxn.
Syntax
Poly(x, c0 [, ... cn])
Arguments
• x
Variable. An integer or real number
• c0 [, ... cn]
Coefficients. There must be at least one coefficient. All must be numbers.
Returns
The value of the polynomial
Exceptions
If x or any coefficient is not an integer or real number, Poly returns an error value
Example
• Poly(3, 4, 5)
[Returns 19]
• Poly('att1', 2, 3)
Pow
Return x raised to the power y.
Syntax
Pow(x, y)
Arguments
• x
numeric value
• y
numeric value
Returns
The value of x raised to the power y
Exceptions
None
Notes
• The Pow function only works in PI Asset Framework (PI AF) asset analytics expression functions. Use caret (^)
operator for same effect in Data Archive performance equations
• Both Pow(2, 3) and 2^3 are acceptable in PI AF asset analytics expression functions
Example
• Pow(2, 3)
[Returns 8]
• Pow(2.5, 3)
[Returns 15.625]
• Pow(TagVal('att1', '*'), 8)
[Return the current value of 'att1' raised to the power 8]
PrevEvent
Find the timestamp of the last recorded value before a specified time.
Syntax
PrevEvent(attname, t1)
Arguments
• attname
The name of an attribute, enclosed in single quotation marks
• t1
A time expression
Returns
The timestamp of the last recorded value before the specified time for the specified attribute
Exceptions
If there is no recorded value before the specified time, the function returns an error.
Example
• PrevEvent('att1', '*')
[Find the timestamp of the last recorded value of 'att1' before current time]
PrevVal
Find the last recorded value before a specified time.
Syntax
PrevVal(attname, t1)
Arguments
• attname
The name of an attribute, enclosed in single quotation marks
• t1
A time expression
Returns
The last recorded value before the specified time for the specified attribute
Exceptions
If there is no recorded value before the specified time, the function returns an error.
Example
• PrevVal('att1', '*')
[Find and return the last recorded value of 'att1' before current time]
• PrevVal('att1', '15-Mar-17')
[Find and return the last recorded value of 'att1' before start of day (12am) March 15th, 2017]
PStDev
Return the time-weighted or event-weighted population standard deviation for a population of one or more
values.
Syntax
PStDev(x1 [, ... xn])
PStDev(array [, calculationBasis])
Arguments
• x1, ... xn
Arguments and a single array of same value type (integers and real numbers, time expressions, or time
intervals)
• calculationBasis
Optional. The type of calculation to be performed enclosed in double quotes. Choose between
"EventWeighted" or "TimeWeighted." If omitted, the default is event-weighted. If you select
"TimeWeighted," the earliest timestamp of the value marks the start time and the latest timestamp the end
of a time range
Returns
The population standard deviation for the arguments. Returns a numeric value if the arguments are numbers.
For arguments that are time expressions (time or time period), a number indicating a time period expressed in
seconds is returned
The population standard deviation of a population x1, ..., xn is
Rand
Return a random number between 0 and 1. For specified x and y values, return a random number between x -
y/2 and x + y/2.
Syntax
Rand(x, y)
Arguments
• x
A real number specifying the center point of the range
• y
A real number specifying the size of the range.
If no arguments are specified, the default range is from 0 to 1.
Returns
A random number between 0 and 1. For specified x and y values, returns a random number between x- y/2 and x
+ y/2.
Exceptions
None
Example
• Rand()
• Rand(500, 250)
Range
Find the time-weighted or event-weighted difference between the maximum and minimum values for an
attribute during a specified time range. Time-weighted values are interpolated at time boundaries when possible
and extrapolated otherwise.
Syntax
Range(attname, starttime, endtime [, pctgood, calculationBasis])
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as'-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• pctgood
Optional. Time-weighted or event-weighted minimum time percentage over a specified time range for which
the attribute had good values
• calculationBasis
Optional. A string indicating the type of calculation to be performed enclosed in double quotes. Choose
between "TimeWeighted" or "EventWeighted". If omitted, the default is time-weighted
Returns
The time-weighted or event-weighted difference between the attribute's maximum and minimum values during
the specified time. Time-weighted values are interpolated at time boundaries when possible and extrapolated
otherwise
Exceptions
If the attribute has no good values or the pctgood minimum is not reached in the given time range, an error is
returned
Notes
• Bad values are excluded from Range calculation
• In order to configure an optional parameter, any previous optional parameter must be specified
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the values is good
Example
• Range('att1', 't', '+1h')
[Return the time-weighted difference between the maximum and minimum values for 'att1' between 12:00
and 1:00am today]
• Range('att1', 't', '+1h', 80)
[Return the time-weighted difference between the maximum and minimum values for 'att1' between 12:00
and 1:00am today when at least 80% of the values were good]
• Range('att1', 't', '+1h', 80, "EventWeighted")
[Return the event-weighted difference between the maximum and minimum values for 'att1' between 12:00
and 1:00am today when at least 80% of the values were good]
Rate
Return the difference over time between the current value and a previously evaluated value of an attribute or
(time) expression.
Syntax
Rate(x)
Arguments
• x
An attribute or (time) expression that resolves to a numeric value
Returns
• The calculated difference, using the value of the attribute, numeric, or timestamp value of the expression
parameter, according to this formula: (current value – previously evaluated value) / (current timestamp –
timestamp from previous evaluation)
Example
• Rate(‘att1’)
• Rate('sinusoid')
• Rate(DaySec(‘*’) + 1)
RecordedValues
Obtain values within a particular time range based on user-specified boundary type.
Syntax
RecordedValues(attname, starttime, endtime [, boundarytype])
Arguments
• attname
attribute of time series data (such as PI point data reference) enclosed in single quotes
• starttime
a time expression representing the beginning of a time range enclosed in single quotes; can be a relative
time (such as '-3h') in reference to an absolute endtime
• endtime
a time expression representing the end of a time range enclosed in single quotes; can be a relative time
(such as '+1h') in reference to an absolute starttime
• boundarytype
a string indicating the data retrieval behavior at the end points of a specified time in double quotes:
"Inside" - return the nearest recorded values inside the requested time range as the first and last values
"Outside" - return the nearest recorded values on the outside of the requested time range as the first and
last values
"Interpolated" - create an interpolated value at the end points of the requested time range if a recorded
value does not exist at that time
Note: If unspecified, the default is the "Inside" mode.
Returns
An array of the values obtained within the specified range
Exceptions
If the attribute does not support range calls, the function returns an error with indication
Notes
• If the starttime is earlier than the endtime, the resulting values will be in time-ascending order, otherwise
they will be in time-descending order.
• When no values are available but you specified "Outside" or "Interpolated" boundary types, a special value
(NoData) is returned.
• This function retrieves up to 500,000 values at a time.
Example
• RecordedValues('att1', 't+2h', 't+8h')
[Return the values of 'att1' between 2:00 and 8:00am today using the default "Inside" retrieval mode]
• RecordedValues('att1', 't', '+1h', "Outside")
[Return the values of 'att1' between 12:00 and 1:00am today using the "Outside" retrieval mode]
RecordedValuesByCount
Obtain a specified number of values beginning at the requested start time in the direction specified.
Syntax
RecordedValuesByCount(attname, starttime, count [, timedirection, boundarytype])
Arguments
• attname
attribute of time series data (such as PI point data reference) enclosed in single quotes
• starttime
a time expression representing the beginning of request
• count
the number of stored (recorded) values to return. The value must be greater than zero
• timedirection
a string indicating the time direction in data retrieval enclosed in double quotes:
"Backward" - begin at the start time and move backward in time. Values will be returned in time-descending
order
"Forward" - begin at the start time and move forward in time. Values will be returned in time-ascending
order
Note: If unspecified, the default is the "Backward" mode.
• boundarytype
a string indicating the data retrieval behavior at the end point of a specified time in double quotes:
"Inside" - return the nearest recorded values inside the requested time boundary
"Outside" - return the nearest recorded values on the outside of the requested time boundary
"Interpolated" - create an interpolated value at the requested time boundary if a recorded value does not
exist at that time
Note: If unspecified, the default is the "Inside" mode.
Returns
An array of the specified number of values (if available)
Exceptions
If the attribute does not support the calls, the function returns an error with indication
Notes
• When no values are available but you specified "Outside" or "Interpolated" boundary types, a special value
(NoData) is returned.
Example
• RecordedValuesByCount('att1', 't+2h', 5)
[Return 5 values of 'att1' in time-descending order starting from 2:00am today using the default "Inside"
retrieval mode moving backwards in time]
• RecordedValuesByCount('att1', 't+8h', 3, "Forward", "Outside")
[Return the first 3 values of 'att1' since 8am today using the "Outside" retrieval mode]
Remainder
Return the remainder resulting from the division of x by y using the IEEERemainder method. This remainder is
equal to x - (y Q), where Q is the quotient of x / y rounded to the nearest integer (if x / y falls halfway between
two integers, the even integer is returned). If x - (y Q) is zero, the value +0 is returned if x is positive, or -0 if x is
negative. If y = 0, NaN (not a number) is returned.
Syntax
Remainder(x, y)
Arguments
• x
Any numeric value
• y
Any non-zero numeric value
Returns
Return the remainder resulting from the division of x by y using the IEEERemainder method
Note: This is not the same as the remainder returned using the Mod (modulus) operator
Exceptions
None
Notes
Unit of measure of x, if it exists, is carried over to the result
Example
• Remainder(11, 3)
[Returns -1]
• Remainder(10, 3)
[Returns 1]
Right
Return a specified number of characters of a string from the right.
Syntax
Right(s1, len)
Arguments
• s1
string
• len
integer
Returns
len characters of the string from the right
Exceptions
If the arguments are not of the required types, an error value is returned.
Example
• Right("String", 3)
[Returns "ing"]
• Right("String", 20)
[Returns "String"]
Round
Round a number or time to the nearest unit.
Syntax
Round(x [, unit] [, roundingMode])
Arguments
• x
Integer, real number, time expression, or time interval
• unit
Optional. The size of the unit to round to. If x is a number, unit must be a number. If x is a time expression or
time period, unit must be a time expression. If unit is omitted, Round rounds to the nearest even integer (for
numbers) or second (for time expressions).
• roundingMode
Optional. The type of rounding to apply. Using the string "AwayFromZero" applies rounding of midpoint
values away from zero. Omission of this parameter, or the use of "ToEven", applies the default banker's
rounding.
Returns
The nearest value to x which is an integer multiple of unit. Returns the same data type as x. For more details, see
the following examples.
Exceptions
If x is a string, or if unit is of the wrong data type, an error value is returned.
Notes
The system uses a banker's rounding which rounds a number to the nearest even number.
If x is time and unit is omitted, this routine has no effect: times are accurate only to a second.
Unit of measure of the argument, if it exists, is carried over to the result.
Example
• Round(12.499)
[Returns 12 (rounded to the nearest integer)]
• Round(12.5)
[Returns 12 (rounded to the nearest even integer)]
• Round(12.5, "AwayFromZero")
[Returns 13 (rounded up to the nearest integer)]
• Round (13.5)
[Returns 14 (rounded to the nearest integer)]
• Round(13.45, 0.1)
[Returns 13.4 (rounded to the nearest even number in one decimal place)]
• Round(13.45, 0.1, "AwayFromZero")
[Returns 13.5 (rounded up to the nearest number in one decimal place)]
• Round(1285, 10)
[Returns 1280 (rounded to the nearest even 10)]
• Round(1285, 10, "AwayFromZero")
[Returns 1290]
• Round(1285, 10, "ToEven")
[Returns 1280 (rounded to the nearest even 10)]
• Round('14-Dec-16 11:47:16')
[Returns 14-Dec-16 11:47:16 (rounded to the nearest second)]
• Round('14-Dec-16 12:30', '+1h')
[Returns 14-Dec-97 12:00:00 (rounded to the nearest even hour)]
• Round('18:47:15'-'15:00:09')
[Returns 03:47:06 (rounded to the nearest second)]
• Round('18:45:40'-'15:15:10','+1m')
[Returns 03:30:00 (rounded to the nearest minute)]
Note: Round to the nearest day results in a timestamp of the closest day in UTC time and not local time.
Roundfrac
Round a numeric value x to y decimal places.
Syntax
Roundfrac(x, y [,roundingMode] )
Arguments
• x
Must be an integer, real number or time expression
• y
Integer that specifies the number of decimal places to round x to
• roundingMode
Optional. The type of rounding to apply. Using the string "AwayFromZero" applies rounding of midpoint
values away from zero. Omission of this parameter, or the use of "ToEven", applies the default banker's
rounding
Returns
The value of x rounded to y decimal places. Returns the same data type as x. For more details, see the examples
Exceptions
If x is a string, neither a numeric value nor a time expression, returns an error
Notes
The system uses a banker's rounding which rounds a number to the nearest even number.
Unit of measure of the argument, if it exists, is carried over to the result.
If x is time and unit is omitted, this routine has no effect: times are accurate only to 1 second.
Example
• Roundfrac (Pi(), 4)
[Returns 3.1416 ]
• Roundfrac (0.005, 2)
[Returns 0]
• Roundfrac (0.005, 2, "ToEven")
[Returns 0]
• Roundfrac (0.005, 2, "AwayFromZero")
[Returns 0.01]
• Roundfrac (TagVal('att1'), 2)
[Return the value of 'att1' rounded to 2 decimal places]
RTrim
Trim trailing blanks from a string.
Syntax
RTrim(s1)
Arguments
• s1
string
Returns
The source string with trailing blanks removed
Exceptions
If s1 is not a string, an error value is returned
Example
• RTrim("String ")
[Returns "String"]
• RTrim(" String")
[Returns " String"]
Sec
Return the trigonometric secant of a number.
Syntax
Sec(x)
Arguments
• x
Must be an integer or real number, which represents an angle in radians
Returns
The secant of x
Exceptions
If x is not a number, returns an error value
Example
• Sec(1)
[Returns 1.8508]
• Sec(1.1)
[Returns 2.2046]
• Sec('att1')
[Return the trigonometric secant of the value of 'att1' at time of evaluation]
Sech
Return the hyperbolic secant of a number.
Syntax
Sech(x)
Arguments
• x
Must be an integer or real number
Returns
The hyperbolic secant of x
Exceptions
If x is not a number, returns an error value
Example
• Sech(1)
[Returns 0.64805]
• Sech(1.1)
[Returns 0.59933]
• Sech('att1')
[Return the hyperbolic secant of the value of 'att1' at trigger time]
Second
Extract the second from a time expression.
Syntax
Second(t1)
Arguments
• t1
A time expression enclosed in single quotes.
Returns
The second of time, in the range 0-59
Exceptions
None
Example
• Second('*')
[Return the second from current time]
• Second(FindEq('att1', '-1m', '*', 2)
[Return the second from a timestamp when the value of 'att1' was first equal to 2 in the past minute]
SecSinceChange
Return the time in seconds since an attribute value or the timestamp was updated.
Syntax
SecSinceChange(attname)
Arguments
• attname
The name of an attribute, enclosed in single quotation marks
Returns
The number of seconds since the last update of the value or a timestamp for an attribute
Example
• SecSinceChange('att1')
[Return the number of seconds since the value of 'att1' or the timestamp was updated]
Sgn
Return an indicator of the numerical sign of a number.
Syntax
Sgn(x)
Arguments
• x
Must be an integer or real number
Returns
-1 if x < 0; 0 if x = 0; 1 if x > 0
Exceptions
If x is not an integer or real number, returns an error value
Example
• Sgn(1.1)
[Returns 1]
• Sgn(0)
[Returns 0]
• Sgn(-0.1)
[Returns -1]
• Sgn('att1')
[Returns 1 if the value of 'att1' is positive, 0 if it equals 0, and -1 if it is negative]
Sin
Return the trigonometric sine of a number.
Syntax
Sin(x)
Arguments
• x
Must be an integer or real number, which represents an angle in radians
Returns
The sine of x
Exceptions
If x is not a number, returns an error value
Example
• Sin(1)
[Returns 0.84147]
• Sin(1.1)
[Returns 0.89121]
• Sin('att1')
[Return the trigonometric sine of the value of 'att1' at trigger time]
Sinh
Return the hyperbolic sine of a number.
Syntax
Sinh(x)
Arguments
• x
Must be an integer or real number
Returns
The hyperbolic sine of x
Exceptions
If x is not a number, returns an error value
Example
• Sinh(1)
[Returns 1.1752]
• Sinh(1.1)
[Returns 1.3356]
• Sinh('att1')
[Return the hyperbolic sine of the value of 'att1' at trigger time]
Split
Split a string into substrings based on a specified delimiter and return an array.
Syntax
Split(s1, delimiter)
Arguments
• s1
Input string in double quotes
• delimiter
Space or character separating the input string such as "|" or "," in double quotes
Returns
Returns an array of substrings obtained by the separation of the input string based on the delimiter
Exceptions
If either of the two arguments (s1 or delimiter) is not a string, the function returns an error
Example
• Split("Value1|Value2|Value3", "|")
[Returns [Value1, Value2, Value3] ]
Sqr
Return the square root of a number.
Syntax
Sqr(x)
Arguments
• x
Must be an integer or real number equal to or greater than zero
Returns
The square root of x
Exceptions
If x is negative, or is not a number, returns an error value
Example
• Sqr(2)
[Returns 1.4142]
• Sqr(2.1)
[Returns 1.4491]
• Sqr('att1')
[Return square root of the value of 'att1' at trigger time]
StateNo
Translate a digital state into its corresponding enumeration value.
Syntax
StateNo(digstate)
Arguments
• digstate
An enumeration value
Returns
The offset into the Digital State Set corresponding to digstate
Exceptions
If a point is passed as digstate that is not a digital point, returns an error value
Notes
A digital state may appear more than once in the digital state table. In this case, the value that StateNo returns
may vary. If digstate is the value of a digital point, StateNo returns a code number appropriate for that point.
Example
• StateNo(DigState("No Data"))
[Returns 248]
• StateNo(TagVal('enum_att1', '*-1h'))
[Return the digital state number corresponding to the value of 'enum_att1' an hour ago]
SStDev
Return the time-weighted or event-weighted sample standard deviation for two or more arguments that are a
sample of a larger population.
Syntax
SStDev(x1, x2 [, ... xn])
SStDev(array [, calculationBasis])
Arguments
x1, ... xn
• Arguments and a single array of same value type (integers and real numbers, time expressions, or time
intervals)
• calculationBasis
Optional. The type of calculation to be performed enclosed in double quotes. Choose between
"EventWeighted" or "TimeWeighted." If omitted, the default is event-weighted. If you select
"TimeWeighted," the earliest timestamp of the value marks the start time and the latest timestamp the end
of a time range
Returns
The sample standard deviation of the arguments. Returns a numeric value if the arguments are numbers. For
arguments that are time expressions (time or time period), a number indicating a time period expressed in
seconds is returned
The standard deviation of a sample x1, ... xn is equal to
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as'-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• pctgood
Optional. Time-weighted or event-weighted minimum time percentage during a specified time range for
which the attribute had good values
• calculationBasis
Optional. A string indicating the type of calculation to be performed enclosed in double quotes. Choose
between "TimeWeighted" or "EventWeighted". If omitted, the default is time-weighted
Returns
The time-weighted or event-weighted standard deviation for attribute values from the specified time range
Exceptions
If the attribute has no good values or the pctgood minimum is not reached for the given time range, an error is
returned
Notes
• Bad values are excluded from StDev calculation
• In order to configure an optional parameter, any previous optional parameter must be specified
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the values is good
Example
• StDev('att1', 't', '+1h')
[Return the time-weighted standard deviation of values for 'att1' between 12:00 and 1:00am today]
• StDev('att1', 't', '+1h', 80)
[Return the time-weighted standard deviation of values for 'att1' between 12:00 and 1:00am today when at
least 80% of the values were good]
• StDev('att1', 't', '+1h', 80, "EventWeighted")
[Return the event-weighted standard deviation of values for 'att1' between 12:00 and 1:00am today when at
least 80% of the values were good]
String
Convert any value to a string.
Syntax
String(x)
Arguments
• x
Any expression that is of normal PI value type
Returns
The string representing the value argument
Exceptions
None
Example
• String("Hello, PI user!")
[Returns "Hello, PI user!"]
• String(12.23)
[Returns "12.23"]
• String('sinusoid')
[Return current value of 'sinusoid' in string]
• String('*')
[Return the current time in string]
TagAvg
Find the time-weighted or event-weighted average of values for an attribute during a specified time range.
Syntax
TagAvg(attname, starttime, endtime [, pctgood, calculationBasis])
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• pctgood
Optional. Time-weighted or event-weighted minimum time percentage in a specified time range for which
the attribute had good values
calculationBasis
Optional. A string indicating the type of calculation to be performed enclosed in double quotes. Choose
between "TimeWeighted" or "EventWeighted". If omitted, the default is time-weighted
Returns
The time-weighted or event-weighted average of attribute values during a specified time range
Exceptions
If the point has no good values or the pctgood minimum is not reached for the given time range, returns an error
value
Notes
• Bad values are excluded from TagAvg calculation.
• In order to configure an optional parameter, any previous optional parameter must be specified.
• For more information, see the OSIsoft Knowledge Base article How Time-Weighted and Event-Weighted
Totals and Averages Work.
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the values is good
Example
• TagAvg('att1', 't', '+1h')
[Return the time-weighted average of values for 'att1' between 12:00 and 1:00am today]
• TagAvg('att1', 't', '+1h', 80)
[Return the time-weighted average of values for 'att1' between 12:00 and 1:00am today when at least 80%
of the values were good]
• TagAvg('att1', 't', '+1h', 80, "EventWeighted")
[Return the event-weighted average of values for 'att1' between 12:00 and 1:00am today when at least 80%
of the values were good]
TagBad
For an attribute associated with a PI point, test the point for an abnormal state at a specified time. If the point is
an integer or real number, any digital state is considered abnormal. For digital points, the states that are defined
for that point are normal; all others are abnormal.
Syntax
TagBad(attname [, t1])
Arguments
• attname
An attribute associated with a PI point
• time
Optional: A time expression. If omitted, current time ('*') is used.
Returns
False if the point's state at time is normal, True if it is abnormal.
Exceptions
None
Notes
BadVal can test any value or expression; TagBad can only test a PI point.
Example
• TagBad('att1')
[Returns True if PI point for 'att1' does not exist or its value corresponds to system digital state (No Data, for
example)]
• TagBad('enum_att1', '14-Dec-16')
[Returns True if PI point for 'enum_att1' does not exist or its value corresponds to system digital state (No
Data, for example) at 12:00am on December 14th, 2016]
TagDesc
For an attribute associated with a PI point, retrieve that point's descriptor from the point database.
Syntax
TagDesc(attname)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotes
Returns
The point's descriptor
Exceptions
If the PI point does not exist, an error value is returned
Example
• TagDesc('sinusoid')
[Returns 12 Hour Sine Wave]
• TagDesc('cdt158')
[Returns Atmospheric Tower OH Vapor]
TagEU
For an attribute associated with a PI point, retrieve the point's engineering unit string from the point database.
Syntax
TagEU(attname)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotes
Returns
The PI point's engineering units
Exceptions
If the PI point does not exist, an error values is returned
Notes
Returns blank when PI point lacks an engineering unit
Example
• TagEU('cdt158')
[Returns DEG.C]
TagExDesc
For an attribute associated with a PI point, retrieve the point's extended descriptor from the point database.
Syntax
TagExDesc(attname)
Arguments
• attname
An attribute with a PI point data reference, enclosed in single quotes
Returns
The PI point's extended descriptor
Exceptions
If the PI point does not exist, an error values is returned
Notes
Returns blank when PI point lacks extended descriptor
Example
• TagExDesc('cdt158')
[Returns blank since the point lacks extended descriptor]
TagMax
Find the time-weighted or event-weighted maximum value of an attribute during a specified time range. Time-
weighted values are interpolated at time boundaries when possible and extrapolated otherwise.
Syntax
TagMax(attname, starttime, endtime [, pctgood, calculationBasis])
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as'-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• pctgood
Optional. Time-weighted or event-weighted minimum time percentage over a specified time range for which
the attribute had good values
calculationBasis
Optional. A string indicating the type of calculation to be performed enclosed in double quotes. Choose
between "TimeWeighted" or "EventWeighted". If omitted, the default is time-weighted
Returns
The attribute's time-weighted or event-weighted maximum value during the specified time range. Time-
weighted values are interpolated at time boundaries when possible and extrapolated otherwise
Exceptions
If the attribute has no good values or the pctgood minimum is not reached for the given time range, an error
value is returned
Notes
• Bad values are excluded from TagMax calculation
• In order to configure an optional parameter, any previous optional parameter must be specified
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the values is good
Example
• TagMax('att1', 't', '+1h')
[Return the time-weighted maximum value of 'att1' between 12:00 and 1:00am today]
• TagMax('att1', '14-Dec-16', '15-Dec-16')
[Return the time-weighted maximum value of 'att1' between 12:00am 12/14/2016 and 12:00am
12/15/2016]
• TagMax('att1', 't', '+1h', 80)
[Return the time-weighted maximum value of 'att1' between 12:00 and 1:00am today when at least 80% of
the values were good]
• TagMax('att1', 't', '+1h', 80, "EventWeighted")
[Return the event-weighted maximum value of 'att1' between 12:00 and 1:00am today when at least 80% of
the values were good]
TagMean
Find the average (mean) of values for an attribute during a specified time range. TagAvg with event-weighted
option provides the same result as TagMean. Consider using TagAvg rather than TagMean especially if time-
weighted TagAvg is used in other analyses.
Syntax
TagMean(attname, starttime, endtime [, pctgood])
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as'-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• pctgood
Optional: Minimum percentage of the specified time range that attribute values must be good.
Returns
The attribute's average value over the given time. Notice that the average is not time-weighted. For time-
weighted average, use TagAvg instead
Exceptions
If the attribute has no good values or the pctgood minimum is not reached for the specified time range, an error
value is returned. Unlike some other summary functions, TagMean does not interpolate any value on the
boundary. Thus, if there is no value in the specified interval, an error value is returned
Notes
Bad values are excluded from TagMean calculation
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the values is good
Example
• TagMean('att1', 't', '+1h')
[Return the average (mean) value of 'att1' between 12:00 and 1:00am today]
• TagMean('att1', 't', '+1h', 80)
[Return the average (mean) value of 'att1' between 12:00 and 1:00am today when at least 80% of the values
were good]
• TagMean('att1', '14-Dec-16', '15-Dec-16')
[Return the average (mean) value of 'att1' between 12:00am 12/14/2016 and 12:00am 12/15/2016]
TagMin
Find the time-weighted or event-weighted minimum value of an attribute during a specified time range. Time-
weighted values are interpolated at time boundaries when possible and extrapolated otherwise.
Syntax
TagMin(attname, starttime, endtime [, pctgood, calculationBasis])
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as'-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• pctgood
Optional. Time-weighted or event-weighted minimum time percentage over a specified time range for which
the attribute had good values
calculationBasis
Optional. A string indicating the type of calculation to be performed enclosed in double quotes. Choose
between "TimeWeighted" or "EventWeighted". If omitted, the default is time-weighted
Returns
The time-weighted or event-weighted minimum value for the attribute during the specified time range. Time-
weighted values are interpolated at time boundaries when possible and extrapolated otherwise
Exceptions
If no good attribute values exist or if the pctgood minimum is not reached for the specified time range, an error
value is returned
Notes
• Bad values are excluded from TagMin calculation
• In order to configure an optional parameter, any previous optional parameter must be specified
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the values is good
Example
• TagMin('att1', 't', '+1h')
[Return the time-weighted minimum value of 'att1' between 12:00 and 1:00am today]
• TagMin('att1', '14-Dec-16', '15-Dec-16')
[Return the time-weighted minimum value of 'att1' between 12:00am 12/14/2016 and 12:00am
12/15/2016]
• TagMin('att1', 't', '+1h', 80)
[Return the time-weighted minimum value of 'att1' between 12:00 and 1:00am today when at least 80% of
the values were good. Return error when minimum pctgood is not reached]
• TagMin('att1', 't', '+1h', 80, "EventWeighted")
[Return the event-weighted minimum value of 'att1' between 12:00 and 1:00am today when at least 80% of
the values were good. Return error when minimum pctgood is not reached.]
TagName
For an attribute associated with a PI point, get a point's name from the point database.
Syntax
TagName(attname)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotes
Returns
The name of the PI point associated with attname
Exceptions
If the PI point does not exist, an error value is returned
Example
• TagName('sinusoid')
[Returns SINUSOID]
• TagName('cdt158')
[Returns CDT158]
TagNum
For an attribute associated with a PI point, get a point's number from the point database.
Syntax
TagNum(s1)
Arguments
• string
The name of an attribute with a PI point data reference, enclosed in double quotes
Returns
The point's number
Exceptions
If the point does not exist, returns an error value
Example
• TagNum("sinusoid")
[Returns 1]
• TagNum("cdt158")
[Returns 3]
TagSource
For an attribute associated with a PI point, get a point's point source string from the point database.
Syntax
TagSource(attname)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotes
Returns
The point's point source string
Exceptions
If the point does not exist, an error value is returned
Example
• TagSource('sinusoid')
[Returns R]
• TagSource('cdt158')
[Returns R]
TagSpan
For an attribute associated with a PI point, get a point's span from the point database.
Syntax
TagSpan(attname)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotes
Returns
The point's span. If the point's type is digital, returns an integer whose value is the number of digital state
defined for the point.
Example
• TagSpan('sinusoid')
[Returns 100]
• TagSpan('cdt158')
[Returns 200]
TagTot
Find the time-weighted (time integral) or event-weighted totalized value of an attribute's values over a specified
time range, optionally converting the totalized value from its current unit of measure (UOM) to a specified UOM
in same class. Time-weighted values are interpolated at time boundaries when possible and extrapolated
otherwise.
Syntax
TagTot(attname, starttime, endtime [, toUnit, pctgood, calculationBasis])
Arguments
• attname
attribute with time series data (such as PI point data reference) enclosed in single quotes
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• toUnit
Optional. The UOM to which the totalized value is converted. The specified UOM must be compatible with
the UOM of the input attribute. Specifying an empty string ("") produces the same result as if no UOM were
specified.
pctgood
Optional. Time-weighted or event-weighted minimum time percentage over a specified time range for which
the attribute had good values
calculationBasis
Optional. A string indicating the type of calculation to be performed enclosed in double quotes. Choose
between "TimeWeighted" or "EventWeighted". If omitted, the default is time-weighted.
Returns
The time-weighted (time integral) or event-weighted totalized value of an attribute's values over a specified time
range. Time-weighted values are interpolated at time boundaries when possible and extrapolated otherwise.
Exceptions
• If the attribute has no good values or the pctgood minimum is not reached for the given time range, an error
value is returned.
• If the specified UOM for conversion is incompatible with the UOM of the input attribute, an error value is
returned. For example, if the UOM of the input attribute is gallons/minute, and the UOM for conversion is
"m" (meters), then an error is returned.
Notes
• In case toUnit is not specified, the system chooses a scale factor such that the integral is correct only if the
flow is expressed in units per day. If the flow is expressed in units per hour, or per some other time unit, you
must multiply this result by a conversion factor. The conversion factor equals the number of actual flow time
units in a day.
• For instance, if you totalize values measured in gallons per minute, multiply the result of TagTot by 1440 to
get the answer in gallons. This conversion factor is not related to the time period you are totalizing over; it is
strictly a function of the attribute's engineering units.
• Bad values are excluded from TagTot calculation.
• When the percentage of good data is less than 100%, TagTot determines the total based on good data and
divides the fraction of good data in the interval. The time period during which the data is bad is ignored
when calculating the total.
• In order to configure an optional parameter, any previous optional parameter must be specified.
Note: If the attribute has very few good values during the time range, this function's result may not be
trustworthy. Use the PctGood function to find out what percentage of the value is good.
Example
• TagTot('att1', 't', '+1h')
[Return the time-weighted totalized value of 'att1' between 12:00 and 1:00am today.]
• TagTot('att1', 't', '+1h', "m")
[Return the time-weighted totalized value of 'att1' calculated based on its unit between 12:00 and 1:00am
today and convert to meters.]
• TagTot('att1', 't', '+1h', "", 80)
[Return the time-weighted totalized value of 'att1' calculated based on its unit between 12:00 and 1:00am
today when at least 80% of the values were good. Return error when minimum pctgood is not reached.]
• TagTot('att1', 't', '+1h', "", 80, "TimeWeighted")
[Return the time-weighted totalized value of 'att1' calculated based on its unit between 12:00 and 1:00am
today when at least 80% of the values were good. Return error when minimum pctgood is not reached.]
• TagTot('att1', 't', '+1h', "m", 80)
[Return the time-weighted totalized value of 'att1' calculated based on its unit between 12:00 and 1:00am
today and convert to meters when at least 80% of the values were good. Return error when minimum
pctgood is not reached.]
• TagTot('att1', 't', '+1h', "m", 80, "EventWeighted")
[Return the event-weighted totalized value of 'att1' calculated based on its unit between 12:00 and 1:00am
today and convert to meters when at least 80% of the values were good. Return error when minimum
pctgood is not reached.]
TagType
For an attribute associated with a PI point, get a point's point type from the point database.
Syntax
TagType(attname)
Arguments
attname
• The name of an attribute with a PI point data reference, enclosed in single quotes
Returns
Point type
Exceptions
If the point does not exist, returns an error
Example
• TagType('sinusoid')
[Returns Float32]
• TagType('cdm158')
[Returns Digital]
TagTypVal
For an attribute associated with a PI point, get a point's typical value from the point database.
Syntax
TagTypVal(attname)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotes
Returns
The point's typical value. If the point is an integer or real number, a number is returned; if the point's value type
is digital, this indicates a digital state
Exceptions
If the point does not exist, returns an error
Example
• TagTypVal('sinusoid')
[Returns 50]
• TagTypVal('cdm158')
[Returns 3, a digital state]
TagVal
Return the value of an attribute at a specified time.
Syntax
TagVal(attname [, t1])
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
• t1
Optional: A time expression. If you omit this argument, '*' is used
Returns
The value of an attribute at a specified time. This value is interpolated unless the associated PI Point has the Step
property set to True or the value type of the attribute cannot be interpolated (for example, if it is a string)
Exceptions
If the associated point does not exist or has no value at the specified time, an error is returned
Example
• TagVal('att1')
[Return the value of 'att1' at current time]
• TagVal('att1', 't+8h')
[Return the value of 'att1' at 8am today]
• TagVal('enum_att1')
[Return the value of 'enum_att1', an attribute from an enumeration set at current time]
TagZero
For an attribute with a PI point data reference, get a PI point's "zero" value from the point database.
Syntax
TagZero(attname)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotes
Returns
The point's zero value. If the point type is integer or real number, this is a number; if the point's type is digital,
this is a digital state (character string)
Exceptions
If the point does not exist, returns an error
Example
• TagZero('sinusoid')
[Returns 0]
• TagZero('cdt158')
[Returns 50]
Tan
Return the trigonometric tangent of a number.
Syntax
Tan(x)
Arguments
• x
Must be an integer or real number, which represents an angle in radians
Returns
The tangent of x.
Exceptions
If x is not a number, returns an error
Example
• Tan(1)
[Returns 1.5574]
• Tan(1.1)
[Returns 1.9648]
• Tan('att1')
[Return the trigonometric tangent of the value of 'att1' at trigger time]
Tanh
Return the hyperbolic tangent of a number.
Syntax
Tanh(x)
Arguments
• x
Must be an integer or real number
Returns
The hyperbolic tangent of x
Exceptions
If x is not a number, returns an error value
Example
• Tanh(1)
[Returns 0.76159]
• Tanh(1.1)
[Returns 0.8005]
• Tanh('att1')
[Return the hyperbolic tangent of the value of 'att1' at trigger time]
Text
Concatenate strings representing argument values.
Syntax
Text(x1 [, x2, … xn])
Arguments
• x1 … xn
Any expression of normal PI value type
Returns
A string that is the concatenation of strings representing the argument values.
Example
• Text(Round('sinusoid', 1), " is the current value of 'sinusoid' at ", '*')
[Returns rounded current value of 'sinusoid' at current time]
THEN
Operator that returns the first of two specified values when the conditional expression in IF-THEN-ELSE
statement is True.
Syntax
IF(expression) THEN (x) ELSE (y)
Arguments
• expression
Any expression that evaluates to true or false
• x,y
An expression that evaluates to an output value
Returns
x when the conditional expression is true and y when the expression is false
Exceptions
None
Example
• IF ('att1' > 50) THEN ('att2') ELSE ('att3')
[If the value of 'att1' is greater than 50, then return the value of 'att2'; otherwise return the value of 'att3']
TimeEq
Find the total time, within a range, when an attribute value is equal to a specified value. Time returned is in
seconds.
Syntax
TimeEq(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• x
The reference value of the search; must be an enumeration set (string), integer or real number
Returns
The total time (in seconds), within a range, when an attribute value is equal to a given value
Notes
Bad values are excluded from TimeEq calculation
Example
• TimeEq('att1', 't', '+1h', 80)
[Find the total time between 12:00 and 1:00am today when 'att1' was equal to 80. Return the result in
seconds]
• TimeEq('att1', '-1h', '*', TagVal('att1', 't+8h'))
[Find the total time in the past hour when the value of 'att1' was equal to the value at 8am today. Return the
result in seconds]
• TimeEq('Temperature Status', '-1h', '*', "Normal")
Expression Output Attribute (attribute mapped to a PI point)
TimeGE
Find the total time, within a range, when an attribute value is greater than or equal to a specified value. Time
returned is in seconds.
Syntax
TimeGE(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• x
The reference value of the search; must be an enumeration set (string), integer or real number
Returns
The total time (in seconds), within a range, when an attribute value is greater than or equal to a given value
Exceptions
None
Notes
TimeGE interpolates between events, if necessary, to find the times when the attribute value crossed the given
value
Bad values are excluded from TimeGE calculation
Example
• TimeGE('att1', 't', '+1h', 80)
[Find the total time between 12:00 and 1:00am today when 'att1' was greater than or equal to 80]
• TimeGE('att1', '-1h', '*', TagVal('att1', 't+8h'))
[Find the total time in the past hour when the value of 'att1' was greater than or equal to the value at 8am
today. Result is in seconds]
• TimeGE('enum_att1', '*-1d', '*', DigState("Normal", 'enum_att1'))
TimeGT
Find the total time, within a range, when an attribute value is greater than a specified value. Time returned is in
seconds.
Syntax
TimeGT(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• x
The reference value of the search; must be an enumeration set (string), integer or real number
Returns
The total time (in seconds), within a range, when an attribute value is greater than a given value
Exceptions
None
Notes
TimeGT interpolates between events, if necessary, to find the times when the attribute value crossed the
specified value
Bad values are excluded from TimeGT calculation
Example
• TimeGT('att1', 't', '+1h', 80)
[Find the total time between 12:00 and 1:00am today when 'att1' was greater than 80]
• TimeGT('att1', '-1h', '*', TagVal('att1', 't+8h'))
[Find the total time in the past hour when the value of 'att1' was greater than the value at 8am today. Result
is in seconds]
• TimeGT('enum_att1', '*-1d', '*', DigState("Normal", 'enum_att1'))
TimeLE
Find the total time, within a range, when an attribute value is less than or equal to a given value. Time returned
is in seconds.
Syntax
TimeLE(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• x
The reference value of the search; must be an enumeration set (string), integer or real number
Returns
The total time (in seconds), within a range, when an attribute value is less than or equal to a given value
Exceptions
None
Notes
TimeLE interpolates between archive events, if necessary, to find the times when the point crossed the given
value
Bad values are excluded from TimeLE calculation
Examples
• TimeLE('att1', 't', '+1h', 80)
[Find the total time between 12:00 and 1:00am today when 'att1' was less than or equal to 80]
• TimeLE('att1', '-1h', '*', TagVal('att1', 't+8h'))
[Find the total time in the past hour when the value of 'att1' was less than or equal its value at 8am today.
Result is in seconds]
• TimeLE('enum_att1', '*-1d', '*', DigState("Normal", 'enum_att1'))
TimeLT
Find the total time, within a range, when an attribute value is less than a specified value. Time returned is in
seconds.
Syntax
TimeLT(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• x
The reference value of the search; must be an enumeration set (string), integer or real number
Returns
The total time (in seconds), within a range, when an attribute value is less than a given value
Exceptions
None
Notes
TimeLT interpolates between Archive events, if necessary, to find the times when the attribute value crossed the
specified value
Bad values are excluded from TimeLT calculation
Example
• TimeLT('att1', 't', '+1h', 80)
[Find the total time between 12:00 and 1:00am today when 'att1' was less than 80]
• TimeLT('att1', '-1h', '*', TagVal('att1', 't+8h'))
[Find the total time in the past hour when the value of 'att1' was less than its value at 8am today. Result is in
seconds]
• TimeLT('enum_att1', '*-1d', '*', DigState("Normal", 'enum_att1'))
TimeNE
Find the total time, within a range, when an attribute value is not equal to a specified value. Time returned is in
seconds.
Syntax
TimeNE(attname, starttime, endtime, x)
Arguments
• attname
The name of an attribute with a PI point data reference, enclosed in single quotation marks
• starttime
time expression representing the beginning of a time range enclosed in single quotes; can be a relative time
(such as '-3h') in reference to an absolute endtime
• endtime
time expression representing the end of a time range enclosed in single quotes; can be a relative time (such
as '+1h') in reference to an absolute starttime
• x
The reference value of the search; must be an enumeration set (string), integer or real number
Returns
The total time (in seconds), within a range, when an attribute value is not equal to a specified value
Exceptions
None
Notes
Bad values are excluded from TimeNE calculation
Example
• TimeNE('att1', 't', '+1h', 80)
[Find the total time between 12:00 and 1:00am today when 'att1' was not equal to 80]
• TimeNE('att1', '-1h', '*', TagVal('att1', 't+8h'))
[Find the total time in the past hour when the value of 'att1' was not equal to the value at 8am today. Result
is in seconds]
• TimeNE('enum_att1', '*-1d', '*', DigState("Normal", 'enum_att1'))
TimeStamp
Return the time stamp for a single time-stamped value or an array of time-stamped values.
Syntax
TimeStamp(x)
Arguments
• x
A time-stamped value or an array of time-stamped values
Returns
The timestamp of the specified time-stamped value
Exceptions
If the value of x is No Data, then Calc Failed is returned
Example
• TimeStamp(PrevVal('sinusoid', '*'))
[Return the time stamp of the last recorded value before the current one for 'sinusoid']
• TimeStamp(Variable1)
Name Expression Value at Evaluation
Arguments
• x1, ... xn
Numbers, time intervals or a single array of numbers or time intervals
• calculationBasis
Optional. The type of calculation to be performed enclosed in double quotes. Choose between
"EventWeighted" or "TimeWeighted." If omitted, the default is event-weighted. If you select
"TimeWeighted," the earliest timestamp of the value marks the start time and the latest timestamp the end
of a time range
Returns
The total of the arguments. The result has the same data type as the arguments
Exceptions
Arguments whose run-time values are digital states are not included in the total. If all values are digital states,
Total returns an error value. Returns an error if the array does not consist of same value type
Notes
• Unit of Measure (UOM) of the arguments is carried over to the result when at least one argument has a
defined UOM while others don't. The returned value lacks a UOM if arguments have different UOMs
Example
• Total('att1', 'att2', TagVal('att1', 'y+2h'), 40)
[Return the sum of following values: values of 'att1' and 'att2' at current time, the value of 'att1' at 2am
yesterday and 40]
• Total('t'-'y', '+1h')
[Returns 1.01:00:00]
• Total(Variable1)
Name Expression Value at Evaluation
Trim
Trim blanks on both sides of a string.
Syntax
Trim(s1)
Arguments
• s1
string
Returns
The source string with leading and trailing blanks removed.
Exceptions
If s1 is not a string, an error value is returned.
Example
• Trim(" String ")
[Returns "String"]
• Trim(" String is a string attribute. ")
[Returns "String is a string attribute."]
Year
Extract the year from a time expression.
Syntax
Year(t1)
Arguments
• t1
A time expression, enclosed in single quotes
Returns
The year of time, in the range 1970-present
Exceptions
None
Example
• Year('*')
[Return what year it is now]
• Year(FindGT('att1', '1/1/1970', '*', 50))
[Return what year it was when the value of 'att1' was first greater than 50 since 1/1/1970]
Trunc
Truncate a number or time to the next lower unit.
Syntax
Trunc(x [, unit])
Arguments
• x
An integer or real number, time expression, or time period.
• unit
Optional. The size of the unit to truncate to; x will be truncated to a multiple of unit. If x is a number, unit
must be a number. If x is a time expression or time period, unit must be a time period. If unit is omitted,
Trunc truncates to the next lower integer (for a number) or second (for a time period).
Returns
The largest multiple of unit that is less than x. For a negative x, it returns the lowest multiple of unit larger than x.
The return is the same data type as x.
Exceptions
If x is a string, or if unit is of the wrong data type, an error is returned.
Notes
If x is a time, and unit is omitted, this routine has no effect, as times are only accurate to one second.
When |x| < |unit|, 0 is returned.
Example
• Trunc(12.999)
[Returns 12, truncated to the next lower integer]
• Trunc(28.75, 10)
[Returns 20, truncated to next lower multiple of 10]
• Trunc('14-Dec-16 11:47', '+1h')
[Returns 12/14/2016 11:00:00 AM, truncated to next lower hour]
• Trunc('18:47'-'15:00','+1h')
[Returns 03:00:00, truncated period to next lower hour]
Note: Truncating to the next lower day results in a timestamp of the next lower day in UTC time, not local
time.
UCase
Convert a string to an uppercase string.
Syntax
UCase(s1)
Arguments
• s1
String in double quotes
Returns
s1 in uppercase
Exceptions
If the argument is not a string, returns an error value.
Example
• UCase("String")
[Returns "STRING"]
Weekday
Extract the day of the week from a given time expression.
Syntax
Weekday(t1)
Arguments
• t1
A time expression, enclosed in single quotes
Returns
The day of the week, in the range 1-7, where 1 represents a Sunday
Exceptions
None
Example
• Weekday('*')
[Return what day of the week today is]
• Weekday(FindEq('att1', '-7d', '*', 50))
[Return what day of the week it was when the value of 'att1' was 50 for the first time in the past 7 days]
Yearday
Extract the day of the year from a time expression. The day of the year (also known as a Julian day) is an integer
ranging from 1 to 366, where 1 represents January 1.
Syntax
Yearday(t1)
Arguments
• t1
A time expression, enclosed in single quotes
Returns
The day of the year of time, in the range 1-366, where 1 represents January 1
Exceptions
None
Example
• Yearday('*')
[Return what day of the year today is, where 1 represents January 1]
• Yearday('y')
[Return what day of the year yesterday was, where 1 represents January 1]
Function Description
Steam_HPS
Calculate the vapor specific enthalpy as a function of pressure (P in kPa) and entropy (S in J/(g K)). Use for both
superheated and wet steam as well as compressed water. By default, input arguments and returned values are in
SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_HPS(P, S)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• S
Specific entropy of the steam. S can range from -0.000155 to 11.921J/(g K).
Returns
Computed vapor specific enthalpy in J/g.
Example
• Steam_HPS(2500, 7.5956)
[Returns 3684.9 J/g]
Steam_HPT
Calculate the vapor specific enthalpy as a function of pressure (P in kPa) and temperature (T in °C). Use for an
entire range from compressed water to superheated steam. By default, input arguments and returned values are
in SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_HPT(P, T)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• T
Temperature of the steam. T can range from 0.0 to 800 °C.
Returns
Computed vapor specific enthalpy in J/g.
Example
• Steam_HPT(40000, 600)
[Returns 3350.4 J/g]
Steam_HPTL
Calculate the liquid specific enthalpy as a function of pressure (P in kPa) and temperature (T in °C). Only use for
compressed water. For any T greater than the saturation temperature for P, the function returns an out-of-range
error. The function accepts any T in the temperature range as long as P is greater than the critical pressure. By
default, input arguments and returned values are in SI units. You can change the units of measure, for example,
by using the Convert function.
Syntax
Steam_HPTL(P, T)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• T
Temperature of the steam. T can range from 0.0 to 800 °C.
Returns
Computed liquid specific enthalpy in J/g.
Example
• Steam_HPTL(40000, 100)
[Returns 449.27 J/g]
Steam_HPX
Calculate the specific enthalpy as a function of pressure (P in kPa) and quality (vapor fraction). Use only for wet
steam. By default, input arguments and returned values are in SI units. You can change the units of measure, for
example, by using the Convert function.
Syntax
Steam_HPX(P, X)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
• X
Steam quality (vapor fraction). X can range from 0.0 to 1.0.
Returns
Computed specific enthalpy in J/g.
Example
• Steam_HPX(10000, 0.9)
[Returns 2593.7 J/g]
Steam_HsatP
Calculate the saturated vapor specific enthalpy as a function of pressure (P in kPa). By default, input arguments
and returned values are in SI units. You can change the units of measure, for example, by using the Convert
function.
Syntax
Steam_HsatP(P)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
Returns
Computed specific enthalpy for saturated vapor in J/g.
Example
• Steam_HsatP(10000)
[Returns 2725.5 J/g]
Steam_HsatT
Calculate the saturated vapor specific enthalpy as a function of temperature (T in °C). By default, input
arguments and returned values are in SI units. You can change the units of measure, for example, by using the
Convert function.
Syntax
Steam_HsatT(T)
Arguments
• T
Temperature of the steam. T can range from 0.0 to 373.946 °C.
Returns
Computed saturated vapor specific enthalpy in J/g.
Example
• Steam_HsatT(250)
[Returns 2801 J/g]
Steam_PsatT
Calculate the saturation pressure as a function of temperature (T in °C). By default, input arguments and
returned values are in SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_PsatT(T)
Arguments
• T
Temperature of the steam. T can range from 0.0 to 373.946 °C.
Returns
Computed saturation pressure of the steam in kPa.
Example
• Steam_PsatT(250)
[Returns 3975.9 kPa]
Steam_SPH
Calculate the vapor-specific entropy as a function of pressure (P in kPa) and enthalpy (H in J/g). Use for both
superheated and wet steam as well as compressed water. By default, input arguments and returned values are in
SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_SPH(P, H)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• H
Enthalpy of the steam. H can range from -0.04159 to 4160.7 J/g.
Returns
Computed vapor specific entropy in J/(g K).
Example
• Steam_SPH(10000, 3500)
[Returns 6.756 J/(g K)]
Steam_SPT
Calculate the vapor specific entropy as a function of pressure (P in kPa) and temperature (T in °C). Use for an
entire range from compressed water to superheated steam. By default, input arguments and returned values are
in SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_SPT(P, T)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• T
Temperature of the steam. T can range from 0.0 to 800 °C.
Returns
Computed vapor specific entropy in J/(g K).
Example
• Steam_SPT(40000, 600)
[Returns 6.017 J/(g K)]
Steam_SPTL
Calculate the liquid specific entropy as a function of pressure (P in kPa) and temperature (T in °C). Only use for
compressed water. For any T higher than the saturation temperature for P, the function returns an out-of-range
error. The function accepts any T in the temperature range as long as P is greater than the critical pressure. By
default, input arguments and returned values are in SI units. You can change the units of measure, for example,
by using the Convert function.
Syntax
Steam_SPTL(P, T)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• T
Temperature of the steam. T can range from 0.0 to 800 °C.
Returns
Computed liquid specific entropy in J/(g K).
Example
• Steam_SPTL(30000, 500)
[Returns 5.7956 J/(g K)]
Steam_SPX
Calculate the steam specific entropy as a function of pressure (P in kPa) and quality (vapor fraction). Use for only
wet steam. By default, input arguments and returned values are in SI units. You can change the units of measure,
for example, by using the Convert function.
Syntax
Steam_SPX(P, X)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
• X
Steam quality (vapor fraction). X can range from 0.0 to 1.0.
Returns
Computed specific entropy of the steam in J/(g K)
Example
• Steam_SPX(15000, 0.7)
[Returns 4.8229 J/(g K)]
Steam_SsatP
Calculate the saturated vapor specific entropy as a function of pressure (P in kPa). By default, input arguments
and returned values are in SI units. You can change the units of measure, for example, by using the Convert
function.
Syntax
Steam_SsatP(P)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
Returns
Computed saturated vapor specific entropy in J/(g K)
Example
• Steam_SsatP(10000)
[Returns 5.6159 J/(g K)]
Steam_SsatT
Calculate the saturated vapor specific entropy as a function of temperature (T in °C). By default, input arguments
and returned values are in SI units. You can change the units of measure, for example, by using the Convert
function.
Syntax
Steam_SsatT(T)
Arguments
• T
Temperature of the steam. T can range from 0.0 to 373.946 °C.
Returns
Computed saturated vapor specific entropy in J/(g K).
Example
• Steam_SsatT(250)
[Returns 6.0722 J/(g K)]
Steam_TPH
Calculate the steam temperature as a function of pressure (P in kPa) and enthalpy (H in J/g). Use for both
superheated and wet steam as well as compressed water. By default, input arguments and returned values are in
SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_TPH(P, H)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• H
Enthalpy of the steam. H can range from -0.04159 to 4160.7 J/g.
Returns
Computed steam temperature in °C.
Example
• Steam_TPH(40000, 3500)
[Returns 643.48 °C]
Steam_TPS
Calculate the steam temperature as a function of pressure (P in kPa) and entropy (S in J/(g K)). Use for both
superheated and wet steam as well as compressed water. By default, input arguments and returned values are in
SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_TPS(P, S)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• S
Specific entropy of the steam. S can range from -0.000155 to 11.921J/(g K).
Returns
Computed steam temperature in °C.
Example
• Steam_TPS(40000, 6)
[Returns 595.93 °C]
Steam_TsatP
Calculate the saturation temperature as a function of pressure (P in kPa). By default, input arguments and
returned values are in SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_TsatP(P)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
Returns
Computed saturation temperature in °C.
Example
• Steam_TsatP(10000)
[Returns 311 °C]
Steam_VPH
Calculate the vapor specific volume as a function of pressure (P in kPa) and enthalpy (S in J/g). Use for both
superheated and wet steam as well as compressed water. By default, input arguments and returned values are in
SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_VPH(P, H)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• H
Enthalpy of the steam. H can range from -0.04159 to 4160.7 J/g.
Returns
Computed vapor specific volume in cm3/g.
Example
• Steam_VPH(25000, 3500)
[Returns 14.197 cm3/g]
Steam_VPS
Calculate the vapor specific volume as a function of pressure (P in kPa) and entropy (S in J/(g K)). Use for both
superheated and wet steam as well as compressed water. By default, input arguments and returned values are in
SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_VPS(P, S)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• S
Specific entropy of the steam. S can range from -0.000155 to 11.921J/(g K).
Returns
Computed vapor specific volume in cm3/g
Example
• Steam_VPS(40000, 6)
[Returns 8.0055 cm3/g]
Steam_VPT
Calculate the vapor specific volume as a function of pressure (P in kPa) and temperature (T in °C). Use for an
entire range from compressed water to superheated steam. You can change the units of measure, for example,
by using the Convert function.
Syntax
Steam_VPT(P, T)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• T
Temperature of the steam. T can range from 0.0 to 800 °C.
Returns
Computed vapor specific volume in cm3/g.
Example
• Steam_VPT(50000, 500)
[Returns 3.8894 cm3/g]
Steam_VPTL
Calculate the liquid specific volume as a function of pressure (P in kPa) and temperature (T in °C). For any T
higher than the saturation temperature for P, the function returns an out-of-range error. The function accepts
any T in the temperature range as long as P is greater than the critical pressure. By default, input arguments and
returned values are in SI units. You can change the units of measure, for example, by using the Convert function.
Syntax
Steam_VPTL(P, T)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 100000 kPa.
• T
Temperature of the steam. T can range from 0.0 to 800 °C.
Returns
Computed liquid specific volume in cm3/g
Example
• Steam_VPTL(75000, 500)
[Returns 2.308 cm3/g]
Steam_VPX
Calculate the steam specific volume as a function of pressure (P in kPa) and quality (vapor fraction). Use for only
wet steam. By default, input arguments and returned values are in SI units. You can change the units of measure,
for example, by using the Convert function.
Syntax
Steam_VPX(P, X)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
• X
Steam quality (vapor fraction). X can range from 0.0 to 1.0.
Returns
Computed steam specific volume in cm3/g
Example
• Steam_VPX(15000, 0.7)
[Returns 7.7352cm3/g]
Steam_VsatP
Calculate the saturated vapor specific volume as a function of pressure (P in kPa). By default, input arguments
and returned values are in SI units. You can change the units of measure, for example, by using the Convert
function.
Syntax
Steam_VsatP(P)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
Returns
Computed vapor specific volume in cm3/g
Example
• Steam_VsatP(10000)
[Returns 18.034 cm3/g]
Steam_VsatT
Calculate the saturated vapor specific volume as a function of temperature (T in °C). By default, input arguments
and returned values are in SI units. You can change the units of measure, for example, by using the Convert
function.
Syntax
Steam_VsatT(T)
Arguments
• T
Temperature of the steam. T can range from 0.0 to 373.946 °C.
Returns
Computed saturated vapor specific volume in cm3/g.
Example
• Steam_VsatT(250)
[Returns 50.087 cm3/g]
Steam_XPH
Calculate the steam quality (vapor fraction) as a function of pressure (P in kPa) and enthalpy (H in J/g). Use only
for wet steam. By default, input arguments and returned values are in SI units. You can change the units of
measure, for example, by using the Convert function.
Syntax
Steam_XPH(P, H)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
• H
Enthalpy of the steam. H can range from -0.04159 to 4160.7 J/g.
Returns
Computed steam quality (vapor fraction)
Example
• Steam_XPH(10000, 2500)
[Returns 0.82888]
Steam_XPS
Calculate the steam quality (vapor fraction) as a function of pressure (P in kPa) and entropy (S in J/(g K)). Use
only for wet steam. By default, input arguments and returned values are in SI units. You can change the units of
measure, for example, by using the Convert function.
Syntax
Steam_XPS(P, S)
Arguments
• P
Pressure of the steam. P can range from 0.611212678 to 22064 kPa.
• S
Specific entropy of the steam. S can range from -0.000155 to 11.921J/(g K).
Returns
Computed steam quality (vapor fraction)
Example
• Steam_XPS(10000, 5)
[Returns 0.72695]
Chapter 14
Notifications
Notifications is the feature in Asset Framework (PI AF) that you use to create and manage notification rules.
Notification rules are the mechanism by which users are alerted for response in real time, for conditions that
signal events of interest. Notification messages may be customized to include information that is specifically
relevant to the event, and may be sent via email to individuals, groups, or to a web service. Further, escalations
are also configurable in the notification system.
Within PI System Explorer, you can configure and manage notification rules from the Notification Rules tab
(visible after you select an element), and from the Management plug-in.
Note: You can open the audit log directly from notification rules by right-clicking the notification rule and
selecting Audit Trail Events. For more information on audit trail, see Track PI AF changes with Audit Trail.
Introduction to notifications
Notification rules: Definition and scope
Notifications is included as a feature of PI Server, starting with the 2016 R2 version, and is not installed as a
separate product. The notifications feature allows you to configure "notification rules" to send email messages or
to call a web service; you can also configure message content and set up escalations.
Note: Notifications created using PI Notifications 2012 or earlier are henceforth referred to as "legacy
notifications".
Notifications are alerts that are generated when an event of interest is detected in the PI Server; such events are
detected by examining and comparing real-time and static data with user-defined conditions configured in the PI
Server. User-specified information can be configured in notifications that are sent to users or groups in real time
to alert users of conditions to which they may need to respond. Notifications integrate with, and leverage, PI AF
and other PI System services, and can be shared, managed, and maintained enterprise-wide. All notification
actions, such as notification send times, acknowledgments, entry of comments, and escalations, are stored for
later retrieval and examination.
Notification rules are based on event frames and notification messages can include information from event
frame templates. For more information, see Notifications and event frames.
PI Notifications Service
PI Notifications Service is a Windows service that evaluates notification rules, processes incoming real-time
event frames, and sends notifications. The PI Notifications Service need not run on the same machine as the
Data Archive, PI AF server, or the client applications.
For information on event frames, see Event frames in PI AF.
Training video
For more information on using notifications in PI Asset Framework, watch the videos on the OSIsoft Learning
channel playlist:
• 1. Analysis-generated event frames. For more information, see Event frame generation analyses to create
analyses from the Analyses tab, and Trigger criteria in notification rules to create analyses from the
Notification Rules tab of PI System Explorer.
• 2. Event Frames Generator (EFGen) interface-generated event frames. See Introduction to PI EFGen.
• 3. Custom AF SDK applications-generated event frames. See the AF SDK documentation.
• 4. Manually created event frames.
Notifications history
Information associated with previous times that a notification was generated is stored as annotations on each
event frame that triggered the notification. The annotations can be accessed by selecting the specific event
frame of interest from the Event Frames plug-in on PI System Explorer. Each event frame annotation includes
such information as the notification rule corresponding to the send event, the subscribers who were notified and
when they were notified, and whether the attempt to notify was successful.
If you have migrated from PI Notifications 2012, and elected to migrate both configuration and history, your
legacy notifications history is fully migrated; the historical information is migrated as annotations on the event
frames created during migration. The migration report includes information on the legacy history instances that
were processed during migration.
Note: For information on permissions required during migration, see Migration from PI Notifications 2012.
Event frame annotations may also be viewed using AVEVA PI Vision or other client tools that support viewing
annotations.
Acknowledge a notification
In PI AF 2016, you can require that an event frame be acknowledged. The acknowledgment feature is used by
notifications and PI AF client applications, such as AVEVA PI Vision. The event-frame acknowledgment feature
replaces the acknowledge notification functionality in legacy PI Notifications 2012 and older versions.
For more information on acknowledging event frames in PI AF, see Acknowledgment of event frames and
Acknowledge event frames.
For more information on viewing and acknowledging event frames using AVEVA PI Vision, see the AVEVA PI
Vision user guide. topic View event details and annotate events.
Notifications security
The notifications feature uses Windows security for communicating internally and with the PI AF server.
Note: See the PI Server topic PI AF objects and local permissions for PI Notifications Service for information on PI
Notifications Service account permissions.
You can secure access to notification rules, notification rule templates, contacts, and contact templates. Object
permissions are granted according to the PI AF Security model.
If Active Directory (AD) access is configured, information from the AD is accessed to create individual contacts.
You cannot delete an AD contact from PI System Explorer, and you cannot modify security settings for the
contact. To configure AD access, see the PI Server topic Configure Active Directory objects for delegation.
If you are using a screenshot feature in your email delivery format, see the security guidelines in the PI Server
Installation and Upgrade guide topic Trusted sites for screenshots. For more information, see also Add a
screenshot in notification email delivery format and Add a domain to the list of trusted sites.
In line with PI Asset Framework, Notifications supports Windows environments that enforce the use of U.S.
Federal Information Processing Standards (FIPS) cryptographic algorithms. For more information, see Support for
FIPS section in and Microsoft Support article "System cryptography: Use FIPS compliant algorithms for
encryption, hashing, and signing" security setting effects in Windows XP and in later versions of Windows.
If you entered ... The system allows ... The system blocks ...
5. Copy the default Global Default Email format by clicking on the copy icon in the Message pane.
Alternatively, you can create a new delivery format by clicking the new delivery format icon .
6. Click in the Message pane, and then click the link icon.
7. Enter your base address in Paste a Link window and click Continue.
8. In the Display link as row, click the Screenshot radio button.
9. Optional. In the Image options row, choose Format and Size from each drop down list.
10. Click OK.
Subscriptions in notification rules
Contacts and Subscriptions panes in PI System Explorer
From the Subscriptions pane, you can configure the subscribers to be alerted when a notification rule is
triggered. A subscriber is an individual entity or group of entities that can receive notification messages by
subscribing to notification rules.
To see the Contacts and Subscriptions panes on PI System Explorer, navigate to the Notification Rules tab for a
selected element, and then click View/Edit Subscriptions in the Subscriptions pane.
To add a subscriber from the Notifications Rules tab of PI System Explorer, simply drag and drop a contact from
the Contacts pane to the Subscriptions pane.
Note: To unsubscribe a contact, right-click on the contact and select Unsubscribe.
When you install PI AF, information from Active Directory (AD) is imported and individual contacts are
automatically created in Contacts. For more information, see Configure Active Directory access for contacts. If a
user does not have an AD account, you can create a custom contact.
Subscriptions pane
When a contact is added to the Subscriptions pane, the following details are included for the contact:
• Name
The name of the contact.
• Configuration
The default, inherited, or custom delivery format for this subscriber.
• Notify Option
The notify option may be one of:
• Event start and end. You can receive a notification when an event frame matching the notification rule is
created or closed.
• Event start.
• Event end. You can receive a notification only when an event frame is closed.
Contacts pane
Subscribers may be configured from these types of contacts on the Contacts pane:
• Individual contact
• Escalation teams
• Groups
• Delivery endpoints
Use Contacts Search to find individual contacts to include in a group or escalation team, or subscribe to a
notification rule. You may use wildcards to expand your name searches; this will search both first and last names.
For example, searching for "A*" will list both "Adam Smith" and "John Adams".
Note: The search results show the display name as configured in Active Directory.
For more information on configuring contacts using the Contacts plug-in, see Contacts plug-in.
Training video
For information on how to configure subscribers, watch this video:
Setup Contacts, Delivery Endpoints, Groups, & Escalation Teams for Notifications[2016 R2]
d. Click the wrench icon to open the Web Service Configuration window to configure the JSON object
for the REST API method.
REST can send a JSON object to the REST server in HTTP methods PUT, POST or PATCH.
e. Click the Body tab to enter the path and value on each row.
Currently, only JSON payloads are supported; query string parameters are not supported.
If you hover over the help icon, you see sample JSON parameters (path and value) that are necessary
for configuring this method:
You can validate the method using the Test Send button.
f. Click the Headers tab to enter HTTP headers for your request.
You use headers to pass additional information along with your request. You can enter the key and value
pair on each row. Common HTTP headers will be available in a drop-down list to enter as a key (for
example, Content-Type).
Note: The default value of the HTTP header Content-Type is application/json; charset=utf-8.
You can also enter a custom header if your web service requires a specific type of header (for example, a
custom API key header.)
You can validate the request using the Test Send button.
SOAP can call the web service methods. Click the "wrench" icon to configure the SOAP API method.
The "Information" icon gives you information about the parameters (path and value) that must be
configured for this method, and their complexity. Enter the path and value on each row (the path
depends on how the web service server is configured); clicking on a row brings up a drop-down list of
expected values for that path. The interface also automatically validates the parameters that you enter
on each row. You can validate the method using the Test Send button.
You have the option to cancel or retry a connection that is taking a long time to complete; this may
happen if you have a high latency (commonly called "laggy") connection where the WSDL information is
not quickly retrieved.
Note: Complex data may be required by the method. To enter the correct information, refer to the
Web Service Definition Language (WSDL) documentation for the API method.
Contacts plug-in
In PI System Explorer, the Contacts plug-in provides you with contact options for individual users and groups.
Contacts plug-in versions
PI System Explorer works with different versions of the Contacts plug-in.
• To work with the version that is compatible with the new version of notifications that was released in 2016
R2, execute the 64-bit version of PI System Explorer.
• To work with the legacy version that is compatible with legacy notifications, execute the 32-bit version of PI
System Explorer. Note that if legacy notifications is not installed, the new version of the Contacts plug-in will
load. For more information on PI System Explorer versions, see .
Subscriber configuration
You can configure subscribers from these types of contacts:
• Delivery endpoints
A delivery endpoint is an entity to which notifications can be sent, and is typically an individual user
or an application.
• Groups
A group contact is an unordered collection of delivery endpoints, other groups or escalation teams.
Notification messages are sent to all members of the group simultaneously.
Note: Group contacts that you create in PI System Explorer are not the same as Active Directory (AD) groups.
• Escalation teams
An escalation team is an ordered collection of delivery endpoints or groups.
Notification messages are sent immediately to the first contact on the list. If the event frame matching the
notification rule is not acknowledged or closed within a specified time, notification messages are sent
sequentially to the remaining members of the escalation team until the event frame is acknowledged or closed.
The escalation period defines the amount of time to elapse before a notification is sent to the next contact on
the list.
Search for contacts
Click the icon to open the Search Contacts window in the Contacts pane on the top left of the screen.
Currently available search criteria are: Name, Description, Department and Email.
Note: You must be running the 2018 or later version of PI AF server to use email as search criterion. Note that
search by email address only works for contacts in Active Directory but does not find contacts created manually.
Manage contacts
You cannot nest escalation teams.
Use the Contacts plug-in to manage individual contact information, as well as manage groups, escalation teams,
and delivery endpoints for use with notifications.
1. In the navigator, click Contacts.
2. In the Contacts browser, choose from the following actions.
To ... Do this ...
Create an escalation team a. Right-click the Escalation Teams folder and click New
b. In the Name field, enter a unique name for the escala
c. In Escalation period, specify how long you want an es
d. In If not acknowledged, specify the action to be taken
sent to all contacts in a team:
To• stop the escalation process, select End escalati
To• repeat the escalation process for a specified nu
acknowledged, select Repeat N times.
To• repeat the escalation process indefinitely until
Repeat while active.
e. Choose from the following actions:
Click
• and, in the Select a Contact window, loca
group, or a delivery endpoint, and click OK.
In•the Contacts palette, locate a contact with a ne
endpoint, and drag it onto the viewer.
f. Configure the sequence for the escalation chain.
Click
• a subscriber and click and to position as
To• remove a subscriber, click the subscriber to be
Create a delivery endpoint such as a stand-alone a. Right-click the Delivery Endpoints folder and click New
email or a web service
b. In the Name field, enter a unique name for the delive
c. Enter notification contact options for the delivery end
fields.
d. From Delivery channel, select a deliver option.
For
• Email, enter address configuration informatio
email delivery channel.
For
• WebService, enter web service address config
the notifications web service delivery channel
3. To save changes you have made to contacts, press Ctrl+S or click Check In.
Option Description
Web Service Address The URL of your web service. You can validate the
connection using the Get Web Services button.
Web Service The name of the web service to be used for
notification.
Default Web Method Default web method to be used for the notification.
This menu displays all of the parameters defined in
the web service.
The PI System Explorer user interface automatically retrieves the associated Web Service Definition Language
(WSDL) methods, provides useful information about the parameters, and guides you through configuring the
web service.
Configuring the REST web service
The following table lists the options you must set for a REST web service delivery endpoint:
REST web service options
Option Description
Use a provided search Select All, Enabled or Disabled. These are view-only
and cannot be modified, as indicated by the (View
selected search) icon.
Create a custom search Note: Customized search is only visible to the user
who created it on the computer where it was created.
Creating your own search is a new feature in PI AF
2017. Refer to the previous versions of PI System
Explorer User Guide if you are using an earlier version
of PI AF.
9. Optional. To create a custom delivery email format, copy the default Global Default Email format by clicking
on the copy icon in the Message pane. Alternatively, you can create a new delivery format by clicking the
new delivery format icon .
The default format includes basic notification information such as the notification rule name, trigger time
and event frame start time, as well as system information such as system and database names. To add more
information to your custom format, drag and drop information from the Content pane to the Message pane.
Tip: A hyperlink indicates that an event frame template is selected; you may add the attributes defined
below the event frame template to the content of your email notification by dragging and dropping the
attributes from the Content pane to the Message pane.
You can designate your custom format as the default by clicking the Is Default box in the Message pane.
10. Click View/edit subscription in the Subscriptions pane.
You can search for contacts using Contacts Search in the Contacts pane. To add a subscriber, drag and drop a
specific contact from the Contacts pane to the Subscriptions pane. Make sure to select your customized
email format if you have created one, or pick the Global Default email format.
Note: The notifications feature no longer supports the Microsoft Office Communication Service (OCS) or custom
delivery channels. However, using REST-based web services, you may be able to integrate notifications with third-
party delivery channels.
Process models in PI AF
A PI AF model consists of connected elements that represent a logical model of your process. A model is itself an
element, but with two additional element properties: layers and connections. Elements in the model can
represent physical entities in your process, such as tanks, pipes, and process units, or logical entities, such as
recipes and summary data. The model is composed of connected elements.
PI AF models can be simple, containing only a handful of elements, or they can be very complex, containing
thousands of elements and measurements. The size of the model is only limited by the data available to fulfill
the information requirements of an analysis on the model.
Submodels
A model is also an element, which means that a model can be composed of other models - referred to as
submodels. This allows for either top-down or bottom-up development of a plant model. The boundary
elements of a model normally define the elements with ports that can be used for connections outside the
model.
Create PI AF models
You create a PI AF model in the Elements browser.
1. In the navigator, click Elements.
2. Right-click the collection of elements and click New Model.
3. In the Choose Model Template window, select a template on which to base the model or select None.
4. Click OK.
The model configuration tabs appear in the viewer.
5. In the Name field of the General tab, enter a name for the model.
6. Optional. In the Description field, enter a description for the model.
7. The read-only Template and Type fields list the template and element type chosen when the model was
created. To view the template properties, click . Element types are described in Element types in models.
8. Optional. You can organize objects by grouping them into categories. To browse the available categories, click
.
9. To assign a default attribute, select the attribute from the Default Attribute drop-down list. Note that you
must add attributes in the Attributes tab first before they appear in the list. This field is read only if the
model is based on a template; the box displays the attribute specified in the template.
10. Optional. To specify location attribute traits for the model, click the Location link. For more information, see
Set location attribute traits.
11. Optional. To specify asset health attribute traits for the model, click the Health link. For more information,
see Set health attribute traits.
12. Optional. To configure access permissions for the new model that are different from those inherited from the
Elements collection, click the Security link. For more information, see Configure security for objects.
13. Click OK and check in your work.
Edit PI AF models
You view or edit PI AF models in the <Model Name> Connections window.
1. Right-click on a model in the Elements browser and click Model Connections.
The <Model Name> Connections window shows a visual representation of the elements in the model and
how they are connected.
2. To edit the model:
▪ Right-click an element in the Connections pane to create a new connection or to view or edit the
properties of the element.
▪ Click an element to center it in the Connections pane and show any other connected elements. You can
move along the flow of the model this way, element by element.
▪ Click a connection to view or edit the connection or to add another source or destination.
▪ Right-click a connection to make another connection, view the properties of the selected connection, or
to copy and paste the properties of the connection.
Create ports
To specify a port as the default port, you must open the Properties window.
1. In the Elements browser, select an element and then click the Ports tab in the viewer.
Note: If the element is based on a template, you cannot add a port unless the template allows extensions.
2. Click New Port, and create a port for the element. Right-click an existing port to view or edit its properties.
3. Configure the port.
• Port Type: Select the port type: Input, Output, or Undirected (for meters, for example).
• Allowed Categories: Select the categories of which the port is allowed to be a member.
• Maximum Connections: Specify the maximum number of connections that can be made to the port.
Enter zero for an unlimited number of connections.
• Connection Type: Select the type of element to which the port can connect, for example, Node,
Boundary, Measurement, and so on.
• Allowed Templates: Select elements allowed to connect to the port. Select only elements created from
the selected template.
Create connections
Use the Connections tab to display the connections in a model.
1. To create a new model in the Elements browser, right-click the collection of elements as described in Create
PI AF models, and click New Model.
2. Follow these steps to fill in the Connections tab.
a. Right-click in the field and select New Connection.
b. In the Make Connection window, right-click an existing connection to view or edit its properties.
c. In the Source field, select the source for the connection. Select the appropriate port of the source in the
corresponding Port field.
d. In the Destination field, select the destination for the connection. Select the appropriate port of the
destination in the corresponding Port field.
To include child elements, select the Include Child Elements check box.
Layers
You can organize the elements of a model into layers. Layers provide a mechanism for including or excluding
portions of the model as needed for analysis. An element of a model can belong to more than one layer. You can
also use the Layers feature with a graphic modeling tool, such as PI ProcessBook, to provide a visual overlay
functionality.
Create layers
Create a Layer to enable you to include or exclude portions of a model.
1. In the Elements browser, select the model to which you want to add a layer.
2. Click the Layers tab in the viewer.
3. Right-click and click New Layer.
4. In the Name field of the Layer Properties window, enter a unique name for the layer.
5. Optional. In the Description field, describe the purpose of the layer.
6. In the element list, select one or more elements that comprise the layer.
7. Click OK.
Chapter 16
After you install PI AF, several utilities are available to assist you in your administration of PI AF and management
of plug-ins.
AFExplorer parameters
The following table lists the available parameters for the AFExplorer utility.
PI AF Diagnostics utility
The PI AF Diagnostics (AFDiag) utility is a command-line utility that you can use to enable or disable PI AF server
features and perform other administrative functions. The utility makes a direct connection with the associated
SQL Server database and requires the SQL Server sysadmin or db_AFadmin role.
AFDiag is located in the \PIPC\AF folder.
8. Click OK to save your changes and close the Microsoft SQL Server Management Studio.
Parameter Description
Review changes to PI AF objects in all databases Click Tools > Audit Trail.
Review changes to a single PI AFobject a. Open the database that contains the object
you want to audit.
b. In the navigator, click the object type you
want to audit. For example, to audit a
table, click Library.
c. In the browser, expand the tree until the
object you want to audit is displayed in
either the browser tree or listed in the
viewer.
d. Right-click the object and click Audit Trail
Events.
Review changes to the UOM database a. In the navigator, click Units of Measure.
b. Click File > Audit Trail Events.
2. In the table displayed in the AF Audit Trail window, review changes made to PI AF data. The following
columns are displayed:
Column Description
Adjust the time period a. Change Start Time and End Time to adjust
the time period. You can choose from the
following actions:
Click
• to choose or enter a new date
and/or time.
Click
• to construct a relative time
expression.
b. Click (or press Enter) to display the
updated table.
View changes for a subsequent time period Click .
View changes for a previous time period Click .
Adjust the number of change rows for current time a. In the Maximum field, enter the number of
period records you want returned in the results
list.
b. Click (or press Enter) to refresh the results
in the list.
c. If there are additional records that are not
displayed in the results list, the Next
button appears active. Click Next to
display the next page of records in the
query results.
Note: You can also display additional records by
increasing the value in the Maximum field and then
pressing Enter.
To ... Do this ...
Action Type of change (Insert, Update, or Delete) and the PI AF object sub-object (such
as an attribute or attribute value).
Name The PI AF sub-object; can be blank.
Id The identity of the object referenced in the detail record. The value is either a
GUID or an integer. The identity can be useful in situations where an object is
renamed, since the underlying identity does not change.
Property Name The column name from the SQL table in PI AF SQL Database (PIFD) for the
changed sub-object. This name provides a specific reference to the data within
the record that has been changed.
Old Value The value before the change.
New Value The value after the change.
b. Click Close to return to the AF Audit Trail window.
4. Optional. You can export selected data grid rows or all the rows from the time range (if no rows are selected)
in CSV format:
a. In the Export to File field, enter a name for the export file.
b. Click to open the Save As window and navigate to a specific directory.
c. If you want to export the data from Audit Trail Details window for each selected row, select the Detailed
check box.
d. Click Export All or Export Selected, depending on whether you selected specific rows. (A tooltip
indicates the number of rows selected.)
The status bar initially indicates the total number of rows and then appends the time when the export
completed. Note that while the export is executing, you can cancel it by clicking Cancel Export. The status
bar indicates the time when the export was canceled.
5. To exit the Audit Trail utility, click Close.
View installed plug-ins
You check on installed plug-ins in the PI AF Server Properties window.
1. Select File > Server Properties.
2. In the PI AF Server Properties window, click the Plug-Ins tab.
▪ Move the pointer over a plug-in to see whether it is loaded and the version loaded.
▪ Right-click a plug-in and select Properties to view details, such as the assembly, version, loaded version,
support assemblies, and so on.
Note: The loaded plug-in version usually matches the version on the PI AF server. However, if the version
on the server changes, you must restart PI System Explorer to load the new plug-in version on the server.
RegPlugIn parameters
The following table lists available parameters for the RegPlugin utility.