PI Server Intalacion PDF
PI Server Intalacion PDF
PI3 Server
Version 3.4.370
Worldwide Offices
OSIsoft, Inc. is the owner of the following trademarks and registered trademarks: PI System, PI ProcessBook,
Sequencia, Sigmafine, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known to be
trademarks or service marks have been appropriately capitalized. Any trademark that appears in this book that
is not owned by OSIsoft, Inc. is the property of its owner and use herein in no way indicates an endorsement,
recommendation, or warranty of such party's products or any affiliation with such party of any kind.
Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)
of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
Copyright Notice
Unpublished -- rights reserved under the copyright laws of the United States
PREFACE – USING THIS GUIDE
The PI Server Installation and Upgrade Guide provides the information and instructions that
System Administrators need to install a PI Server, or to upgrade an existing installation.
This guide includes comprehensive instructions to assist you in:
Installing, upgrading and removing PI Servers on Windows and UNIX platforms
Performing Cluster and Silent installations on Windows platforms
To install or upgrade your PI System, please review and follow the recommendations and
instructions for the procedure(s) you need to perform:
Preparing and Planning for Installation
PI Server Installation on Windows
• Upgrading the PI Server on Windows
• Starting and Stopping PI on Windows
• Removing PI Installations on Windows
PI Server Installation on UNIX
• Upgrading the PI Server on UNIX
• Starting and Stopping PI on UNIX
• Removing PI Installations on UNIX
PI Server Cluster Installation on Windows
PI Server Silent Installation on Windows
This guide assumes that the System Administrator has a working understanding of PI Server
tools and utilities such as PIConfig, PIDiag and PIArtool. For information about command-
line tools and other PI System setup and configuration procedures, see the PI Server System
Management Guide and the PI Server Reference Guide.
The PI Server Documentation Set provides additional PI Server information and system
management procedures.
The PI Server Documentation Set includes seven user guides, described below.
Tip: Updated user guides, which provide the most up-to-date information, are
available for download from the OSIsoft Technical Support Web site
(http://techsupport.osisoft.com).
Introduction to PI A guide to the PI Server for new users and administrators. It explains PI
System Management system components, architecture, data flow, utilities and tools. It provides
instruction for managing points, archives, backups, interfaces, security
and trusts, and performance. It includes a glossary and resource guide.
PI Server Installation A guide for installing, upgrading and removing PI Servers on Windows
and Upgrade Guide and UNIX platforms, including cluster and silent installations.
PI Server System An in-depth administration guide for the PI Server, including starting and
Management Guide stopping systems, managing the Snapshot, Event Queue and Data
Archive, monitoring system health, managing backups, interfaces,
security, and moving and merging servers. Includes comprehensive
instructions for using command-line tools: PIConfig, PIDiag, and PIArtool,
and in-depth troubleshooting and repair information.
PI Server Reference A comprehensive reference guide for the System Administrator and
Guide advanced management tasks, including: databases; data flow; PI Point
classes and attributes, class edit and type edit; exception reporting;
compression testing; security; SQL subsystem; PI time format; and
overviews of the PI API, and PI-SDK System Management Tool (SMT).
Auditing the PI An administration guide that explains the Audit Database, which provides
Server a secure audit trail of changes to PI System configuration, security
settings, and Archive Data. It includes administration procedures to
enable auditing, to set subsystem auditing mode, to create and archive
database files, and to export audit records.
PINet and PIonPINet A systems administration guide, including installation, upgrade and
User Guide operations, for PINet for OpenVMS and PIonPINet, which support
migration and interoperability between PI2 and PI3 Systems.
Page iv
Preface - Using this Guide
Monospace Consolas monospace is used for: To list current Snapshot information every 5 seconds,
type: Code examples use the piartool -ss command. For example:
"Consolas" Commands to be typed on the
font command line (optionally with
arguments or switches)
System input or output such as
excerpts from log files and other
data displayed in ASCII text
Bold consolas is used in the
context of a paragraph
Light Blue - Links to URL / Web sites, and email http://www.osisoft.com/procedures.aspx
Underlined addresses [email protected]
Related Documentation
OSIsoft provides a full range of documentation to help you understand and use the PI Server,
PI Server Interfaces, and PI Client Tools. Each Interface has its own manual, and each Client
application has its own online help and/or user guide.
The UniInt End User Manual describes the OSIsoft Universal Interface (UniInt), which is
recommended reading for PI Server system managers. Many PI Interfaces are based upon
UniInt, and this guide provides a deeper understanding of principals of Interface design.
The PI Server provides two sets of powerful tools that allow System Administrators and users
to perform System Administration tasks and data queries.
The PI Server includes many command-line tools, such as pidiag and piartool. The
PI Server Documentation Set provides extensive instruction for performing PI Server
Administrative tasks using command-line tools.
The PI System Management Tools (SMT) is an easy-to-use application that hosts a
variety of different plug-ins, which provide all the basic tools you need to manage a
PI System. You access this set of tools through a single host application. This host
application is sometimes referred to as the SMT Host, but it is more commonly called
System Management Tools or SMT.
You can download the latest version of SMT from the Technical Support Web site:
http://techsupport.osisoft.com
In addition to extensive online help that explains how to use all of the features in the SMT,
the SMT includes the Introduction to PI System Management user guide.
Page vi
QUICK TABLE OF CONTENTS
Table of Contents..............................................................................................................................ix
Index of Topics...............................................................................................................................131
Page x
Chapter 1. PREPARING AND PLANNING FOR INSTALLATION
A license file, pilicense.dat, is required for the PI Server installation to complete. The license
file is separate from the PI Server installation package. The license file is available on CD-
ROMs or by downloading it from the OSIsoft Web site.
Page 2
1.3 - System Sizing
Compaq Alpha Compaq Tru64 UNIX V5.1B or Alpha EV6, Alpha EV67,
later Alpha EV68, or Alpha EV7;
500+ MHz
IBM RS/6000 IBM AIX 5L Version 5.1 RS64 IV; 450+ Mhz
Note: The minimum processor specifications should be used as guidelines only. The
PI Server assumes it is the only server application on the system. The PI Server, for
performance, makes aggressive use of available memory. The PI Server will not
perform optimally if it competes with other large applications such as an RDBMS.
In this manual, HP-UX, Sun Solaris, Compaq UNIX, and IBM AIX are collectively called
UNIX systems.
Network Configuration
The PI Server relies on a proper network configuration to run successfully. TCP/IP must be
installed and configured before installing PI, even on stand-alone hosts.
A standard installation uses host name lookups for client access logging and validation. It is
important for performance and security to configure a stable and responsive host name file,
DNS or other name service. A slow name service can dramatically impede PI and in some
cases cause it to fail.
similarly to the CD installation, copying a few files into the system temporary directory. Both
the self-extracted files will remain in place after installation or upgrade is complete. You may
remove them if you wish.
The PI Server files installed on the system require approximately 100 MB on the system disk
for Intel Windows, excluding archive files. In addition, there are support symbols for
debugging that require an additional 60 MB of space on the system disk for Intel Windows.
The bulk of a PI Server’s disk usage is in the archives. These can typically encompass many
gigabytes of disk space, depending on the number of days of online data desired.
The disk space used by each archive is typically fixed at archive creation time. However, the
other PI Server databases and the message log files grow with time. Most of the databases
grow in size proportionally to the number of points defined in the system. The message log
files grow with time and system activity.
Detailed sizing information follows.
Archive Size
During new installations, three default archives are created. The installation script prompts
for archive size (in MB) and archive location. All three archives are created with the same
size in the same location (path). Additional archives can be created after the installation using
the utility piarcreate or, in some cases, piartool. Once created, these archive files do not
change size. Note that there is also a special kind of archive referred to as a dynamic archive
that does grow, but this is a special case.
The PI Server allows a maximum point-to-archive record ratio of 512 points per 1 MB (1024
archive records). For example, 256,000 points can be created in a 500MB archive. However,
it is recommended that you allocate as much space as possible without exceeding the limits of
your physical and backup media. Typically a ratio of between 10 and 20 records (1 KB per
record) per point per archive yields the best performance. Systems with a large percentage of
slow-moving data or a large number of fast-moving data may deviate from this dramatically.
Selecting a proper archive size can dramatically affect performance and space utilization.
Archives that are too small will waste significant space. Archives that are too large incur
overhead due to overflow index record creation and result in significant system transients
during archive maintenance such as backups and shifts. The limitations of the system
resources and backup media should also be weighed. Fortunately, archives sizes can be
changed as the system configuration changes, and old archives can be reprocessed to
optimize space use and performance.
Page 4
1.3 - System Sizing
The remaining system databases will together take at least another megabyte of disk space.
These include the User Database, Point Context and Point Attribute Set Databases, the Digital
State Database, and the network manager tables.
The PI Snapshot Event Queue overflow file resides in the PI\dat directory and is named
pieventq.dat. For example, if communications between the Snapshot and the Archive fail
(such as during an archive backup or archive shift), the Event Queue file will fill up with
incoming data. Anywhere from a few megabytes to the size of the disk may be needed to
buffer incoming data until the Archive is accessible again. The amount of disk space
available determines the maximum duration that PI can accommodate the loss of the
archiving process.
HP-UX 21 63
Solaris 24 108
Tru64 21 82
AIX 24 42
All platforms require the same total space for data files and tables. The bulk of a PI Server’s
disk usage is in the archives. These can typically encompass many gigabytes of disk space
depending on the number of years of online data desired.
The disk space used by archives is typically fixed at archive creation time. However, the
other PI Server databases and the message log files grow with time. Most of the databases
grow in size proportionally to the number of points defined in the system. The message log
files grow with time and system activity.
More detailed sizing information follows.
Archive Size
During new installations, three default archives are created. The installation script prompts
for archive size (in MB) and archive location. All three archives are created with the same
size in the same location (path). Additional archives can be created after the installation using
the utility piarcreate or, in some cases, piartool. Once created, these archive files do not
change size. Note that there is also a kind of archive referred to as a dynamic archive that
does grow. It is a special case.
The PI System allows a maximum point-to-archive-record ratio of 512 points per 1 megabyte
(1024 archive records). For example, 256,000 points can be created in a 500MB archive. It is
recommended that you allocate as much space as possible without exceeding the limits of
your physical and backup media. Typically a ratio of between 10 and 20 records (1 KB per
record) per point per archive yields the best performance. Systems with a large percentage of
slow-moving data or a large number of fast-moving data may deviate from this dramatically.
Selecting a proper archive size can dramatically affect performance and space utilization.
Archives that are too small will waste significant space. Archives that are too large incur
overhead due to index record creation and result in significant system transients during
archive maintenance such as backups and shifts. The limitations of the system resources and
backup media should also be weighed. Fortunately, archives sizes can be changed as the
system configuration changes and old archives can be reprocessed to optimize space use and
performance.
Page 6
1.3 - System Sizing
Memory Requirements
The PI System is a memory-intensive application. Frequently accessed data structures are
kept in memory for performance reasons. The primary memory-consuming PI processes, in
descending order, are piarchss, pibasess, and pisnapss. The archive cache comprises most of
the memory use in piarchss, the Point Database in pibasess, and the Snapshot in pisnapss.
The other PI processes do not vary significantly with point count.
The memory use in pibasess, and pisnapss is directly related to point count. Memory use in
piarchss is more complicated. It is related to point count and data rates. Overall rate as well
as number of different points receiving events affects the data rate impact on memory. A high
overall data rate spread over a small percentage of points may require less memory than a
lower overall rate spread over a high percentage of points.
Once again, an empirical approach is used to estimate memory requirements. The estimate is
7 kilobytes per point, plus a constant for operating system and the PI system. The constant
depends on the operating system and does not take into account applications other than PI
System.
Windows
Minimum processor, Intel Pentium III (800 MHz or faster).
Minimum disk requirements in MB:
(Point Count x Days online)/1024 + 128
Minimum memory requirements in MB:
(Point Count x 7)/1024 + 64
UNIX Platforms
The following list provides the minimum system required for a PI System running on UNIX
assuming there are no other applications using system resources:
A minimum of 32 MB of system memory (48 megabytes for 64 bit operating systems
like Compaq Tru64 UNIX, HP-UX 11.x, etc.) plus 12 MB of system memory for
every 1000 points (16 MB for 64 bit operating systems).
A minimum of 256 MB of free disk space for Sun Solaris, HP-UX, or Compaq Tru64
installations or a minimum of 700 MB of free disk space for IBM AIX installations
are required.
Maximum Data Segment. Some Unix Operating Systems have a configurable and
small, by default, maximum data segment size. The data segment is the amount of
private virtual bytes allocated by a process. Limits are imposed to prevent rogue
applications in multi-user environments from monopolizing memory. For server
machines, the maximum data segment should be set to at least 2GB—this is the
maximum allowable for 32-bit machines.
HP-UX
Minimum disk requirements in MB:
(Point Count x Days online)/1024 + 128
Minimum memory requirements in MB:
(Point Count x 7)/1024 + 64
IBM AIX
Minimum disk requirements in MB:
(Point Count x Days online)/1024 + 352
Minimum memory requirements in MB:
(Point Count x 7)/1024 + 96
Sun Solaris
Minimum disk requirements in MB:
(Point Count x Days online)/1024 + 128
Minimum memory requirements in MB:
(Point Count x 7)/1024 + 64
Page 8
1.4 - Other Installation Considerations
Caution: Incorrect TZ settings will result in incorrect timestamps for archived data.
Also, see the section called Setting the Interface Node Clock in PI Server System
Management Reference Guide.
1.4.4 Security
A security plan should be developed for your site. The PIfirewall, PItrust Database, and PI
user names and groups should be defined to implement the security plan. The access
permissions on each tag should be set accordingly. See Managing Security in the PI Server
System Management Guide.
For detailed installation and upgrade instructions, see Chapter 3, Upgrade the PI Server on
Windows on page 23, and Chapter 6, PI Server Installation on UNIX on page 43.
Page 10
Chapter 2. PI SERVER INSTALLATION ON WINDOWS
2.1 Overview
Before starting an installation, be sure that you have reviewed the Installation and Upgrade
Planning section in this booklet.
The following section provides a detailed pre-installation checklist for new installations, a
step-by-step overview of the installation script activities, and a discussion of necessary post-
installation tasks.
5. Ensure that you have created or identified the user account with sufficient privileges
for installation and administration of the PI Server.
6. Verify the host time settings.
7. Verify the host network configuration.
8. Determine a path for the target installation consistent with disk space requirements.
All files except the archives are installed to the same path. Default interfaces may or
may not be installed in that same path.
9. Ensure that enough space is available on the system disk.
10. Determine whether you intend to install the default points.
11. Determine the size and directory for the first three default archives. The default
directory is PI\dat. You may want to specify a different directory if the PI Server disk
is small.
12. A new installation cannot be performed on any host that has an existing installation
of the same version. If this is the case, review Removing PI Installations at the end of
this chapter.
13. To install the PI Server in a Microsoft Cluster Service (MSCS) environment, ensure
that the MSCS software is installed and tested.
14. For a clustered installation, in the event that a reboot is needed during the installation,
make sure the other nodes in the cluster are paused.
2.2.2 Installation
Once you have completed the installation checklist you are ready to begin the installation.
For a PI Server installation package on CD-ROM, insert the CD, which launches an HTML
page in your Internet browser that offers a link to the setup program. Click the link to start the
setup.
If the setup program does not open automatically, run it by executing:
m:\nt\setup.exe
where “m:” is the device letter of the CD-ROM. For a PI Server installation package from
self extracting executable, running the self extracting executable copies the source files to a
user-defined location and then runs the setup.
During new installations, the setup program executes the following tasks:
1. Setup opens a log file PIServerMaster.log in the root directory of the system
partition. For example, if Windows is installed in e:\winnt, the log file would reside
in the root of the e: drive: e:\PIServerMaster.log. This log file documents the overall
progress of the PI Server installation as well as the installations of the supporting
software.
2. Setup installs or upgrades supporting software such as Microsoft® Windows
Installer, Microsoft® Windows Script, Microsoft® Data Access Components, and
Page 12
2.2 - New Installation Instructions
.NET Framework. In the event that a reboot is needed, the setup program will
automatically continue with the setup after the reboot.
3. Setup opens a log file SetupPIServer.log in the root directory of the system partition.
4. Certain system .dlls are checked for necessary installation or updates.
5. The version of the system to be installed is determined.
6. The system requirements are verified, such as Windows version, CPU, and network
installation.
7. Setup checks for the Microsoft Cluster Service. If the service is detected, then the
user is prompted for a clustered installation of the PI Server.
8. Setup asks for the location of the license file (pilicense.dat).
9. User information is solicited, including the user name, company name, and the
system number (serial number). The system number identifies the installation to
OSIsoft and is provided on the packing list. This number is useful when contacting
OSIsoft Technical Support or Sales.
10. Setup solicits the target path for installation and creates it if necessary.
11. If the pipc.ini file does not exist in the operating system directory or pihome is not
defined in the pipc.ini file, setup solicits the target path for the installation of the PI-
SDK.
12. Setup allows the user to specify additional installation options. These include
whether PI services will be installed to automatically start on system reboot and
whether the default points should be installed (default points are recommended).
13. Setup solicits the default archive size and location.
14. Files are copied to the target.
15. The registry is updated with PI installation information.
16. PI databases are created. These include the Point Database, Digital State Table, and
Security Tables.
17. For clustered installations, Setup installs PI Cluster Wizard.
18. PI Services are registered.
19. The log file is closed and moved to the \dat subdirectory of the directory indicated by
the pihome entry of the pipc.ini file.
20. If necessary, the PI-SDK installation (which includes the PI API) is installed or
updated. In the event that a reboot is needed, the setup program will automatically
continue with the setup after the reboot. It is recommended that for a clustered
installation, the PI-SDK be installed on the non-shared disk.
21. The default PI interfaces are installed. Setup installs these interfaces in the Interfaces
subdirectory of the directory indicated by the pihome entry of the pipc.ini file. The
installation log files for each interface installation is located in the \dat subdirectory
of directory indicated by the pihome entry of the pipc.ini file
22. The PI Interface Configuration Utility is installed in the \ICU subdirectory of the
directory indicated by the pihome entry of the pipc.ini file. The ICUs for the default
interfaces are installed in the same directory.
23. For clustered installs, if the installation is for the first cluster node, the installation
procedure will need to be repeated on that second cluster node.
24. The first time the PI Server is run, it will complete installation by processing the
PI\adm\pirunonce.dif script. After the first run, this script will no longer be
processed.
Page 14
2.2 - New Installation Instructions
Setup checks if MDAC is installed and if the version of MDAC is greater or equal to 2.7.
Setup launches the MDAC installation.
Setup checks the version of Windows Installer and then silently installs the new version of
Windows Installer. The Windows Installer installation may ask for a reboot to complete.
Setup then checks for the existence of the Microsoft® Windows Script. This is installed if it
is not already installed. The final pre-installation step is to install Microsoft .Net Framework
if it is not already installed.
After all the prerequisite installs are complete, the PI Server installation begins.
Page 16
2.2 - New Installation Instructions
The user is prompted for the directory containing the license file, pilicense.dat.
If the PI-SDK is not installed, Setup asks for the location to install the PI-SDK. The standard
location is in the \Program Files\PIPC directory.
Page 18
2.2 - New Installation Instructions
The user is asked if default points are to be installed and if the services are installed as
automatic startup.
The Advanced button on the Default Archive Information screen is used to select the Event
Queue settings.
Page 20
2.2 - New Installation Instructions
Setup now copies all the files into the proper location.
Setup installs default PI interfaces and other server applications in its own separate Windows
Installer window. As an example, the PI Random Simulator Interface Windows Installer
window is displayed.
After the PI interfaces and server applications are installed, setup is finished.
Page 22
Chapter 3. UPGRADE THE PI SERVER ON WINDOWS
If you are upgrading to the PI Server 3.4, you must be running the PI Server 3.2 or later. If
you are running the PI Server 3.1 or the PI Server 3.0, you must first upgrade to the PI Server
3.2.
If you are upgrading from the PI Server 3.4.364.32 or earlier, you will need to reconfigure
your backup procedures for PI because the backup procedure for PI changed as of the PI
Server 3.4.370. The PI Server backup now utilizes the Microsoft Volume Shadow Copy
Services if it is available on the operation system. The pibackupat.bat file has been replaced
by the pibackuptask.bat file. If you are upgrading from the PI Server 3.4.364.32 or earlier,
any currently scheduled backup tasks that utilize the pibackupat.bat file will cease to function
after the upgrade. You will need to review the backup section of the PI Server manual for
further details and schedule a new PI Server backup after the upgrade.
Before starting an upgrade, be sure that you have reviewed the Preparing and Planning for
Installation on page 1.
This section provides a detailed checklist for upgrades, a step-by-step overview of the
upgrade script activities, and a discussion of necessary post-upgrade tasks.
Once you have completed the upgrade checklist you are ready to begin the upgrade.
For a PI Server installation package on CD-ROM, insert the CD, which launches an HTML
page in your Internet browser that offers a link to the setup program. Click the link to start the
setup.
If the setup program does not run automatically, run it by executing:
m:\nt\setup.exe
where “m:” is the device letter of the CD-ROM. For a PI Server installation package from
self extracting executable, running the self extracting executable copies the source files to a
user-defined location and then runs the setup.
The setup program during upgrades executes the following tasks:
1. Setup opens a log file PIServerMaster.log in the root directory of the system
partition. For example, if Windows is installed in e:\winnt, the log file would reside
in the root of the e: drive: e:\PIServerMaster.log. This log file documents the overall
progress of the PI Server installation as well as the installations of the supporting
software.
2. Setup installs or upgrades supporting software such as Microsoft® Windows
Installer, Microsoft® Windows Script, Microsoft® Data Access Components, and
.NET Framework. In the event that a reboot is needed, the setup program will
automatically continue with the setup after the reboot.
3. Setup opens a log file SetupPIServer.log in the root of the system partition.
4. Certain system .dlls are checked for necessary installation or updates.
5. The version of the system to be installed is determined.
Page 24
3.2 - Upgrading the PI Server
6. The system requirements are verified, such as Windows version, CPU, and network
installation.
7. Setup checks for any running PI processes and asks to stop the PI services before
continuing with the upgrade.
8. Setup checks for upgrade (any evidence of a prior installation). If detected, the
upgrade procedure is executed. If a new installation is desired, the existing PI Server
should first be removed. See the section below on Removing PI Installations.
9. Setup checks for the Microsoft Cluster Service. If the cluster service is detected and
is running, then the user is prompted for a clustered upgrade of the PI Server. For
more details, see Chapter 10, PI Server Cluster Installation.
10. Setup checks for downgrades. Downgrading PI is not supported. To return to a prior
version (build) of PI, the entire system including the data file and archives need to be
restored from backup.
11. Setup asks for the location of the license file (pilicense.dat).
12. User information including the user name, company name, and the system number
(serial number) is verified. The system number identifies the installation to OSIsoft
and is provided on the packing list. This number is useful when contacting OSIsoft
Technical Support or Sales.
13. Setup verifies the target path of the existing installation.
14. Setup allows the user to specify the additional installation option of whether PI
services will be installed to automatically start on system reboot.
15. Setup reminds you that the PI Server uses a new backup subsystem and that
previously scheduled backups will no longer run.
16. The user is prompted to acknowledge that they have a good backup of the PI Server.
It is recommended that a complete backup of the PI Server be done before upgrading.
17. If the PI Server services are still running, setup asks if it can stop the services before
the upgrade can start.
18. Setup verifies and creates if necessary all target directories.
19. The remaining files are copied to the target.
20. The registry is updated with PI installation information, and old registry information
is removed if found.
21. PI databases are updated if necessary.
22. Out of date files are removed.
23. The default interfaces are installed or upgraded. When upgrading from PI 3.2, the
upgrade will first check to see if each of the six interfaces have been installed in the
PI\interfaces directory. If found, then the interface will be upgraded in that directory.
Otherwise the interface will be installed in the directory that is indicated by the
pipc.ini file. Refer to the PI-SDK documentation for further information regarding
the pipc.ini file.
Once the upgrade has completed, there are a number of administrative and maintenance tasks
that may need to be addressed to ensure continued successful operation of the PI Server. This
section provides a checklist that should be reviewed before restarting PI (especially since
there may have been changes from previous releases).
1. After running the setup program, review the ASCII log files PIServerMaster.log,
SetupPIServer.log, all the interface logs and all the server application logs for any
errors.
2. During the upgrade, a number of site-specific files are not overwritten. However, new
versions of these files are provided (with the extension .new). These new files may
have significant changes from the original versions. These files should be compared
to the originals and changes incorporated as needed. In particular, the following files
should be examined:
C:\PI\adm\pisitestart.bat.new
C:\PI\adm\pisrvsitestart.bat.new
C:\PI\adm\pisrvsitestop.bat.new
C:\PI\dat\shutdown.dat.new
The pisrvsitestop.bat.new and pisrvsitestart.bat.new, contain the startup information
for the new default interfaces. Be sure to include these changes into the older
versions of the site-specific files. In addition, the interface site-specific files (if
installed) also need to be checked for significant changes.
random.bat.new
rmp_sk.bat.new
pisnmp_basic.bat.new
piping_basic.bat.new
piperfmon_basic.bat.new
3. Review Managing Security in the PI Server System Management Guide, as some
security features may have been enhanced from previous releases. For example,
PItrust tables have replaced PIproxy tables.
4. At this point any temporary files generated by the setup program are no longer
needed and may be removed from the system.
Setup begins and checks whether Microsoft® Windows Installer, Microsoft® Windows
Script, and Microsoft® Data Access Components need to be installed or upgraded.
Page 26
3.4 - Sample Upgrade
In this example, Microsoft® Windows Installer has already been installed. Microsoft®
Windows Script, Microsoft® Data Access Components, and the PI-SDK are to be installed or
upgraded.
Setup checks if MDAC is installed and if the version of MDAC is greater or equal to 2.7.
Setup launches the MDAC installation.
Setup checks the version of Windows Installer and then silently installs the new version of
Windows Installer. The Windows Installer installation may ask for a reboot to complete.
Setup then checks for the existence of the Microsoft® Windows Script. This is installed if it
is not already installed.
The final pre-installation step is to install Microsoft .Net Framework if it is not already
installed.
Page 28
3.4 - Sample Upgrade
The user is prompted for the directory containing the license file, pilicense.dat.
After license information is obtained, the user information from the previous installation is
then displayed.
Page 30
3.4 - Sample Upgrade
If you are upgrading from 3.4.364.32 or earlier, the setup kit will warn you that the backup
procedure has changed.
After accepting the new backup scheme, you are asked to verify that you good backup of the
PI Server, and you are asked to stop PI if it is running.
The Next button will not be enabled until both questions are answered.
Setup will attempt to stop these services and any other services configured to be dependent on
the PI Server and start the upgrade.
Page 32
3.4 - Sample Upgrade
Setup installs each of the default PI interfaces and the server applications in its own separate
Windows Installer window. As an example, the PI Random Simulator Interface Windows
Installer window is shown.
After the PI interfaces and the server applications are installed, setup is complete.
The installation logs for the PI Server installation can be found in the dat subdirectory of the
directory indicated by the pihome entry of the pipc.ini file. Depending on your license, some
of these log files may not exist.
Page 34
3.5 - Installation Logs
Start the PI Server by running the pisrvstart.bat script from the \adm directory. This starts all
PI subsystems and then runs the script pisrvsitestart.bat, which contains commands for all of
the interfaces and other site-specific applications.
Alternatively, if the PI Server was installed to start the services automatically on reboot, you
may also reboot the system. If the PI Server was installed on a cluster, use the Cluster
Administrator to start the PI Server after using the PI Cluster Wizard to configure the PI
Server on the cluster.
The first time the PI Server is run, certain error messages appear because installation is not
quite complete. The PI Server does not yet recognize any points. The messages are:
>> Invalid Start/End times in Primary archive file.
/usr/PI/dat/ piarch.001 - Archiving disabled until Archive shift.
Archive file /usr/PI/dat/piarch.002 loaded.
Archive file /usr/PI/dat/piarch.003 loaded
Primary archive file failed to load or has invalid dates.
Archiving will be turned off.
No intervention is necessary.
Next, the PI Server will run the PI\adm\pirunonce.dif script, which will install the default
points. After the first run, this script is renamed and will no longer be processed.
Once the PI Server is started, verify that the base PI processes are running:
You may build points and configure interfaces now or later. For more information, see the PI
System Management Tools (PI SMT) on the OSIsoft Technical Support site.
It is useful to monitor the data transfer rate from each interface to the PI Home node. See
Data Rate Monitoring in the PI Server System Management Guide.
Note: For clustered PI Servers, the services are always installed manually and
should never be configured to start automatically during reboot.
Page 38
3.5 - Installation Logs
If the following programs and services are installed, the following interfaces can be
configured to automatically start with the system startup.
Page 40
Chapter 5. REMOVE PI INSTALLATIONS ON WINDOWS
To uninstall the PI Server, run the Add/Remove Programs applet from the Control Panel.
Select PI Server to uninstall. Uninstalling the PI Server will also uninstall the PI-SDK, the
interfaces that were installed with the PI Server, and PI Server Applications. If there are other
programs that require the PI-SDK, the PI-SDK installation must be reinstalled. Sometimes
you must reboot after uninstalling. Also, a number of files including Archives may remain
and will need to be manually removed from the system (especially if a reinstallation is to be
attempted).
6.1 Overview
The PI Server for UNIX-based operating systems is distributed on CD ROM or via the
Internet as compressed .tar files (which may be obtained from the OSIsoft Web site). As of
the 3.4 release, both the PI Server and the Server Applications are distributed in a single
bundle. Installation files are copied to a temporary (source) directory and then the pi_install
script is run to perform the PI System installation or upgrade.
Review the UNIX-related sections of Chapter 1, Preparing and Planning for Installation, in
this guide before a new PI Server installation or upgrade. This material covers system settings
and requirements such as memory and disk sizing. These preparatory steps should be
understood before proceeding. The installation or upgrade itself usually takes less than
one hour.
The time required for post-installation steps, such as creating additional archives, configuring
tags, and setting up the site-specific interface files will vary.
As part of a default installation, several points are automatically created. When PI is started,
two sample interfaces that generate simulated data are run to populate these points. This
means that you are collecting and archiving test data as soon as you start PI. These data can
be viewed immediately by using client applications such as PI ProcessBook and PI DataLink.
Important: The procedures described in this section must be performed under a root
log-in. The changes involved affect system configuration files and data structures
which, if improperly modified, could cause the system to become unusable.
Rebuilding of the operating system kernel may be involved. On most platforms, a
reboot will be required to make any change take effect. If you are unfamiliar with
system administration procedures for UNIX systems, please enlist the help of you
local UNIX System Administrator when making any of the changes outlined below.
Please read the entire section that applies to your system before attempting any changes.
IBM AIX
To check the limit on open file descriptors, log in as piadmin and run the following
command:
ulimit –aH
Look for the line that begins nofiles(descriptors), followed by a number. If the number is
greater than 1024 or is unlimited, no further action is required.
The recommended procedure for changing the limit depends on whether there is a Network
Information Service (NIS) database installed on the system. The preferred method for
changing the limit is the chuser command. However, this command must not be used if there
is an NIS database installed on the system. In that case, direct modification of the appropriate
system configuration file is the appropriate method.
For AIX systems that do not have an NIS database installed, log in as root and run the
following command:
chuser nofiles_hard=1024 piadmin
This change will take effect the next time piadmin logs in. In order to insure that the PI server
can take advantage of the change, shut down the server, log out of the piadmin account, log
back in as piadmin, and restart the server.
For AIX systems that have an NIS database installed, log in as root and edit the file
/etc/security/limits to include the following line in the stanza for piadmin:
nofiles_hard = 1024
Consult the man page for the limits file (run: man limits) for details concerning the format of
the file. Alternatively, the value may be specified as -1 to allow an unlimited number of file
descriptors. Consult your AIX System Administrator before selecting a value.
As with the chuser command, this change will take effect the next time piadmin logs in. Use
the procedure given above to shut down and restart the PI server.
Page 44
6.1 - Overview
Log in as root and apply the stanza file to the system configuration by running the following
command:
/sbin/sysconfigdb -m -f stanza_file proc
The change will take effect after the system is rebooted.
HP-UX
To check the limit on open file descriptors, log in as piadmin and run the following
command:
sh exec ulimit –aH
1. Look for the line that begins nofiles(descriptors), followed by a number. If the
number is greater than 1024 or is unlimited, no further action is required.
2. To increase the descriptor limit, use the System Administrator Management utility,
SAM. Log in as root and start SAM, then do the following:
3. Enter the Kernel Configuration area.
4. Call up the Configurable Parameters utility.
5. Check whether the current value of the parameter nfile is 1024 or greater. If it is,
proceed to step 11. If not, continue with the next step. The value of this parameter is
the upper limit for the maxfiles_lim parameter which is the one that must be changed
to increase the descriptor limit.
6. Find the entry for the parameter maxusers. The standard formula for the value of
nfile is dependent on this parameter. Setting maxusers to 48 should yield a value for
nfile that is greater than 1024. If the current value of maxusers is less than 48, set it
to 48 or more and save the change.
7. Exit the Configurable Parameters utility.
8. Exit SAM.
9. When prompted to Create a New Kernel, choose the option to rebuild the kernel
now, press OK and wait for the new kernel to be built.
10. When prompted to Reboot the System, choose to install the new kernel, shut down
and reboot now. Press OK in response to the dialog about overwriting the /etc/system
file.
11. Wait while the system shuts down and reboots.
12. Once the system has restarted, log in as root, start SAM, return to the Configurable
Parameters utility and continue with the next step.
13. Modify the value of the parameter maxfiles_lim to be 1024 or greater.
14. Exit the Configurable Parameters utility, saving the change.
15. Since maxfiles_lim is a dynamic tuning parameter, the change should take effect
immediately. Verify the change by repeating the check described at the beginning of
this section.
Sun Solaris
To check the limit on open file descriptors, log in as piadmin and run the following
command:
ulimit –aH
Look for the line that begins nofiles(descriptors), followed by a number. If the number is
greater than 1024 or is unlimited, no further action is required.
To increase the descriptor limit, the system configuration file, /etc/system, must be modified.
Note: Damage to the file /etc/system could make the system unbootable. Always
make a backup copy before changing the file. See the man page for /etc/system
(run: man system) for further details concerning the format of the file and recovery
procedures.
Page 46
6.1 - Overview
In all cases, the home node should be set to its correct local time, time zone, and DST setting.
See Setting the Interface Node Clock in Chapter 6, Managing Interfaces, in the PI Server
System Management Guide,
Examine the current settings by using the UNIX date command. For example:
$ date
Fri Mar 6 10:30:17 PST 1998
The syntax to reset the date, time zone and daylight saving observation varies with UNIX
platform. Time settings should be verified before PI is installed.
If possible, configure your UNIX system to use xntp to synchronize the system clock with a
reliable network time source. Using xntp can greatly simplify the task of keeping server and
interface node clocks synchronized.
6.1.5 Security
A security plan should be developed for your site. The PIfirewall, PIproxy database, and PI
user names and groups should be defined to implement the security plan. The access
permissions on each tag should be set accordingly. See Chapter 7, Managing Security, in the
PI Server System Management Guide.
Page 48
6.1 - Overview
all in compressed tar format. In each platform-specific subdirectory, the distribution file is
called pi.tar.gz.
There are two methods to copy the tar files from CD to the target machine’s PI source
directory:
The first method is to read the CD using a PC:
Insert the CD into a PC and copy the appropriate tar.gz file to the target machine,
using FTP in binary mode.
On the target UNIX machine, change your working directory to the PI source
directory, decompress using gunzip and extract the distribution files using the tar
command as shown in the examples below.
The second method is to read the CD on the target UNIX machine:
Mount the CD directly on the target machine.
Copy the appropriate tar.gz file and if necessary the appropriate gunzip
decompression utility to the PI source directory.
There are examples below that show how to mount the CD on the target machine, copy the
tar.gz file to the PI source directory, decompress and extract the distribution files. If you have
used FTP to copy the tar.gz file to the UNIX machine, ignore the commands for mounting
and dismounting the CD.
The examples may need to be modified slightly for your system. If you experience any
difficulty in getting the examples to work, first do a directory listing to check the actual
names of the directories and filenames on your system. The case of the directory names and
the file names themselves may change depending on which operating system you are using to
view the CD-ROM.
For more information on the mount and tar commands, use the UNIX man command to view
the online documentation. The gunzip utility is provided on the CD for each of the supported
platforms if it is not already available. The source and license for gunzip are provided in the
/support/unix directory of the CD and on the ftp.osisoft.com FTP site.
Note: These are examples only. Use the actual paths and device names on your
system. As of the 3.4 release, the server (PI Server) is distributed together with the
PI Server Applications in a single distribution file. Separate installation of the Server
and Server Applications is no longer required.
HP-UX Example
# mkdir /cdrom
# /etc/mount -o ro -t cdfs /dev/dsk/c201d2s0 /cdrom
# mkdir /tmp/PIsource
# cp "/cdrom/UNIX/HP-UX/PI.TAR.GZ;1" \ /tmp/PIsource/pi.tar.gz
# cp "/cdrom/SUPPORT/UNIX/HP-UX/GUNZIP;1" \ /tmp/PIsource/gunzip
# /etc/umount /cdrom
# cd /tmp/PIsource
# chmod 555 gunzip
# gunzip pi.tar.gz
# tar xvf pi.tar
Page 50
6.2 - New Installation Instructions
Before starting a new installation, be sure that you have reviewed Chapter 1, Preparing and
Planning for Installation, in this manual.
10. Determine a path for the target installation consistent with disk space requirements.
All files except the archives are installed to the same path.
11. Determine whether you intend to install the default points.
12. Determine the size and directory for the first three default archives. The default
directory is PI/dat. You may want to specify a different directory if the PI disk is
small. Create the directory prior to installation.
13. A new installation cannot be performed on any host that has an existing installation.
If this is the case, review Chapter 9, Removing PI Installations on UNIX.
14. Create a directory for the source media and load the installation files on the host
machine.
6.2.2 Installation
Once you have completed the installation checklist you are ready to begin the installation.
1. Log into the target host as root.
2. Change your working directory to the source directory and run the installation using
the script pi_install:
# cd /tmp/Pisource/370.XX.serv
# ./pi_install
Output from a sample installation is available in the section A Sample New
Installation at the end of this chapter. The installation script executes the following
tasks:
• The pi_install script runs adm/piins.sh, redirecting the output to generate a record
of the installation in the file /tmp/piinstall.log.
• The initial display presents the current system date and system information.
• The script checks that it is being run on a supported platform.
• The source files location (path) is verified. The default path should be correct. If
not, make sure that you are running the installation script from the source path.
• The script checks for an existing PI installation. If the /etc/piparams.default file
is detected, the script attempts to run an upgrade. If a new installation is desired
(as opposed to an upgrade), the existing PI System must first be removed. See
Chapter 9, Removing PI Installations on UNIX.
• The target (installation) location is verified. If the default directory is not the
intended target, enter the complete path where you want PI to be installed.
• Setup asks for the location of the license file (pilicense.dat).
• The /etc/piparams.default file is created to record the target (installation)
location.
• The script verifies that it is being run from the root account. It then checks if the
piadmin and osi users and the pigrp group are defined. If not, it creates them.
• The script checks that you are satisfied with the backup of your system.
• Distribution files are copied to the PI target. File permissions are set.
Page 52
6.2 - New Installation Instructions
• Next you are asked to specify whether to install the default points.
• The script prompts for the initial size and location parameters for the Event
Queue file. If you are unsure about the appropriate settings for these parameters,
accept the default values and continue. Adjustments can be made at a later date,
if the need is identified.
• The archive files and PI databases are created, including the Point Database,
Digital State Table, batch tables and the security tables. Event queue file
parameters are saved in the PITimeout Table.
• The system ID file is created.
• A record of the installation session is put in the file /tmp/piinstall.log.
• The first time the PI Server is run it will complete the install by processing the
PI/adm/pirunonce.dif script (if it exists).
Page 54
6.2 - New Installation Instructions
Page 56
6.2 - New Installation Instructions
Page 58
6.2 - New Installation Instructions
6. APIServerID: 87312
chown: /opt/PI/log/*: No such file or directory
chgrp: /opt/PI/log/*: No such file or directory
Installation/upgrade complete at Thu Nov 10 15:02:18 PST 2005
************************************************************
PI Universal Data Server 3.4 Post Installation Instructions
************************************************************
REVIEW LOG FILES
If there were any problems reported during the upgrade
process with the startup or shutdown of PI, please
check the log files in the log directory for any
documented errors.
POST INSTALLATION TASKS
After new installations there are a number of post
installation administrative tasks such as creating more
archives (three are created by default), configuring
site specific activites and scheduling backups. Please follow
the post installation instructions in the UNIX installation
section of the PI 3 UDS manual, review any
published release notes and review the additional
information provided below.
NEW BACKUP SCHEME
The PI server backup scheme has changed. The PI server backup is now
implemented by a backup subsystem process as opposed to a shell script. The
pibackup.sh script remains as the command-line interface to the backup
subsystem, however the argument list has changed. The cronpibackup.sh file
formerly installed for automatic backups has been replaced by the file
pibackuptask.sh. If this is an upgrade, any currently scheduled cron job that
utilitzes cronpibackup.sh will cease to function. Please review the backup
section of the PI Server manual for details concerning the changes to the
pibackup.sh script and the procedure for scheduling an automatic backup task.
START PI
PI is currently not running. To start PI, you should be logged
in as piadmin. Start PI using pistart.sh in the adm directory.
REMOVE TEMPORARY FILES
You may now remove the temporary PI installation directory,
it is no longer needed.
PI API
The PI API development kit for use on the PI 3 host is
no longer distributed and installed as part of the PI 3
installation / upgrade procedure.
****************************************************
PI Universal Data Server 3.4
Notes for Solaris Users
****************************************************
DEFINE SHARED LIBRARY PATH
You must define and export the shared library environment variable
for the piadmin account to point to the PI lib directory:
If using Korn Shell or Bourne Shell:
LD_LIBRARY_PATH=/opt/PI/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
If using C Shell:
setenv LD_LIBRARY_PATH /opt/PI/lib:$LD_LIBRARY_PATH
If you are upgrading to PI 3.4, you must be running PI 3.2 or later. If you are running PI 3.1
or PI 3.0, you must first upgrade to PI 3.2.
Before starting an upgrade, be sure that you have reviewed Chapter 1, Preparing and
Planning for Installation, in this guide.
The following section provides a detailed checklist for upgrades as well as a step by step
overview of the upgrade script activities followed by a discussion of necessary post-upgrade
tasks.
9. If your system is being used only to run PI, and no other applications are run from the
piadmin account, then your default process quotas should be sufficient. If this is not
the case, read UNIX Process Quotas in Chapter 12, PI Troubleshooting and Repair in
the PI Server System Management Guide.
10. Create a path for the source media and load the upgrade files on the host or network
accessible machine.
7.2 Upgrade
Once you have completed the upgrade checklist, you are ready to begin the installation.
Log into the target host as root. Change your working directory to the source directory and
run the upgrade using the script pi_install:
# cd /tmp/Pisource/370.XX.serv
# ./pi_install
Output from a sample upgrade is available in A Sample Upgrade at the end of this chapter.
The upgrade script executes the following tasks:
• The pi_install script runs /adm/piins.sh redirecting the output to generate a record
of the upgrade in the file /tmp/piinstall.log.
• The initial display presents the current system date and system information.
• The script checks that it is being run on a supported platform.
• The script verifies that the piadmin and osi users and the pigrp group are defined.
If not, the upgrade terminates immediately with a message indicating that they
must be created before the upgrade can be completed.
• The source files location (path) is verified. The default path should be correct. If
not, make sure that you are running the installation script from the source path.
• The script checks for an existing PI installation. If the /etc/piparams.default file
is detected, the script prompts the user for verification that the upgrade is
intended.
• The target (installation) location is verified. If the PI system is properly
configured, the default path should point to the existing installed system.
• The script asks for the location of the license file (pilicense.dat).
Page 62
7.3 - Post-Upgrade Checklist
• The script will now inform the user about changes in the server backup scheme
and ask the user to accept the new scheme. If the user refuses, the upgrade will
terminate immediately with no changes to the existing PI server installation.
• The script will now check whether a downgrade is being attempted. As data file
structures evolved between releases, there can be unexpected results from
downgrading so this is not supported. To downgrade, you should perform a
complete restore from a full backup of the PI server.
• The script checks that you are satisfied with the backup of your system.
• The script runs pistop.sh from the target directory to stop any running PI
processes.
• Distribution files are copied to the PI target and file permissions and ownerships
are set. The existing archives and files in the PI/dat directory are preserved. The
site-specific files PI/dat/shutdown.dat, PI/adm/pisitestart.sh,
PI/adm/pisitestop.sh, and PI/adm/pisiteverify.sh are preserved. The interface
startup files are preserved. The new versions of these files are copied with the
.new extension.
• The license file (pilicense.dat) is installed in the /dat subdirectory.
• If an automatic backup script (cronpibackup.sh) is found in the /adm directory, it
is renamed to cronpibackup.sh.old.
• PI databases are updated or created where necessary. This includes an update to
the System Digital State Set to add new elements.
• The script will now either print the contents of an existing system ID file or
create a new one and display its contents.
• Any platform specific post-upgrade information is displayed.
• A record of the upgrade session is put in the file /tmp/piinstall.log.
• The first time the PI Server is restarted, it will complete the upgrade by
processing the PI/adm/pirunonce.dif script (if it exists). Not all upgrades will
provide this script.
Once the upgrade script has completed, there are a number of administrative and maintenance
tasks that may need to be addressed to ensure continued successful operation of the PI Server.
This section provides a checklist that should be reviewed before restarting PI (especially
since there may have been changes from previous releases).
1. Be sure to log out of the root account and into piadmin for PI administrative tasks.
2. Review the log file /tmp/piinstall.log for any errors. In particular, please note the
changes that affect backup procedures.
3. With the 3.4 release, a new PI server backup scheme has been introduced. If an
automatic backup was scheduled for the old server, it will no longer work following
the upgrade. In order to continue the automatic backups, the old backup task must be
removed from the crontab file and a new task scheduled using the pibackup.sh script
which is found in the /adm subdirectory. For further details see Chapter 4, Backing
up the PI Server, in the PI Server System Management Guide.
4. During the upgrade, a number of site-specific files are not overwritten. However, new
versions of these files are provided (with the extension .new), which may have
significant changes from the original versions. These files should be compared to the
originals and changes incorporated as needed. In particular, the following files should
be examined:
• PI/adm/pisitestart.sh.new
• PI/adm/pisitestop.sh.new
• PI/adm/pisiteverify.sh.new
• PI/adm/rmp_sk.dat
• PI/adm/rmp_sk.dif
• PI/bin/pipeschd.sh.new
• PI/dat/shutdown.dat.new
• PI/interfaces/random/random.sh.new
• PI/interfaces/rmp_sk/rmp_sk.sh.new
5. Review the Managing Security subsection in the PI Server System Management
Guide, as some security features may have been enhanced from previous releases.
6. At this point, the PI source directory is no longer needed and may be removed from
the system.
7. Proceed to the Running PI section.
Page 64
7.3 - Post-Upgrade Checklist
Page 66
7.3 - Post-Upgrade Checklist
Page 68
7.3 - Post-Upgrade Checklist
START PI
PI is currently not running. To start PI, you should be logged
in as piadmin. Start PI using pistart.sh in the adm directory.
REMOVE TEMPORARY FILES
You may now remove the temporary PI installation directory,
it is no longer needed.
PI API
The PI API development kit for use on the PI 3 host is
no longer distributed and installed as part of the PI 3
installation / upgrade procedure.
****************************************************
PI Universal Data Server 3.4
Notes for Solaris Users
****************************************************
DEFINE SHARED LIBRARY PATH
You must define and export the shared library environment variable
for the piadmin account to point to the PI lib directory:
If using Korn Shell or Bourne Shell:
LD_LIBRARY_PATH=/opt/PI/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
If using C Shell:
setenv LD_LIBRARY_PATH /opt/PI/lib:$LD_LIBRARY_PATH
Once the pi_install script has completed, log out of the root account and login as piadmin. All
PI Server administration should be performed while logged in from the piadmin account.
8.1 Start PI
Start PI by running the pistart.sh script from the /adm directory. This starts all PI Server
subsystems. Next, the script pisitestart.sh is run, which contains commands for all of the
interfaces and other site-specific applications.
The pistart.sh script can take a number of arguments:
./pistart.sh -nosite
starts the PI processes but does not run pisitestart.sh. Thus the site-specific applications and
interfaces will not be started.
./pistart.sh M
causes only the PI Network Manager and the PI Message Log processes to be started. This is
used when the message log is to be searched for diagnostics without starting the other
subsystems.
./pistart -stdout
causes the PI message log to not be started. All messages are instead directed to the standard
output. By default, this means that a separate ASCII log file is created in the PI/log directory
for each PI process.
Note: If you have a large point count, it may take a while for PI to complete its
initialization at startup time. During the initialization, the processes are all running,
but none of the utilities will work. When the utilities work, that is an indication that
initialization is complete. It can take as long as 30 minutes for initialization to
complete on a system of 50,000 points or more, depending on the hardware.
8.1.3 To Stop PI
To stop PI, run the pistop.sh script from the /adm directory. This stops all of the PI processes
and then calls the site-specific script, pisitestop.sh, which contains the shutdown commands
for all of the interfaces and other site-specific applications.
The piverify.sh script in the /adm directory can be used to determine the running status of the
PI System. This utility prints the PI version and the running state of each PI process. It then
calls pisiteverify.sh to run site-specific verifications.
PI requires the shared library environment variable to be set on all UNIX platforms. These
variables provide the path to the PI/lib directory.
The name of the environment variable depends on the operating system. The configuration of
this environment variable depends on which shell you are using. Thus there are six cases.
In each case, you can enter the commands on the command line. However, it is strongly
recommended that these commands be placed in the shell startup file for the piadmin account
so that the commands are automatically configured every time you login. Remember to
logout and login after modifying the startup file so that the changes will be executed.
Page 72
8.2 - Setting Environment Variables
Case 1: On HP-UX systems using the Korn Shell, enter the commands in the .profile file as
follows:
SHLIB_PATH=<PItarget>/lib:$SHLIB_PATH
export SHLIB_PATH
Case 2: On HP-UX systems using the C Shell, enter the commands in the .cshrc file as
follows:
setenv SHLIB_PATH <PItarget>/lib:$SHLIB_PATH
Case 3: On Sun Solaris and Compaq Tru64 UNIX systems using the Korn Shell, enter the
commands in the .profile file as follows:
LD_LIBRARY_PATH=<PItarget>/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
Case 4: On Sun Solaris and Compaq Tru64 UNIX systems using the C Shell, enter the
commands in the .cshrc file as follows:
setenv LD_LIBRARY_PATH <PItarget>/lib:$LD_LIBRARY_PATH
Case 5: On IBM AIX systems using the Korn Shell, enter the commands in the .profile file as
follows:
LIBPATH=<PItarget>/lib:$LIBPATH
export LIBPATH
Case 6: On IBM AIX systems using the C Shell, enter the commands in the .cshrc file as
follows:
setenv LIBPATH <PItarget>/lib:$LIBPATH
This documentation details the installation of the PI Server software on a two-node, single-
quorum Microsoft Cluster. For more information about configuring and operating the
Microsoft Cluster Service (MSCS), please consult Microsoft’s TechNet
(http://technet.microsoft.com). At the time of this publication, the following links were valid
for installing the Cluster Service for Windows Server 2003 Enterprise Edition (or Datacenter
Edition) and Windows 2000 Advanced Server (or Datacenter Server), respectively:
http://www.microsoft.com/technet/prodtechnol/windowsserver2003/library/ClusteringQuickS
tart/dba487bf-61b9-45af-b927-e2333ec810b6.mspx
http://www.microsoft.com/technet/prodtechnol/windows2000serv/howto/clustep.mspx
Prior to installation of the PI Server software, it is assumed that MSCS has already been
installed properly, tested successfully, and is currently running.
10.2 Installation of PI
The PI Server must be installed on each node of the cluster. For each node, PI should be
installed on a shared disk, but not on the quorum disk, and have the same installation path.
For example, if installing the PI Server onto the drive F:\PI, then all other nodes must install
the PI Server using the same path. It is necessary to have the cluster service running during
installation of the PI Server, and it is also necessary that the node onto which the PI Server is
being installed has control of the shared disk. To ensure that this node will maintain control
of the shared disk in case a reboot is necessary during the installation, it is recommended that
the node that is not currently participating in the install be paused using the Cluster
Administrator. If the PI Server archives are to be placed in another directory or drive other
than the default, be sure that every cluster node has access to the archives.
Note: For clustered PI Servers, the services are always installed manually and
should never be configured to start automatically during reboot.
Run Setup on the node that has control of the shared disk. The PI Server installation begins
after Setup confirms that at least Microsoft® Data Access Components 2.7, Microsoft®
Page 78
10.2 - Installation of PI
Windows Installer 2.0, Microsoft® Windows Script 5.6, and Microsoft® .NET Framework
1.1 have already been installed.
The user is prompted for the directory containing the license file, pilicense.dat.
Setup determines that MSCS is installed and asks about installing the PI Server on a cluster.
Page 80
10.2 - Installation of PI
Two questions are shown after selecting “Yes, setup the PI Server for clustering”. Setup asks
if this is the first node of the cluster and if the default interfaces are to be installed in the PI
directory on the shared disk or in the directory where the PI-SDK is installed. To allow for
rolling upgrades of the interface software, OSIsoft recommends installing the default
interfaces on a local disk containing the PI-SDK.
Setup asks where to install the PI Server. The chosen drive should be a separate physical
drive than the one containing the cluster quorum.
The PI Server installation options are then presented. For clustered installations, services are
always installed as manual.
Setup asks for the location and size for the default archives. The Default Archive Size of 128
MB is almost certainly too small for most systems, but archives larger than 1 GB are
generally not recommended either on Windows computers that can address only 32 bits of
memory.
Page 82
10.2 - Installation of PI
The Advanced button on the Default Archive Information screen is used to select the Event
Queue settings. The default sizes are typically adequate for most systems.
Setup now copies all the files into the proper location.
Page 84
10.2 - Installation of PI
Setup installs the default PI interfaces after the PI SDK installation. If PI Server Applications
are part of the installation, setup installs the PI Server Applications after the default
interfaces.
After the PI Server Applications are installed, setup is complete for the first node on the
cluster.
It is necessary to install the PI Server on all other nodes of the cluster. In this sample, there
are only two nodes. Using the Cluster Administrator, resume the paused second node.
Move the group with the shared disk to the second node.
Page 86
10.2 - Installation of PI
Run Setup on the second node. The PI Server installation begins after Setup confirms that at
least Microsoft® Data Access Components 2.7, Microsoft® Windows Installer 2.0,
Microsoft® Windows Script 5.6, and Microsoft® .NET Framework 1.1 have already been
installed.
The user is prompted for the directory containing the license file, pilicense.dat.
Page 88
10.2 - Installation of PI
Setup determines that MSCS is installed and asks about installing the PI Server on a cluster.
Two questions are shown after selecting “Yes, setup the PI Server for clustering.” Setup asks
if this is the first node of the cluster and if the default interfaces are to be installed in the PI
directory on the shared disk or in the directory where the PI-SDK is installed. This is not the
first node, so select “No, this is not the first node of the cluster.” Because the interfaces were
installed with the PI SDK on the first node, they must also be installed with the PI SDK on
the subsequent node.
The location for the PI Server should also be the same as the first node.
The PI Server installation options are then presented. For clustered installations, services are
always installed as manual.
Page 90
10.2 - Installation of PI
The default archives should be installed in the same location with the same size as the first
node.
The Event Queue should also have the same location and size information as the first node.
Setup now copies all the files into the proper location.
Page 92
10.2 - Installation of PI
Setup installs the default PI interfaces after the PI SDK installation. If PI Server Applications
are part of the installation, setup installs the PI Server Applications after the default
interfaces.
After the PI Server Applications are installed, setup is complete on the second node.
Page 94
10.3 - Sample Cluster Wizard Configuration
After completing installations on all nodes of the cluster, the PI Cluster Wizard can be used to
configure the Cluster Resources for the PI Server. The PI Cluster Wizard must be run on the
cluster node that has control of the shared disk where the PI Server was installed. If a
predefined IP Address and Network Name resource are to be used, those resources must also
be controlled by the cluster node. The PI Cluster Wizard will create a Cluster Group and the
necessary Cluster Resources for the PI Server.
The PI Cluster Wizard (PIClusWizard.exe) is located in the PI/adm directory. A shortcut to
the PI Cluster Wizard can also be found in the Start Menu under the PI System submenu.
The PI Cluster Wizard first asks for an IP Address that clients will use to communicate with
the PI Server. If you wish to use an existing IP Address Cluster Resource, check the “Use
existing IP Address” check box, and a drop-down list of all available IP Address Cluster
Resources will be displayed. The IP Address for the default Cluster Group (containing the
quorum disk) should not be used. An existing IP Address Resource will be moved to the
Cluster Group for the PI Server.
Next, the Network Name associated with the IP Address is obtained along with the network
to be used. During the configuration of MSCS, each NIC card should have been named
appropriately according to its role. In the “Network to use” drop-down list, choose the name
of the NIC that will be used to communicate with clients.
Choose the name of the Cluster Group that will be created for the PI Server. The default
name is PI GROUP. If the name of the Cluster Group exists prior to running the PI Cluster
Wizard, then all resources will simply be created in that group. Also, from the drop-down list
Page 96
10.3 - Sample Cluster Wizard Configuration
of shared cluster disks, choose the disk drive where the PI Server was installed. The selected
disk will be moved to the Cluster Group for the PI Server.
Check any optional Cluster Resources to be included in the Cluster Group for the PI Server.
Click Finish to create the Cluster Group and Resources for the PI Server.
In the Cluster Administrator, the PI Group should appear as partially online and should
contain all the configured resources for the PI Server.
Page 98
10.3 - Sample Cluster Wizard Configuration
The PI Server does not yet support a rolling upgrade, and thus, downtime must be scheduled
for the upgrade. Prior to upgrading, take the PI Server Generic Service resources offline and
pause inactive cluster nodes. Upgrade the PI Server on the node with ownership of the PI
Server Cluster Group. Once the upgrade is complete on the first node, move the PI Server
Cluster Group to the other node and upgrade the PI Server. Once the upgrade is complete on
all nodes, run the PI Cluster Wizard once to create cluster resources for any new required or
optional PI Server subsystems. Finally, resume all nodes and bring the PI Server Cluster
Group back online.
Using the Cluster Administrator, pause the node that does not own the PI Server Cluster
Group.
Page 100
10.4 - PI Server Upgrades
Run Setup on the node that does own the PI Server Cluster Group. The PI Server upgrade
begins after Setup confirms that at least Microsoft® Data Access Components 2.7,
Microsoft® Windows Installer 2.0, Microsoft® Windows Script 5.6, and Microsoft® .NET
Framework 1.1 have already been installed.
The user is prompted for the directory containing the license file, pilicense.dat.
Page 102
10.4 - PI Server Upgrades
Setup determines that MSCS is installed and asks about installing the PI Server on a cluster.
Two questions are shown after selecting “Yes, setup the PI Server for clustering”. Setup asks
if this is the first node of the cluster and if the default interfaces are to be installed in the PI
directory on the shared disk or in the directory where the PI-SDK is installed. To allow for
rolling upgrades of the interface software, OSIsoft recommends installing the default
interfaces on a local disk containing the PI-SDK.
Page 104
10.4 - PI Server Upgrades
If you are upgrading from 3.4.364.32 or earlier, Setup warns you that the backup procedure
has changed.
After accepting the new backup scheme, Setup asks if you have a good current backup of the
PI Server.
When you select, “Yes, I have a good current backup of the PI Server”, the Next button is
activated.
Page 106
10.4 - PI Server Upgrades
Setup installs the default PI interfaces after the PI SDK installation. If PI Server Applications
are part of the installation, setup installs the PI Server Applications after the default
interfaces.
After the PI Server Applications are installed, the upgrade is complete for the first node in the
cluster.
It is necessary to upgrade the PI Server on the other nodes of the cluster. In this sample, there
are only two nodes in the cluster. Using the Cluster Administrator, resume the paused node.
Page 108
10.4 - PI Server Upgrades
Run Setup on the second node. The PI Server upgrade begins after Setup confirms that at
least Microsoft® Data Access Components 2.7, Microsoft® Windows Installer 2.0,
Microsoft® Windows Script 5.6, and Microsoft® .NET Framework 1.1 have already been
installed.
The user is prompted for the directory containing the license file, pilicense.dat.
Page 110
10.4 - PI Server Upgrades
Setup determines that MSCS is installed and asks about installing the PI Server on a cluster.
Two questions are shown after selecting “Yes, setup the PI Server for clustering”. Setup asks
if this is the first node of the cluster and if the default interfaces are to be installed in the PI
directory on the shared disk or in the directory where the PI-SDK is installed. This is not the
first node, so select “No, this is not the first node of the cluster”. Because the interfaces were
installed with the PI SDK on the first node, they must also be installed with the PI SDK on
the subsequent node.
Page 112
10.4 - PI Server Upgrades
If you are upgrading from 3.4.364.32 or earlier, Setup warns you that the backup procedure
has changed.
After accepting the new backup scheme, Setup asks if you have a good current backup of the
PI Server.
When you select, “Yes, I have a good current backup of the PI Server”, the Next button is
activated.
Page 114
10.4 - PI Server Upgrades
Setup installs the default PI interfaces after the PI SDK installation. If PI Server Applications
are part of the installation, setup installs the PI Server Applications after the default
interfaces.
After the PI Server Applications are installed, the upgrade is complete on the second node.
Run the PI Cluster Wizard to create any new required or optional resources. For example,
version 3.4.370.52 introduced two new requirements: PI Backup Subsystem and PI License
Manager. Recall that the PI Cluster Wizard (PIClusWizard.exe) is located in the PI/adm
Page 116
10.4 - PI Server Upgrades
directory, and a shortcut to the PI Cluster Wizard can also be found in the Start Menu under
the PI System submenu.
Because the PI Server Cluster Group already exists, check “Use existing IP Address” and
select the correct IP Address from the drop-down list.
The network name should automatically be populated based on the selected IP Address.
Simply select the correct “Network to use” from the drop-down list.
Enter the name of the existing PI Server Cluster Group and select the appropriate disk where
the PI Server is installed.
Check any additional optional resources that you want added to the existing PI Server Cluster
Group.
Page 118
10.4 - PI Server Upgrades
Click Finish to create the new required and optional Cluster Resources in the existing PI
Server Cluster Group. All new resources will initially be offline.
Page 120
Chapter 11. PI SERVER SILENT INSTALLATION
This section details the silent installation and upgrade of the PI Server on Microsoft®
Windows Platforms. Silent installs or upgrades require that the Microsoft® Data Access
Components (MDAC) be at version 2.7 or greater and Microsoft® Windows Installer be at
version 2.0 or greater. Silent installs can not be run from the original CD or self extracting zip
file because installation files within the distribution need to configured for silent installation
or upgrade.
[SETUPMODULES]
1 = MDACSetup
2 = WindowsInstallerSetup
[DISPLAYNAME]
1 = Microsoft Data Access (MDAC)
2 = Microsoft Windows Installer
[UNSUPPORTED_OPERATING_SYSTEMS]
; Defined Operating Systems ( Win95, Win98, WinME, WinNT, Win2K, WinXP,
WinNET)
; A 0 entry denotes that the setup can not run on the given operating
systems.
; An entry that corresponds to an entry in the [SETUPMODULES] section
denotes that
; the particular setup module will be skipped on the given operating
system
0 = Win95, Win98, WinME, WinNT
When the setup is run using the prerequisite.ini file, the Microsoft® Data Access
Components (MDAC) and Microsoft® Windows Installer are not installed. It is the user’s
responsibility to install Microsoft® Data Access Components (MDAC) and Microsoft®
Windows Installer before the PI Server installation can run silently. The entry that triggers a
check for installation is the CHECKFORINSTALLEDONLY entry in the [SETUPKIT]
section. Setting the value of CHECKFORINSTALLEDONLY to true triggers the prerequisite
installation. The prerequisite check installation can be run in silent mode or verbose mode. In
silent mode, three parameters in the [SETUPKIT] section of the prerequisite.ini file are set to
true. These parameters are
• suppresscompletionmessage = true
• suppressdialogs = true
• suppressheadermessage = true
When running in silent mode, setup.exe will return the number of setup modules that have not
been installed. For example, if both MDAC and Windows Installer are already installed, the
return is 0. If either MDAC or Windows Installer is not already installed, the return is 1. If
both are not installed, setup.exe returns 2. In addition, setup.exe outputs messages to the setup
master log describing which setup modules are not installed. If the prerequisite check
installation is run in verbose mode, three parameters in the [SETUPKIT] section of the
prerequisite.ini file are set to false. These parameters are
• suppresscompletionmessage = false
• suppressdialogs = false
• suppressheadermessage = false
In this scenario, the welcome dialog will list the setup modules that are not installed. In
addition, setup.exe outputs messages to the setup master log describing which setup modules
are not installed.
Page 122
11.2 - Silent New Installation
The silent.ini file included in the PI Server distribution is used for silent installations. This
file needs to be configured to satisfy the specifications of the destination machine. The
silent.ini file is used in the overall execution of the installation. It executes the PI Server
installation as well as supporting software that is included in the PI Server distribution. By
default, when the setup executable, setup.exe is run, it looks for the setup.ini file in the same
directory as the distribution kit and copies it to the root directory of the destination machine
as pisetup.ini. Setup then uses pisetup.ini to control the installation. Optionally, Setup can use
another file instead of the setup.ini file when the –f flag is specified. This flag is used for
silent installations. In the following example below, setup.exe is run with the –f flag using
the silent.ini file. The file m:\nt\silent.ini is copied to the root directory of the destination
machine as pisetup.ini and is used in the installation.
m:\nt\setup.exe –f m:\nt\silent.ini
The letter of the drive containing the distribution is denoted as “m:” in this case.
A silent.ini file is shown below. This file may look different depending on your license
agreement.
[SETUPKIT]
; Setup wrapper master log file name
NAME = PIServer
DISPLAYNAME = PI Server
; These suppress the setup wrapper dialogs, not those for the individual
setup modules
SUPPRESSCOMPLETIONMESSAGE = TRUE
SUPPRESSDIALOGS = TRUE
SUPPRESSHEADERMESSAGE = TRUE
[NUMSETUPMODULES]
NUM = 30
[SETUPMODULES]
1 = MDACSetup
2 = WindowsInstallerSetup
3 = ScriptingRuntimeSetup
4 = dotnetSetup
5 = PIServer.msi
6 = pisdk.msi
7 = Random.msi
8 = Random_ICU.msi
9 = Rmp_sk.msi
10 = Rampsoak_ICU.msi
11 = PingBasicSetup.msi
12 = PIPing_ICU.msi
13 = SNMPBasicSetup.msi
14 = PISNMP_ICU.msi
15 = PIPerfmon_basic.msi
16 = PIPerfmon_ICU.msi
17 = PIIntStatusSetup.msi
18 = PIIntStatus_ICU.msi
19 = PIICUSetup.msi
20 = PIGenericNamesSetup.msi
21 = PISptSetup.msi
22 = pialarm.msi
23 = pibatch.msi
24 = pipeschd.msi
25 = pirecalc.msi
26 = pitotal.msi
27 = pibagen.msi
28 = piaf.msi
29 = PIAPSSetup.msi
30 = PIAPSRegisterInterfaceSetup.msi
[COMMANDLINE]
3 =:a /r:ns
4 =:a /c:"install /l /q"
5 = REBOOT=Suppress ALLUSERS=1 /qn SET_EXTERNAL_DIRS=1
INSTALLDIR="C:\PI\" ARCHIVEDATDIR="C:\PI\dat\"
EVENTQUEUEDIR="C:\PI\dat\" PIPCHOME="C:\Program Files\PIPC\"
ARCHIVESIZE=128 EVENTQUEUEPAGESIZE=1024 EVENTQUEUESIZE=64 SERVICESTART=1
DEFAULTPTS=1 USERNUMBER=12345
6 = REBOOT=Suppress ALLUSERS=1 /qn SUPPRESS_PINS=1 PI_SERVER=localhost
PI_ALIAS=localhost PI_TYPE=3 PI_PORT=5450 PI_USER=piadmin
7 = REBOOT=Suppress ALLUSERS=1 /qn
8 = REBOOT=Suppress ALLUSERS=1 /qn
9 = REBOOT=Suppress ALLUSERS=1 /qn
10 = REBOOT=Suppress ALLUSERS=1 /qn
11 = REBOOT=Suppress ALLUSERS=1 /qn
12 = REBOOT=Suppress ALLUSERS=1 /qn
13 = REBOOT=Suppress ALLUSERS=1 /qn
14 = REBOOT=Suppress ALLUSERS=1 /qn
15 = REBOOT=Suppress ALLUSERS=1 /qn
16 = REBOOT=Suppress ALLUSERS=1 /qn
17 = REBOOT=Suppress ALLUSERS=1 /qn
18 = REBOOT=Suppress ALLUSERS=1 /qn
19 = REBOOT=Suppress ALLUSERS=1 /qn
20 = REBOOT=Suppress ALLUSERS=1 /qn
21 = REBOOT=Suppress ALLUSERS=1 /qn
22 = REBOOT=Suppress ALLUSERS=1 /qn
23 = REBOOT=Suppress ALLUSERS=1 /qn
24 = REBOOT=Suppress ALLUSERS=1 /qn
25 = REBOOT=Suppress ALLUSERS=1 /qn
26 = REBOOT=Suppress ALLUSERS=1 /qn
27 = REBOOT=Suppress ALLUSERS=1 /qn
28 = REBOOT=Suppress ALLUSERS=1 /qn ADDLOCAL=ALL
29 = REBOOT=Suppress ALLUSERS=1 /qn
30 = REBOOT=Suppress ALLUSERS=1 /qn
[DISPLAYNAME]
1 = Microsoft Data Access (MDAC)
2 = Microsoft Windows Installer
3 = Microsoft Windows Script
4 = Microsoft .NET Framework 1.1
[UNSUPPORTED_OPERATING_SYSTEMS]
Page 124
11.2 - Silent New Installation
Parameter Description
SERVICESTART This parameter is set to 1 if you want the PI Server to start when
the machine is started. Set this parameter to “” if you want the
service start to be manual.
DEFAULTPTS This parameter is set to 1 if you want to install default points. Set
this parameter to “” if you do not want to install default points.
A silent upgrade requires that the PI Server be shut down before upgrading the PI Server. The
silent.ini file included in the PI Server distribution is used for silent upgrades. It executes the
PI Server upgrade as well as supporting software that is included in the PI Server distribution.
By default, when the setup executable, setup.exe is run, it looks for the setup.ini file in the
same directory as the distribution kit and copies it to the root directory of the destination
machine as pisetup.ini. Setup then uses pisetup.ini to control the upgrade. For a silent
upgrade, Setup needs to use another file instead of the setup.ini file. This is accomplished by
specifying the –f flag. In the following example below, setup.exe is run with the –f flag using
the silent.ini file. The file m:\nt\silent.ini is copied to the root directory of the destination
machine as pisetup.ini and is used in the upgrade.
m:\nt\setup.exe –f m:\nt\silent.ini
The letter of the drive containing the distribution is denoted as “m:” in this case.
A silent.ini file is shown below. This file may look different depending on your license
agreement.
[SETUPKIT]
; Setup wrapper master log file name
NAME = PIServer
DISPLAYNAME = PI Server
; These suppress the setup wrapper dialogs, not those for the individual
setup modules
SUPPRESSCOMPLETIONMESSAGE = TRUE
SUPPRESSDIALOGS = TRUE
SUPPRESSHEADERMESSAGE = TRUE
[NUMSETUPMODULES]
NUM = 30
[SETUPMODULES]
1 = MDACSetup
2 = WindowsInstallerSetup
3 = ScriptingRuntimeSetup
4 = dotnetSetup
5 = PIServer.msi
6 = pisdk.msi
7 = Random.msi
8 = Random_ICU.msi
9 = Rmp_sk.msi
10 = Rampsoak_ICU.msi
11 = PingBasicSetup.msi
12 = PIPing_ICU.msi
13 = SNMPBasicSetup.msi
14 = PISNMP_ICU.msi
15 = PIPerfmon_basic.msi
16 = PIPerfmon_ICU.msi
17 = PIIntStatusSetup.msi
18 = PIIntStatus_ICU.msi
19 = PIICUSetup.msi
20 = PIGenericNamesSetup.msi
Page 126
11.3 - Silent Upgrade
21 = PISptSetup.msi
22 = pialarm.msi
23 = pibatch.msi
24 = pipeschd.msi
25 = pirecalc.msi
26 = pitotal.msi
27 = pibagen.msi
28 = piaf.msi
29 = PIAPSSetup.msi
30 = PIAPSRegisterInterfaceSetup.msi
[COMMANDLINE]
3 =:a /r:ns
4 =:a /c:"install /l /q"
5 = REBOOT=Suppress ALLUSERS=1 /qn SET_EXTERNAL_DIRS=1
INSTALLDIR="C:\PI\" ARCHIVEDATDIR="C:\PI\dat\"
EVENTQUEUEDIR="C:\PI\dat\" PIPCHOME="C:\Program Files\PIPC\"
ARCHIVESIZE=128 EVENTQUEUEPAGESIZE=1024 EVENTQUEUESIZE=64 SERVICESTART=1
DEFAULTPTS=1 USERNUMBER=12345
6 = REBOOT=Suppress ALLUSERS=1 /qn SUPPRESS_PINS=1 PI_SERVER=localhost
PI_ALIAS=localhost PI_TYPE=3 PI_PORT=5450 PI_USER=piadmin
7 = REBOOT=Suppress ALLUSERS=1 /qn
8 = REBOOT=Suppress ALLUSERS=1 /qn
9 = REBOOT=Suppress ALLUSERS=1 /qn
10 = REBOOT=Suppress ALLUSERS=1 /qn
11 = REBOOT=Suppress ALLUSERS=1 /qn
12 = REBOOT=Suppress ALLUSERS=1 /qn
13 = REBOOT=Suppress ALLUSERS=1 /qn
14 = REBOOT=Suppress ALLUSERS=1 /qn
15 = REBOOT=Suppress ALLUSERS=1 /qn
16 = REBOOT=Suppress ALLUSERS=1 /qn
17 = REBOOT=Suppress ALLUSERS=1 /qn
18 = REBOOT=Suppress ALLUSERS=1 /qn
19 = REBOOT=Suppress ALLUSERS=1 /qn
20 = REBOOT=Suppress ALLUSERS=1 /qn
21 = REBOOT=Suppress ALLUSERS=1 /qn
22 = REBOOT=Suppress ALLUSERS=1 /qn
23 = REBOOT=Suppress ALLUSERS=1 /qn
24 = REBOOT=Suppress ALLUSERS=1 /qn
25 = REBOOT=Suppress ALLUSERS=1 /qn
26 = REBOOT=Suppress ALLUSERS=1 /qn
27 = REBOOT=Suppress ALLUSERS=1 /qn
28 = REBOOT=Suppress ALLUSERS=1 /qn ADDLOCAL=ALL
29 = REBOOT=Suppress ALLUSERS=1 /qn
30 = REBOOT=Suppress ALLUSERS=1 /qn
[DISPLAYNAME]
1 = Microsoft Data Access (MDAC)
2 = Microsoft Windows Installer
3 = Microsoft Windows Script
4 = Microsoft .NET Framework 1.1
[UNSUPPORTED_OPERATING_SYSTEMS]
Page 128
TECHNICAL SUPPORT AND RESOURCES
Email Support
Email support is available 24 hours a day, 7 days a week. Send technical support
inquiries, including the problem description and message logs, to:
[email protected]. Technical Support will respond to your inquiry within 24
hours.
Knowledge Center
The Knowledge Center provides a searchable library of documentation and technical
data, as well as a special collection of resources for system managers. For these options,
click Knowledge Center in the Technical Support Web site.
• The Search feature allows you to search Support Solutions, Bulletins, Support
Pages, Known Issues, Enhancements, and Documentation (including User
Manuals, Release Notes, and White Papers).
• System Manager Resources include tools and instructions that help you
manage: Archive sizing, Backup scripts, Daily Health Check, Daylight Saving
Time configuration, PI Server security, PI System sizing and configuration, PI
Trusts for Interface Nodes, and more.
Page 130
INDEX OF TOPICS
Page 132
Index of Topics
System UniInt
Number, 13, 25 downloading documentation
Requirements for, vi
UNIX, 7 Universal Interface
System Management Tools, vi downloading documentation
for, vi
System sizing
UNIX
Compaq Tru64 UNIX, 8
Installation and Upgrade, 43
Guide to, 2
Login accounts, 47
Sun Solaris, 8
Upgrade
Windows, 7
Cluster, 100
Tar command, 49, 51
Earlier versions, 23, 61
Tar file, 51
Overview
Technical Support, 129
UNIX, 62
Time
Windows, 11
Daylight Savings Time, 9, 46
Windows Services
Setting, 9
Configuring, 40
UNIX, 46
Running PI, 38
TZ environment variable, 9
Zone, 9, 46
Page 134
Introduction to PI Server
System Management
PI3 Server
Version 3.4.370
Worldwide Offices
OSIsoft, Inc. is the owner of the following trademarks and registered trademarks: PI System, PI ProcessBook,
Sequencia, Sigmafine, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known to be
trademarks or service marks have been appropriately capitalized. Any trademark that appears in this book that
is not owned by OSIsoft, Inc. is the property of its owner and use herein in no way indicates an endorsement,
recommendation, or warranty of such party's products or any affiliation with such party of any kind.
Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)
of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
Copyright Notice
Unpublished -- rights reserved under the copyright laws of the United States
PREFACE – USING THIS GUIDE
This guide provides a starting place for new PI System Managers on Windows-based PI
Systems. This guide:
Introduces the PI System, PI Server and Interface Nodes.
Explains PI system components, architecture, data flow, utilities and tools.
Provides instruction for managing points, archives, backups, interfaces, security and
trusts, and performance.
Includes a glossary and resource guide.
This guide does not cover systems with PI Servers on VMS. For information on managing an
OpenVMS-based PI Server System, see the VMS PI Server page on the Technical Support
Web site (http://techsupport.osisoft.com/).
Introduction to PI Server
System Management Page iii
Preface - Using this Guide
The PI Server Documentation Set includes seven user guides, described below.
Tip: Updated user guides, which provide the most up-to-date information, are
available for download from the OSIsoft Technical Support Web site
(http://techsupport.osisoft.com).
Introduction to PI A guide to the PI Server for new users and administrators. It explains PI
System Management system components, architecture, data flow, utilities and tools. It provides
instruction for managing points, archives, backups, interfaces, security and
trusts, and performance. It includes a glossary and resource guide.
PI Server Installation A guide for installing, upgrading and removing PI Servers on Windows and
and Upgrade Guide UNIX platforms, including cluster and silent installations.
PI Server System An in-depth administration guide for the PI Server, including starting and
Management Guide stopping systems, managing the Snapshot, Event Queue and Data Archive,
monitoring system health, managing backups, interfaces, security, and
moving and merging servers. Includes comprehensive instructions for using
command-line tools: PIConfig, PIDiag, and PIArtool, and in-depth
troubleshooting and repair information.
PI Server Reference A comprehensive reference guide for the system administrator and
Guide advanced management tasks, including: databases; data flow; PI Point
classes and attributes, class edit and type edit; exception reporting;
compression testing; security; SQL subsystem; PI time format; and
overviews of the PI API, and PI-SDK System Management Tool (SMT).
Auditing the PI Server An administration guide that explains the Audit Database, which provides a
secure audit trail of changes to PI System configuration, security settings,
and Archive Data. It includes administration procedures to enable auditing,
to set subsystem auditing mode, to create and archive database files, and
to export audit records.
PI Server Applications A guide to key add-on PI Server Applications: Performance Equations (PE),
User Guide Totalizer, Recalculator, Batch, Alarm, and Real-Time SQC (Statistical
Quality Control). Includes a reference guide for Performance Equations, and
Steam calculation functions.
PINet and PIonPINet A systems administration guide, including installation, upgrade and
User Guide operations, for PINet for OpenVMS and PIonPINet, which support migration
and interoperability between PI2 and PI3 Systems.
Page iv
Preface - Using this Guide
Monospace Consolas monospace is used for: To list current Snapshot information every 5 seconds,
type: Code examples use the piartool -ss command. For example:
"Consolas" Commands to be typed on the
font command line (optionally with
arguments or switches)
System input or output such as
excerpts from log files and other
data displayed in ASCII text
Bold consolas is used in the
context of a paragraph
Light Blue - Links to URL / Web sites, and email http://www.osisoft.com/procedures.aspx
Underlined addresses [email protected]
Introduction to PI Server
System Management Page v
Preface - Using this Guide
Related Documentation
OSIsoft provides a full range of documentation to help you understand and use the PI Server,
PI Server Interfaces, and PI Client Tools. Each Interface has its own manual, and each Client
application has its own online help and/or user guide.
The UniInt End User Manual describes the OSIsoft Universal Interface (UniInt), which is
recommended reading for PI Server system managers. Many PI Interfaces are based upon
UniInt, and this guide provides a deeper understanding of principals of Interface design.
The PI Server provides two sets of powerful tools that allow system administrators and users
to perform system administration tasks and data queries.
The PI Server includes many command-line tools, such as pidiag and piartool. The
PI Server Documentation Set provides extensive instruction for performing PI Server
administrative tasks using command-line tools.
The PI System Management Tools (SMT) is an easy-to-use application that hosts a
variety of different plug-ins, which provide all the basic tools you need to manage a
PI System. You access this set of tools through a single host application. This host
application is sometimes referred to as the SMT Host, but it is more commonly called
System Management Tools or SMT.
You can download the latest version of SMT from the Technical Support Web site:
http://techsupport.osisoft.com
In addition to extensive online help that explains how to use all of the features in the SMT,
the SMT includes the Introduction to PI System Management user guide.
Page vi
QUICK TABLE OF CONTENTS
Introduction to PI Server
System Management Page vii
TABLE OF CONTENTS
Introduction to PI Server
System Management Page ix
Table of Contents
Page x
Table of Contents
Introduction to PI Server
System Management Page xi
Table of Contents
Index of Topics.................................................................................................................................99
Page xii
TABLES AND FIGURES
Tables
Figures
Introduction to PI Server
System Management Page xiii
Chapter 1. INTRODUCTION TO PI SYSTEM MANAGEMENT
This guide provides a starting place for new PI System Managers on Windows-based PI
Systems. It introduces the PI System, PI Server and Interface Nodes, and gives you the PI
System Management basics, including system backups, archive management, and security.
This guide contains the following topics:
System Manager Checklist on page 3
PI System Administration Tools on page 5
Introduction to the PI System on page 9
Managing PI Points on page 17
Managing Archives on page 25
Managing Backups on page 35
Managing Interfaces on page 41
Managing PI Security on page 47
Monitoring PI System Performance on page 57
Managing Buffering on page 63
Where to Go to Get More Help on page 73
This guide does not cover systems with PI Servers on VMS. If you need information on
managing an OpenVMS-based PI Server System, a good starting point is the VMS PI Server
page on the Technical Support Web site (http://techsupport.osisoft.com/).
Introduction to PI Server
System Management Page 1
Chapter 2. SYSTEM MANAGER CHECKLIST
This section provides a quick-reference table for checks that you need to perform regularly, to
make sure that your PI System is working properly. This is sometimes called a “Daily Health
Check” because we recommend you perform each of these checks each day.
The checklist is organized into functional areas, with a list of things to check in each area.
This table does not provide detailed instructions for checking each item. To learn more about
how to check a particular item, go to the section listed in the column on the right. You
perform most of the checks using the PI System Management Tools (SMT). To learn how to
get these tools, see PI System Administration Tools on page 5.
PI Server 9 Core PI systems and interfaces are SMT Server Process Manager
Subsystems running (see Checking whether the PI Server
is Running on page 12)
Backups 9 PI System backups have been run Check the files and disk
9 There is enough disk space for future (see Managing Backups on page 35)
backups
9 The backup files are copied to the
backup media or device
Introduction to PI Server
System Management Page 3
Chapter 2 - System Manager Checklist
Event Queue 9 The Archive data flow is normal PI Performance Monitor points
9 The Snapshot data flow is normal (see Monitoring PI System
9 The Event Queue flow is normal Performance on page 57)
9 There is enough disk space available
for the Event Queue(s)
9 There are no unexpected out-of-order
events
Message 9 There are no errors or unusual events SMT Message Log viewer
Log in the message logs
Data 9 The I/O rate tag trends look good Check I/O rate tags
Sources 9 There are no error messages in the (see Monitoring Interface
pipc.log file Performance on page 44)
Points 9 There are no stale or bad tags SMT Stale and Bad Tags
(Tags) (see Finding Malfunctioning Points on
page 23)
Page 4
Chapter 3. PI SYSTEM ADMINISTRATION TOOLS
OSIsoft provides two tools that make it much easier to manage a PI System. If you haven't
already installed these two tools, do it now:
The PI System Management Tools (SMT) on page 5
The PI Interface Configuration Utility (ICU) on page 6
Make a habit of checking the Technical Support Web Site (http://techsupport.osisoft.com)
regularly for updates to these tools.
OSIsoft also provides some other helpful tools that you might want to look at, if you have the
time:
Using Other PI Tools on page 7
Introduction to PI Server
System Management Page 5
Chapter 3 - PI System Administration Tools
Page 6
3.1 - Getting and Using the Tools You Need
Introduction to PI Server
System Management Page 7
Chapter 4. INTRODUCTION TO THE PI SYSTEM
The PI System collects, stores and manages data from your plant or process. You connect
your data sources to one or more PI Interface Nodes. The Interface Nodes get the data from
your data sources and send it to the PI Server. Users get data from the PI Server and display it
with client tools (for example, ProcessBook, DataLink or RtWebParts).
Data Sources: Your data sources are the instruments that generate your data. They
can be almost anything and they can connect to the Interface Nodes in a variety of
different ways. PI’s Performance Equations, ACE, and Totalizer are also all data
sources. See Managing Data Source Equipment on page 71 for more information
about Data Sources.
Interface Nodes: Interface Nodes run PI interfaces. PI interfaces get the data from
the data sources and send it to the PI Server. Each different data source needs a PI
interface that can interpret it. OSIsoft has over 300 different interfaces. For more
information, see About PI Interface Nodes on page 10 and Managing Interfaces on
page 41.
PI Server: The PI Server stores the PI data and acts as a data server for Microsoft
Windows-based client applications. You can also use the PI Server to interact with
data that is not stored in PI (external systems). For more information, see About the
PI Server on page 11.
Clients: Operators, engineers, managers and other plant personnel use a variety of
client applications to connect to the PI Server to view plant data. For more
information, see About Client Applications on page 16.
Introduction to PI Server
System Management Page 9
Chapter 4 - Introduction to the PI System
OSIsoft provides specialized interface programs (interfaces) for each data source. These
interfaces typically run on a dedicated system, called an Interface Node, which connects both
to the data sources and to the PI Server. For historical reasons, Interface Nodes are also
sometimes referred to as API Nodes or Data Source Nodes.
Interface Nodes can run multiple interfaces to multiple PI Servers. The Interface Node might
be a machine that is a part of the foreign data system, or a stand-alone dedicated interface
machine, or even a PI Server itself (PI to PI).
Data Flow on the Interface Nodes
About Buffering
In the preceding illustration, values A, D and C are reported to the PI Server. Value A is the
last reported value, values B and C fall within the exception dead band, but value D falls
Page 10
4.2 - About the PI Server
outside the deadband, so the interface reports value D and the previous value, in this case,
value C.
The interface uses the point’s ExcDev, ExcMin and ExcMax attributes to decide whether to
report the new value to PI:
The ExcDev (or ExcDevPercent) attributes determine how much a point's value
needs to change before the interface sends it to the Server. For example, a 12 bit A/D
converter can never be more precise than 1 part in 4096.
The ExcMax attribute sets a limit on how long the interface can go without reporting
a value to PI. After the ExcMax time period, the interface sends the next new value
to PI, regardless of whether the new value is different from the last reported value.
The ExcMin attribute sets a limit on how frequently the interface can report values.
For example, if you want the interface to wait a full ten minutes before reporting a
new value to the PI Server, then you would set the ExcMin attribute to ten minutes.
For details on setting exception reporting attributes, see Exception Specifications on page 20.
Some interfaces do not support exception reporting. See the documentation for your interface
to determine whether it supports this capability.
The PI Server is the heart of your PI System. It gets the data and routes it in real time
throughout the PI System and your entire information infrastructure, making it possible for
everyone to work from a common set of real data. Operators, engineers, managers, and other
plant personnel can connect to the PI Server and view manufacturing data from PI Data
Storage or from external data storage systems.
What's in the PI Directory?
File System Dos and Don'ts
Checking whether the PI Server is Running
Data Flow in the PI Server
Directory Contents
dat Contains databases such as points and digital states. This is also the
default directory for archives.
Introduction to PI Server
System Management Page 11
Chapter 4 - Introduction to the PI System
Directory Contents
PI Archive subsystem The PI Archive subsystem stores and serves the data after it comes out
of the Snapshot subsystem.
PI Backup subsystem The PI Backup subsystem controls the backup of the PI Server.
PI Base subsystem The PI Base subsystem maintains the point configuration data. This
subsystem also hosts the PI Module Database.
PI License Manager The PI License Manager maintains licensing information for the PI
Server and all connected applications
PI Message subsystem The PI Message subsystem records status and error messages for the
PI Server in a log file.
PI Network Manager The PI Network Manager provides the connection between all the
subsystems in the Server. This subsystem also manages network
connections between the PI System and client applications.
PI Shutdown subsystem Determines when the PI Server was stopped and writes shutdown
events to points configured to receive these events (runs only at startup
and then stops on non-Clustered PI Servers)
PI Snapshot subsystem The PI Snapshot subsystem stores the most recent event for each point.
It applies compression, sends data to the Event Queue, and serves
Snapshot events to the client applications.
PI SQL Subsystem The PI SQL Subsystem processes SQL statements, including those
submitted by the PI ODBC Driver.
Page 12
4.2 - About the PI Server
To check whether the core subsystems are running, you can use the Server Process Manager
plug-in in the PI System Management Tools (SMT):
1. Open the PI System Management Tools and select the Server you want to check (see
The PI System Management Tools (SMT) on page 5).
2. In the System Management plug-ins list, under Operation, choose Server Process
Manager. The list of processes appears.
3. If the core subsystems (except Shutdown on non-Clustered PI Servers) are running,
then the PI Server is running. The Shutdown subsystem runs only when the PI Server
is starting up, so Shutdown is listed as Stopped.
In addition to the core subsystems, the Server Process Manager lists the status of optional
subsystems, such as Batch and Performance Equation Scheduler. These optional subsystems
do not need to be running in order for the PI Server to be running.
Introduction to PI Server
System Management Page 13
Chapter 4 - Introduction to the PI System
When a new event comes in, it becomes the Snapshot for that point. The PI Server evaluates
the previous Snapshot according to the compression specifications and either sends the new
value to the Event Queue or discards it.
These values in the Snapshot Subsystem are called Snapshot events or, sometimes, just
Snapshots. The collection of all the Snapshot values for all the points is the Snapshot
database.
Page 14
4.2 - About the PI Server
The same principle applies to compressing real-world data. The PI Server uses a sophisticated
compression algorithm to determine which events it needs to keep in order to provide an
accurate data history. The CompDev, CompMin and CompMax attributes allow you to
control the “granularity” of the compression algorithm.
The CompMin and CompMax attributes give you some control over how often the
PI Server should save a new value for a particular point.
CompDev and CompDevPercent allow you to decide how much a point's value
needs to change in order for PI to save it.
For details on setting compression testing attributes, see Compression Specifications on page
21.
Normally the Event Queue passes events through to the Archive as quickly as they arrive, but
in some circumstances the Archive Subsystem might be too busy or an archive file might be
unavailable. When this happens, the Event Queue holds the data, filling until the Archive is
again available. This is called Archive Queuing.
Introduction to PI Server
System Management Page 15
Chapter 4 - Introduction to the PI System
The Archive Subsystem is busy because incoming events are out of order.
The PI Server works with a wide range of client applications, from ProcessBook and
DataLink to RtWebParts. Some of the client software packages available from OSIsoft are
listed in the table below.
Software Description
PI DataLink Allows PI to access and deliver data to and from spreadsheet programs
and create easy-to-read reports.
PI Control Monitor Oversees plant control systems, ensuring accuracy, and keeps a
historical system record.
PI Manual Logger Used to organize and manually enter data from handheld loggers,
computer terminals, scanners, and other input devices into the PI
System.
RtWebParts Web parts that work with RtBaseline Services to display PI and other
data in various ways.
Page 16
Chapter 5. MANAGING PI POINTS
This section gives you a brief introduction to PI points and point attributes and then covers
the basic point-related tasks that a System Manager needs to know how to do:
About Points
About Point Attributes
Creating New Points
Finding Malfunctioning Points
Decommissioning Points
Deleting Points
This material is an introduction to PI points. For comprehensive documentation on PI points,
see the PI Server Reference Guide.
Points, sometimes also called tags, are the basic building blocks of a PI system, because they
are how you track the events that comprise your data history. When the System Manager or
OSIsoft Field Services engineer installs a PI Server, he creates a PI Point for every source of
data that the PI System needs to track.
Each point has more than 50 attributes (About Point Attributes on page 17) that define exactly
how the data should be collected for that point. These attributes determine how frequently the
point gets new values, the data type of the point values (whether integer or string, for
example), who is allowed to view and/or edit the point, and so on. The PI Base Subsystem
stores points and their attributes in the Point Database.
Note: Some PI interfaces are compatible with PI Auto Point Sync (PI APS), which
tracks changes in foreign data systems and automatically updates the PI Points
Configuration to reflect those changes.
Point attributes are where you configure how and when PI should collect data from a
particular data source. Point attributes specify the data source location, how often PI should
Introduction to PI Server
System Management Page 17
Chapter 5 - Managing PI Points
get new values from the data source, which values PI can ignore and which represent valid
data, and much more.
Point attributes are fully documented in the PI Server Reference Guide. This section gives
you a brief overview of a few key attributes:
Point Name: Tag Attribute
Class of Point: PtClass Attribute
Data Type of Point: PointType Attribute
Data Source: PointSource Attribute
Interface ID Number: Location1 Attribute
Setting Scan Class: Location4 Attribute
Exception Specifications
Compression Specifications
Point Value Range: Zero, Span and Typical Value
Configuring Shutdown Events: Shutdown
Point Security: PtOwner, PtGroup, PtAccess, DataOwner, DataGroup, DataAccess
There are more than 50 different point attributes that you can specify for each point. The
exact list of attributes that configures a point depends on the class of the point (see Class of
Point: PtClass Attribute on page 18).
Page 18
5.2 - About Point Attributes
Base: The Base class is a common set of attributes that all point classes include. The
Base class includes both system-assigned and user-assigned attributes. This is the
minimum set of attributes that a PI point needs in order to function.
Alarm: The Alarm class is used for alarm points. See the PI Server Applications Guide
for more information on Alarm points.
Totalizer: The Totalizer class is for a type of point that represents a running total of data.
There are many different kinds of Totalizer points. For more information on Totalizer
points, see the PI Server Applications Guide and the SMT help topic for the Totalizer
Editor.
SQC_Alarm: The SQC_Alarm class is for SQC_Alarm points. See the PI Server
Applications Guide for more information on SQC_Alarm points.
Digital Use the Digital point type for points whose value can only be one of several
discrete states, such as ON/OFF or Red/Green/Yellow.
Int16 Use the Int16 point type for points whose values are integers between 0 and
32767 (15-bit unsigned integers).
Int32 Use the Int32 point type for points whose values are integers between -
2147450880 and 2147483647 (32-bit signed integers).
Float16 Use the Float16 point type for floating point values, scaled. The accuracy is one
part in 32767.
Float32 Use the Float32 point type for single-precision floating-point values, not scaled
(IEEE floating points).
Float64 Use the Float64 point type for double-precision floating-point values, not scaled
(IEEE floating points).
String Use the String point type for strings of up to 976 characters.
Blob Blob stands for Binary Large Object. Use the Blob point type to store any type
of binary data up to 976 bytes.
Timestamp Use the Timestamp point type for any time/date in the range 1-jan-1970 to 1-
Jan-2038 Universal Time (UTC).
Introduction to PI Server
System Management Page 19
Chapter 5 - Managing PI Points
Note: Most interfaces require you to use the Location4 attribute to set the scan
class, however there are exceptions, particularly among older interfaces. Also, some
interfaces get data on command, rather than scanning. Always check the
documentation for the interface.
Exception ExcDev Use this attribute to specify how much a point value must
Deviation change before the interface reports the new value to PI.
Use ExcDev to specify the exception deviation in the
point's engineering units. As a general rule, you should
set the exception slightly smaller than the precision of the
instrument system.
Exception ExcMin Use ExcMin to limit how often (in seconds) the interface
Minimum reports a new event to PI. For example, if you set ExcMin
to five, then the interface discards any values collected
within five seconds of the last reported value. ExcMin is
typically set to zero.
Exception ExcMax Set ExcMax to the maximum length of time (in seconds)
Maximum you want the interface to go without reporting a new event
to PI. After this time, the interface will report the new
event to PI without applying the exception deviation test.
Page 20
5.2 - About Point Attributes
To learn more about exception reporting, see the PI Server Reference Guide.
Note: For Digital, Blob, or String points, only the exception maximum and minimum
times are important. PI ignores the exception deviation specification for them.
Compression CompMin Sets a minimum limit on the time between events in the
minimum time Archive. Set the CompMin attribute to zero for any point
coming from an interface that does exception reporting.
You typically use CompMin to prevent an extremely noisy
point from using a large amount of archive space
Introduction to PI Server
System Management Page 21
Chapter 5 - Managing PI Points
To learn more about how PI calculates compression, see the PI Server Reference Guide.
Note: For Digital, Blob, or String points, only the compression maximum and
minimum times are important. PI ignores the compression deviation specification for
them.
Zero Indicates a point’s lowest possible value. Zero does not have to be the
same as the instrument zero, but that is usually a logical choice. This
attribute is required for all numeric data type points and is critically important
for float16 points.
Span The difference between the top of the range and the bottom of the range.
This attribute is required for all numeric data type points.
Typical Value Documents an example of a reasonable value for this point. For a numeric
tag, it must be greater than or equal to the zero, and less than or equal to
the zero plus the span.
Data Access Specifies who has access to a point's data values (Snapshot and Archive
data).
Point Access Specifies who has access to the point's attributes (Zero, Span, Descriptor,
and so on).
You can have different owners and different group access for a point's attributes than for the
point's data. So, for example, one user might be allowed to edit the data for a point, but not be
allowed to edit the attributes of that point.
Page 22
5.3 - Creating New Points
Note: If users don’t have permission to view a point’s attributes, they won’t be able
to see that point’s data either, in most cases. This is because client applications
need access to the point attributes in order to get the data.
To edit the owner, group and permissions for a point, select the point in SMT's Point Builder
and click the Security tab.
As a PI System Manager, you might need to create a new PI Point. The easiest way to create
a new tag is to copy an existing tag that is very similar to the tag you want to create—then
you can just edit the Tag attribute and any other attributes that you want to change. SMT's
Point Builder provides an easy interface for editing and creating PI points. If you're very
familiar with Excel, you will probably find the Excel plug-in, TagConfigurator, a better tool
to use. If you want to create more than one point at the same time, use TagConfigurator.
At least once a month, you should use SMT's PI Stale and Bad Tags plug-in to search for
stale and/or bad points. This plug-in identifies points that have not received data for a long
time or that have current values representing error conditions such as “I/O timeout”, “Pt
Created”, “bad input” or, in many cases “Shutdown”. Also check any “flat-lined” or “stuck”
points.
When you find points that are no longer useful (points that represent data from obsolete
equipment, for example), you should decommission them (see Decommissioning Points on
page 24).
Introduction to PI Server
System Management Page 23
Chapter 5 - Managing PI Points
When you delete a point, you lose all data for that point, so you break any client displays that
use the point. Further, once you delete a point, you can't get it back. If you are unsure about
the purpose of a point’s existence or about the need for any historical data associated with it,
it’s safer to decommission the point (see Decommissioning Points on page 24) rather than
deleting it.
Page 24
Chapter 6. MANAGING ARCHIVES
You need to pay close attention to the PI archives, because this is where PI stores your data
(About Archives on page 25). As the data accumulates, you need new archives to hold it.
Otherwise, PI overwrites data in existing archives. You can do all or most of your archive
management with the SMT Archive Manager plug-in.
About Archives
Finding the Archive Files
Making Sure PI Doesn’t Overwrite Your Archives
Creating an Archive
Registering an Archive
Unregistering an Archive
Moving an Archive
Fixing Archive Gaps
Automating Archive File Creation
The PI System stores your data in archives. Typically, archives are files of a fixed size that
can hold PI data. Fixed archives allocate the full amount of space upfront, meaning that an
empty archive and a full archive take the same amount of disk space.
The archive receiving current data is called the Primary Archive. When the Primary Archive
becomes full, an Archive Shift occurs and the next available archive becomes the new
Primary Archive.
Note: PI actually performs the archive shift before the Primary Archive is completely
full so that older data can be added later, if necessary.
Introduction to PI Server
System Management Page 25
Chapter 6 - Managing Archives
For an archive file to be eligible to be the new Primary Archive, it must be registered
(Registering an Archive on page 28), writeable, shiftable, and large enough to handle the
current size of the Point Database.
If no eligible archives are available for an Archive Shift, PI uses the oldest available filled
archive as the new Primary Archive, overwriting the data in the old archive. For example in
the preceding illustration, after the shift from piarch.003 to piarch.004, no empty registered
archives are left. If no new archives are created, then piarch.001 becomes the next Primary
Archive.
It takes PI a few minutes to complete an Archive Shift. During that time, you are not allowed
to add, edit, or delete points. PI stores incoming data in the Event Queue until the shift is
complete and then writes the queued events into the new Primary Archive.
Note: Archives that can grow in size to accept variable amounts of data are called
dynamic archives. Dynamic archives are not discussed in this document. See the PI
Server System Management Guide for details.
By default the archives are placed in the PI\dat directory, but you can put them anywhere you
like. The Archive Manager lists the location of each registered archive file:
1. Run SMT and select the PI Server on which you want to view the archives (How to
Run SMT on page 5).
2. Click to expand the Operation item in the System Management Plug-ins pane.
Page 26
6.3 - Making Sure PI Doesn’t Overwrite Your Archives
Note: Don't use anti-virus software to scan the directories containing PI Server
database and archive files on systems collecting production data.
If you don’t have an empty, writable, shiftable, archive available when the archive shift
occurs, PI overwrites the oldest available full archive—unless your Server is set up to create
archives automatically. If your PI System does not create new archives automatically, you
can set it up to do that, if you like (Automating Archive File Creation on page 32).
Here's what you need to do:
1. Find out where the PI archive files are located (Finding the Archive Files on page
26).
2. If you don't want PI to create new archives automatically, then you need to figure out
how often your archives fill and you need to create new archives (Creating an
Archive on page 27) as needed so that PI doesn't run out of space and start
overwriting data.
3. If you do use automatic archive creation, then you need to make sure you don't run
out of disk space on that machine.
The SMT Archive Manager plug-in provides an easy interface for creating, editing, and
monitoring your PI archives. To create a new PI archive, follow these steps:
1. Run SMT and select the PI Server on which you want to view the archives (How to
Run SMT on page 5).
Introduction to PI Server
System Management Page 27
Chapter 6 - Managing Archives
2. Click to expand the Operation item in the System Management Plug-ins pane.
3. From the list of Operation plug-ins, double-click on Archive Manager. The Archive
Manager plug-in appears in the Active Plug-in pane. It lists all the archives registered
on the selected server. The Primary Archive is first on the list.
4. To create a new archive, click the Create a New Archive icon.
5. The Create New Archive dialog box appears. Name the new archive file and choose
the Clone the primary archive fixed size radio button.
6. If you want to choose a different size for the archive, you need to understand the
issues in archive sizing. Read the chapter on managing archives in the PI Server
System Management Guide.
7. Click the OK button. The Archive Manager plug-in creates and registers the
archive.
In order for the PI Server to recognize a file as an archive file you must register it. By
registering an archive file, you tell the PI Server that the file exists and that is an archive file.
The PI Server cannot access data in unregistered archives, nor can the PI client applications.
Page 28
6.6 - Unregistering an Archive
The SMT Archive Manager plug-in provides an easy interface for registering archives. To
register an archive, follow these steps:
1. Run SMT and select the PI Server on which you want to view the archives (How to
Run SMT on page 5).
2. Click to expand the Operation item in the System Management Plug-ins pane.
3. From the list of Operation plug-ins, double-click on Archive Manager. The Archive
Manager plug-in appears in the Active Plug-in pane. It lists all the archives registered
on the selected server. Unregistered archive files do not appear in the list.
4. Click the Register an Archive icon to register the archive.
If you want to move or reprocess an archive file, you need to unregister it, make your
changes, and then re-register it. You cannot unregister the primary archive.
Introduction to PI Server
System Management Page 29
Chapter 6 - Managing Archives
The SMT Archive Manager plug-in provides an easy interface for unregistering archives. To
register an archive, follow these steps:
1. Run SMT and select the PI Server on which you want to view the archives (How to
Run SMT on page 5).
2. Click to expand the Operation item in the System Management Plug-ins pane.
3. From the list of Operation plug-ins, double-click on Archive Manager. The Archive
Manager plug-in appears in the Active Plug-in pane. It lists all the archives registered
on the selected server. Unregistered archive files do not appear in the list.
4. To unregister an archive file, click the Unregister selected archive icon to unregister
the archive. The archive disappears from the list.
If you want to move an archive file, you unregister it (Unregistering an Archive on page 29),
move it to the new location, and then register it again (Registering an Archive on page 28).
When you move the archive file, be sure to move the associated annotation file as well. The
annotation file has the same name as the archive file, except that it ends in .ann. For example,
if the archive is named piarch.003, then the associated annotation file would be called
piarch.003.ann.
Page 30
6.8 - Fixing Archive Gaps
PI archive files meet chronologically end-to-end, accounting for all of history with no gaps
and no overlaps. If a gap does occur, it’s important to identify and fix it as soon as possible.
To check for (and fix) archive gaps, follow these steps:
1. Run SMT and select the PI Server on which you want to view the archives (How to
Run SMT on page 5).
2. Click to expand the Operation item in the System Management Plug-ins pane.
3. From the list of Operation plug-ins, double-click on Archive Manager. The Archive
Manager plug-in appears in the Active Plug-in pane. It lists all the archives registered
on the selected server. Any archive gaps are clearly labeled and highlighted in red.
Introduction to PI Server
System Management Page 31
Chapter 6 - Managing Archives
4. To fix an archive gap, right-click on the line displaying the archive gap.
5. Select Create New from the resulting pop-up menu. The Create New Archive
dialog box appears. The dialog box is already filled in for you, with the right start and
end times to fill the archive gap.
6. Click OK. The Archive Manager plug-in creates and registers the new archive and an
archive gap no longer appears in the archive list.
If your PI Server is running PI 3.4 or later, you can set it up to create archive files
automatically, as needed. This is very convenient, but you need to keep a close eye on
available disk space for the archives.
To automate archive file creation, follow these steps:
1. Make sure you have a fixed-size Primary Archive (automatic archive generation
won’t work if you have a dynamic Primary Archive). The automatically-generated
archives will be the same size as the Primary Archive.
2. Make sure you have a valid, shiftable target archive available. This gives you a
backup in case the file creation fails for some reason. This target archive can be
dynamic or fixed.
3. Run SMT (How to Run SMT on page 5).
4. Select the Server on which you want to automate archive file creation (How to Select
a Server in SMT on page 6).
5. From the list of Operation plug-ins, double-click on Timeout Table Editor. The
Timeout Table Editor appears in the Active Plug-in pane.
6. Click the Archive tab and select any item in the list.
7. Click the New Timeout Setting button.
Page 32
6.9 - Automating Archive File Creation
Introduction to PI Server
System Management Page 33
Chapter 7. MANAGING BACKUPS
It's important to back up the PI Server daily, so that you don't lose data and configuration
information. On a PI Server that is already correctly configured to back itself up
automatically, all you need to do is check your backups periodically and check that you have
enough disk space available for upcoming scheduled backups.
About PI Server Backups
Choosing a Backup Strategy
Checking Whether Backups are Scheduled
Setting up Automatic Backups
All backups of PI that are done while the PI System is running are managed by the PI Backup
Subsystem (PI\bin\pibackup.exe). Typically, the backups are launched via the
PI\adm\pibackup.bat backup script. However, if PI is installed on Windows 2003 Server, you
can backup PI with any third party backup application that supports Volume Shadow Copy
Services (VSS). This chapter only discusses backups with the backup script.
Note: If you don't have buffering turned on for all interfaces, you might lose data
during backups. See Checking whether the Buffering Service Is Running on page 64.
(PINet buffers data for interfaces running on PINet nodes.)
The easiest backup strategy is to set up PI to automatically run the backup scripts every day
as described in Setting up Automatic Backups on page 38 and in more detail in the PI Server
System Management Guide.
You can also run the scripts manually. The backup script initiates backups via NTBackup
(NTBackup.exe) on platforms that support VSS, and/or with the piartool –backup command
on platforms that do not support VSS. It is highly recommended that you run PI on a platform
that supports VSS because VSS backups cause minimal disruption to the operation of PI.
Introduction to PI Server
System Management Page 35
Chapter 7 - Managing Backups
The name of the backup task that is installed with the pibackup.bat file is called “PI Server
Backup”. If backups have been running successfully, the “Last Run Time” should not be
blank. The next run time should be about one day apart from the Last Run Time. Details of
the scheduled task can be viewed by double clicking on the task.
Page 36
7.5 - Checking the Message Logs
Number of Archives to
backup
The backup
script being
run.
Introduction to PI Server
System Management Page 37
Chapter 7 - Managing Backups
2. The above command will search for backup-related messages from midnight until
current time.
3. The output of the pibackup.bat script is written to a log file. The destination of this
log file is the same as the destination of the backup, and the name of the log file is of
the form pibackup_dd-mmm-yy_hh.mm.ss.txt.
4. The NTBackup log file (VSS Backups only). If there was a problem creating a VSS
shadow copy during a backup, the reason for the failure will be logged at the
beginning of the NTBackup log file.
5. If the “Run As” user for the “PI Server Backup” scheduled task is the same as your
account, then you will be able to view the NTBackup log from the “Tools |
Report…” menu of NTBackup. Launch NTBackup from a DOS command prompt
and choose to run in advanced mode.
An automated backup task can be installed with the PI\adm\pibackup.bat backup script. You
must install the automated task because the installation of the PI Server does not install a
backup task. The syntax for using the pibackup.bat file is as follows.
PIbackup.bat <path> [number of archives]
[archive cutoff date] [-install]
where <> indicates a required parameter and [] indicates an optional parameter. The
command line parameters must be specified in the above order. If the -install flag is not
specified, a backup will be performed immediately. The more restrictive of [number of
Page 38
7.7 - Site-Specific Backup Tasks
archives] and [archive cutoff date] takes precedence. Regardless of [number of archives] and
[archive cutoff date] archives that do not contain data will not be backed up.
<path> E:\PI\backup Path must be the complete drive letter and path to a
directory with sufficient space for the entire backup.
[archive cutoff date] *-10d The cutoff date is specified in PI time format. For
example, "*-10d" restricts the backup to archives
archives that contain data between 10 days prior to
current time and current time. The more restrictive
of [number of archives] and [archive cutoff date]
takes precedence.
If the pisitebackup.bat file exists, then the pibackup.bat backup script calls it before exiting.
If you have any tasks you want pibackup.bat to execute each day after the backup, then add
these tasks to a file called pisitebackup.bat in the PI\adm directory.
Typically, PI System Managers use the pisitebackup.bat file to move the backup directory to
tape. PI System Managers may also use the script to back up specific files that are not
included in the PI Server backup.
Introduction to PI Server
System Management Page 39
Chapter 8. MANAGING INTERFACES
Once you install and configure an interface on a PI Interface Node, you can typically then
leave it to run indefinitely without any intervention. If you perform software upgrades or
security patches or if the network infrastructure changes, you might need to know how to
perform a few basic tasks.
About PI Interfaces
Configuring Interfaces
Starting and Stopping Interfaces
Monitoring Interface Performance
Configuring Interfaces for Buffering
Where to Go for More Information on Interfaces
PI interfaces are the software applications that take the data from your data source and send
them to the PI Server. There are hundreds of PI interfaces and they each have their own
specific documentation. However, because most interfaces are based on the OSIsoft
Universal Interface (UniInt), they share a common set of features.
The three basic variables that define an interface are interface ID, scan class, and point
source.
9 RampSoak Simulator
Introduction to PI Server
System Management Page 41
Chapter 8 - Managing Interfaces
G Alarm
T Totalizer program
@ Alarm
Offset The offset specifies a start time for the 01:00:00, 13:00:00
calculation. The offset is optional. PI Get data every hour, starting at
counts the offset from midnight of the 1PM
current day. As with the period, the first
two digits are the hours, the second two
the minutes, and the third two the
seconds.
Page 42
8.2 - Configuring Interfaces
UTC Time The UTC time specifies that the 01:00:00, 13:00:00, U
scheduling sync with Universal Get data every hour, starting at
Coordinate Time (UTC). The UTC time 1PM, UTC time.
is optional. To use it, add a comma
followed by a capital U to the end of the
scan class.
Note: If a scan class has a frequency of more than an hour, make it a UTC scan
class. Otherwise, your scheduling might be thrown off the next time there's a switch
change to or from daylight savings time. UTC scan classes don't have this problem
because they force the scan class scheduling to sync with UTC, rather than local
time.
If you have access to the Interface Nodes for your PI System, then the Interface
Configuration Utility (ICU) is the best way to manage your PI interfaces. You need to do an
initial configuration in the ICU for each interface. This is called registering the interface with
the ICU:
1. On the ICU menu, select New. The Configure a New Interface dialog appears.
2. Click the Browse… button and browse to the location of the interface executable. By
default, PI installs your interface executables in the Program Files\PIPC\Interfaces
directory.
3. Type in a descriptive name for the interface. The ICU uses this name in its displays,
so choose a name that you can remember.
4. Type in a Point Source.
5. Type in an Interface ID number.
6. Select the Host PI System.
7. Click OK.
Introduction to PI Server
System Management Page 43
Chapter 8 - Managing Interfaces
The first time you start a PI Interface, you need to start it from the Windows Services control
panel. After that, you can start and stop the Interface from the ICU (Configuring Interfaces on
page 43). Start and stop the interface directly on the Interface Node:
1. From the Windows Start menu on the Interface Node, open the Control Panel and
then open Administrative Tools.
2. In the Administrative Tools folder, double-click on Services.
3. In the Services window, find the interface that you want to start or stop. In the
Windows Services panel, PI interface services are listed with the PI- prefix. For
example, the buffering service is listed as PI-Buffer Server.
4. Right-click on the interface service select either Start or Stop from the resulting pop-
up menu.
There are two main ways to check how your interfaces are working:
Checking IORates and Performance Points
Checking Log Files
IORates point Monitors the flow of data from an interface. Every 10 minutes each IOrates
point registers the 10-minute average data transfer rate to PI in
events/second.
Performance Reads the value in seconds that it takes the interface to complete one round
Point of data collection for a set of points. You can create one performance point
for each scan class of each interface.
You can easily create both IORates points and performance points for an interface using the
ICU (Configuring Interfaces on page 43).
Page 44
8.5 - Configuring Interfaces for Buffering
Most interfaces also write a performance summary every 8 hours to pipc.log. For each scan
class, the summary shows the duration of the most recent scan, the percent of scans missed,
and the percent of scans skipped. PI counts a scan as missed if it was started after its
scheduled start time (due to a previous scan taking too long). PI counts a scan as skipped if it
did not have an opportunity to run at all. Note that a previous scan can be from any of the
defined scan classes.
Performance points are an important tool for tuning scan classes, because if a scan takes too
long, it can cause the next scan to be skipped, resulting in data loss. You can tune scan classes
by changing the scan frequency, the scan offset, and the number of tags in the scan list. For
more information on configuring scan classes and scan lists, see the user manual for your
interface.
If you are starting the buffering service on an Interface Node for the first time, you also need
to re-configure the interfaces so that they work correctly with buffering:
1. Configure the interfaces on this node so that they're dependent on the buffering
service.
2. Set the shutdown attribute to off for points on these interfaces.
3. Restart the interfaces, so that they can send their data through the buffering service.
Note: When installing an interface for the first time, it is a good idea to disable
buffering until you are sure the interface is correctly collecting data and storing it in
the archive. Bufserv stands in for the archive when it is not available and may mask
errors your interface would see when running unbuffered.
There are many different sources of information on PI interfaces. You can download all of
the following documents from the Technical Support Web Site
(http://techsupport.osisoft.com).
Each interface has its own documentation. If you're not sure how to configure a
particular interface, check the documentation for that specific interface.
Many interfaces are based on the Universal Interface (UniInt). You can learn a lot by
reading the UniInt End User manual.
The PI Server System Management Guide contains a chapter on managing
interfaces.
The Technical Support Web Site also provides a product page dedicated to PI
interfaces and a PI System Manger Resources page. You can get information on new
releases, as well as information on the Interface Configuration Utility and other tools.
Introduction to PI Server
System Management Page 45
Chapter 9. MANAGING PI SECURITY
PI has two main mechanisms for security: log-in accounts (users and groups) and trusts.
About PI Security
Managing Users and Group
Managing PI Trusts
Managing PI Database Security
The two most commonly used methods of PI Security are user identification security (login
accounts with access permissions) and trusts (trusted computers that are granted access
without having to log in).
User Identification Security: The PI Server has its own user identification and
password security. Users typically access client applications, server connections and
other PI resources by typing in a valid user name and password. For some resources,
such as point data and attributes, you can set access permissions based on user name
and group association. User identification security is explained in Managing Users
and Group on page 47. PI databases rely on user identification security (Managing PI
Database Security).
Trusts: In some situations, you don’t want to require a username and password to
establish a PI connection. A typical example of this is a PI interface application
requesting a connection to a PI Server. PI provides trust security for this type of
situation. Trusts are explained in Managing PI Trusts.
Note: PI also provides a firewall mechanism that is not covered in this guide. The PI
firewall is explained in the PI System Management Guide.
This section explains how to manage user accounts and how to set up groups to manage
access permissions to PI resources. It contains the following sections:
About Users and Groups
Introduction to PI Server
System Management Page 47
Chapter 9 - Managing PI Security
Access Description
Read-only access Users can view the item, but they cannot change it.
Read-write access Users can view the item and they are also allowed to edit it.
Page 48
9.2 - Managing Users and Groups
Category Description
Owner Each resource has one (and only one) owner. The owner is always a single user,
not a group. Owner access is usually read-write, but it doesn't have to be.
Group Each resource has one (and only one) associated group. Group access is often
read-only, but it doesn't have to be. Since each resource has only one
associated group, you sometimes need to create additional groups to give access
to all the users who need it (Setting up Groups to Manage Resource Access on
page 50).
World The World category is where you set the permissions for users that are not the
owner and not in the associated group. By default, world access is none, but it
doesn't have to be.
The piadmin user always has read-write access to all resources regardless of access settings.
By default, the pidemo user has read-only access to all objects. For more information about
these two accounts, see What are the piadmin and pidemo User Accounts on page 49.
Introduction to PI Server
System Management Page 49
Chapter 9 - Managing PI Security
Demonstration account: the pidemo user is the demonstration account. The pidemo
user has permission to look at all the data, but is not allowed to make any changes.
For example, the pidemo user cannot edit a point. You can delete the pidemo account,
if you wish.
The default password is blank for both the piadmin and the pidemo accounts. Since the
piadmin account can do just about anything on the PI Server, you should choose a good
password for the piadmin account and change it periodically. You cannot delete the piadmin
account.
Suppose that all the users in the Developers and Managers groups need read-write access to a
particular resource, such as the attributes for the Sinusoid point. Because a resource can have
only one associated group, you need to create a group that contains all the developers and all
the managers and then associate that resource with the new group.
Page 50
9.2 - Managing Users and Groups
Typically, you create different PI groups for groups in your organization that need different
point access.
Introduction to PI Server
System Management Page 51
Chapter 9 - Managing PI Security
1. Run the System Management Tools (How to Run SMT on page 5).
2. Select the Server on which you want to manage the accounts (How to Select a Server
in SMT on page 6).
3. Click to expand the Security item in the System Management Plug-ins pane.
4. From the list of Security plug-ins, double-click on User and Group Editor. The
User and Group Editor plug-in appears in the Active Plug-in pane.
The Users tab lists all the users who have accounts on the selected server. Similarly,
the Groups tab lists all the groups registered on the selected server.
5. To work with users (to add or delete users or to change a password) select the Users
tab. To work with groups (to add or delete a group, or to add users to or delete users
from a group) select the Groups tab.
6. Different icons appear in the toolbar, depending on whether you select the Users or
Groups tab. Some icons are enabled only when you click on an item in the list.
As System Manager, you need to update the PI trusts anytime any trusted machine changes
host name or IP address. Use SMT's PI Trust Editor to view and manage your PI trusts.
About Trusts
Managing Trusts with SMT
Page 52
9.3 - Managing PI Trusts
In addition, you set up a trust for each Interface Node that connects to the PI Server. For each
Interface Node, configure the following three trusts:
The Interface Node by IP address and netmask
The Interface Node by fully-qualified host name (for example, apollo.osisoft.com)
The Interface Node by the short host name (for example, apollo)
The preceding interface trust configuration is the most general configuration. If you want
tighter security, read the section on PI security in the PI System Management Guide.
Each trust has a name and three basic areas of information: IP information, Windows account
information, and application information. In addition, each trust has an associated PI user.
You do not need to fill in all the areas in the Properties form. The more details you fill in, the
more restrictive the trust becomes. For example, if you create a trust for a particular
Introduction to PI Server
System Management Page 53
Chapter 9 - Managing PI Security
hostname, then any request from that hostname gets access, based on that trust. However, if
in addition to the hostname, you add an application name, then that trust lets through only the
specified application from that hostname.
PI stores its configuration information and process data in databases. You can configure
access to the databases with SMT's Database Security Editor:
About Databases
Managing Databases with SMT
PI Heading Sets Database Stores the heading sets for the Module Database
(PIHeadingSets).
PI Module Database (PIModules) Stores and maintains all the data objects associated
with the Module Database, including PIModules,
PIHeadingSets, and PIHeadings
PI Point Database (PIPOINT) Contains the list of points that are either recorded in
the Data Archive or mapped to points in foreign data
systems
PI Transfer Record Database Stores the transfer records for plant materials
(PITransferRecords)
Page 54
9.4 - Managing PI Database Security
6. Select your access configuration from the pull-down menus and click OK.
Introduction to PI Server
System Management Page 55
Chapter 10. MONITORING PI SYSTEM PERFORMANCE
One important way to monitor your PI System's performance is to record key performance
counters. Performance counters can provide important insights into a number of performance
management problems, including memory, disk, and process management problems.
PI gets performance counter data through the PI Performance Monitor interface, PIPerfmon.
PIPerfmon reads the PI point database to determine which performance counters to monitor.
It then scans for the performance counter and sends exception reports to the PI system.
There are two versions of the PIPerfmon interface, full and basic. The PI Server comes with
the basic version, which is just like the full version, except that it:
Must run on the machine with the PI Server.
Is limited to 512 points.
Allows one instance of the interface.
Will collect data for local performance counters only.
Introduction to PI Server
System Management Page 57
Chapter 10 - Monitoring PI System Performance
To use PIPerfmon to monitor performance, you build a point for each performance counter
you’re interested in (Which Performance Counters to Monitor on page 58) and then create a
ProcessBook display that contains those points (Trending Performance Points on page 59).
You can then open the ProcessBook display and check system performance at a glance.
Note: You can also view the statistics for the PI performance counters in Microsoft’s
Performance Monitor utility (System Monitor in Windows 2000).
The most confusing thing about performance counters for new System Managers is figuring
out which ones to monitor. The following list contains the basic set of performance counters
that OSIsoft recommends you monitor. This list includes some counters that are available
only on PI 3.4 and later. If you are running an earlier version of PI, and don't want to
upgrade, just use the other counters in the list.
PI Archive Subsystem\Cache Flush Rate at which points are flushed from the archive
Operations/sec cache to disk.
PI Archive Subsystem\Time to Archive Shift Number of seconds until the archive is projected
to shift. This time is not calculated if the archive
is less than 20% full.
Page 58
10.3 - Building Performance Monitor Points
Note: This table lists only a very small subset of the PI performance counters. The
PI Server System Management Guide provides a comprehensive list of all available
PI performance counters.
The PI System Management Tools (The PI System Management Tools (SMT) on page 5)
includes a plug-in for building PIPerfmon tags, called the Performance Monitor Tag Builder.
To build a performance monitor point, follow these steps:
1. Run the System Management Tools (How to Run SMT on page 5).
2. Select the Server on which you want to create the performance point (How to Select
a Server in SMT on page 6).
3. In the list of Points plug-ins, double-click on Performance Monitor Tag Builder.
The Performance Monitor Tag Builder appears in the Active Plug-in pane.
4. Under the Tag Settings tab, choose an existing PIPerfmon interface from the pull-
down menu. If no interfaces appears in the list, make sure PIPerfmon is installed and
running on the PI Server (Configuring the PIPerfmon Interface on page 60).
5. Click the Build Tag tab and select the performance monitor points you want to
create from the list of available counters.
6. Click the Create Tags button. The plug-in creates the performance monitor tags for
you.
If you put your PI-Performance Monitor points on a ProcessBook display, you can check
your PI System performance at a glance. You might also include interface performance points
(Monitoring Interface Performance on page 44) and representative points from each of the
batch, alarm, performance equation, and ACE component.
The following illustration shows the ProcessBook display for the Performance Monitoring
Kit from the OSI Developer’s Network (Performance Monitoring Kit (PI 3.4 and Later on
page 60). This is a good example of a ProcessBook display for performance monitoring.
Introduction to PI Server
System Management Page 59
Chapter 10 - Monitoring PI System Performance
If you're running PI 3.4 or later, then you can download and use the PI Server Performance
Monitor Kit. This kit gives you a point configuration spreadsheet that allows you to create
your performance points in a matter of seconds, and it also gives you a great Performance
Monitoring display for ProcessBook. You can get this kit from OSIsoft's Developers Network
(http://devnet.osisoft.com).
Note: The Developer’s Network is a useful source of tools and information for PI
System Managers, but the downloads are not actively supported by OSIsoft. If you
have trouble getting, installing or running the Performance Monitor Kit, you cannot
get help from Technical Support. Also, this kit might not work with future releases of
PI.
The executable for the basic version of the PIPerfmon interface is included in your PI Server
installation. To configure PIPerfmon on your PI Server, follow these steps:
1. Run the ICU (How to Run the ICU on page 6).
2. On the ICU menu, select New. The Configure a New Interface dialog appears.
Page 60
10.6 - Configuring the PIPerfmon Interface
3. Click the Browse… button and browse to the location of the PIPerfmon executable.
By default, PI installs the PIPerfmon executable in the PIPC directory under:
Interfaces\PIPerfmon_basic
4. Type in a descriptive name for the interface, such as Performance Monitor Interface
or PIPerfmon.
5. Type in a Point Source (What's a Point Source? on page 41). The default point
source for PIPerfmon is the pound sign (#).
6. Type in an Interface ID number (What's an Interface ID Number? on page 42).
7. Select the Host PI System. This can be the PI Server itself.
8. Click OK. A dialog appears saying that the interface is ready to be configured.
9. Click OK.
10. If you're using the Performance Monitor Kit from DevNet, add the following scan
classes for the interface (What's a Scan Class? on page 42):
00:00:05
00:01:00
11. Click Apply.
12. Under the Service Tab, type in a user name and password for a Windows account
with Administrative privileges on the PI Server, then click the Create button. This
installs the interface.
Introduction to PI Server
System Management Page 61
Chapter 10 - Monitoring PI System Performance
13. Click the Start the Interface arrow button at the top of the ICU. This starts the
interface.
Page 62
Chapter 11. MANAGING BUFFERING
If you are not currently using the buffering service on your Interface Nodes, refer to
Configuring Interfaces for Buffering on page 45. Once it's running, buffering typically takes
care of itself.
About Buffering
Checking whether the Buffering Service Is Running
Testing the Buffering Service
If the Buffering Service Isn't Working
Starting the Buffering Service
OSIsoft provides a buffering service that can save your data if the Interface Node loses its
connection to the PI Server. When an Interface Node is running the buffering service
(bufserv), data flows from the data source, through the interface to the buffering service and
from there to the Snapshot Subsystem on the PI Server.
If the PI Server is not available (e.g., for an upgrade on the Server) then bufserv stores the
data in a file buffer on the Interface Node. When the PI Server becomes available again,
bufserv sends all the stored data from the buffer, in chronological order, back to the PI
Introduction to PI Server
System Management Page 63
Chapter 11 - Managing Buffering
Server. At this point, if you look at the data in ProcessBook, you see a continuous flow of
data, with no gaps.
As System Manager, you should make sure that the buffering service is running on each
Interface Node. The main exception to this rule is for PINet Nodes, which perform their own
buffering. Also, a few interfaces, such as batch file and event file, work better without the
buffering service. If you're not sure whether a particular interface is compatible with the
buffering service, check the documentation for that interface.
You need only one buffering service running on each Interface Node to buffer all the
interfaces for a particular Server, however you can only buffer data to one Server at a time
from each Interface Node. You can set the maximum size of the file buffer (up to 2GB) in the
ICU (Configuring Interfaces on page 43).
To check whether buffering is running on an Interface Node look for the APIBE process for
that particular Interface Node in the Network Manager Statistics SMT plug-in:
1. Run the System Management Tools (How to Run SMT on page 5).
2. Select the Server that is connected to the Interface Nodes you want to check (How to
Select a Server in SMT on page 6).
3. It's easier to check one PI Server at a time, so while you're in the PI Servers pane,
click to deselect all other PI Servers. Now there should be only one checkmark in the
PI Servers pane.
4. Click to expand the Operation item in the System Management Plug-ins pane.
Page 64
11.3 - Testing the Buffering Service
7. Now look in the Name column for the buffer service, which in this display is called
APIBE. You should see one APIBE connection for every Interface Node that is
running the buffering service.
8. For each APIBE row in the table, look under the PeerName column to find the
hostname for the Interface Node associated with that particular buffering service.
(The IP address is also listed, under the PeerAddress column.)
9. Interface Nodes that do not have an APIBE application associated with them are not
running the buffering service.
10. Start the buffering service on all Interface Nodes where it is not running (Starting
the Buffering Service on page 68).
Note: If you are looking for a particular Interface Node among many, click the
PeerName heading to sort the table by host name.
The only way to actually test whether the buffering service is working is to interrupt the
connection between the PI Server and the Interface Node for a period of time and then, after
restoring the connection, check to see whether you have data:
Introduction to PI Server
System Management Page 65
Chapter 11 - Managing Buffering
Note: Why unplug the PI Server and not the Interface Node? Because many
Interface Nodes get their data from the network. If you unplug such an Interface
Node from the data source, then the interface gets no data and you can’t test data
buffering.
If the buffering service is not working correctly, first check the login information for the
buffering service, then check the pipc.log file.
Page 66
11.4 - If the Buffering Service Isn't Working
5. Click on the General tab and click the Start button under Service status.
6. Click OK.
Note: Make sure the interface that you are buffering is running under this same
Windows account. The buffering program shares memory between bufserv and the
interface. If they are not running under the same account then they can not share
memory and buffering will not work.
Introduction to PI Server
System Management Page 67
Chapter 11 - Managing Buffering
3. In the Log Files dialog box, double-click on the pipc.log entry. The pipc.log file
appears.
4. If you see the error message, “Unable to create shared memory buffers” you're
probably trying to run the buffering service under an account that does not have
administrative privileges. Follow the instructions in Starting the Buffering Service on
page 68.
These instructions assume that you are starting the buffering service on an Interface Node
that is configured for buffering (Managing Buffering on page 63) and that the following items
are installed on the Interface Node:
The interface software for the interface(s) you want to buffer
PI Interface Configuration Utility (ICU)
PI API (this is installed with the interface software)
PI-SDK (this is installed with the ICU)
To start the buffering service on an Interface Node, follow these steps:
1. From the Windows Start menu on the Interface Node, point to Programs, point to
PI System, and then click PI-Interface Configuration Utility. The ICU appears.
2. Select an interface from the Interface pull-down menu. If the interface you want
does not appear in the Interface pull-down menu, then you need to register that
interface with the ICU (Configuring Interfaces on page 43).
Page 68
11.5 - Starting the Buffering Service
3. On the Tools menu, point to API Buffering. The Buffering dialog box appears.
4. Under the Settings tab, make sure the Enable buffering checkbox is checked.
7. Click OK.
8. From the Windows Start menu, open the Control Panel and then open
Administrative Tools.
9. In the Administrative Tools folder, double-click on Services.
Introduction to PI Server
System Management Page 69
Chapter 11 - Managing Buffering
10. In the Services window, right-click on PI-Buffer Server and select Start from the
resulting pop-up menu. The buffering service should start now. If it doesn't, see If the
Buffering Service Isn't Working on page 66.
Page 70
Chapter 12. MANAGING DATA SOURCE EQUIPMENT
Changes to your plant or process equipment sometimes mean you need to make changes to
PI.
About Data Sources
Adding New Equipment
Replacing Equipment
Removing Obsolete Equipment
Your data sources can be almost anything, including Distributed Control Systems (DCSs),
Programmable Logic Controllers (PLCs), lab systems, Supervisory Control and Data
Acquisition systems (SCADA), process models, and other business information systems.
When new equipment comes online, you need to configure PI to recognize it and set up
points to collect the data:
Connect the equipment to an Interface Node and install the appropriate interface
software. You can download interface documentation from the Technical Support
Web Site (http://techsupport.osisoft.com). If this is a new Interface Node, you also
need to install the ICU (How to Install the ICU on page 6) and set up the trusts
(Managing PI Trusts on page 52).
Install the interface according to the instructions in the interface documentation.
Register and configure the interface with the ICU (Configuring Interfaces on page
43).
Start the buffering service, if it isn't already running on this Interface Node (Starting
the Buffering Service on page 68).
Build a new point(s) to get the data from the equipment into PI (Creating New Points
on page 23).
Introduction to PI Server
System Management Page 71
Chapter 12 - Managing Data Source Equipment
When equipment goes offline, you need to decommission any points associated with that
equipment (Decommissioning Points on page 24).
If you do not decommission obsolete points, the PI System continues to try to get values for
them, which is bad for system performance and can sometimes even lead to data loss for
other points.
If you replace an instrument with a different one that measures the same process value, it's
usually best to continue using the same PI point. Edit the point as required so that it will
collect the new data. If the instrument is significantly different, you might need to adjust the
compression and exception attributes, among others. Don't change the Tag attribute.
When you change the point, insert a digital event into the data to indicate when the transition
from the old to the new instrument took place.
Page 72
Chapter 13. WHERE TO GO TO GET MORE HELP
13.1 Training
OSIsoft offers training classes and computer-based training (CBT) CDs on managing PI
Servers. For more information, look at the OSIsoft training website:
http://training.osisoft.com
The OSIsoft Developers Network (DevNet) is a Web site dedicated to helping PI users and
developers create productive PI applications. PI users post a lot of these homegrown
applications on the DevNet site so, even if you're not interested in developing your own PI
applications, you're still likely to find some useful tools and information on DevNet. The
DevNet Web site is here:
http://devnet.osisoft.com
Introduction to PI Server
System Management Page 73
Chapter 14. GLOSSARY
Annotation
Arbitrary information (e.g. text comment, other binary data) that can be associated
with any archive value. Annotations are accessed exclusively with the PI-SDK and
are stored in an archive file’s corresponding annotation file
(<archive_filename>.ANN). The maximum size of an annotation is equal to the page
size in the Event Queue, which is 1 MB by default with a maximum of 8 MB.
API
A C-based Application Programming Interface library of functions that enable
programs to access PI Servers locally or remotely across a network. PI ProcessBook
2.x (and earlier), PI DataLink 2.x (and earlier), a majority of interfaces, and many
custom programs depend on this library.
API Node
A synonym for Interface Node.
Archive
The historical record of time-series data maintained by the PI Server. The term is
often overloaded: sometimes it’s used to refer to the entire logical data record itself;
sometimes it’s used to refer to a specific archive file; and sometimes it’s used to refer
to the subsystem responsible for actively hosting the historical data record.
Archive Event
Any Event that is stored in the Archive.
Archive File
A binary file that contains a section of the data archive covering some finite time
range. These files, defined by start and end times, should be contiguous and non-
overlapping. Two types of archive files may be created: Dynamic and Fixed.
Introduction to PI Server
System Management Page 75
Glossary of Terms
Archive Gap
A non-zero period of time between the end time of one archive file and the start time
of the chronologically next archive file. Archive gaps are not desirable because
archive events with a timestamp during the gap cannot be stored on disk in an archive
file and will be discarded. To avoid archive gaps, archive files should always be
created such that the end time of one archive equals the start time of the
chronologically next archive.
Archive Queue
A less commonly used synonym for Event Queue.
Archive Shift
The process of clearing the oldest writeable and shiftable archive file and making it
the new primary archive. An archive shift typically happens automatically when the
previous primary archive becomes full, but it sometimes must be performed manually
for maintenance and troubleshooting purposes.
Archive Subsystem
The core PI Server component that is responsible for writing data to, reading data
from, and otherwise managing the complete data archive. The Archive Subsystem is
very tightly coupled with the Snapshot Subsystem, which is actually responsible for
performing compression on the incoming data.
Argument, Command-Line
User input specified after the name of a program to control or modify the behavior of
that program in some fashion. A command line argument must typically be separated
from the program name and other command line arguments by at least one space.
Depending on the program, command line arguments must typically be prefixed by a
hyphen (‘-’) or a slash (‘/’). Several of the diagnostic utility programs that are
distributed with the PI Server like piartool and pidiag will require the use of one or
more command line arguments.
Attribute, Point
A characteristic or parameter of a point that directs an interface and the PI Server in
the collection and processing of data values for that point.
Page 76
Glossary of Terms
Attribute Set
A named collection of attributes. One or more attribute sets are used to define point
classes to establish the complete list of attributes that can specified when creating or
modifying a point of that class.
Base Subsystem
The core PI Server component that is responsible for hosting several configuration
stores such as the Point database, the User and Group database, and the Trust table.
The Base Subsystem also hosts the hierarchical Module Database.
Batch
A batch represents a span of time on a unit.
Batch Alias
An additional name, usually the common name, for a unit attribute. A batch alias
allows batch users and applications to reference the more natural common name of a
unit attribute instead of its more obscure instrument name, which may only be readily
understood by the instrument or process engineer.
Introduction to PI Server
System Management Page 77
Glossary of Terms
the SDK. The batch information store maintained by the Batch Subsystem is
independent of the newer Batch Database.
BatchView
A Windows client application that allows the viewing of batch data from the Batch
Database and the Batch Subsystem. BatchView consists of three different
components: an SDK-based ProcessBook Add-In, an API-based Excel Add-in, and a
stand-alone SDK-based application for quick batch searching.
Buffering Service
An API process that typically runs on an Interface Node for the purpose of storing
interface data during periods when network communication to the PI Server is
unavailable. When network communication is restored, the buffering service relays
the stored data to the PI Server. Because the buffering service works to help prevent
data loss but is disabled by default, enabling and configuring buffering is a critical
task for an administrator.
Bufserv
The executable or process name that performs the Buffering Service.
Calculated Point
A synonym for PE Point.
Calculated Tag
A synonym for PE Point.
Page 78
Glossary of Terms
Clock Scheduling
A method of triggering program execution to occur based on a fixed time or clock
schedule such as that defined by a scan class. Clock scheduling is one method
available for triggering PE or ACE calculations. Another method is Event
Scheduling.
COM Connector
A COM object designed to allow the PI Server to access data from foreign data
sources and make it available to any PI client application in a seamless fashion. Some
currently available COM Connectors include those for data historians from
AspenTech and Honeywell as well as one for any data source with an OLEDB
provider. In order to function, all COM Connectors require the services provided by
the Redirector. COM Connectors are only available on Windows platforms.
CompDev
The base attribute that specifies the compression deviation in engineering units. This
represents the maximum error when historical data values need to be interpolated
and, at the very least, should typically be set to the error of the underlying instrument.
CompDevPercent
The base attribute that specifies compression deviation as a percentage of Span,
another base attribute. The relationship is defined by the following equation:
CompDev = (CompDevPercent / 100) * Span. If both CompDev and
CompDevPercent are specified when creating or editing a point, CompDevPercent
takes precedence.
CompMax
The base attribute that specifies the compression maximum time, in seconds.
CompMax is the maximum time difference from the previous archive event before
the next event will be sent to the archive. Because the PI Server itself never generates
events, a lower bound on the archiving rate for the associated point cannot be
determined from CompMax alone.
CompMin
The base attribute that specifies the compression minimum time, in seconds.
CompMin is the minimum time difference from the previous archive event before the
Introduction to PI Server
System Management Page 79
Glossary of Terms
next event is eligible to be archived. Because the PI Server itself never generates
events, the archiving rate for the associated point will be at most one event every
CompMin seconds.
Compressing
The base point attribute that controls whether or not compression is performed for a
particular point. If Compressing is disabled (set to 0), then all events will bypass
compression.
Compression
The process of selecting which Snapshot events will be sent to the Archive for
storage. Applying compression is one of the main responsibilities of the Snapshot
Subsystem, and the specific algorithm used is known as Swinging Door
Compression.
Compression Specification
The three base attributes that control the compression process for a particular point:
CompDev, CompMax, CompMin. Although they are technically not included in the
specification, CompDevPercent and Span affect CompDev, and Compressing
determines whether the specification is needed at all.
Connection Credentials
The set of identifying information about a client application seeking connection to
the PI Server. This information can include the client computer’s IP address or
hostname, the client application’s name, or the Windows Domain name and
Windows user name under which the client application is running. API applications
are restricted in the credentials that they can specify. The PI Server uses connection
credentials to determine if there is a matching Trust.
D Point Type
Interface manuals sometimes refer to the D point type. This is synonymous with
Digital Point Type.
Data Archive
The fundamental and most important information store of the PI Server that contains
the historical data record of all events for all points. The Data Archive is commonly
referred to as simply the Archive.
Page 80
Glossary of Terms
Data Type
The kind of value that will be used. Both points and point attributes have a data type.
Some of the possible types include several kinds of numbers, digital, string, and
Blob.
Descriptor
The base point attribute that can be used to provide a textual description of a point.
The Descriptor is a common attribute to display in various client applications and
user reports.
Deviation Blanket
In compression, the conceptual parallelogram with a width that extends from the
previous archive event to the current event and a height equal to twice the
compression deviation.
DigitalSet
The base attribute required for all digital points to indicate the appropriate digital set
containing the list of possible digital state values for the point.
Introduction to PI Server
System Management Page 81
Glossary of Terms
Dynamic Archive
A type of archive file that does not pre-allocate its disk space at creation time but
instead grows as needed. A dynamic archive can be configured to grow up to a
maximum size and support a maximum number of points, but a non-empty dynamic
archive cannot participate in archive shifts. Another archive type is a Fixed Archive.
Event
The fundamental unit of information used in the PI Server. Each event consists of
two main components: a value and a timestamp. The value can be one of several
different data types (e.g. string, digital, int32, float64). The timestamp is always
represented as UTC seconds and can contain a sub-second component.
Event Queue
A buffer consisting of one or more memory-mapped files that stores events that have
passed or bypassed compression and are destined for archive storage. The Snapshot
Subsystem writes events into the Event Queue, and the Archive Subsystem reads
events out of the Event Queue. While events are still in the Event Queue, they are not
visible by any client applications. Under normal operating conditions, the Event
Queue should typically be empty.
Event Scheduling
A method of triggering program execution when some specific condition occurs such
as the arrival of a new Snapshot event for a particular point. Event scheduling is one
method available for triggering PE or ACE calculations. Another method is Clock
Scheduling.
ExcDev
The base attribute that specifies exception deviation in engineering units. ExcDev
specifies the deadband or how much a new value must differ from the previous value
sent to the Snapshot Subsystem on the PI Server in order to determine whether the
new value is significant and should also be sent.
ExcDevPercent
The base attribute that specifies exception deviation as a percentage of Span, another
base attribute. The relationship is defined by the following equation: ExcDev =
(ExcDevPercent / 100) * Span. If both ExcDev and ExcDevPercent are specified
when creating or editing a point, ExcDevPercent takes precedence.
Exception Reporting
The process, normally executed by an interface program or external system, of
sending events to the Snapshot Subsystem on the PI Server only when there has been
Page 82
Glossary of Terms
Exception Specification
The three base attributes that control the exception reporting process for a particular
point: ExcDev, ExcMax, and ExcMin. Although they are technically not included in
the specification, ExcDevPercent and Span affect ExcDev.
ExcMax
The base attribute that specifies exception maximum time, in seconds. ExcMax is the
maximum time difference from the last sent event before the next event will be sent.
ExcMax thus effectively limits the length of time that events can be discarded
because their values did not exceed exception deviation.
ExcMin
The base attribute that specifies exception minimum time, in seconds. ExcMin is the
minimum time difference from the last sent event before the next event is eligible to
be sent. Thus, the send rate of events for the associated point can be at most one
event every ExcMin seconds.
Firewall
A table hosted by Network Manager that provides the first level of security access to
a PI Server. Access can either be allowed or disallowed based on the IP address or
hostname of a client computer.
Fixed Archive
A type of archive file that allocates all of its disk space at creation time. Thus, both
an empty and full archive occupy the same amount of disk space. Unless shifting has
explicitly been disabled, non-empty fixed archives will participate in archive shifts.
Another archive type is a Dynamic Archive.
Introduction to PI Server
System Management Page 83
Glossary of Terms
Home Node
A computer running the PI Server software or the network location (IP address or
hostname) of such a computer.
I Point Type
Interface manuals sometimes refer to the I point type. This is synonymous with either
Int16 Point Type or Int32 Point Type.
Initializing Archive
The process of writing all the primary records, one for each existing point, to an
archive file and cleaning and preparing overflow records in order to receive data.
Interface Node
A computer running one or more PI interfaces or the network location (IP address or
hostname) of such a computer.
Interface
A software program that collects data from some type of data source and sends the
data to a PI Server. Some interfaces also have the ability to read data from a PI
Server and write back to the data source.
Page 84
Glossary of Terms
Ipisql Utility
An interactive command line program that executes SQL statements directed at the
PI Server. The utility depends on the API to communicate to the PI Server.
Mapped Point
A synonym for COM Connector Point.
Message Subsystem
The PI Server component that records informational and error messages from various
PI Server subsystems in a series of log files. The Message Subsystem can also serve
these messages to various client applications.
Network Manager
The core PI Server component that handles all communication between the PI Server
subsystems. Network Manager also manages all connections from client applications
and their communication with the PI Server.
Node
A computer on a network or the network location (IP address or hostname) of such a
computer.
ODBC
The driver software that exposes a PI Server as an ODBC-compliant data source and
thus provides the PI Server with the ability to communicate with any ODBC-
compliant client application that needs to access the process data stored on the PI
Server.
Introduction to PI Server
System Management Page 85
Glossary of Terms
Offset
An optional field used when defining a scan class that specifies the first time at which
a scan should occur. If no offset is specified, the first scan occurs immediately after
the specified interval. After the initial scan, subsequent scans continue to occur after
every specified interval.
Owner
The individual user that has permission to view and edit a resource on the PI Server.
Each resource can have only one owner. Two examples of resources include a point’s
data (attribute name: DataOwner) and a point’s configuration (attribute name:
PtOwner).
PE Point
A PI point whose value is calculated by the Performance Equation (PE) Scheduler
based on the point’s configured performance equation specified in the ExDesc base
attribute.
Perfmon (PIPerfmon)
The Windows-only Performance Monitor interface which reads Windows
Performance Counters and stores the values in PI points. The basic version of the
interface can only monitor a limited number of Windows Performance Counters from
the local computer.
Page 86
Glossary of Terms
Performance Point
An overloaded term that can mean either a point associated with the Perfmon
interface or a special point used to monitor interface performance on a per-scan class
basis. In the case of monitoring interface performance, the point tracks how long (in
seconds) the interface took to collect data for all tags in that scan class for each scan.
PI2
Nickname for the original generation of the PI Server software that (still) runs on
VAX and Alpha computers with the OpenVMS operating system.
PI3
Nickname for the current generation of the PI Server software that runs on computers
with the Windows or UNIX operating systems.
PI Server
The set of several software subsystems packaged together that constitute a single
logical server application capable of storing time-series data from distributed data
sources and serving this same data to client applications in real-time.
PI System
The complete collection of OSIsoft software applications running on one or more
computers that function to collect, store, retrieve, analyze, view, or manage process
data. Examples of these software applications include interfaces, the PI Server, and
client applications.
Piarchss
The executable or process name that implements both the Archive Subsystem and the
Offline Archive Utility.
Piarcreate
A command line utility program for creating both fixed and dynamic archive files.
After creation, the archive files must be registered with the Archive Subsystem in
order to be made available for use.
Introduction to PI Server
System Management Page 87
Glossary of Terms
Piartool
A command line utility program that provides a number of diagnostic and
management functions. The PI Server must be started for nearly all of the commands
to function properly.
Pibasess
The executable or process name that implements the Base Subsystem.
Pibatch
The executable or process name that implements the Batch Subsystem.
Piconfig
An interactive command line utility program that provides access to nearly all the
configuration and data stores maintained by the PI Server. Several client applications
have come along to provide a graphical interface to these various tables and
databases, but certain tasks can still only be performed with this command line
utility. To achieve some degree of automation, a series of piconfig commands can be
saved to a text file which can then be passed as input to piconfig.
Pigetmsg
A command line utility program that allows the viewing of PI Server messages stored
by the Message Subsystem. Messages can be retrieved based on characteristics like
timestamp, a search string, or the program name that generated the message.
Pilistupd
A command line utility program that displays information about the registered
consumers and producers maintained by Update Manager. Consumer info includes
the number of outstanding events in its buffer.
Pinetmgr
The executable or process name that implements Network Manager.
PINet on OpenVMS
Software running on a remote VMS computer that collects data from interfaces and
sends it to a PI Server for data archiving.
Ping
An interface that monitors the network availability of computers by directing an
ICMP ping request agai them and then storing the response times in PI points. A
basic version of the interface is included with the PI Server.
Page 88
Glossary of Terms
PIonPINet/VMS
Software running on a remote VMS computer that includes all the PINet on
OpenVMS functionality as well as additional utility programs for analysis, reporting,
and graphical displays of process data.
Pipeschd.bat
The script file containing the startup configuration for the Performance Equation
Scheduler.
PIPOINT Table
A synonym for Point Database. In piconfig, the table that provides access to the Point
Database.
Pishutev
The executable or process name that implements the Shutdown Subsystem.
Pisnapss
The executable or process name that implements the Snapshot Subsystem.
Pisqlss
The executable or process name that implements the SQL Subsystem.
Piupdmgr
The executable or process name that implements Update Manager.
Point
A variable whose value is measurable and typically dynamic. Examples include
transmitter readings, status indicators, manual inputs, control limits, etc. Each point
must be assigned a unique tag on the PI Server, and measurements of the point
captured over time are effectively stored as an array of timestamped values in the
data archive.
Point Class
A collection of one or more attribute sets. Examples of point classes include Base,
Classic, Alarm, and Totalizer. All point classes include all the attributes from the
Base class, which has a core set of attributes needed by various processes in the PI
System. Other point classes add attributes needed to provide functionality for certain
processes. The base attribute PtClassName specifies the point class for every point.
Introduction to PI Server
System Management Page 89
Glossary of Terms
Point Configuration
The complete list of attributes characterizing a point.
Point Database
The information store that contains the list of all points and their complete point
configuration. The list includes both typical points that have their data stored in the
archive and COM connector points that have their data stored on foreign data
sources. The point database is hosted by the Base Subsystem.
Point Security
Access control for a point which consists of specifying an owner and a group and the
respective read / write permissions. Each point has one security specification for
controlling access to its attribute configuration and a second separate security
specification for controlling access to its archive data. The base attribute PtAccess
holds the security specification for configuration, and the base attribute DataAccess
holds the security specification for archive data.
PointType
The base attribute that specifies the data type for the values that a point stores. The
possible point types include the following: int16, int32, float16, float32, float64,
digital, string, Blob, and timestamp. PointType can be edited after point creation, but
not all type transitions are allowed.
PointSource
The base attribute that identifies the interface or other scanning software responsible
for providing data for the associated point.
Posting
Sending events packaged into messages that contain either 128 or 256 events
(depending on the server platform), from the Snapshot Subsystem to the Archive
Subsystem. Posting is typically no longer performed with the introduction of the
memory-mapped Event Queue in later versions of the PI Server.
Page 90
Glossary of Terms
Postprocessing
Processing by the Totalizer on the values stored in the Snapshot table that enables
accurate counting and summary calculations. The results of these operations are then
stored in other points.
Primary Archive
The archive file with an end time of current time. All events recorded with a
timestamp after the start time of the primary archive are stored in this archive file.
Thus, the primary archive typically contains the most recent data for all points. At
most one primary archive may be registered at any given time.
Product
In batch processing, the description of a specific material or class of materials. This
term is used in batch applications that use equipment to produce a variety of different
materials.
R Point Type
Interface manuals sometimes refer to the R point type. This is synonymous with the
Float16 Point Type or Float32 Point Type or Float64 Point Type.
Ramp Soak
A standard interface program included with the PI Server that generates signals that
might have come from a batch process. This interface is useful for testing and
validating a PI Server without affecting actual process data.
Random Simulator
A standard interface program included with the PI Server that is capable of
generating a sinusoidal wave and several kinds of pseudo-random data. This interface
is useful for testing and validating a PI Server without affecting actual process data.
Real-time SQC
The component of the PI Server that provides continual evaluation of Statistical
Quality Control pattern tests and the management of alarms generated from these
tests. Use of this component will assist in monitoring how well a process stays within
its control limits.
Recalculator
The component of the PI Server that adjusts the values of PE points automatically
whenever the values of points used in their expressions are added, edited, or deleted
by any application.
Introduction to PI Server
System Management Page 91
Glossary of Terms
Redirector
The component of the PI Server that functions as the intermediary between server
subsystems and all COM connectors. The redirector is an out-of-process COM server
that is only available on Windows platforms.
Registering an archive
Informing the Archive Subsystem of the name and location of an archive file that is
available for use. Registering an archive can be performed with several different
programs including piartool and SMT.
Satellite node
Any remote computer on a network running PI software other than the PI Server
software. Examples of the software the computer might be running include interfaces,
PINet, or PIonPINet.
Scan
The base attribute that specifies whether or not the interface or scanning program
should collect new data for the associated point. If Scan is disabled (set to 0), then
new data will not be collected.
Scan Class
A specification that provides an interface with the schedule for performing data
collection for its associated points. The scan class specification consists of a period
and an optional offset. The period determines the recurring interval when data
collection should occur, and the offset determines when data collection should first
start. A scan class can also optionally contain a code to force the interface to use
UTC time for scheduling. A point can only be in one scan class, and assignment to a
scan class is typically configured through the classic attribute Location4.
SDK
A COM-based Software Development Kit that provides rich access to objects and
data stored on the PI Server. The SDK is used for other PI applications like
ProcessBook 3.x and DataLink 3.x and also for custom user applications. The SDK is
only available for Windows platforms, but it can access a PI Server running on any
supporting operating system. The distribution kit for the SDK also includes the API.
Shutdown Event
An Event whose value consists of the Shutdown digital state from the SYSTEM
digital set and whose timestamp is intended to mark when the PI Server or an
interface or some other application or device is not available.
Page 92
Glossary of Terms
Shutdown Subsystem
The component of the PI Server that writes a shutdown event for all points that match
a particular tag mask and attribute selection. By default, any tag with its base
attribute Shutdown set to 1 will receive a shutdown event. After the Shutdown
Subsystem writes all the shutdown events for the appropriate points, it will stop
running.
Snapshot Event
An overloaded term that can refer to either any Event sent to the Snapshot Subsystem
or the event currently residing in the Snapshot table for a particular point. The event
stored in the Snapshot table for each point has the most recent timestamp of all events
received so far for that point; when a new event arrives with a more recent
timestamp, the previous event is passed through the compression filter.
Snapshot Subsystem
The core component of the PI Server that receives all the new data events for all
points regardless of the sending application. The most recent of these events for each
point is maintained in the Snapshot table along with additional information necessary
to perform compression. Besides performing compression and writing events to the
Event Queue, the Snapshot Subsystem responds to client requests for Snapshot
events and forwards Snapshot events for requested points to Update Manager.
SNMP Interface
An interface included that collects performance data from any device that supports
the Simple Network Management Protocol and then stores the values in PI points.
Examples of devices include computers, printers, and routers. A basic version of the
interface is included with the PI Server for Windows.
Span
The base point attribute that specifies the range or the difference between the
maximum and minimum values for a point. Span is required for all numeric points
and is linked to compression and exception specifications through CompDevPercent
and ExcDevPercent, respectively. Span is only enforced for values for float16 points.
SQC
The SDK-based Add-In to ProcessBook that enables users to create and view a
variety of Statistical Quality Control charts on their ProcessBook displays. SQC chart
limits can be PI points, manually entered constants, or values from ODBC datasets
defined within ProcessBook.
Introduction to PI Server
System Management Page 93
Glossary of Terms
SQL Subsystem
The component of the PI Server that prepares and executes Structured Query
Language statements directed against it from mainly ODBC and SDK applications.
The existence of the SQL Subsystem allows clients to access PI Server information
stores like the Data Archive and Point Database using the same SQL syntax used to
interact with relational databases.
State Set
A synonym for Digital State Set or DigitalSet.
Statement Handle
An object allocated by the SQL Subsystem to enable servicing of a SQL request or
statement.
Status
The classification of an Event depending on the nature of its value. If the event has a
valid value considering the type of point, then the event is considered to have a Good
status. If the event has a SYSTEM digital state as a value, then the event is
considered to have a Bad status.
Steam Functions
A set of built-in functions available within a Performance Equation that calculate the
thermodynamic properties of steam.
Step
The base attribute that specifies how to interpolate between successive archive
events. If Step is non-zero, the value is assumed to change in a stepwise or staircase
fashion.
Subnet
A networking term that refers to a range of numerical IP addresses.
Page 94
Glossary of Terms
Subsystem
A functionally distinct software component or module that executes in its own
process space. The PI Server has several core subsystems such as Network Manager,
Update Manager, Base, Snapshot, and Archive.
Tag
The base attribute that is the unique alphanumeric name for a point. Certain
characters are not allowed like ‘*’, ‘?’, ‘\’, and ‘;’. The term Tag and Point are often
used interchangeably.
Tag Configurator
An SDK-based Add-In to Excel that facilitates creating, editing, and viewing points
from a spreadsheet. This is the ideal application for bulk point operations.
Timeout Table
The information store that contains all the configuration parameters for the PI Server.
When tuning the performance of the PI Server, several of these Timeout Table
parameters will typically need to be adjusted.
Timestamp
A date and time, almost always associated with a data value through an Event. The PI
Server stores timestamps internally in UTC (Universal Coordinated Time).
Introduction to PI Server
System Management Page 95
Glossary of Terms
Totalizer Subsystem
The component of the PI Server that can be used to continuously calculate a variety
of quantities like totals, averages, minimum and maximum values, and standard
deviations.
Trust
A record stored on the PI Server that automatically grants access for a program
connecting to the PI Server without requiring an explicit PI user login. A trust
consists of one or more Connection Credentials criteria and the name of an existing
PI user to be used for access. All trusts are stored in the Trust Table which is hosted
by the Base Subsystem. Trust lookup is always performed when an application first
connects to the PI Server.
Unit
In batch processing, the name of the equipment set on which batch activity takes
place. The definition of a unit is not limited to a single piece of equipment. For
example, a unit could be a single reactor or a group of reactors and related
equipment.
Update Manager
The core component of the PI Server that buffers data events and notifications of
configuration changes for programs that have requested this service. For example,
ProcessBook will request updates of Snapshot events for a point on a trend so that the
trace will remain current; all such events will pass through Update Manager.
Zero Attribute
The base point attribute that indicates the lowest possible value for a point. Zero is
only enforced for values for float16 points.
Page 96
TECHNICAL SUPPORT AND RESOURCES
Email Support
Email support is available 24 hours a day, 7 days a week. Send technical support
inquiries, including the problem description and message logs, to:
[email protected]. Technical Support will respond to your inquiry within 24
hours.
Knowledge Center
The Knowledge Center provides a searchable library of documentation and technical
data, as well as a special collection of resources for system managers. For these options,
click Knowledge Center in the Technical Support Web site.
Introduction to PI Server
System Management Page 97
Technical Support and Resources
• The Search feature allows you to search Support Solutions, Bulletins, Support
Pages, Known Issues, Enhancements, and Documentation (including User
Manuals, Release Notes, and White Papers).
• System Manager Resources include tools and instructions that help you
manage: Archive sizing, Backup scripts, Daily Health Check, Daylight Saving
Time configuration, PI Server security, PI System sizing and configuration, PI
Trusts for Interface Nodes, and more.
Page 98
INDEX OF TOPICS
Introduction to PI Server
System Management Page 99
Index of Topics
Page 100
Fixed archives, 25 PIPerfmon, 60
Fixing archive gaps, 31 Point source, 41
Float16 point type. See Registering, 43
Float32 point type, 19 Starting and stopping, 44
Float64 point type, 19 IORates points, 44
Frequency Load Sharing
Data collection, 20 Interface Nodes, 10
Gaps, Archives, 31 Location1 attribute, 42
Generating archives automatically, Location4 Attribute, 20
32 log directory, 12
Group access, 49 Log files
Groups Interfaces, 44
Managing, 47 Log Files
Setting up, 50 pigetmsg, 44
Heading Sets Database, 54 pipc.log, 44
Health Check, 3 Message logs
ICU, 6 pipc.log, 68
About, 6 Module Database, 54
Configuring interfaces with, 43 Module Database Builder, 7
Starting Buffering, 68 Monitoring Backups, 36
ID number, Interface, 42 Moving archives, 30
Information Naming points
On interfaces, 45 Tag attribute, 18
Instruments. See Data Sources No access, 48
Int16 point type, 19 Nodes
Int32 point type, 19 Interface, 10
Interface Configuration Utility. See Obsolete points, 24
ICU
Offset, 42
Interface ID number, 42
OSIsoft Universal Interface, 41
Interface Nodes
out of order event, 14
About, 10, 41
Owner access, 49
Buffering, 63
Performance
Data flow, 10
Interfaces, 44
Multiple interfaces, 10
Performance counters
Interfaces
Which to use, 58
Configuring, 43
Performance points
Configuring for Buffering, 45
About, 57
downloading documentation
Creating, 59
for, vi
Interfaces, 44
Getting more information, 45
PI 3.4 and later, 60
Log files, 44
PIPerfmon interface, 60
Monitoring performance, 44
Introduction to PI Server
System Management Page 101
Index of Topics
Trending, 59 pisnapss_OutOfOrderSnapshots/sec
Period, 42 , 58
Permissions pisnapss_Queued Events/sec, 58
Access, 48 pisnapss_Snapshots/sec, 58
Owner, group, world, 48 PITransferRecords, 54
PI PIUSER, 54
Overview, 9 Point Access
PI APS, 17 Privileges, 22
PI Backups. See Backups Point classes, 18
PI databases. See Databases Point Database, 54
PI Points. See Points Point Security
PI Security. See Security Configuration, 22
PI Server. See Server Point Source
PI trusts. See Trusts PIPerfmon, 61
piadmin account, 49 Point sources, 41
piarchss_Archived Events/sec, 58 Point types. See
piarchss_Cache Record Count, 58 Points
piarchss_Events Read/sec, 58 About. See Points
piarchss_Primary Archive % Used, Attributes, 17
58 Creating, 23
piarchss_Time to Archive Shift, 58 Decommissioning, 24
piarchss_Total Unflushed Events, Deleting, 24
58 Finding Malfunctioning, 23
pibasess_Module Count, 58 points vs. tags, 18
pibasess_Point Count, 58 PointSource attribute, 19
PIBatch, 54 PointType attribute, 18, 19
pidemo account, 50 Primary archive, 25
PIDS, 54 Privileges
pigetmsg, 44 Points, 22
PIHeadingSets, 54 PtClass attribute, 18
PIModules, 54 Queue, Event, 15
pipc.log, 44, 68 Read only access, 48
PIPerfmon interface, 60 Read/Write access, 48
Point source, 61 Registering archives, 28
PIPOINT, 54 Registering interfaces, 43
pisnapss_Events in Overflow Removing equipment, 72
Queues, 58
Retiring points, 24
pisnapss_Events in Primary Queue,
Run command, 7
59
Scan class
pisnapss_GetSnapshots/sec, 58
PIPerfmon interface, 61
pisnapss_Number of Overflow
Queues, 59 Scan Class
Location4 attribute, 20
Page 102
Scan classes Technical support Web site, 73
About, 42 Testing Buffering, 66
Security Time
About, 47 UTC, 43
Owner, group, world, 48 Timestamp point type, 19
Point configuration, 22 Tools for System Managers, 5
Server Totalizer point class, 19
About, 11 Training
Compression, 14 Where to find, 73
Compression testing, 14 Transfer Record Database, 54
Data flow, 13 Troubleshooting
File system. See Buffering, 66
Snapshot, 14 Trusts
Setting up groups, 50 About, 47
Shutdown attribute, 22 About, 52
SMT Type attribute, 18, 19
about, vi Typical Value attribute, 22
About, 5 UniInt, 41
Archive Manager, 27, 29 downloading documentation
Database Security Editor, 55 for, vi
Installing, 5 UNIINT
Running, 5 Documentation, 45
User and Group Editor, 51 Universal Interface
Snapshot, 14 Documentation, 45
Span attribute, 22 downloading documentation
for, vi
SQC Alarm Manager, 7
Unregistering archives, 29
SQC_Alarm point class, 19
User and Group Editor, 51
Stale points
User Database, 54
Finding, 23
User Identification Security, 47
Starting buffering, 68
Users
Starting interfaces, 44
Managing, 47
Stopping interfaces, 44
UTC Time, 43
String point type, 19
Web site
Support Web site, 73
Developers Network, 73
System Management Tools, vi, See
SMT support, 73
Tag attribute, 18 Windows command prompt
window, 7
TagConfigurator, 7
World access, 49
Tags. See Points
Zero attribute, 22
tags vs. points, 18
Technical Support, 97
Introduction to PI Server
System Management Page 103
PI Server System Management Guide
PI3 Server
Version 3.4.370
Worldwide Offices
OSIsoft, Inc. is the owner of the following trademarks and registered trademarks: PI System, PI ProcessBook,
Sequencia, Sigmafine, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known to be
trademarks or service marks have been appropriately capitalized. Any trademark that appears in this book that
is not owned by OSIsoft, Inc. is the property of its owner and use herein in no way indicates an endorsement,
recommendation, or warranty of such party's products or any affiliation with such party of any kind.
Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)
of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
Copyright Notice
Unpublished -- rights reserved under the copyright laws of the United States
PREFACE – USING THIS GUIDE
The PI Server System Management Guide is an in-depth manual that provides the
information and instructions that system administrators need to operate the PI System.
This guide includes comprehensive instructions to assist you in:
Using PI Server command-line tools such as PIConfig, PIDiag, and PIArtool
Configuration and tuning of your PI Server for optimum performance
Monitoring system health, and ensuring data preservation and integrity
Managing the Snapshot, Event Queue and Data Archive
Troubleshooting and repair
To effectively manage a PI System, follow the recommendations and procedures for each of
the following topics:
Starting and Stopping PI Systems
Backing Up PI Servers
Managing Archives
Managing Interfaces
Managing Security
Monitoring PI System Health
Moving, Copying or Merging PI Servers
For troubleshooting and performance issues, this guide includes Appendices of error
messages provided in the System Message Log, and an extensive list of performance
measurements (statistics) you can use to optimize the System.
The PI Server Documentation Set includes seven user guides, described below.
Tip: Updated user guides, which provide the most up-to-date information, may be
available for download from the OSIsoft Technical Support Web site
(http://techsupport.osisoft.com).
Introduction to PI A guide to the PI Server for new users and administrators. It explains PI
System Management system components, architecture, data flow, utilities and tools. It provides
instruction for managing points, archives, backups, interfaces, security and
trusts, and performance. It includes a glossary and resource guide.
PI Server Installation A guide for installing, upgrading and removing PI Servers on Windows and
and Upgrade Guide UNIX platforms, including cluster and silent installations.
PI Server System An in-depth administration guide for the PI Server, including starting and
Management Guide stopping systems, managing the Snapshot, Event Queue and Data Archive,
monitoring system health, managing backups, interfaces, security, and
moving and merging servers. Includes comprehensive instructions for using
command-line tools: PIConfig, PIDiag, and PIArtool, and in-depth
troubleshooting and repair information.
PI Server Reference A comprehensive reference guide for the system administrator and
Guide advanced management tasks, including: databases; data flow; PI Point
classes and attributes, class edit and type edit; exception reporting;
compression testing; security; SQL subsystem; PI time format; and
overviews of the PI API, and PI-SDK System Management Tool (SMT).
Auditing the PI An administration guide that explains the Audit Database, which provides a
Server secure audit trail of changes to PI System configuration, security settings,
and Archive Data. It includes administration procedures to enable auditing, to
set subsystem auditing mode, to create and archive database files, and to
export audit records.
PINet and PIonPINet A systems administration guide, including installation, upgrade and
User Guide operations, for PINet for OpenVMS and PIonPINet, which support migration
and interoperability between PI2 and PI3 Systems.
Page iv
Preface - Using this Guide
Monospace Consolas monospace is used for: To list current Snapshot information every 5 seconds,
type: Code examples use the piartool -ss command. For example:
"Consolas" Commands to be typed on the
font command line (optionally with
arguments or switches)
System input or output such as
excerpts from log files and other
data displayed in ASCII text
Bold consolas is used in the
context of a paragraph
Light Blue - Links to URL / Web sites, and email http://www.osisoft.com/procedures.aspx
Underlined addresses [email protected]
Related Documentation
OSIsoft provides a full range of documentation to help you understand and use the PI Server,
PI Server Interfaces, and PI Client Tools. Each Interface has its own manual, and each Client
application has its own online help and/or user guide.
The UniInt End User Manual describes the OSIsoft Universal Interface (UniInt), which is
recommended reading for PI Server system managers. Many PI Interfaces are based upon
UniInt, and this guide provides a deeper understanding of principals of Interface design.
The PI Server provides two sets of powerful tools that allow system administrators and users
to perform system administration tasks and data queries.
The PI Server includes many command-line tools, such as pidiag and piartool. The
PI Server Documentation Set provides extensive instruction for performing PI Server
administrative tasks using command-line tools.
The PI System Management Tools (SMT) is an easy-to-use application that hosts a
variety of different plug-ins that provide all the basic tools you need to manage a PI
System. You access this set of tools through a single host application. This host
application is sometimes referred to as the SMT Host, but it is more commonly called
System Management Tools or SMT.
You can download the latest version of SMT from the Technical Support Web site:
http://techsupport.osisoft.com
In addition to extensive online help that explains how to use all of the features in the SMT,
the SMT includes the Introduction to PI System Management User Guide.
Page vi
QUICK TABLE OF CONTENTS
Chapter 12. Finding and Fixing Problems: the pidiag Utility ..................................................263
Table of Tables................................................................................................................................xix
Page x
Table of Contents
Page xii
Table of Contents
Page xiv
Table of Contents
Chapter 12. Finding and Fixing Problems: the pidiag Utility ..................................................263
12.1 General Information ......................................................................................................265
Page xvi
Table of Contents
Index of Topics...............................................................................................................................347
Page xx
TABLE OF FIGURES
The PI Server includes several separate processes that participate in startup and shutdown.
These are referred to as PI processes or PI subsystems. This section describes the relationship
between the processes, and the startup and shutdown scripts used to control them.
PI should only be started or stopped by the PI System manager. It is important to remember
that stopping PI affects all client applications, performance equation calculations, and the
archiving of data.
PI Server startup is performed with a pair of scripts: a generic PI startup script starts all PI
processes, which then calls a site-specific script to start interfaces and other site specific
programs. The system manager should modify only the site-specific script since the generic
startup script may be replaced during a PI Server upgrade. The actual file names of these
scripts vary with the operating system. Platform-specific details are provided in the following
subsections.
In general, the PI Server shutdown scripts are similar: a generic PI shutdown script calls a
site-specific script to shut down interfaces and site specific programs, and then shuts down all
PI processes.
Note: The only exception to this is shutting down PI processes running as individual
command windows. In this case, you must bring each window in focus and type
<CTRL-C>. Running PI subsystems in command windows is very rare; and usually
only encountered in troubleshooting scenarios.
1.1 Starting PI
The PI Subsystems may take several minutes to start. Remote or PI API based interfaces and
other applications are blocked from connecting until the core PI Subsystems have completed
startup. The connection blocking is accomplished by opening the TCP/IP listener when the
core subsystems are ready to service requests. The following message is posted to the PI
Server log when the listener is opened:
Page 2
1.2 - Stopping PI
Some interfaces on Windows cannot be run as services. Check the interface documentation.
1.2 Stopping PI
The procedure for stopping PI is slightly different, depending on whether you’re running on
Windows or UNIX.
should be set to reflect the actual shutdown time. Failing to allow proper shutdown of the PI
Server can result in lost data or corrupted data files.
To shut down an interactively started PI Server, type <CTRL-C> in each of the command
windows corresponding to the PI processes. These should be stopped in the following order:
Utilities (for example, piconfig)
Interfaces (for example, Ramp Soak and Random)
pinetmgr (When you instruct pinetmgr to stop, the remaining processes are told to
exit in the proper order and, finally, pinetmgr will stop.)
Shutdown Flag
The shutdown point attribute in the point database is set to TRUE (1) by default.
If the shutdown attribute for a point is set to TRUE, the point is able to receive shutdown
events if the shutdown.dat file targets the point.
Page 4
1.2 - Stopping PI
pishutev
Shutdown events are written at system startup by the pishutev interface. The utility reads a
configuration file to determine which tags should receive shutdown events. It also supplies a
configurable timestamp for the PI Server shutdown. Unlike most PI processes, pishutev exits
after completion.
The startup command line for pishutev is located in the PI startup files PI/adm/pistart.sh
(UNIX), PI\adm\pistart.bat and PI\adm\pisrvstart.bat.
By default, the configuration file is PI\dat\shutdown.dat. It is sometimes useful to create
additional shutdown configuration file(s) with additional point selections. These files are
processed by starting another instance of the interface. The new shutdown configuration file
name is passed as a parameter using the -f flag in the pishutev command line: For example:
pishutev -f myshutdown.dat
This command line should be added to the PI site-specific startup files PI/adm/pisitestart.sh
(UNIX) and PI\adm\pisitestart.bat. Starting a second instance of pishutev in order to process
an additional shutdown configuration file is not supported when starting PI as Windows
services.
By default, pishutev determines the shutdown event timestamp from a file written by the
Snapshot Subsystem. This file is updated whenever the Snapshot is flashed to disk, usually
every 10 minutes. Hence, in the event of a power failure, the timestamp of the shutdown
event are accurate to within 10 minutes. When PI is shut down normally, the timestamps are
the actual shutdown time. If the file that is written by the Snapshot Subsystem is missing, the
shutdown events interface uses the current time to timestamp the shutdown events.
The default time may be overridden by a user-specified time using the -t flag and passing the
time as a parameter in the command line.
For example:
pishutev -t 11:00
By default, the digital state of shutdown is written for each shutdown event.
To write a digital state other than shutdown, use the -s flag and pass the digital state as a
parameter in the command line. The specified state must already be configured in the System
Digital State Set in the Digital State Table. For example:
pishutev -s SpecialState
The -f, -t, and -s flags may be used in any combination.
Shutdown.dat
The points receiving shutdown events are specified using the file PI\dat\shutdown.dat.
The PI Server is delivered with a shutdown.dat file that selects all points whose shutdown
flag is TRUE. This file is shown below. You may wish to edit the file to restrict shutdown
events to certain groups of tags.
! @(#)shutdown.dat 1.1 05/24/96
! default shutdown events file
Caution: Do not specify additional tags by appending comma separated tag masks
or by using additional lines. Only one tag mask may be specified.
If you do not specify a tag-mask, the interface exists with an error. To prevent all shutdown
events, specify a tag mask that does not match any tag.
Other point attributes and values may be used in addition to or instead of the shutdown flag.
These conditions are logically ANDed together.
For example, the following configuration file selects only tags that start with s, have the
location1 attribute set to 0, and Pointsource set to H. No other tags will receive shutdown
events.
! tag mask
s*
! point attributes
location1,0
pointsource,H
If no point attributes are specified, all tags specified by the tag mask are selected to receive
shutdown events.
The procedure to configure PI for automatic startup depends on the operating system.
PI Server on Windows is normally run as a collection of services. The installation procedure
provides a dialog to optionally set automatic startup on reboot. The reboot startup behavior of
PI can also be set using the Control Panel Services applet.
Page 6
1.3 - Automatic Startup
3 default level
Which processes run at each level is determined by a set of scripts, /etc/rcS through /etc/rc6.
These scripts look in the directories /etc/rc#.d (where # = 0, 2, 3, etc.) for scripts that begin
with a K or an S. The K scripts are used to kill processes, and the S scripts are used to start
processes. When the system moves from level 3 to level 2, the K scripts in /etc/rc2.d are
executed first, then the S scripts. The scripts are run in ASCII collated sequence, so K02stop
is run before K04metoo. On shutdown or reboot, the system runs the scripts in /etc/rc0.d.
If you are using the default run level, you will need to put the PI startup in /etc/rc3.d. The
shutdown script for PI needs to be in /etc/rc2.d, so PI will be shut down if the system goes to
non-networked mode, and also in /etc/rc0.d, so PI will be shut down if the system is halted or
rebooted.
Note: Solaris systems should be restarted using shutdown -i 6. This will cause the
shutdown scripts to be run before running reboot. The reboot command simply
restarts the kernel, without taking the time to shut down processes properly. The
command shutdown -i 5 is for powering down.
Script files are actually kept in /etc/init.d, with links placed in the /etc/rc#.d directories. So, in
/etc/init.d, you need to create the following three files: PI, PIstart and PIstop. Be sure to
change the lines that specify where to find PI on your system.
#!/bin/ksh
#
# Filename: /etc/init.d/PI
#
# become piadmin to start/stop PI
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
case "$1" in
'start')
if [ -f /etc/init.d/PIstart ] ; then
su - piadmin -c "/etc/init.d/PIstart" > /dev/console 2>&1
fi
;;
'stop')
if [ -f /etc/init.d/PIstop ] ; then
su - piadmin -c "/etc/init.d/PIstop" > /dev/console 2>&1
fi
;;
*)
echo "usage: $0 {start|stop}"
;;
esac
#!/bin/ksh
#
# Filename: /etc/init.d/PIstart
# Make sure to set the directory in these
# files to your PIHOME directory, in all
# places
#
if [ -f /opt/pi/adm/pistart.sh ] ; then
cd /opt/pi/adm
nohup ksh pistart.sh
fi
#!/bin/ksh
#
# Filename: /etc/init.d/PIstop
# Make sure to set the directory in these
# files to your PIHOME directory, in all
# places
#
if [ -f /opt/pi/adm/pistop.sh ] ; then
cd /opt/pi/adm
ksh pistop.sh
fi
Next, set the owner, group, and permissions on these files to match the other files in this
directory:
root> chgrp sys /etc/init.d/PI*
root> chmod 755 /etc/init.d/PI*
Page 8
1.3 - Automatic Startup
Then, you'll need to set the links in the rc#.d directories. Make sure that the S## number on
the startup file is higher than the S## number for inetd, and that the K## number for the kill
file is lower than the K## number for inetd (in both directories).
root> ln -s /etc/init.d/PI /etc/rc3.d/S96PI
root> ln -s /etc/init.d/PI /etc/rc2.d/K04PI
root> ln -s /etc/init.d/PI /etc/rc0.d/K04PI
Verify that these files have the same owner, group, and permissions as other startup files in
those directories.
Finally, test your scripts before you restart your machine. To stop PI:
root> sh /etc/rc0.d/K04PI stop
Verify that PI processes shut down.
root> sh /etc/rc3.d/S96PI start
Verify that PI starts properly.
If there is any problem with stopping or restarting PI, remove the links in the /etc/rc#.d
directories until you've debugged and fixed the problems. The files in the /etc/init.d directory
will not affect your system as long as there are not links in the /etc/rc#.d directories.
Which processes run at each level is determined by the /sbin/rc script. This script looks in the
directories /sbin/rc#.d (where # = 1, 2, 3, etc.) for scripts that begin with a "K" or an "S". The
"K" scripts are used to kill processes, and the "S" scripts are used to start processes. When
moving down from a higher level to a lower level, all "K" scripts in all the intervening levels
are run. When moving up to a higher level, all "S" scripts in all intervening levels are run. So
when the system moves from level 4 to level 2, the "K" scripts in /sbin/rc3.d are executed,
then the "K" scripts in /sbin/rc2.d. The scripts are run in ASCII collated sequence, so
K002stop is run before K004metoo.
If you are using the default run level of 2, you must put the PI startup in /sbin/rc3.d. The
shutdown script for PI needs to be in /sbin/rc%.d, where % is the default run level, minus 1,
so PI will be shut down if the system goes out of the default run level to any other level, or if
the system is halted or rebooted. To determine your default run level, check the line in
/etc/inittab that reads "init:#:initdefault:." The # is the default run level for the system.
Script files are actually kept in /sbin/init.d, with links placed in the /sbin/rc#.d directories. So,
in /sbin/init.d, you need to create the following three files: PI, PIstart and PIstop. Be sure to
change the lines that specify where to find PI on your system.
#!/bin/ksh
#
# Filename: /sbin/init.d/PI
#
# become piadmin to start/stop PI
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
case "$1" in
'start')
if [ -f /sbin/init.d/PIstart ] ; then
su - piadmin -c "/sbin/init.d/PIstart" > /dev/console 2>&1
fi
;;
'stop')
if [ -f /sbin/init.d/PIstop ] ; then
su - piadmin -c "/sbin/init.d/PIstop" > /dev/console 2>&1
fi
;;
'start_msg')
echo "Starting PI"
;;
'stop_msg')
echo "Shutting down PI, please wait"
;;
*)
echo "usage: $0 {start|stop}"
;;
esac
#!/bin/ksh
#
# Filename: /sbin/init.d/PIstart
# Make sure to set the directory in these
# files to your PIHOME directory, in all
# places
#
if [ -f /opt/pi/adm/pistart.sh ] ; then
cd /opt/pi/adm
nohup ksh pistart.sh
fi
#!/bin/ksh
#
# Filename: /sbin/init.d/PIstop
# Make sure to set the directory in these
# files to your PIHOME directory, in all
# places
#
if [ -f /opt/pi/adm/pistop.sh ] ; then
cd /opt/pi/adm
ksh pistop.sh
fi
Next, set the owner, group, and permissions on these files to match the other files in this
directory:
Page 10
1.3 - Automatic Startup
0 shutting down
2 local (non-networked)
3 default, networked
Which processes run at each level is determined by a set of scripts, /sbin/rc0, /sbin/rc2, and
/sbin/rc3. These scripts look in the directories /sbin/rc#.d (where # = 0, 2, 3) for scripts that
begin with a "K" or an "S". The "K" scripts are used to kill processes, and the "S" scripts are
used to start processes. When the system moves from level 3 to level 2, the "K" scripts in
/sbin/rc3.d are executed first if the system is not coming from single-user mode, then the "S"
scripts are run (remember the system goes to single-user on boot, then goes to the default run
level). The scripts are run in ASCII collated sequence, so K02stop is run before K04metoo.
On shutdown or reboot, the system will run the scripts in /sbin/rc0.d.
You should put the PI startup in /sbin/rc3.d. The shutdown script for PI must be in
/sbin/rc2.d, so PI will be shut down if the system goes to non-networked mode, and also in
/sbin/rc0.d, so PI will be shut down if the system is halted or rebooted.
Script files are actually kept in /sbin/init.d, with links placed in the /sbin/rc#.d directories. So,
in /sbin/init.d, you need to create the following three files: PI, PIstart and PIstop. Be sure to
change the lines that specify where to find PI on your system.
#!/bin/ksh
#
# Filename: /sbin/init.d/PI
#
# become piadmin to start/stop PI
PATH=/sbin:/usr/sbin:/usr/bin
export PATH
case "$1" in
'start')
if [ -f /sbin/init.d/PIstart ] ; then
su - piadmin -c "/sbin/init.d/PIstart" > /dev/console 2>&1
fi
;;
'stop')
if [ -f /sbin/init.d/PIstop ] ; then
su - piadmin -c "/sbin/init.d/PIstop" > /dev/console 2>&1
fi
;;
*)
echo "usage: $0 {start|stop}"
;;
esac
#!/bin/ksh
#
# Filename: /sbin/init.d/PIstart
# Make sure to set the directory in these
# files to your PIHOME directory, in all
# places
#
if [ -f /opt/pi/adm/pistart.sh ] ; then
cd /opt/pi/adm
nohup ksh pistart.sh
fi
#!/bin/ksh
#
# Filename: /sbin/init.d/PIstop
# Make sure to set the directory in these
Page 12
1.3 - Automatic Startup
The system determines what processes should run at each level by reading the /etc/inittab file.
The lines in this file tell the system what scripts to run at what run levels. The line with the
initdefault in it (init:#:initdefault:, where # is some number 2-9) tells the system the default
run level. Each line with this number after the first colon is executed when entering the
default run level. Thus, we need to add a line to the /etc/inittab file:
pisystem:2:once:su - piadmin -c /etc/rc.pistart > /dev/console 2>&1 #
Start PI
Caution: Before editing /etc/inittab, you must save the original under another name. If
you do not and make an error while editing, your system will not boot.
If your initdefault level is not 2, you should replace the 2 with the appropriate number from
initdefault.
For shutdown and reboot, the system uses the /etc/rc.shutdown script. If this file does not
exist, you should create it. Otherwise, just add the last line below to your current file. If you
have to create the /etc/rc.shutdown file, you should give it the same owner, group, and
permissions as the /etc/rc file. As before, you are strongly advised to save a copy of the
original file under another name before editing this file.
#! /bin/ksh
#
# Filename: /etc/rc.shutdown
#
su - piadmin -c "/etc/rc.pistop" > /dev/console 2>&1
Now you'll have to create these two files you've told the system to use, /etc/rc.pistart and
/etc/rc.pistop. Be sure to change the directory in these files to the PI Server directory on your
system.
#!/bin/ksh
#
# Filename: /etc/rc.pistart
#
if [ -f /usr/PI/adm/pistart.sh ] ; then
cd /usr/PI/adm
nohup ksh pistart.sh
fi
#!/bin/ksh
#
# Filename: /etc/rc.pistop
#
if [ -f /usr/PI/adm/pistop.sh ] ; then
cd /usr/PI/adm
ksh pistop.sh
fi
You'll need to change the permissions on these files so that piadmin can run them:
root> chmod 755 /etc/rc.pi*
Finally, test your scripts before you restart your machine. To stop PI:
root> su - piadmin -c "/etc/rc.pistop" > /dev/console 2>&1
Verify that PI processes shut down.
Page 14
1.3 - Automatic Startup
Caution: Before editing /etc/rc, save the original under another name. If an error is
made while editing, the system will not boot.
In /etc/rc, there is a section intended for use by the local PI System Manager, "localrc()". In
this section, add the following lines (be sure to add them before vuelogin, if you have it):
#
# start PI
#
su - piadmin -c /etc/rc.pistart > /dev/console 2>&1
There's another directory, /etc/shutdown.d, which has the shutdown scripts for applications on
the system. This directory may be empty.
In any case, you should create a file, /etc/shutdown.d/PIstop, that looks like this:
#! /bin/ksh
#
# Filename: /etc/shutdown.d/PIstop
# Stop PI gracefully
su - piadmin -c "/etc/rc.pistop" > /dev/console 2>&1
This file should have the same owner, group, and permissions as the /etc/rc file. For our
systems, that means running these commands:
root> chown bin /etc/shutdown.d/PIstop
root> chgrp bin /etc/shutdown.d/PIstop
root> chmod 555 /etc/shutdown.d/PIstop
Next create the two files in /etc. Make sure you set the directories in these files to point to
your PI Server directory.
#!/bin/ksh
#
# Filename: /etc/rc.pistart
#
if [ -f /export/PI/adm/pistart.sh ] ; then
cd /export/PI/adm
nohup ksh pistart.sh
fi
#!/bin/ksh
#
# Filename: /etc/rc.pistop
#
if [ -f /export/PI/adm/pistop.sh ] ; then
cd /export/PI/adm
ksh pistop.sh
fi
Again, you need to set the owner, group, and permissions:
root> chown bin /etc/rc.pi*
root> chgrp bin /etc/rc.pi*
root> chmod 555 /etc/rc.pi*
Then test these scripts before restarting your machine.
root> sh /etc/shutdown.d/PIstop
Verify that PI shuts down.
root> su - piadmin -c "/etc/rc.pistart" > /dev/console 2>&1
Verify that PI starts up properly.
If there is any problem with stopping or restarting PI, you will need to restore your original
/etc/rc file, and remove the new file from the /etc/shutdown.d directory.
Shutting down an individual subsystem depends on the operating system. On Windows, look
in the file adm\pisrvstop.bat for the shutdown procedure; on UNIX, adm/pistop.sh. For restart
procedure check adm\pisrvstart.bat and adm/pistart.sh onWindows and UNIX, respectively.
Page 16
Chapter 2. MONITORING PI SYSTEM HEALTH
Each day, check the key elements of your PI System to make sure PI is working efficiently
and correctly. By checking the PI System daily, you can catch problems quickly and you also
familiarize yourself with the normal state of the system. This makes it easier to interpret
system metrics (such as I/O rates) and to find abnormal messages, when they occur.
Tag Data Does the Archive data for a reference tag pisnap.bat or pisnap.sh
look normal?
Archive data flow Is the Archive data flow normal? piartool -as and piartool -qs
Archive Shift Verify that the expected archives are piartool -al
registered and that you have prepared
for the next archive shift.
License limits Check the usage statistics and point piartool -lic
and usage counts for your system. Anticipate
license increase needs.
During normal operation, the PI Message Subsystem maintains a central log file for messages
from all PI subsystems. PI creates a new log every day, on universal time coordinate (UTC)
time. PI puts the log files in the PI\log directory and names each log according to the date.
The file names are of the form, pimsg_YYMMDD.dat, where:
YYY is years since 1900 (for example,if the year is 2000, YY is 100)
MM is the month (for example, if the month is January, MM is 01)
DD is the day (for example, if it is the fifth of the month, DD is 05)
For example, the log file for January 5, 2000 is named pimsg_1000105.dat.
PI Message log files are binary files that you can view using the pigetmsg utility.The
pigetmsg utility lets you view messages according to time, subsystem, or sender’s identity.
The pigetmsg utility requires PI to be running.
Note: The message log can be written (but not read) using function calls in the PI
API. It can be both read and written using the function calls in the PI SDK.
Page 18
2.2 - Viewing System Messages
If start time and max count are specified, the utility returns the number of messages
specified by the max count beginning from the start time.
If end time and max count are specified, the utility returns the number of messages
specified by the max count up to and including the end time.
If start time, end time, and max count are all specified, the utility returns messages
beginning at the start time and finishing when either the number of messages
specified in the max count or the end time is reached.
All the command line options for pigetmsg are listed in the following table.
Argument Description
-mc Max count. This is an integer the total number of messages to return.
-id This is an integer that represents the specific message identification number
from the text-file: 0 for the free-format messages. The default is all messages.
-pn This is the message source, either a specific program name (pinetmgr) or a wild-
card mask (* for all programs, *arc* for all archive related sources, etc.). The
default is all programs.
-msg A string mask selection for the message text. The default is * (show everything).
-dc Number of message to display at one time. The default is to display all
messages.
Parameter Description
For example, to begin an interactive session as the user, piadmin, with the password,
“buddy” on a remote NT host named Samson, use:
pigetmsg -remote -node Samson -username piadmin -port 5450 -password
buddy
Page 20
2.2 - Viewing System Messages
daily; each file covers one day. The file naming convention contains the year month and date.
The log files are created in the PI\log directory.
Even though all messages will be read from the log file, pinetmgr must be running.
The PI Message Subsystem executable, pimsgss, is located in the PI\bin directory. Here is an
example of running pimsgss offline to view messages from February 27, 2003:
D:\PI\bin>pimsgss -file ..\log\pimsg_1030227.dat
Message ID [A], (0-n) (A)ll (H)ead (T)ail (Q)uit (?):
Once the log file is specified, the behavior is identical to pigetmsg. Only messages in the
time period covered by the specified file can be viewed.
Offline use also allows specifying all arguments on the command line, just like pigetmsg.
Messages that match the command line arguments are immediately displayed. Here is an
example:
D:\PI\bin>pimsgss -file ..\log\pimsg_1030227.dat -st "27-feb-03 12:00" -
et "27-feb-03 15:00"
0 pinetmgr 27-Feb-03 12:07:16
>> Connection accepted: Process name: piconfig(1696) ID: 88
0 pinetmgr 27-Feb-03 12:11:54
>> Deleting connection: Piconfig(1696), Shutdown request received from
piconfig(1696) (8), ID: 88
0 pinetmgr 27-Feb-03 12:35:20
>> Connection accepted: Process name: Piconfig(1484) ID: 89
0 pinetmgr 27-Feb-03 12:38:08
>> Deleting connection: Piconfig(1484), GetQueuedCompletionStatus
error: Broken Pipe [109] The pipe has been ended.
Connection: Piconfig(1484) (14, 109), ID: 89
0 pinetmgr 27-Feb-03 13:24:08
>> PInet accepted TCP/IP connection, cnxn ID 90 Hostname:
olive.osisoft.com, 208.243.230.129
Avoid reading error codes from the PI Server message log on one operating system and
translating them with pidiag -e on another.
Windows-based PI Server exposes the Snapshot data displayed by piartool -ss as Windows
Performance Counters. These counters may be viewed with the Windows Performance
Monitor or recorded to the PI Server with the OSI Performance Monitor Interface.
Page 22
2.3 - Monitoring Snapshot Data Flow
Note: The piartool utility can monitor a remote PI Server by specifying the -remote
argument after all other arguments. piartool prompts the user for remote connection
information.
Point Count
The Point Count is the number of points that are currently defined in the Point Database. It is
incremented when a point is created and decremented when a point is deleted.
Page 24
2.4 - Monitoring the Event Queue
Note: When multiple Event Queues exist, the file pimapevq.dat is renamed to
pimq0000.dat and additional queues are named pimq<id>.dat where id is the queue
number in hexadecimal representation (from 0000 to FFFF). The piartool -qs
command always shows information from the queue to which the Snapshot
Subsystem is writing (primary queue).
After installation and regularly after significant changes, the System Manager should verify
the proper sizing and functioning of the Event Queue. The command piartool -qs allows you
to look at internal counters and statistics about the queue activity.
Queue Size
The Physical File Size shows the current size of the Event Queue on disk (the file
pimapevq.dat or any overflow queues). The Page Size is the portion of the file that is loaded
into memory for faster access. The Event Queue is a circular buffer of pages and each page is
a circular buffer of events. When a page is full, the Snapshot Subsystem tries to write into the
next one and the Archive Subsystem reads the pages in the same order they were written. The
Total Data Pages shows the number of pages, obtained by dividing the queue size by the
page size (minus one for the queue header).
Page Activity
The Write Page Index shows the page the Snapshot Subsystem is currently writing to.
Similarly, the Read Page Index indicates the page from which the Archive Subsystem is
reading. Under normal conditions, these two numbers are identical. If the Archive Subsystem
is not reading at the same pace the Snapshot is writing, page shifts will occur and the Total
Page Shifts counter will increment. At any time, the Available Pages counter shows how
many free pages are left in the current queue.
Queue Capacity
Based on the average size of all events, the Snapshot Subsystem maintains the number of
Average Events per Page. From this it derives an Estimated Remaining Capacity in number
of events (also shown by piartool -ss).
Total Bytes Written shows the volume of data that transited through the Event Queue since
the Snapshot Subsystem was last started.
Note: A System Manager should try to configure the queue so that it is big enough to
hold a few days worth of data. To configure the queue size, see Tuning the PI Server
in Chapter 3, Troubleshooting and Repair.
Event Rates
Every time the Snapshot sends an event to the archive, the Total Event Writes counter gets
incremented. Similarly, when events are read by the Archive Subsystem, the Total Event
Reads is incremented. The difference between these counters shows the Current Queue
Events (total events per queue).
Overflow Queues
When the current queue is entirely full, the Snapshot Subsystem creates additional queue files
of the same size. The Overflow Queues counters and Total Overflow Events (same as in
piartool -ss) indicates how many queues exist and how many events they hold. The Current
Page 26
2.5 - Monitoring the Archive
Queue Id shows the sequence number of the primary queue (always 0 under normal
conditions).
On a daily basis, the System Manager should look at the internal counters for the Archive
Subsystem. This enables you to predict the next archive shift as well as to monitor ongoing
system behavior and performance. You can use piartool -as and piartool -al for this purpose.
Other piartool commands are discussed in the chapter, Managing Archives.
Note: Windows-based PI Server exposes the Archive data displayed by piartool -as
as Windows Performance Counters. These counters may be viewed with the
Windows Performance Monitor or recorded to PI Server with the OSI Performance
Monitor Interfaces. This subject is covered in detail later in this chapter.
The piartool utility can run remotely by specifying some additional parameters on the
command line as described in Table 3–1. Options for Use with piartool on page 37.
Page 28
2.5 - Monitoring the Archive
The cache consists of archive records loaded into memory. Records are added as needed; they
are deleted when unused for a certain length of time. Cache Record Count yields the current
count. Cache Records Created is incremented when memory is allocated for a new record.
When archive data is requested (for example, the user is trying to trend a point in PI
ProcessBook), the Archive Subsystem goes to the cache to retrieve the event data. If the
record is not there, the Archive Subsystem loads the record from disk to the cache; Archive
Record Disk Reads is incremented.
When writing events to the archive, they are stored first in memory. Unflushed Events
Counter indicates the total number of events not yet flushed to disk. Unflushed Points counter
indicated the number of points with any number of events not yet flushed.
Archive Record Disk Writes is incremented each time a record is written to disk. This occurs
during the regular cache flush every 15 minutes. It also occurs when the number of un-
flushed events for a point exceeds the configured maximum.
Cache Record Memory Reads is incremented for each read access.
Cache Clean Count indicates the number of records that were removed from the cache. The
archive cache contains a finite number of records. Old or low use records are removed from
memory to make room for most recently accessed records.
Archiving Flag
Indicates whether or not events may be written to the archive; a value of 1 indicates events
may be written, a value of 0, events may not be written. The Archiving Flag is set to 1 when
there is a mounted Primary Archive. A Primary Archive may be registered but not mounted,
for example during an archive shift. In this case, the Archiving Flag would be set to 0. This
flag is also set to 0 when in backup mode.
All registered archives may be viewed using piartool -al. The Archive Flag is set to 0 if the
Primary Archive becomes full and there is no other archive file available into which to shift.
Note that the Primary Archive will never overwrite itself.
The Update Manager provides change notification of Snapshot events, Point Database,
Module Database, Batch Database and Archive changes for applications such as PI
ProcessBook, Interfaces, and other PI API or PI-SDK-based applications. For example, a
trend application can request Snapshot update notification on points being trended. The
Update Manager queues all new Snapshots for these points. Periodically the trend application
retrieves and plots the new events.
Page 30
2.7 - System Date and Time
The PI server uses the Windows clock, including the time zone and Daylight Savings Time
(DST) settings to track time. If the system clock isn't right, the PI data isn't right either. You
might even lose data if the system clock is wrong.
As the PI System Manager, you must:
Check the system clock regularly
Page 32
Chapter 3. MANAGING ARCHIVES
PI Archive Management includes significant tasks for the PI System Manager, including:
Archive creation and deletion
Archive sizing
Archive shifting
Archive backups
Archive splitting/combining/compressing
Archive repair
The PI System stores your data in Archives, which are just files for holding PI data. Archive
files can be either fixed or dynamic. Fixed archive files are always the same size, regardless
of how much data they contain. Dynamic archive files grow in size as they get data. (See
About Fixed and Dynamic Archives for a complete explanation.)
The archive receiving current data is called the Primary Archive. When the Primary Archive
becomes full, an Archive Shift occurs and the next available archive becomes the new
Primary Archive.
If no eligible archives are available for an Archive Shift, PI uses the oldest available filled
archive as the new Primary Archive, overwriting the data in the old archive. For example in
the preceding illustration, after the shift from piarch.003 to piarch.004, no empty registered
archives are left on the Server. If the System Manager does not create new archives on this PI
Server, then at archive shif piarch.001 becomes the next Primary Archive and the PI Server
overwrites the existing data in that archive.
It takes PI a few minutes to complete an Archive Shift. During that time, you are not allowed
to add, edit or delete points. PI stores incoming data in the Event Queue until the shift is
complete and then writes the queued events into the new Primary Archive.
Page 34
3.2 - About Archives
archive file. Overflow records start at the end of the archive file and are filled backwards.
Each record is one kilobyte.
A point can have as many overflow records as needed. Points that receive events at a slow
rate might never need to allocate an overflow record, whereas points that receive events at a
fast rate might need to allocate many overflow records. (PI uses index records to keep track
of multiple overflow data records for a point).
Note: When the Archive allocates a new overflow record for a point, it writes the new
record to disk immediately, along with any existing records that reference the new
record.
Fixed Archives
The default archives that are installed with a PI System are fixed archives. They have the
following characteristics:
Fixed archive files have all of their disk space allocated at creation time. An empty
archive and a full archive take the same amount of disk space.
Fixed archives may or may not participate in archive shifts, depending on the point
count to archive size ratio and the state of the shift and write flags.
New points may be added to a primary fixed archive.
Use fixed archives for all normal operations.
Dynamic Archives
Dynamic archives have the following characteristics:
Like fixed archives, dynamic archives are for a specific time range.
Dynamic archives that already contain data are not eligible for Archive Shift. Newly-
created dynamic archives participate in the standard shift algorithm, if they are
registered.
Dynamic archives do not contain unallocated space waiting to be used for overflow
records. Rather, the file grows as overflow records are added. Dynamic archives have
a maximum archive size (specified at archive creation). The default maximum
archive size is 1 Gbyte or 10% less than the maximum available disk space,
whichever is less.
Dynamic archives are initialized with a fixed number of primary point records. Once
a dynamic archive is created, the number of primary records cannot grow beyond the
initial allocation, even if there is space in the file.
Note: You can create dynamic archives with a number of primary records higher
than the current number of points. This allows users to create additional points in a
dynamic primary archive. Users can add new points as long as the number of points
does not exceed the number of primary records specified when you created the
dynamic archive. To create this type of dynamic archive, use the piarcreate -acd
command.
Page 36
3.3 - Tools for Managing Archives
There are three main command line tools for managing archives:
piartool: The main archive management utility. You can use it to create, register and
unregister archives, force archive shifts, list details of archive files, and much more.
You can use piartool only when PI is running.
piarchss: The Archive Subsystem, piarchss, includes an Offline Archive Utility.
You use this utility to process existing “offline” archives. For example, you use
piarchss to combine multiple archives into one, to divide large archives into multiple
archives, to recover corrupted archives, and so on.
piarcreate: Use thie piarcreate utility to create new archives.
-aag Archive Activity Enable/Disable the archive activity grid, and list the
Grid Archive access information.
-cad 'tagname' [-reset] Archive cache Archive cache diagnostics for a specified point.
diagnostics Display the events sitting in the read and write
cache.
-cas ['tagmask'] Archive cache Display a summary of the contents of the archive
summary cache, including the number of events in the Read
and Write caches for every point that matches the
tagmask.
Page 38
3.3 - Tools for Managing Archives
-idci <in file> ID conversion file Create ID conversion file from specified input file.
-idco <outfile> creation
-lic [Options listed Licensing Usage List options for viewing license info
under Action] Information Def List all licenses
User List all licenses in use
Lic List all licenses and users
AllowedApps <-List <type,type...>|-Check
<app,app,...>>
List the types of licenses or check whether a
specific feature is licensed
-mpt <0|1> Message protocol Log all communication coming to and from the
[For troubleshooting trace server.
only] To enable tracing run with -mpt 1. Call a second
time with -mpt 0 to stop tracing.
The resulting output file appears in the “\pi\temp
directory” with the .mpt extension.
The file can be read with the mptconsolveview
utility, which OSISoft provides on request, e.g.:
Mptconsolveview .\24-Aug-05_12-10-06.mpt
-ooo <-r><Sec> Out of order snap Show tags with Out of Order events. Optional
events Reset and Repeat.
-remote Remote system Run utility against a remote system. When this
argument is included as the last argument in any
valid command the utility prompts for remote
system login information. If successful the utility
runs against the remote system.
-rpctest <subsystem> Inter-process Times the RPC round trip to the specified sub-
<count> Communication system.
[For troubleshooting Test
only]
Page 40
3.3 - Tools for Managing Archives
console mode using special command line arguments. The offline archive utility can be used
even while PI is running.
You typically use the piarchss utility to work with archive files outside the context of a
running PI Server. This enables you to continue archiving current data on your PI Server,
while manipulating other archives “offline.” Typical applications of the offline tool include:
Combining a number of archives together
Dividing a big archive file into smaller archives
Extracting specific time period from an archive
Recovering a corrupted archive
Recovering events from an Event Queue file
Converting PI2 archive file to the PI3.x format.
Note: The archives that are created by the Offline Archive Utility may be either fixed
or dynamic. Their format is not different from any other archives created by piartool
-ac.
-if <full path name> Input Archive Required. The full path, including drive letter is
File required. This is true for all file arguments passed.
-ost <option> Output file Options: Input, Event, <time>, NFE See “Specifying a
Start Time Start Time for the Output File (-ost).”
-oet <option> Output file End Options: Input, Event, <time>, NFE, Primary,
Time NoChange
-f <size in Mbytes> Make output If size = 0, the input file size is used. Default is dynamic
archive a fixed archive.
archive
-tzf <full path name> TimeZone Use when PI2 input different from standard DST - see
specification also the PI Server Reference Guide, Appendix D.
file
-filter <start end> Filter Process events only within the time range specified.
Both timestamps must be provided. See “Time Filtering
(-filter).”
-tfix Time Fix Apply a specified time transformation to input data. See
“Transforming Event Timestamps (-tfix).”
input Sets the start time to the start time of input. This is the default behavior.
time Sets the start time to the specified time string. Times are specified in absolute PI
(where time is time format. Relative times are not supported. Times must be enclosed in double
specified in quotes when containing spaces. If only date is specified the time defaults to
absolute PI 00:00:00 (midnight)
time format) For example:
“22-JAN-02 23:59:59”
23-JAN-02
21-Feb
Output file start and end times must differ by at least one second.
NFE Sets the start time to time of first event which passes the time filter.
Page 42
3.3 - Tools for Managing Archives
input Sets the end time to the end time of input file.This is the default behavior.
event Sets the end time to the time of last event in input file.
time Sets the end time to the specified time string. Times are specified in absolute PI
(where time is time format. Relative times are not supported. Times must be enclosed in double
specified in quotes when containing spaces. If only date is specified the time defaults to
absolute PI time 00:00:00 (midnight).
format) For example:
“22-JAN-02 23:59:59”
23-JAN-02
21-Feb
Output file start and end times must differ by at least one second.
NFE Sets the end time to time of last event which passes the time filter.
primary Sets the end time to indicate the archive is a primary archive.
Note: The piartool -idci input file does not allow for comment characters. The
comment character ( * ) generated by piconfig must be removed.
Page 44
3.3 - Tools for Managing Archives
01-Jan-70 00:00:00,3600
01-Jan-10 00:00:00,3600
Applies a missed DST conversion to an archive that covers the summer of 1997:
01-Jan-02 00:00:00,0
06-Apr-02 02:00:00,3600
26-Oct-02 02:00:00,0
31-Dec-02 23:59:59,0
A series of UTC values and offsets:
814953600,-61200
828871200,-57600
846403200,-61200
860320800,-57600
System to your PI Server. An error message is issued for every record for which a point could
not be found in the local PI Server. These messages can be suppressed if desired.
Statistics are displayed after every 200 records are processed, at the end of the first pass, and
at the end of the second pass.
During the second pass, records from the sorted list are written to the output file. The input
data is optionally filtered or modified. If the output archive file does not exist, it is created.
The archive header is initialized based on command line specifications. If the output file
already exists, the input data is added. If a primary record does not exist for a given point ID,
the data for that point ID is discarded.
The input data is converted to the output point type, if different from the input point type. All
auxiliary data, such as index records and record chaining, are recreated during the load. Only
actual data are read from the input, and thus, any errors in the input file auxiliary data are
repaired.
<0 An error returned from the output processing check log messages
Archives must be registered before the PI Server can use them. If an archive is not registered,
its data are not accessible. The piartool -al command lists the registered archives.
Archives are listed in reverse chronological order—archives with the newer data before
archives with older data. The first archive listed is the Primary Archive, which covers the
current time range. The dates that are spanned by each archive are also shown. There cannot
be an overlap in dates between archives. Attempting to register an archive that overlaps an
already registered archive will fail. Unused archives have start and end times shown as
Current Time. The display order of unused archives is arbitrary and may change.
Here is a sample archive listing:
D:\PI\adm>piartool -al
Archive shift prediction:
Shift Time: 5-Oct-05 19:42:01
Target Archive: e:\pi\arc\piarch-2GB.1
Archive[0]: e:\pi\arc\piarch-2GB.3 (Used: 53.4%)
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 101 $]::
Page 46
3.4 - Listing the Registered Archives
Label Description
Shift Prediction Provides estimated time for the next shift and the target archive. This is
important for backup planning.
Version Identifier of the archive's internal architecture. This label allows PI Server
to mount and upgrade archives from older versions of PI.
State Current condition of the archive. In piartool -al, this will always be
displayed as 4, which means mounted and ready. All other states
correspond to unmounted states, in which case the archive is not visible in
piartool -al.
Add Rate Average number of overflow-records added per hour, over the archive
lifetime.
Offsets: Primary Start and end record numbers for primary records. The end record number
is always 1/2 of the Record Count.
Offsets: Overflow Start and end record numbers for overflow records.
Annotations Number of annotations used and the maximum number available. The
archive shifts when this number is reached.
chronologically assigned with zero being the primary archive. The archive sequence number
is shown in with the archive list command (piartool -al); it is the number in the brackets
immediately following “Archive.”
Here is a sample archive listing:
C:\pi\adm>piartool -al
Archive shift prediction:
Shift Time: 27-Sep-05 14:46:56
Target Archive: g:\pi\arc\piarc.144
Archive[0]: g:\PI\arc\piarc.045 (Used: 72.2%)
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 101 $]::
Version: 7 Path: g:\PI\arc\piarc.045
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 131072 Add Rate/Hour: 116.0
Offsets: Primary: 19273/98304 Overflow: 55751/131072
Annotations: 10/65535 Annotation File Size: 1623
Start Time: 11-Aug-05 12:59:35
End Time: Current Time
Backup Time: Never
Last Modified: 9-Sep-05 22:26:55
Archive[1]: g:\pi\arc\piarc144.arc (Used: 16.2%)
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 101 $]::
Version: 7 Path: g:\pi\arc\piarc144.arc
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 131072 Add Rate/Hour: 3337.3
Offsets: Primary: 19273/65536 Overflow: 129079/131072
Annotations: 1/65535 Annotation File Size: 1552
Start Time: 11-Aug-05 09:12:35
End Time: 11-Aug-05 12:59:35
Backup Time: Never
Last Modified: 16-Aug-05 19:08:48
Archive[2]: g:\pi\arc\piarc145.arc (Used: 99.8%)
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 101 $]::
Version: 7 Path: g:\pi\arc\piarc145.arc
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 131072 Add Rate/Hour: 77.9
Offsets: Primary: 19273/65536 Overflow: 19511/131072
Annotations: 1/65535 Annotation File Size: 1552
Start Time: 2-Jun-05 09:21:00
End Time: 11-Aug-05 09:12:35
Backup Time: Never
Last Modified: 7-Sep-05 09:41:50
Archive[3]: g:\pi\arc\piarch.011 (Used: 99.8%)
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 101 $]::
Version: 7 Path: g:\pi\arc\piarch.011
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 131072 Add Rate/Hour: 36.8
Offsets: Primary: 19473/98304 Overflow: 19740/131072
Annotations: 1/65535 Annotation File Size: 1552
Start Time: 5-Jan-05 08:15:06
End Time: 2-Jun-05 09:21:00
Page 48
3.5 - Listing Archive Record Details
Use piartool -aw to read the contents of an Archive directly from file. The key to reading
archive data this way is to understand that every PI point has a unique Record Number
(RecNo) which corresponds to a primary record in the Archive. This can be found through
piconfig or PI-SMT tools. When a new archive is created, data for each point flows into its
own separate primary record (archives are divided into fixed size records, the number of
which is either static or can grow dynamically.) When this primary record fills up, then an
overflow record is set aside for the data to flow into. The primary record points to the first
overflow record which can point to a second and so forth. It is following this chain of records
that is referred to as an Archive Walk. Finally when the number of free unused overflow
records in an archive gets down below a certain number, this is when an automated archive
shift will occur.
S StateSet
Page 50
3.6 - Estimating Archive Utilization
Index shows whether the values in the records are data values or pointers to data records,
where 0 indicates that it is NOT an index record. If they are pointers, the pointers are actually
record numbers corresponding to the start time. When events for a point exceed two records
in a single archive, an index record is created. An index record holds about 150 pointers to
data records.
RecNo (Record Number) is a read-only point attribute which contains a pointer to the point's
primary record in the archive. This is useful when using tools such as piartool -aw to
examine the archives. Do not confuse RecNo with the PointID attribute. If the point is
deleted, the RecNo will be reused but the PointID will not.
8 Int32 (all records which have the index flag set will also show datatype 8)
12 Float32
101 digital
102 Blob
Broken Pointers
In rare cases of hardware failure, record chains can become inconsistent. The archive check
utility
pidiag -archk 'path'
can be used to examine archive integrity. For more details on this pidiag command, refer to
Verify the Integrity of Archive Files on page 272.
The archive offline utility will repair any chaining problem.
The space that a fixed archive uses is completely allocated at archive creation time. Use
piartool -al to list the registered archives. For each archive an estimate of the used space is
displayed.
The piconfig utility, the PI API and the PI-SDK may be used to add, edit, or delete archive
values.
Note: Contrary to the above title “Editing an Archive”, all archive edits are first
handled by the Snapshot Subsystem. The Snapshot Subsystem performs some
security and data checks then, if appropriate, forwards the edit events to the Archive
Subsystem.
For large scale changes and repair use the Offline Archive Utility (piarchss). For example,
inadvertently moving the computer system clock ahead may cause considerable problems.
You can configure a time limit on insertion and editing of events. The Snapshot rejects events
with timestamps earlier than the limit. By default there is no limit, which is consistent with
earlier versions of PI.
To configure, add an entry to PITimeout Table:
EditDays, nnn
where nnn is the number of days (prior to current time) in which changes and additions are
allowed. The Snapshot Subsystem loads PI Timeout table parameters on startup, therefore,
this subsystem must be restarted for the changes to take effect.
To create a new archive, use piarcreate, piartool -ac, or piartool -acd. These utilities allow
you to name the new archive, specify its location, create it, and initialize it. In general, use
piarcreate for all archive creation, unless you need to specify start and end times. piartool -
ac creates a fixed size archive, piartool -acd creates a dynamic archive.
With piarcreate, you may specify the size of the archive, but you will need to do a second
step to register it. This utility creates a dynamic archive if you use the -d flag.
With piartool -ac, the created archive size matches the current Primary Archive size, and
registration is automatic. The piartool utility allows you to optionally specify the start and
end times of the new archive. Option -ac specifies a fixed size archive, -acd specifies a
dynamic archive.
Every archive has a parallel annotation file that has the extension .ann. The file is created
automatically by either utility. It must remain in the same directory as its archive file at all
times.
Page 52
3.8 - Creating Archives
Some sites may find it useful to make data available in PI that was collected prior to the PI
installation.
Several applications can be used for backfilling, including a PI API or PI-SDK application,
piconfig, or the batch file interface. This depends mainly on the way the data to be entered
into PI is currently stored.
Note: Entries that allow access to specific names or addresses override the
above “disallow”. Edit all other entries to “Disallow”. Local connections are not
affected by pifirewall entries; make applications that may write data are not
running.
3. Start PI with the -base parameter. This ensures that PI starts up with only the
minimum required subsystems.
On Windows hosts, issue the command:
pisrvstart.bat -base
4. Create and register archive files for the backfilling period (using piartool -ac or -
acd).
5. Insert one event for every point at the earliest time on-line.
6. Delete all the PointCreated events from the snapshot. This will bring into the
snapshot the old events. Steps 5,6 can be done with a PI API or PI-SDK program or
using the piconfig utility. Make sure that the old event is in the snapshot.
Page 54
3.10 - Creating a New Primary Archive
7. Backfill the archives by reading in the data In Time Sequential Order. This way the
data is compressed.
Caution: The Archive Subsystem assumes the archive end time is the most
recent time stamp written to any point. It is important to keep all current data
sources from writing to the PI Server. This is why Random, Ramp Soak,
Performance Equations, PI Total, PI Alarm, or any other interfaces cannot be
running.
8. If you used the technique of modifying the PIFIREWALL table in Step 4 above, run
piconfig to either change the hostmask value to Allow or to delete the above
hostmask altogether.
9. Start the interfaces using pisitestart.sh or pisrvsitestart.bat.
Note: An archive can be created with a start time prior to point creation time, as long
as the point exists when that archive is created. Reprocessing an old archive with
the offline utility adds to that archive all existing points, while preserving all the old
data.
2. Use piartool -ac to create and initialize back fill archives. The start and end times
must be specified (that is why piarcreate cannot be used). The start time should be
the timestamp of the oldest data to be backfilled; the end time should be just prior to
the oldest archive time specified using piartool -al.
3. Backfill the data. The data that you backfill will not be compressed, since it is prior
to the snapshot time.
4. If the backfill archive is filled before all of the backfill data is entered, you must
delete the backfill archive, and create two backfill archives, dividing the target time
range between the two, or creating a single larger archive, and then retry the data
backfilling.
In some situations it is useful to create and register a primary archive with specific start-time,
for example, when recovering from setting the time into the future, or when backfilling
archives, or after using pidiag -ar to recover from any situation of corrupted archives. To
create a new primary archive, use piartool -ac and specify the start time as required and the
end time as *. Note the following restrictions:
Registering a new primary archive will fail whenever there is a current valid primary
archive registered.
A valid primary archive must have a specified start time and null end-time, which
signifies current time.
Note: Renaming archive files is generally not necessary. If you must do this,
remember to rename the annotation file as well. Check the release notes for a
description of issues associated with archive file renaming.
Page 56
3.11 - Managing Archive Shifts
When the primary archive file becomes full, the next empty (shiftable, writeable) archive is
used to store the new data. If none of the archives are empty, the archive file with the oldest
data (which is also shiftable and writeable) is cleared and used for new data. The start time of
this archive is set to the end time of the archive file that just became full.
The process of clearing the oldest archive and preparing it to be the new primary archive is
called an archive shift. It is important that all eligible archives are backed up prior to the
archive shift to ensure that no data is lost.
When an archive is assigned a start time, it is initialized. Archives are only initialized at
installation and during an archive shift.
The archive shift process takes a few minutes to initialize a new archive file. Adding, editing,
or deleting points is not allowed during archive shift. Events sent to the Archive during an
archive shift are queued. When the shift is complete, the queued events are written to the
Archive.
registering a new empty archive automatically resolves the situation and a shift into the new
archive will occur.
Failed shifts do not cause any data loss since the archive goes into read-only mode. All
incoming data is queued in the Event Queue by the Snapshot Subsystem.
Note: The oldest shiftable archive is the oldest writable archive large enough for the
current point count. Also, dynamic archives containing data are not shiftable.
Page 58
3.12 - Combining and Dividing Archives
From a user perspective, archive files are organized according to their size and the time
ranges that they span. It is useful sometime to change the initial file organization of the
archive. The Offline Archive Utility can be used to accomplish each of the following tasks:
Combining archives with overlapping dates into one archive
Combining archives with adjacent time ranges into one archive
Dividing an archive into smaller archives, each covering a portion of the original
time span
Note: The Offline Archive Utility will not work in descending or random time order.
The end-time of the output file can be moved forward as required, but the start-time cannot be
changed after creation.
Archives with an unknown end time should be processed into a new archive to determine the
actual end time. The resulting archive can then be merged chronologically. Merging a series
of archives with overlapping dates requires processing the archive with the oldest start time
first, then process the remaining in chronological order based on the archive end times.
In this example, january.dat and february.dat do not exist prior to the operation. They are
created as dynamic archives by default. After they are created, they may be registered using
piartool -ar, and then events may be added to the archive files in the usual way. Both output
archives are not shiftable because they were created by the Offline Archive Utility as
dynamic archives.
The filter start time of january.dat is specified as 1-jan. This defaults to 1-jan, of the current
year, at 00:00:00. The filter end time is enclosed in double quotes because of the embedded
space character. The output archive start and end times are explicitly specified. Failing to
include the “-ost” and “-oet” flags will get the default behavior. See the above discussion of
output archive time settings for more information.
If the input file were registered prior to the operation, it would be unregistered during the
operation. When the operation is complete, it may be registered again using piartool -ar.
Page 60
3.12 - Combining and Dividing Archives
Note: In most cases the Event Queue is the above file. But, it is possible to have
multiple Event Queues. The utility, piartool -qs, will indicate if your system uses
multiple queues. The queue naming convention, if multiple queues are used is
pimapNNNN.dat where NNNN is a four digit integer.
Prior to version 3.4, the Event Queue was pi\dat\pieventq.dat. PI 3.4 and newer does
not support processing this format. These files should be processed before
upgrading.
Also, the memory mapped file approach introduced in version 3.4 and other
enhancements allows PI to handle out of order data much more efficiently in most
cases offline processing of the Event Queue will not be necessary.
It’s important to back up the PI Server at least once a day, so that you don't lose data and
configuration information if something goes wrong with your equipment. All backups of PI
that are done while the PI System is running are managed by the PI Backup Subsystem
(PI\bin\pibackup.exe).
Page 64
4.3 - Guidelines for Backing Up Before Upgrading
• Restart the PI Backup Subsystem, wait for all of the subsystems except for the
problematic subsystem to register for backup, and then do a backup manually.
During VSS backups, PI databases are unavailable for writes for a very brief period
of time, typically on the order of milliseconds. This time period is less than the
timeout period for write operations such as point edits. This means backups could
potentially be done several times a day without disrupting normal server operation.
Backups should not be done while configuration changes are being made since the
changes may not take effect properly.
Although the disruption from a Freeze/Thaw cycle is relatively small, unnecessary
Freeze/Thaw cycles should be avoided. It is possible to unintentionally put PI
through a Freeze/Thaw cycle if you are using a non-component mode VSS backup
application such as NTBackup to do backups on your system. If any file on a volume
is backed up with a non-component mode backup, any VSS writer that has files on
that volume will go through a Freeze/Thaw cycle. This means that PI may think that
it is being backed up when you are really backing up a file that is completely
unrelated to it but happens to share a volume that is common to the PI databases.
Before and after an upgrade, do a complete backup of the PI Server by shutting PI down and
copying all PI files to a backup medium. Follow these steps.
Make sure that your Interface Nodes are buffering your data.
Shut down PI, so that all files are closed.
Back up all files in all subdirectories under the PI directory. Since PI is not running,
you can use any standard operating system utility such as copy or tar.
On UNIX, include the /etc/piparams.default file.
On Windows, include the registry entries under
HKEY_LOCAL_MACHINE/SOFTWARE/PI System/PI.
The exact instructions for automating PI backups depend on the operating system on which
your PI Server is installed. Refer to the appropriate section for your PI Server:
Automating Backups on Windows
Automating Backups on Windows with a 3rd Party Backup Application
Automating Backups on UNIX
Page 66
4.4 - Automating PI Backups
<path> E:\PI\backup Path must be the complete drive letter and path to a
directory with sufficient space for the entire backup.
[archive cutoff date] *-10d The cutoff date is specified in PI time format. For
example, "*-10d" restricts the backup to archives
archives that contain data between 10 days prior to
current time and current time. The more restrictive
of [number of archives] and [archive cutoff date]
takes precedence.
For example, the following command installs a task to backup the primary archive, archive1,
and archive2.
PIbackup.bat e:PI\backup 3 1-Jan-70 -install
All archives contain data later than midnight on 1-Jan-70, so the number of archives to be
backed is not restricted by the cutoff date. Note, however, only archives that contain data are
actually backed up. This means that if archive1 and archive2 are empty archives, then these
archives are not backed up.
The next example installs a task to backup all archives that contain data for the last 60 days to
the current time.
PIbackup.bat e:PI\backup 99999 *-60d -install
The assumption above is that less than 99999 archives are mounted, so 99999 does not
restrict the number of archives to be backed up.
The next example installs a task to backup PI using the default number of archives and the
default cutoff date.
PIbackup.bat e:PI\backup -install
The default number of archives for backup is 3, unless otherwise specified by the
Backup_NumArchives timeout parameter (see Timeout Parameters on page 87). The default
cutoff date is “1-Jan-1970 00:00:00”, unless otherwise specified by the
Backup_ArchiveCutoffDate timeout parameter.
administering the backups. This recommendation is simply for convenience purposes for
viewing the NTBackup log file. This is discussed further in Do a Test Backup on page 69.
Scheduled tasks can be viewed and edited via the Scheduled Tasks control panel.
Alternatively, tasks can be viewed and edited via the command line.
On Windows NT and Windows 2000, the scheduled tasks can be displayed with the at
command.
C:\pi\adm>at
Status ID Day Time Command Line
-----------------------------------------------------------------
1 Each M T W Th F S Su 2:00 AM C:\PI\adm\pibackuptask.bat
c:\PI\backup." 3 "*-60d""
On Windows 2003 Server, the scheduled tasks can be displayed and edited with the schtasks
command. Although the at command is still available on Windows 2003 Server, the schtasks
command should be used instead. For example, any task created with the at command on
Windows 2003 server cannot be edited.
e:\pi\adm>schtasks
TaskName Next Run Time Status
==================== ======================== ===============
PI Server Backup 02:00:00, 7/29/2005
Page 68
4.4 - Automating PI Backups
Note: If you want to do a non-VSS backup on a platform that supports VSS, you
would alter the pintbackup.bat file to specify your preferred backup tool, either
piartool -backup or some other backup tool.
backups, the actual files will be copied to subdirectories of PI\backup\. For example,
if the original file was located in PI\dat\, the file will be backed up to PI\backup\dat\.
8. For VSS backups, run vssadmin list writers. The output should indicate that the
state of the OSISoft PI Server VSS writer is stable.
General Considerations
The following files require special treatment during a restore.
Pisubsys.cfg This file contains the full path name to the rendezvous file
piv3.rdz. This path may be incorrect if the restore is not to
the original location. There is no need to restore the
pisubsys.cfg file after a new installation because this file is
installed by the installation kit.
Piarstat.dat The piarstat.dat file contains the full path names to all of
the registered archives and database security information
for the archives. If the destination directory of the archives
to be restored is different than the original, then you may
need to generate a new piarstat.dat file with the piartool -
ar command. You will need to re-register your archives and
re-create the database security.
Page 70
4.4 - Automating PI Backups
3. Review the options for the restore from the Tools > Option menu.
4. Click Start Restore. The files should be restored to the alternate location.
5. After the restore is complete, click Report… The report should indicate that all files
were restored successfully.
Page 72
4.5 - Automating Backups on a Windows Cluster
using NTBackup is that it comes with Windows free of charge, which allows OSISoft to
provide a default backup solution without requiring a third-party backup application.
However, you might want to use a third-party backup application if, for example, you already
use a third-party backup application and you want to use the same backup strategy for all of
your applications. A second reason may be that the third-party backup application has
particular features that make it easier for you to maintain backups. However, in order to use
any third-party backup application, the backup application must support VSS backups.
One limitation of NTBackup is that it only supports non-component mode VSS backups,
which means that NTBackup cannot use the components of PI to select files for backup. A
list of file names must be provided to NTBackup via the backup selection file
PI\dat\pibackup.bks. A big disadvantage of non-component mode backups is that if any file is
backed up on a volume where there is a PI database, PI will think that it is being backed up
even though none of its files are actually affected by the backup.
Most third-party backup applications support component mode backups, which mean that the
backup application will be able to detect the PI Backup Subsystem as a registered VSS writer
and will be display the components of the PI System that are available for backup. The
backup components of PI might appear in a third-party backup application as discussed in
Selecting Files or Components for Backup on page 75.
If you are using the PI Backup Scripts for your backups, then the backups must be scheduled
to run on both nodes in the cluster. That is, the command
PIbackup.bat <path> [number of archives]
[archive cutoff date] [-install]
must be run on both nodes in the cluster. Installing the backup scripts as a scheduled task is
discussed in detail under Automating Backups on Windows on page 66. Only one of the
scheduled backup tasks will succeed at any given time because the pibackuptask.bat and
pibackup.bat files are on the shared drive.
Other than the need to schedule the backups on both nodes, backups on clustered and non-
clustered Windows nodes are the same.
Page 74
4.7 - How The PI Backup Subsystem Works
occur until all participating VSS writers have been frozen. Since the system drive is
associated with several VSS writers, you should not install PI or any of its databases on the
system drive, especially if you plan to use a non-component mode backup application to do
your backups.
You can use any third-party backup application to backup PI as long as the backup
application supports VSS. Most third-party backup applications that support VSS also
support component mode backups. At the request of a backup application the, PI Backup
System identifies the files and components of the PI System. The backup application can use
this information to display the components in a graphical user interface. If the component of a
different application is selected for backup, then the PI system will not go through a
Freeze/Thaw cycle, even if that component has files on a disk volume that is common to the
PI databases.
A backup application that supports component mode backups has the following information
available to it for display purposes.
The registered name of the PI VSS writer. The registered name is OSISoft PI Server.
The friendly name of each component. Each component has a name and description.
The component description is intended to be used as a friendly name for display
purposes.
A component path. The component path provides a means of logically organizing a
group of components. The PI Archive Subsystem is the only subsystem that has a
non-null component path.
The PI System may appear as follows in a graphical user interface of a backup application
that supports component mode backups.
Each entry in the above tree view is a friendly name of a component except OSISoft PI
Server, which is the registered name of the PI VSS writer, and PI Archive Subsystem, which
is a component path. Typically, a backup application will use different icons to distinguish
between a registered writer, a component path, and a component, but this is dependent on the
particular backup application. Also, the component path PI Archive Subsystem may not be
selectable in some backup applications because there is no component at that point in the tree.
Page 76
4.7 - How The PI Backup Subsystem Works
A user can select one or more components for backup. However, for a typical, automated
backup one should configure the backup application to backup the OSISoft PI Server as a
whole because new archive components are added after each archive shift. These new
archives will not be selected for backup by default unless the OSISoft PI Server is selected for
backup as a whole.
... … …
PIBackup
The PIBackup Subsystem has a single component called SettingsAndTimeoutParameters.
The Settings and Timeout Parameters component contains files that are owned by various
subsystems. The owning subsystems do not need to participate in backup because there is no
special need to suspend data writes to these files during a backup. The subsystems that are
associated with these files are not listed in the list of registered subsystems for backup with
the piartool -backup -query command. The file names are hard-coded in the PI Backup
Subsystem.
The files backed up with this component are:
Plicmgr
The Pilicmgr subsystem has a single component called Pilicmgr.
The files backed up with this component are:
Page 78
4.7 - How The PI Backup Subsystem Works
Pimsgss
The Pimsgss subsystem has a single component called Pimsgss.
The PI Message system contains all message log files from the PI\log directory. The message
file log names all begin with pimsg_ and end with .dat.
The files backed up with this component are:
Pibasess
The Pibasess subsystem has a single component called Pibasess.
The files backed up with this component are:
Pisnapss
The Pisnapss subsystem has a single component called Pisnapss.
The files backed up with this component are:
Piarchss
The Piarchss subsystem has a component called Archive Registry and Archive Audit
Database plus one component for each archive.
The files backed up with the Archive Registry and Archive Audit Database component
are:
Archive and Archive file names can be anything. The annotation file name is the same
Annotation (.ann) as the archive file name with “.ann” appended to it.
files for all
components
PIBatch
The Pibatch subsystem has a single component called Pibatch.
The files backed up with this component are:
Page 80
4.7 - How The PI Backup Subsystem Works
The Identify event always occurs at the beginning of every backup, but it can also occur at
any time before or during a backup. The other VSS events always occur in the order specified
in the following table.
Identify The PI Backup Subsystem requests a list of files and components from each
subsystem that participates in backups. The PI Backup Subsystem returns the
compiled list to the VSS provider. During a non-component mode backup, this
information is simply not used by the backup application.
A backup application can use the information from the Identify event to
display the components of the PI System in its graphical user interface. If the
PI Backup Subsystem takes a long time to reply to a particular VSS event, a
backup application may send an Identify event to make sure that the PI
Backup Subsystem is still alive.
There is no way for the Backup Subsystem to be able to distinguish an identify
event at the beginning of a backup from an Identify event that occurs merely
for information gathering purposes.
PrepareBackup This event signifies the start of a backup. For a component mode backup, this
event is received only if one or more components of the PI System have been
selected for backup. The PI Backup Subsystem is told which of its
components have been selected. The event is forwarded to the subsystems
that are affected by the backup. For non-component mode backups, the event
is forwarded to every subsystem that participates in backups.
When this event is received by the PI Archive Subsystem, the subsystem sets
a flag to indicate that a VSS backup is in progress. The archive backup flag as
displayed by the piartool -as command will be set to 5.
For all other subsystems, the PrepareBackup event is ignored.
Freeze Each subsystem that is participating in the backup stops writing data to its files
when it receives the freeze event. For example, any data that is sent to the PI
archives will go to the queue and will not be readable until after the thaw
event. Data that is already in the archive remains readable between the
Freeze and Thaw events. Similarly, configuration information (such as point
configuration and the module database) also remains readable.
After the PI Backup Subsystem and all other VSS writers that are participating
in the backup have indicated that all files are frozen, the VSS provider will take
a snapshot of all disk volumes that are affected by the backup.
Thaw Each subsystem that is participating in the backup resumes writing data to
each of its files. The time between Freeze and Thaw is typically on the order
of a few milliseconds and cannot be greater than 60 seconds without timing
out.
The time period between Freeze and Thaw is typically short enough so that
database configuration operations should not time out. For example, a user
should be able to edit PI points during a backup without even noticing that a
PostSnapshot No actions are taken during the PI Backup Subsystem for the PostSnapshot
event.
Backup applications back up files between the PostSnapshot and the
BackupComplete events. Although data is being written to the files that are
being backed up, the state of the files at the time the snapshot is preserved
via a difference file. The difference file is maintained by the operating system
and is completely transparent to the PI system.
After the backup is complete or aborted, the difference file is discarded.
Backup completion may take hours if large files are being copied.
BackupComplete This event indicates that a backup has completed successfully. The last
backup time will be updated for each of the PI System’s database files that
keep track of such information. A summary of last backup times can be
displayed with the piartool -backup -identify -verbose command. The last
backup time for archive files are displayed by piartool -al command.
When the PI Archive subsystem received this event, the output of piartool -as
should indicate that the archive backup flag has been reset to 0.
BackupShutdown If the PI Backup Subsystem gets the BackupShutdown event without getting
the BackupComplete event, then this means that the backup did not
complete successfully.
If the PI Archive Subsystem never receives a BackupComplete event, it will
turn its archive backup flag off if it gets the BackupShutdown event.
Page 82
4.8 - Launching Non-VSS Backups with piartool -backup <path>
Identify The PI Backup Subsystem requests a list of files and components from
each subsystem that participates in backups. The Backup Subsystem uses
the list of files to determine which files it should backup.
PrepareBackup When this event is received by the PI Archive Subsystem, the subsystem
sets a flag to indicate that a non-VSS backup is in progress. The archive
backup flag as displayed by the piartool -as command will be set to 21.
Currently, all other subsystems ignore the PrepareBackup event.
Freeze Like a VSS freeze, each subsystem that is participating in the backup stops
writing data to its files. Also like a VSS freeze, all PI databases remain
readable after the freeze event.
On Windows, each subsystem duplicates its handles for the files that it has
open so that the Backup Subsystem can copy the files. On UNIX, the
Backup Subsystem can copy the open files without a duplicate handle.
There is one Freeze event per component.
Thaw The Frozen component resumes writing data to each of its files. The time
between Freeze and Thaw can be long, especially for large archive files that
are being copied. If all selected components have been backed up, then the
BackupComplete event follows the Thaw event. Otherwise, the Freeze
event follows the Thaw event to backup the next component. There is a
delay between archive components that are backed up to allow the queue
to be emptied.
After each component is successfully backed up, the last backup time is
updated for the files of that component. This is different than for a VSS
backup, where the last backup time is updated for every component during
the BackupComplete event. A summary of last backup times can be
displayed with the piartool -backup -identify -verbose command. The last
backup time for archive files are displayed by piartool -al command.
BackupComplete This event indicates that a backup has completed successfully. When the PI
Archive subsystem received this event, the output of piartool -as should
indicate that the archive backup flag has been reset to 0. No action is taken
by other subsystems when the BackupComplete event is received.
The syntax of the piartool -backup command for starting a non-VSS backup is
piartool -backup <path> [-component <comp>][-numarch <number>
[-cutoff <date>][-wait <sec>]
where <> indicates a required parameter and [] indicates an optional parameter.
Argument Description
<path> Path must be the complete drive letter and path to a directory with
sufficient space for the entire backup.
-numarch <number> The number of archives to backup. For example, "2" will backup the
primary archive and archive1, provided that the primary archive and
archive1 contain data. In no case will an empty archive be identified for
backup. The default number of archives for backup is 3, unless
otherwise specified by the Backup_NumArchives timeout parameter.
-cutoff <date> The cutoff date is specified in PI time format. For example, "*-10d"
restricts the backup to archives that contain data between 10 days prior
to current time and current time. The more restrictive of -numarch
<number> and -cutoff <date> takes precedence. The default cutoff
date is 1-Jan-1970 00:00:00, unless otherwise specified by the
Backup_ArchiveCutoffDate timeout parameter.
-wait <sec> Wait up to <sec> seconds for the non-VSS backup to complete before
returning from the piartool -backup command. The progress of the
backup is reported every 15 seconds and when the backup is
complete, the status of the backup is reported via a piartool -backup -
query.
Page 84
4.9 - Managing Backups with piartool
non-VSS backup. If <Arg1> begins with a hyphen (-), then <Arg1> is assumed to be a backup
command. The following backup commands are valid.
-identify [-numarch The identify command reports the list of files that PI will backup. If the -
<number>] [-cutoff verbose flag is specified, PI will report a list of files and components.
<date>] [-verbose] A component is a logical grouping of files. For example, all of the files for
the base subsystem are grouped under the pibasess component. The
purpose of a component is to identify a group of files for backup.
The -numarch and -cutoff flags have the same meaning as the backup
command for non-VSS backups, which is described below.
The identify command creates a \pi\dat\pibackupfiles.bks file. This file is
used in the pibackup.bat backup script to specify the list of files to backup
using NTBackup. NTBackup is used by the backup script for performing
VSS backups on Windows 2003 Server.
Example:
piartool -backup -identify -verbose
-trace <level> Debug messages are written to the log file when the trace level is non-
zero. The higher the trace level, the more messages that are written. The
maximum number of messages is written with a trace level of 100.
Tracing should be off unless you are troubleshooting a problem to avoid
unnecessary messages in the log file. If the trace level is non-zero, the
trace level is displayed by the piartool -backup -query command.
Example:
piartool -backup -trace 1
PI Network Manager
PI Backup Subsystem
PI Batch Subsystem Registers for backup if you are licensed to use the old PI Batch
Subsystem
The other subsystems either do not have files that need to be backed up or they do not need to
be running for a backup to succeed. The above subsystems that register for backup should
appear in the list of registered subsystems in the output of the piartool -backup -query
command.
After doing a backup, the query will show information about the last backup. The following
shows an example of a query that was done after a successful non-VSS backup.
e:PI\adm>piartool -backup -query
Backup in Progress: FALSE
Last Backup Start: 29-Jul-05 02:00:04
End: 29-Jul-05 02:01:11
Status: [0] Success
Last Backup Type: FULL, NON-VSS
Last Backup Event: BACKUPSHUTDOWN
Last Backup Event Time: 29-Jul-05 02:01:22
Page 86
4.10 - Timeout Parameters
The timeout parameters that are specifically related to backup operations are reproduced here
for convenience. For a full list of all timeout parameters, see PI Server Reference.
Page 88
4.11 - Troubleshooting Backups
The NT Event Log. From the Application Log, look for messages from “VSS”,
“COM+”, and “ntbackup” sources.
The NTBackup.exe log file (VSS Backups only). If there was a problem creating a
VSS shadow copy during a backup, the reason for the failure is logged at the
beginning of the NTBackup.exe log file.
If the “Run As” user for the “PI Server Backup” scheduled task is the same as your
account, then you can view the NTBackup log from the Tools > Report… menu of
NTBackup. Launch NTBackup from a DOS command prompt and choose to run in
advanced mode.
If the PI Server Backup scheduled task was run under the system account, you must
browse to the NTBackup.exe log file with Windows explorer to the following directory.
C:\Documents and Settings\Default User.WINDOWS\Local
Settings\Application Data\Microsoft\Windows NT\NTBackup\data
If the scheduled task is run under a user name other than the system account, then replace
Default User.Winodows with the specific user name to get the path to which the
NTBackup.exe log file is written.
4.11.2 VSSADMIN
Vssadmin.exe is the Volume Shadow Copy Service administrative command line tool. You
can use the tool to view the status of the VSS writers, VSS Providers, and VSS shadow
copies on the system.
Page 90
4.11 - Troubleshooting Backups
Page 92
Chapter 5. MANAGING INTERFACES
5.1 Introduction
This chapter is split into two sections. The first section covers basic principles of interface
operation. The second section describes the basic steps involved with installing, configuring,
and administering a typical interface.
There are several manuals in addition to this document that provide general information with
regard to interface configuration and management.
PI API Installation On Windows, this manual is installed into the pipc\bin directory by
Instructions the PI SDK installation kit. The manual provides several important
post-installation details for configuring the PI API and buffering.
UniInt End User Manual Most interfaces are based on the OSIsoft Universal Interface
(UniInt) and therefore share a common set of features. Certain
UniInt features may be described in more detail in the UniInt End
User Manual document than in the interface-specific
documentation. However, not all features that are described in
UniInt End User Manual are supported by all UniInt interfaces.
PI Interface Status Utility The PI Interface Status Utility is an interface that runs on the PI
Server node. The utility writes events such as “I/O Timeout” to PI
Points that have not received values for a configurable period of
time from a particular interface.
PI AutoPointSync User Some interfaces, such as the OPC Interface, support auto-point
Manual synchronization. PI AutoPointSync (PI APS) is a utility that
synchronizes the PI Server points for an interface with the tag
definitions on the interface’s data source.
For the most part, this section discusses general interface principles that apply to interfaces
running on Windows, UNIX, and VMS. If a particular topic in this section applies to a
particular operating system, then this is mentioned up front. For example, interfaces can only
use the PI Software Development Kit (PI-SDK) on Windows, but the PI-SDK is such a
fundamental part of the PI System that it is discussed under general principles.
Page 94
5.2 - General Interface Principles
When buffering is enabled, the data flows through the interface to the buffering service and
from there to the Snapshot Subsystem on the PI Server. On Windows and UNIX interface
nodes, data is buffered with the bufserv service, which must be installed and configured
separately from the interface. On VMS, data buffering comes built-in with the interface node.
The above diagram shows the buffering application sending data to only one PI Server node.
As of PI API version 1.6, buffering supports collecting data from one interface and
distributing the data to multiple PI Servers. On VMS Interface Nodes, buffering supports data
sends to one PI Server only.
Some interfaces do not require buffering because the data source itself is buffered. For
example, the Batch File Interface and the Event File interface do not require buffering. The
interface-specific documentation should be consulted to see if your interfaces require
buffering.
If the PI Server is not available for some reason (such as an upgrade on the Server) then the
data is stored in a file buffer on the Interface Node. The size of the file buffer is configurable
(up to nearly 2GB on Windows and UNIX). When the PI Server becomes available again, the
buffering application sends all the stored data from the buffer, in chronological order, back to
the PI Server. If you then look ProcessBook, for example, your data appears as a continuous
flow of data, with no gaps.
Page 96
5.3 - Basic Interface Node Configuration
parameters and some interface specific parameters. UniInt is constantly being upgraded with
new options and features.
The steps outlined in this section describe the basic steps for interface configuration. The
steps are provided in a logical sequence for you to follow. However, there is nothing
preventing you from doing the many of the steps in a different order than specified below.
This discussion applies to VMS, UNIX, and Windows interface nodes. However, the majority
of the details are provided for Windows and UNIX Interface Nodes. Differences between the
platforms are pointed out as necessary. Also, for the most part, the configuration steps apply
whether the interface is on the PI Server Node or on a remote node. Distinctions are made as
necessary.
These basic interface configuration steps can be summarized as follows.
• Install the PI-SDK and/or the PI API
• Connect to PI with apisnap.exe
• Connect with AboutPI-SDK.exe
• Configure PI Trusts for the Interface Node
• Install the Interface
• Set the Interface Node Time
• Connect with the Interface
• Configure Points for the Interface
• Configure Buffering
• Configure Interface For Automatic Startup
• Configure Site-Specific Startup Scripts
• Configure the PI3 PointSource Table
• Monitor Interface Performance
• Configure Auto Point Synchronization
• Configure the Interface Status Utility
Page 98
5.3 - Basic Interface Node Configuration
Option 2 provides slightly tighter security. Instead of configuring the above two trusts, set up
the following trust.
• One trust based on IP address, netmask, and fully-qualified host name
In Option 2 if the IP address or fully-qualified host name changes, the trust will fail, whereas
in Option 1, it will not fail.
Page 100
5.3 - Basic Interface Node Configuration
interfaces are in. Interfaces are configured to allow writing data to the PI Server, so physical
access to the machine allows any user who can log on to that machine to run PI applications
that could write data to the PI Server and a malevolent user could use an application name for
which a trust is already configured.
Part of the complexity arises when buffering is configured on the Interface Node because a PI
Trust must be configured for the buffering application as well as the interface. For Windows
and UNIX, the buffering application (bufserv.exe) has an application name of APIBE. For
VMS, the buffering application has an application name of EXCP plus a 4-digit process
identifier.
There is additional complexity for interfaces that connect with both the PI API and PI-SDK
because the PI API and PI-SDK pass different Application Names in their connection
credentials. For example, the OPC interface uses opciE for the API and opcint.exe for the
SDK. The application name for PI API interface connections can be determined by
examining connection messages in the PI Message Log on the server, whereas the PI-SDK
uses the actual file name of the executable.
If the interface-specific documentation does not give specific instructions for setting time,
time zone, and DST, these guidelines should typically result in the correct timestamps being
set to PI. Exceptions are noted in the documentation for each interface. The most common
exception is for Foxboro Interface nodes, which must have their time zone settings set to
GMT.
Caution: In all cases, the PI Server clock should be set to its correct local time, time
zone, and DST setting.
Parameter Description
/ps=x The /ps flag specifies the point source for the interface. x
required is not case sensitive and can be any single character. For
example, /ps=P and /ps=p are equivalent.
The point source that is assigned with the /ps flag
corresponds to the PointSource attribute of individual PI
Points. The interface will attempt to load only those PI
points with the appropriate point source.
Consult the PI3 PointSource table to make sure you are not
using a PointSource that is already configured for another
interface.
/id=x The /id flag is used to specify the interface identifier. For
sometimes required example,
/id=1
The interface identifier is a string that is no longer than 9
characters in length. UniInt concatenates this string to the
header that is used to identify error messages as belonging
to a particular interface.
Many interfaces also use the /id flag to identify a particular
interface copy number that corresponds to an integer value
that is assigned to one of the Location code point attributes,
most frequently Location1. For these interfaces, one should
use only numeric characters in the identifier.
/host=host:port The /host flag is used to specify the PI Home node. host
recommended parameter is the IP address of the PI Sever node or the domain name
of the PI Server node. port is the port number for TCP/IP
communication, which should always be specified as 5450
for communication to a PI 3 server.
Page 102
5.3 - Basic Interface Node Configuration
Parameter Description
Scan If the Scan attribute is set to OFF for a UniInt based interface, the
point will be removed from the interface. This can be useful when
troubleshooting the interface.
Page 104
5.3 - Basic Interface Node Configuration
The file can be edited with a text editor. Setting buffering=0 turns buffering off. Any
changes that are made to the pihome\dat\piclient.ini will only take effect when bufserv is
restarted.
The default and maximum size limit of buffer files is 2,000,000 KB (~2GB). If there is not
2GB of disk space available, then the buffer will grow as large as possible before failing. The
maximum size limit can be set to a value less than 2,000,000 KB with the maxfilesize
parameter in the piclient.ini file. For a full list of configuration options, refer to the PI API
Installation Instructions.
The following applies to buffering for PI API version 1.6 and greater on Windows and UNIX.
In PI API version 1.6 and greater, data that is sent via the PI API can be buffered to
multiple PI server Nodes. The PI Server Nodes for which buffering is enabled is
configured in the pihome\dat\piclient.ini file in the [BUFFEREDSERVERLIST]
section. In addition to the parent process, one buffer server process will be spawned
for each buffered server specified in the list. See PI API Installation Instructions for
more details.
The connection name for the interface (usually specified in the /host parameter) must
exactly match the buffer server name configured in the pihome\dat\piclient.ini file.
For example, in order for buffering to work for a UniInt-based interface, the
IPAddress or HostName specified by the /host command line parameter would need
to be identical to a PI Server listed in one of the entries specified in the
[BUFFEREDSERVERLIST] section in the pihome\dat\piclient.ini file. The
IPAddress and HostName are not interchangeable in this case, if the IPAddress is
used in the interface and the HostName in the pihome\dat\piclient.ini file, then
interface connection via the IPAddress would be unbuffered.
Bufserv now supports event distribution to multiple PI servers. This is sometimes
referred to as n-way buffering or buffering to replicated servers. Event distribution to
multiple PI servers consists of the taking data sent to one buffered server distributing
of the same event to multiple buffer servers. The list of PI servers to receive
distributed events is configured in the [REPLICATEDSERVERLIST] section in the
piclient.ini file. The distributed event is not manipulated in any way, which means
that the event does not have the point ID or the timestamp altered. Therefore, the
replicated PI servers must all have synchronized point databases. PI servers in the
[REPLICATEDSERVERLIST] section must also be in the
[BUFFEREDSERVERLIST] section.
The following applies to versions of the PI API prior to version 1.6.
Prior to PI API version 1.6, buffering could only be enabled for the default PI Server
node. The default PI-Server node is specified in the pihome\dat\pilogin.ini on
Windows and in the pihome\dat\piclient.ini node on UNIX.
The connection name for the interface (usually specified in the /host parameter) must
exactly match the name of the default PI-Server node. configured in the
pihome\dat\piclient.ini file.
The following applies to Windows only, but it applies to all version of the PI API.
Monitoring Buffering
To ensure that buffering is functioning properly, check the interface log each day. You can
also use the buffering utility, bufutil.exe, to check the buffering service. For example,
bufutil.exe can be used to list the number of events that are currently in the buffer. When
connected to the PI server, the number of unprocessed events should generally be zero, but
may show a finite number since events are streaming through the buffers.
For version 1.6 and greater of the PI API, when bufutil.exe is started, the currently selected
buffered server is listed. There is a menu option to change the selected server.
Page 106
5.3 - Basic Interface Node Configuration
On Windows the difference between pistart.bat and pisrvstart.bat is that the former is used to
start PI interactively and the latter is used to start PI as a service. To start your interface
interactively, add a line similar to the following to pisitestart.bat.
program files\pipc\interfaces\myinterface\myinterface.bat
To start your interface as a service, add a line similar to the following to pisrvsitestart.bat.
net start myinterface
Page 108
5.3 - Basic Interface Node Configuration
In order to save the Windows Performance Counter data to PI, you must configure the PI
Performance Monitor Interface, which is available as basic or full versions. The basic version
is installed on the PI Server Node by default. You can collect performance counter data with
the interface from local and remote interface nodes. For more information, see the PI
Performance Monitor Interface documentation.
The following performance counters are available for most UniInt-based interfaces that run as
a service.
Interface up-time The number of seconds since the interface has started. This counter is
(seconds) incremented once a second.
IO Rate The number of events per second received by the interface. If this
(events/second) counter is viewed from the NT performance monitor, one should
increase the update time of the performance monitor to the minimum
scan period for the interface. For example, say that the minimum
scanning period for the interface is 5 seconds (/f=5). One can set the
Scan Time Time in milliseconds to call developer function and to write values to
(milliseconds) PI. There is one “Scan Time” counter per scan class.
Scheduled Scans: Percentage of missed scans since starting the interface. If a scan
% Missed occurs more than 1 second after its scheduled time, the scan is
considered missed. There is one “Missed Scans” counter per scan
class.
Related counters:
Scheduled Scans: % Skipped
Scheduled Scans: Scans this interval
Scheduled Scans, Percentage of skipped scans since starting the interface. If a scan
% Skipped occurs 1 scan period or more after its scheduled time, then 1 or more
scans are considered skipped. There is one “Skipped Scans” counter
per scan class.
Related counters:
Scheduled Scans, % Missed
Scheduled Scans, Scans this interval
Scheduled Scans: The total number of scans in the current performance interval. This
Scans this interval total is the current sample size that is used to evaluate the % Missed
Scans and the % Skipped scans. The performance interval is 8 hours
by default, but this can be changed by the /perf command-line
argument. The minimum performance interval is 60 seconds (see the
/perf argument for more information). When the performance interval is
exceeded, the previous samples are discarded and the sampling starts
again from scratch.
Related counters:
Scheduled Scans, % Skipped
Scheduled Scans, % Missed
Log file message count Number of messages that have been written to the log file. Only
applies to the instance _Total.
Points edited in the Number of point edits that have occurred. Only applies to the instance
interface _Total.
Points added to the Number of point that have been added to the interface. Only applies to
interface the instance _Total
Points removed from Number of point that have been removed from the interface. Only
the interface applies to the instance _Total
Page 110
5.3 - Basic Interface Node Configuration
Page 112
5.3 - Basic Interface Node Configuration
from the interface to the PI Server. For example, stale data can occur under the following
scenarios.
The interface is running but the PI API node cannot send data to the PI Server.
The interface is not running and a system digital state was not written to indicate that
the interface has been shut down. This could happen if the interface crashes.
One PI Interface Status tag is configured per monitored interface, each tag monitors a
watchdog tag collecting data from the interface. If the watchdog tag’s value on the PI
server hasn’t updated after a user specified amount of time, the PI Interface Status
tag’s status changes to a bad digital state status.
If you decide to configure the PI Interface Status Utility, then the utility is always configured
to run on the PI server Node. For more information see the PI Interface Status Utility
documentation.
Typically, PI Server is used in production systems where secure, correct, and reliable
operation is required. For this reason, a number of security mechanisms are available to
protect against both willful and accidental tampering with the system. These include:
Physical Security
Network Security
Operating System Security
PI Server Security
Firewall—Control at the IP Address Level
User Security—User Name and Password—Control for Individuals
Groups—Control for Separate Groups of Workers
Database Security—User, Group, and Access Rights to PI Point, PI User, and PI
Digital State Databases.
Point Security—for Point Attributes and Point Data
Trust-Login Security
Once a user is logged in, access is granted until the user logs out. It is not unusual for the PI
Server computer to be left unattended while a user is logged in. For this reason, physical
access to the PI Server Home Node should be restricted. It is recommended that the PI Server
computer be located in a lockable, temperature-controlled computer room with an un-
interruptible power supply.
Limiting the use of a single computer solely for data archiving can further enhance security
and reliability. Thus, it is recommended for data collection to be distributed on one or more
PI API or PINet Nodes.
Even if physical access to the PI Server computer is limited, access is available over the
network. Network security is provided through several mechanisms. On TCP/IP, access to a
given node is controlled via the host table, domain name server, or DHCP. See your
networking documentation for details.
The network router may also be configured to restrict traffic on specified subnets.
Network setup and security is very important for satisfactory PI System operation. The details
of this are broad, diverse, and beyond the scope of this manual.
The PI Server files are protected by the hosting operating system security. On all platforms,
each executable, data file, and directory may independently be given read, write, and execute
access on a per-user or per-group basis.
The System Manager’s account is called “administrator” on Windows systems and “root” on
UNIX systems. Since the System Manager’s account is central to a secure system, it is
imperative that the account password be well chosen (to guard against password guessing),
periodically changed, and known only to a small group of trusted managers.
During installation, all the PI system files are created with the system’s default security, and
are owned by the installing user. This should be the System Manager.
The System Manager may change the ownership and the access rights to these files. This
might be done to assure that only selected users can have any access to the PI system. It is
mandatory to keep full access to the System Manager and to make sure that the PI services
have full access to the PI files. It is best to keep the file ownership as the System Manager. If
tighter security is required, limit the access for group and world, and allow full access to the
System Manager and to the Administrators group.
It is typical for a PI System Manager to implement restricted access to the Data Archive and
the Point Database beyond what is provided by physical, network, and operating system
security.
In using PI Server security features, the System Manager is responsible for:
Restricting access via the PI firewall
Creating PI users accounts and groups
Assigning users to groups
Assigning an owner and a group to all databases and setting the access rights. Each
database can have a different owner and a different group.
The default owner and group is piadmin. The default access is “o:rw g:r w:r.” See
the section on Database Security below.
Note: Membership in the piadmin group does not automatically give special
privileges. The piadmin user account does give unlimited access.
Page 116
6.5 - Firewall Security
Caution: Some operations are modifying local files and cannot be done remotely.
Specifically this applies to modifications of the timeout and firewall tables.
The first level of PI access security is a firewall maintained by the pinetmgr subsystem. The
firewall allows the PI System Manager to control access to the PI Data Archive at the IP
address level.
The pinetmgr process manages all connections to PI, including subsystem connections and
TCP/IP applications. pinetmgr uses the PI Firewall Database to screen access based on the IP
address.
The database is a list of IP addresses and/or IP address masks. Each entry is associated with
the ALLOW or DISALLOW keyword, and this specifies whether or not pinetmgr completes
the connection request.
piconfig is used to maintain the PI Firewall Database.
Note: Requests from the local host (that is, the same computer on which pinetmgr
is running on) are always allowed.
Host/Mask Value
192.168.168.* ALLOW
192.168.168.67 DISALLOW
Only hosts within the 192.168.168.0 subnet are allowed connections. 192.168.168.67 is not
allowed to connect; even though it matches the first host mask.
Page 118
6.5 - Firewall Security
Note: To disallow all network connection, make sure you have an entry with
“*.*.*.*”,Disallow, and all other entries are either deleted or set to Disallow.
Note: PIconfig loads the PIfirewall table in memory; all edits are to the in memory
image. Changes are written to disk when the new table is loaded or piconfig is
exited.
Database level security controls access to the various PI server databases such as PI Point and
PI Module Database. PI Server installation sets the owners of these tables to piadmin.
Therefore, only the piadmin account can initially change the settings. After installation,
system administrators can alter the security settings to grant other users modification and
access privileges.
Following a brief description of all the security tokens in the DBsecurity table:
6.6.1 PIDBSEC
Only piadmin can change this token, which allows other users to view/change the
DBsecurity table itself. The PIDBSEC token also controls programmatic access to the
timeout table.
Other users or groups may still be assigned modify privileges in the DBsecurity table but any
changes to this token must be done by piadmin.
6.6.2 PIARCADMIN
Controls access to archive management functions: Archive creation and registration. Archive
shifts. To create new archives or change their attributes the user needs write access to this
token.
Archive backup operations require read access to this token.
Page 120
6.6 - Database Security
6.6.3 PIARCDATA
Controls access to archive data that is not point specific. Access to archive events is
controlled by individual point security. Such general data includes the list of archives
(piartool -al) archive counters, archive activity grid and cache information (piartool -as,
piartool -aag, etc.)
PIartool -aw is also controlled by this token although it does access actual archive events.
6.6.4 PIBatch
Controls the PIbatch database.
6.6.5 PICampaign
Controls the PIcampaign database.
6.6.6 PIDS
Controls the Digital States table. To create or edit sets or states the user needs write access to
this token.
6.6.7 PIHeadingSets
Controls the PIheadingsets database.
6.6.8 PIModules
Controls the creation and modifications of modules in the MDB. Note that each module has
its individual ownership and security specifications. This token controls access to the
database as a whole.
6.6.9 PIPOINT
Control the Point database. As with the MDB, there is individual point security
specifications. This token also controls access to the Point Source table.
6.6.10 PITransferRecords
Controls the creation and modification of transfer records in the MDB.
6.6.11 PIUSER
This token controls several tables: PIusers, PIgroups, PIContext and PItrust.
Note: See examples of managing the DBsecurity table in the PIconfig utility chapter
Security for points is assigned on two separate levels. Point attributes (zero, span,
descriptor, etc.) have one access level and the point data values (Snapshot and Archive data)
have another. Thus, you can have different owners and different access for point attributes
than for point data.
Note: Changing point ownership or security access is best done separately from
other point editing operations. For example, change the span and the compression
deviation first, and then change the security or the ownership.
There is not any relationship necessarily between the point owner and the point group.
Note: The user piadmin is a special user. This account is the PI System super user.
It has full access to all databases and database records regardless of security
attribute settings. piadmin is the only user that has this level of privileges.
Page 122
6.7 - Point Security
Page 124
6.8 - User Security
@table pipoint
@mode edit
@modify ptaccess=o:rw g:rw w:rw
@modify dataaccess=o:rw g:rw w:rw
@select tag="*"
@endsection
@exit
As mentioned earlier, the PI Server has its own user identification and password security.
Client applications may obtain login credentials through a PITrust login, or by passing a user
name and password. A PITrust assigns a user to the login session based on a set of
credentials; this mechanism is discussed in the next section, Trust Login Security.
To log in to the PI Server from one of the PI client applications, such as PI ProcessBook or PI
DataLink, requires a PI user name and password or a valid PITrust. The user is also assigned
to one or more groups of users.
Note: The PI Server does support PI API based logins without supplying a user
name/password or a trust. This is the “default” user access that assigns world rights
to the connection. This feature may be disabled by adding the PITimeout table entry
“DefaultUserAccess” and setting the value 0. A non-zero value or no entry allows
default user access. If default user access is disabled no secure objects may be
accessed regardless of security attribute settings.
When a user accesses the PI Server, after the request passes the PI Firewall, the user ID and
password are used to determine what access to grant.
There are three types of user access: owner, group, and world. Owner access is typically read-
write privileges. Group access is often read-only. World access is by default, none.
Two user accounts are included in the installation of PI Server, piadmin and pidemo. The
piadmin user always has read/write access to all objects regardless of access settings. This is
similar to a super user account in UNIX. The pidemo user has read-only access to all objects.
Do not delete either account. You should establish passwords for both accounts. This does
not affect the trust login process.
PI groups are defined. Every user is a member of one or more groups. This determines their
access to the various PI databases and their individual elements.
Note: To add users to groups, use the User Database, NOT the Group Database.
Page 126
6.8 - User Security
When an application needs access to the PI Archive and does not have an explicit interactive
login, you can configure an automatic Trust Login, using piconfig. This login grants access
of an existing PI user as defined in the PI User Database, based on the current connection
attributes such as the IP address, the machine name or the Operating System user name. Trust
login work by comparing the connection credentials of the connecting application to the trust
records in the Trust Database. Human intervention is not required at the time of connection.
For example, interface processes must start, connect to PI Server, and achieve access rights
with sufficient privileges to write data to the Data Archive. To permit this access, a trust
record can be created in advance on the PI Server to allow the application to assume the
privileges of a valid PI user.
The Trust Database, which is maintained by the Base Subsystem, replaces the Proxy
Database used prior to PI version 3.3. The Trust Database maintains all the functionality of
the proxy mechanism while being more secure. It permits a unified login for PI API and PI-
SDK applications that is consistent with Windows security.
PI-SDK is limited to Windows clients. PI-SDK version 1.1 can use trust logins. Earlier
versions of the PI-SDK have no trust login support.
In the following sections, you will find:
A discussion of connection credentials
How to define trust records in the Trust Database
Evaluating the match between trust records and connection credentials
Examples
Page 128
6.9 - Trust Login Security
The three types of logins are discussed more fully in the following sections. Trust records are
discussed later, followed by examples.
PIUser req
Page 130
6.9 - Trust Login Security
Before you configure records in the Trust Database, set up the entries in the User Database.
For more information, see Adding a New PI User, page 127. When you establish a new trust
record, if the PIUser you include does not already exist in the User Database, the trust record
will be rejected.
Note: Trust record with only Trust name and PIUser are not allowed. Always include
at least one optional entry.
PI Server does not allow two trust records that differ only in PIUser, because this would
create ambiguous trust login results.
Using Piconfig
Piconfig is the only tool that can modify the Trust Database. The key value of the Trust
Database is Trust.
D:\PI\adm>piconfig
* (Ls - ) Piconfig> @tabl pitrust
* (Ls - PITRUST) Piconfig> @?atr
1 - Trust String D: C:
2 - NEWTrust String D: C:
3 - AppName String D: C:
4 - Domain String D: C:
5 - IPAddr String D: C:
6 - IPHost String D: C:
7 - Netmask String D: C:
8 - OSUser String D: C:
9 - PIUser String D: C:
Suppose you wish to create a trust record that permits a PI-SDK application named
piperfmon.exe to connect as a User called Perfmon. You could name the trust record
perfmondefault. Use the following commands to create the record above:
@table pitrust
@mode create
@istru trust, appname, piuser
perfmondefault, piperfmon.exe, perfmon
Additional information about each field is given in the following sections.
Trust
The Trust field is required. It is a record name that must be unique within the Trust Table.
Any alphanumeric combination is acceptable.
AppName
A blank value indicates the match is not required. Otherwise, a case-insensitive match is
required.
For a PI API application to match the AppName, the AppName must be specified as the 4-
character application name plus an “E” at the end.
For a PI-SDK application to match the AppName, the AppName must be specified as the
filename of the application executable with file extension and without the directory path.
Domain
Windows Domain name may be used only for trust logins for PI-SDK client applications
running on Windows operating systems. The domain must be the same for the PI Server and
the connecting application.
A blank value indicates the match is not required. Otherwise, a case-insensitive match is
required.
Note: The relationship between IPAddr and Netmask in the Trust Database is the
same as the relationship between Network Destination and Netmask in a TCP/IP
routing table. The class C (24 bit) subnet is just an example—any valid subnet and
IPAddr is supported. If you use this mechanism to allow access to all addresses in a
subnet, you must set the bits corresponding to your subnet to zero.
IPHost
IPHost (sometimes called Host name or machine) is an optional field that may be used for
either PI API or PI-SDK connections. It refers to the name of the connecting machine.
Trust lookups based on IPHost are case-insensitive.
OSIsoft recommends that you verify the IPHost name as discussed below.
For PI API connections, the IPHost name is retrieved by PI Server using the IP address of the
connecting client. The lookup generally requires access to a Domain Name Server (DNS). If
a DNS is not used, the client IPHost name must be defined in the hosts table of the PI Server.
To check this name, ping the client machine from the PI Server. For example, the DNS might
provide JoePC.osisoft.com.
For PI-SDK connections, the IPHost name comes from the information sent by the client to
the PI Server. This name is the short IPHost name. You can confirm this name by running
pidiag -host on the client. For example, the name might be JoePC.
Page 132
6.9 - Trust Login Security
OSUser
The OSUser (Operating system user) name field is used only for PI-SDK applications
running within a Windows NT or Windows 2000 Domain.
Leaving this field blank indicates a match is not required. Otherwise a case-insensitive match
is required.
Because Domain must be the same for both the PI Server and the connecting PI-SDK
application, it is recommended that you include Domain whenever you want to include
OSUser.
If this field contains a dollar sign ($), it represents any domain user. If the PIUser field in the
trust record is also $, then the OSUser name must match a name in the PIUser database.
If this field contains a dollar sign ($), and the PIUser field contains a specific PIUser, then
all domain users will be granted the access rights of that PI user.
5. Type in the Domain and a User Name and then a Password (twice) or select a User
Name from the dropdown list. Click OK. In the example below, the Domain is
“OSI” and the account User Name is piperfmon. The syntax is OSI\piperfmon.
PIUser
Required field. PIUser must be a valid user defined in the PI User Database (with one
exception, described under OSUser). This field specifies the PI Server user whose privileges
will be assigned to the incoming connection when the connection credentials match the
specifications in the trust record.
Although you can choose the piadmin account for PIUser, it is preferable to reserve the use
of piadmin for installation and management of the PI System.
6.9.3 Evaluating the Match Between Trust Records and Connection Credentials
When connection credentials are compared to the Trust Database, each trust record is
considered. If only one record matches exactly, that record will be used to grant login. If
more than one record contains matching fields, then the record that matches most closely will
be used.
If incoming PI API connection credentials do not match any trust record, the application is
granted the default access rights, which is equivalent to having world access to any system
object. Whether points can be accessed depends on the Point Security configured for each
point.
Page 134
6.9 - Trust Login Security
If incoming PI-SDK connection credentials do not match any trust record, then the default
user for that server as configured on the caller’s machine is tried with a blank password. If
that fails, the PI-SDK application is not connected.
103 IP address
103 IPHost
101 Subnet
For example, whenever the Base Subsystem is shutdown for backups, existing connections
are maintained, but no new PI API connections are accepted. Interfaces and PI API BufServ
will attempt reconnections, typically every sixty seconds. Once the Base Subsystem is
running again, new connections can occur.
Page 136
6.9 - Trust Login Security
6.9.7 Examples
The PI Server compares incoming connection credentials with every Trust Login record.
Each field in a trust record is compared to the corresponding credential field. Every field that
is not blank in the Trust Record must exactly match the passed credentials. Otherwise, the
authorization is not granted. When an authorization is refused for one trust record, the PI
Server continues to search the other records until it has exhausted the possibilities.
You can create explicit individual trust records for each interface or you can group them
according to subnet, host machine, or username. A group of interfaces can share the same
privileges, based on matching a name in the User Database.
As explained previously, if IPAddr and Netmask fields are blank, they appear as 0.0.0.0.
Trust APIIF1
Domain Domain
Netmask 0.0.0.0
OSUser OSUser
PIUser IFGroupA
Trust SDKIF1
Domain Domain
Netmask 0.0.0.0
OSUser OSUser
PIUser IFTypeB
Page 138
6.9 - Trust Login Security
Example 4. Any PI API Application from a Specific Remote Node with a Fixed
IP Address
The following example creates a trust record that would match any PI API application from a
remote PI API node or VMS-based PINet remote data collection node with a fixed IP
address.
The trust record would allow the interface from a data source to write to the PI Server, just as
the former Proxy Database did. Assume the entry in the User Database will be IFUser1.
@table pitrust
@mode create
@istru Trust,IPAddr,Netmask,PIUser
MyTrust1,206.79.198.12,255.255.255.255,IFUser1
@endsection
Trust NT/2000/XP
Netmask 0.0.0.0
PIUser IFTypeC
The set of credentials at the right is sent by a PI-SDK application on Windows. This example
has Domain OSI and User Suzanne logged on to machine Gerke at IPaddress
192.168.168.121 running an application called piperfmon.exe.
Note: If you specify either a domain or OSUser in the trust record, the PI Server
must be in the same domain as the connecting application.
In this case, the credentials match the information in the trust record, because only Domain
OSI was specified in the trust record. The application would be granted access to PI as the
user IFTypeC. For greater restriction, you might also specify the application name and/or
OSUser name or IP Addr.
Note: If you specify a domain or OSUser in the trust record, the PI Server must be in
the same domain as the connecting application.
Using this feature requires a Trust Record with OSUser set to “$” and PIUser set to “$”.
Other fields are optional. The operating system for the client application must be Windows.
This trust would not authorize any PI API application or any PI-SDK application on
Windows 98.
Trust MatchUserName
Page 140
6.9 - Trust Login Security
Netmask 0.0.0.0
PIUser $
In the example above, if the User Database contains a user named Perfmon, the trust will be
granted.
Whenever there is a record in the User Database that matches the entry in OSUser, the trust
is granted.
You could restrict the trust record further by specifying more fields, such as IPHost, subnet,
or AppName.
Trust Matchmachine
Netmask 0.0.0.0
PIUser OSI
In Row A, the trust IPAddr and the Trust Netmask are blank. The “ANDed” result is also
blank; these fields are ignored in the matching process.
In Row B, when you combine Trust Netmask with Machine IPAddr, you get a 0 in the last
field; this matches the Trust IPAddr. Use this when you want to authorize any PC on a
subnet. See Example 8. In Row C, the third field does not match (168, 175).
In Row D, the “ANDed” result of 240 and 178 is 176, and thus, matches the Trust IPAddr. In
Row E, the “ANDed” result process does not match. This type of Netmask restricts matching
to certain IP addresses on a network subnet.
Row F and G illustrate the situation described in Example 9. Using IPAddr and Netmask to
Specify a Particular Address.
Page 142
6.9 - Trust Login Security
above in Row F. Similarly, the results of the credential IPAddr and the Netmask in Row G is
not an exact match for the trust IPAddr and the trust is not authorized.
Trust Matchmachine
Netmask 255.255.255.255
PIUser OpsPC15
Trust SubnetC1
Netmask 255.255.255.0
PIUser SubnetC1User
Page 144
6.10 - Resolving Ambiguities
The PI Server weighting factor for the OSUser field is higher than the weight of the IPHost
field. Consequently, the connecting application would receive the trust login for User6.
Trust AddedFirst
AppName
Domain OSI
IPAddr 192.168.168.0
Netmask 255.255.255.0
IPHost
OSUser
PIUser UserA
Now suppose you add another trust record called NewNetmask and point to UserB like this:
Trust NewNetmask
AppName
Domain OSI
IPAddr 192.168.168.0
Netmask 255.255.255.240
IPHost
OSUser
PIUser UserB
The PI Server would accept the NewNetmask Trust Record because the two NetMask fields
are different.
Notice that the IPAddr in both records has “0” in the last field.
The first Netmask has a 24-bit Netmask, the second has a 28-bit Netmask. Unfortunately, any
match with NewNetmask would also match with AddedFirst.
There is no predictable rule as to which trust will be assigned if ambiguous Trust Records are
created in the database.
Page 146
Chapter 7. MOVING PI SERVERS
PI Servers are designed for platform independence. All the databases and tables are stored in
a format that allows you to move a Server to a different computer or a different location on
the same computer. The programs and scripts themselves are platform-specific so a proper
installation is needed for any host platform.
This chapter provides the information necessary to move a Windows- or UNIX-based PI
Server. To move a VMS-based PI Server, you must first migrate it to either Windows or
UNIX. Refer to the OSIsoft support Web site for details on migrating VMS Servers.
These instructions assume that the PI Server System that is being moved is release 3.2 or
greater. If your PI System is an earlier release, upgrade it before continuing.
7.1 Preparation
Before attempting to move a PI Server, ensure that the PI Server and all related processes
have been stopped. Make a backup copy of the entire PI Server and all of the archive files (if
they do not reside in the PI directory.) On UNIX hosts, back up the /etc/piparams.default file.
On Windows hosts, back up the Registry.
To move a PI Server onto a different computer, you install the PI Server software on the new
computer and then copy the databases, tables, and archives over to the new PI Server. This
section describes the steps for moving the PI Server and explains which files and directories
you need to copy to the new Server.
This section refers to the original PI Server as the source and to the new PI Server as the
target. The pihome directory is the top-level PI directory (C:\PI\ for example). These
instructions use the backslash (\) for path names, but the steps are the same for all platforms.
Before starting the procedure below determine if there are any tags with a Snapshot value
before the start time of the Primary Archive. Set the shutdown attribute to 0 for these tags.
When the target PI system is first started, setting shutdown to 0 for these points will prevent -
11043 errors because only the primary archive will be registered.
To move the PI Server:
1. Perform a new installation on the target (new) host using the same release and build
number as the source (original) host’s PI Server. Select the default archive sizes
during the installation, because you delete them anyway, in one of the following
steps. Ensure that the new PI Server is functional before you continue to the next
step.
2. Identify the Primary Archive on the source PI Server using the administrative utility
pidiag -ad or piartool -al or the Archive Manager plug-in in the PI System
Management Tools (SMT).
3. Stop both the source and target PI Servers.
4. Copy the entire pihome/dat directory from the source PI Server to the pihome/dat
directory of the target PI Server, excluding the following files:
• Pisubsys.cfg
• PISysID.dat (you can include PISysID.dat if you are moving the server to a
computer with the same host name and IP address as the original server.)
• Archive files
This overwrites most of the files in the target PI Server dat directory.
5. Copy the entire pihome/log directory from the source PI Server to the pihome/log
directory of the target PI Server.
6. Copy the pipeschd.bat file from the pihome\bin directory of source PI Server to the
pihome\bin directory of the target PI Server.
7. Delete the target PI Server’s archives and copy the source PI Server’s primary
archive to the desired location on the target PI Server.
8. On the target PI Server, update the archive location file (piarstat.dat) by running the
pidiag -ar utility. Specify the full path to the copied Primary Archive when
prompted.
9. Restart the new PI Server and verify that it is working correctly.
10. Move and register the remaining archive files. This should be done while the new PI
Server is running.
11. Move or install any platform or site specific interfaces or programs as needed.
12. Back up the new PI Server once it is stable.
Moving the install location of a PI Server is nearly identical to moving from one computer to
another. The procedures are identical except for the following steps:
1. Isolate your PI Server from the network. This will force buffering of data on the
interface nodes.
2. Run piartool -qs monitor until the Event Queue is empty.
3. Run piartool -al redirecting the output to a text file. This is a record of all registered
archives.
Page 148
7.3 - Same Computer
All PI Servers are identified by a ServerID. The Server ID is stored in the binary file
PI\dat\PISysID.dat. The ID is used to uniquely identify a PI Server; basically, it augments the
PI Server's host computer's name. For example, a PI Point may only be uniquely identified by
including all four of these parameters:
Server ID
Computer Name (the computer name is the handle as set in the Known Servers table)
Tag Name
Point ID
Originally the PI System ID was assigned at system installation with an algorithm the used
the computer name to generate a 32-bit integer. This approach could create ambiguous IDs—
two unique computer names could generate the same ID. PI Servers with 32-bit IDs must
continue to use these IDs otherwise client applications that reference the ID may not be able
to resolve resources.
PI Servers installed starting with version 3.3.?.? use GUIDs for the System ID. This ID is
assigned at PI Server installation and is guaranteed to be unique.
Note: The 32-bit ID is still generated on the PI Server for legacy purposes. For
example, PI API based applications may only support the 32-bit ID.
The Server ID is only an issue when you move or copy the PI Server to another computer.
There are three basic scenarios:
1. Moving to a new host computer and retiring the original computer as described in
Moving PI Servers on page 147. In this case the Server ID file is copied to the new
computer as part of the moving process. No other action is needed.
2. Copying the PI Server to a new machine where the copy may be accessed
simultaneously with the source PI Server. In this case, although the data may be
nearly indentical, the two PI Servers must be assigned unique ID values. Therefore,
the copied PI Server must have a Server ID different from the source PI Server. This
is kept unique by not overwriting the Server ID file on the destination server; that is,
keep the Server ID file that was created on initial PI Server installation on the
destination server. In this scenario, the two servers are unique: ProcessBook displays
that target the source PI Server will not resolve against the destination server.
3. Copying the PI Server to a new machine that will not be accessed simultaneously
with the source PI Server. This scenario is used when it is desirable to access the
destination PI Server with existing displays, etc., created against the source PI Server.
Client applications that attempt to access both machines will have problems: the PI-
SDK knows the server table will be ambiguous. Attempting to do this is not
supported and will result in confusion.
In summary:
Copy the source PI Sever ID file to the destination PI server if the source PI Server is
being retired.
Leave the destination PI Server ID file in place if the source and destination PI Server
may be accessed simultaneously.
Note: The existence of two PI Servers with the same ID is problematic. This
approach should only be used in special circumstances. Specifically, attempts to
access both servers from the same client machine will result in confusing problems.
Page 152
Chapter 9. MERGING TWO PI SERVERS
The offline archive utilities can be used to merge two PI Server Systems. A merge is used
when a PI Server System is to be retired and the data from the retired system is preserved in
an existing system. The basic steps and an example merger follow.
Transfer Points
Install all points from the retired system onto the destination system.
Cutover Interfaces
At this time, interfaces feeding data to the retired system should be stopped. If appropriate,
restart the interfaces pointing to the destination system. If the interfaces are restarted against
the destination system, check interface output for errors--address any problems before
proceeding.
On the retired system run pishutev to put shutdown events into the Snapshot. This will force
the Snapshot value into the Archive.
Page 154
9.1 - Server Merging - Procedures
The following example retires a small NT Intel PI System and merges it with an existing
HPUX PI System. Both systems consist of example points provided with installation. The
tags on the retired system were edited to create unique tags.
Here is the archive list and point list of each system before starting the merge:
Retired System
BA:Active.1
BA:CONC.1Retired
BA:LEVEL.1Retired
BA:PHASE.1Retired
BA:TEMP.1Retired
batchid-1Retired
CDEP158Retired
CDM158Retired
CDT158Retired
piba1
pipe:sine2Retired
pipe:sine2tRetired
pipe:sine3Retired
pipe:sine4Retired
pipe:sine5Retired
pipe:sineRetired
pitot1Retired
pitot2Retired
pitot3Retired
pitot4Retired
pitot5estRetired
pitot5rampRetired
pitot5Retired
pitot5runRetired
pitot6countRetired
pitot6timeNERetired
pitot6timeRetired
pitot_1Retired
pitot_avgRetired
pitot_maxRetired
pitot_minRetired
productid-1Retired
sin:h2Retired
sin:hourRetired
SINUSOIDRetired
SINUSOIDURetired
t_minRetired
t_state1Retired
Archive: D:\PI\dat\piarch.002
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21 $]:
Version: 4 Path: D:\PI\dat\piarch.002
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Page 156
9.2 - Server Merge Procedure - Example
Destination System:
BA:ACTIVE.1
BA:CONC.1
BA:LEVEL.1
BA:PHASE.1
BA:TEMP.1
batchid-1
CDEP158
CDM158
CDT158
piba2
pipe:sine
pipe:sine2
pipe:sine2t
pipe:sine3
pipe:sine4
pipe:sine5
pitot1
pitot2
pitot3
pitot4
pitot5
pitot5est
pitot5ramp
pitot5run
pitot6count
pitot6time
pitot6timeNE
pitot_1
pitot_avg
pitot_max
pitot_min
productid-1
sin:h2
sin:hour
SINUSOID
SINUSOIDU
test1
test10
test11
test12
test13
test14
test15
test16
test17
test18
test19
test2
test20
test3
test4
test5
test6
test7
test8
test9
t_min
t_state1
Archive: /opt/PI/dat/piarch.001
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21
Version: 4 Path: /opt/PI/dat/piarch.001
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 59/512 Overflow: 2037/2048
Start Time: 2-Mar-98 12:21:11
End Time: Current Time
Backup Time: Never
Archive: /opt/PI/dat/piarch.002
PIarcfilehead [$Workfile: piarfile.cxx $ $Revision: 21
Version: 4 Path: /opt/PI/dat/piarch.002
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 2048
Offsets: Primary: 1/512 Overflow: 2047/2048
Start Time: Current Time
End Time: Current Time
Backup Time: Never
Archive: /opt/PI/dat/piarch.003
Page 158
9.2 - Server Merge Procedure - Example
Page 160
9.2 - Server Merge Procedure - Example
26,26,pitot_avgRetired
27,27,pitot_maxRetired
28,28,pitot_minRetired
12,12,productid-1Retired
16,16,sin:h2Retired
14,14,sin:hourRetired
1,1,SINUSOIDRetired
2,2,SINUSOIDURetired
15,15,t_minRetired
17,17,t_state1Retired
The text file requires modification. The PI Batch tag, piba1, cannot be migrated and
therefore, must be removed. Here are the contents after the edit:
9,9,ba:active.1Retired
8,8,BA:CONC.1Retired
7,7,BA:LEVEL.1Retired
10,10,BA:PHASE.1Retired
6,6,BA:TEMP.1Retired
11,11,batchid-1Retired
5,5,CDEP158Retired
4,4,CDM158Retired
3,3,CDT158Retired
34,34,pipe:sine2Retired
35,35,pipe:sine2tRetired
36,36,pipe:sine3Retired
37,37,pipe:sine4Retired
38,38,pipe:sine5Retired
33,33,pipe:sineRetired
18,18,pitot1Retired
19,19,pitot2Retired
20,20,pitot3Retired
21,21,pitot4Retired
25,25,pitot5estRetired
24,24,pitot5rampRetired
22,22,pitot5Retired
23,23,pitot5runRetired
29,29,pitot6countRetired
31,31,pitot6timeNERetired
30,30,pitot6timeRetired
32,32,pitot_1Retired
26,26,pitot_avgRetired
27,27,pitot_maxRetired
28,28,pitot_minRetired
12,12,productid-1Retired
16,16,sin:h2Retired
14,14,sin:hourRetired
1,1,SINUSOIDRetired
2,2,SINUSOIDURetired
15,15,t_minRetired
17,17,t_state1Retired
Page 162
9.3 - Shut Down the Retired System
Reactor1Retired,XYZ3,Green,3-Mar-98 12:24:23,12:44:00
At this point we have piconfig text files of the point and batch databases and the ID
conversion text file. This is required to reproduce the point and batch configuration on the
destination system. Before shutting down the retired system, stop the interfaces and other data
sources, write shutdown events to all the points, and force a shift.
In this example, all interfaces are on the localhost rather than a remote node. On your system,
make sure any API node and PINet node interfaces are shut down. Also shut down
PI Totalizer, PI PE Scheduler, and PI Batch Subsystems.
Before forcing the shift, make sure an empty archive is available for the shift.
Here is the dialog from these steps:
D:\PI\adm>pisrvsitestop
D:\PI\adm>echo Stopping Site Specific PI System Services...
Stopping Site Specific PI System Services...
D:\PI\adm>..\interfaces\rmp_sk\rmp_sk -stop
Stopping service rmp_sk
rmp_sk Stopped Successfully.
D:\PI\adm>..\interfaces\random\random -stop
Stopping service random
.
random Stopped Successfully.
D:\PI\adm>net stop pibatch
The PI Batch Subsystem service is stopping....
The PI Batch Subsystem service was stopped successfully.
D:\PI\adm>net stop pitotal
The PI Totalizer service is stopping...
The PI Totalizer service was stopped successfully.
D:\PI\adm>net stop pipeschd
The PI Performance Equation Scheduler service is stopping..
The PI Performance Equation Scheduler service was stopped successfully.
D:\PI\adm>..\bin\pishutev -verbose
Shutdown input file: D:\PI\dat\shutdown.dat.
Shutdown events will be written for tag mask *
Point attributes:
shutdown, 1
Shutdown Events at 3-Mar-98 11:04:09 sent for 37 Points
Service Manager requested shutdown of pishutev
D:\PI\adm>piartool -fs
Attempting to force an archive shift...
An archive shift has been initiated on the server.
Completion time will vary from a few minutes to hours,
depending on the machine and archive size. During this
time the archive subsystem will be unavailable and the
PI System should not be stopped until the shift is
complete.
Page 164
9.3 - Shut Down the Retired System
Page 166
9.3 - Shut Down the Retired System
enough space for all used records in both archives being combined. If in doubt use dynamic
archives--they can always be moved into a fixed size archive later.
In the following dialogs, the ID conversion file is not required:
$ ../bin/piarchss -if /opt/PI/dat/piarch.001 -of
/opt/PI/dat/piarchcomb.001
PIarchss offline archive utility
Input file type: PI 3
Archive input file: /opt/PI/dat/piarch.001
Beginning first pass. Sorting input archive.
Archive indicated start time: 2-Mar-98 12:21:11
Archive indicated end time: 3-Mar-98 16:32:27
Archive indicated recordcount: 2048
Processing record 1 ...
Primary record load completed.
Records processed: 97
Records with data: 86
Empty records: 11
Records with errors: 0
Records out of time range: 0
Records with duplicate time range: 0
Overflow record load completed.
Records processed: 101
Records with data: 101
Empty records: 0
Records with errors: 0
Records out of time range: 0
Records with duplicate time range: 0
Begining Output pass. Output archive: /opt/PI/dat/piarchcomb.001
Processing record 1 ...
19260 Loaded in 1( 0 + 1 ) Seconds 19260 Event/Sec.
101476 Archive Total seconds - ratio: 101476
Service Manager requested shutdown of piarchss
Now combine the converted archive.
$ ../bin/piarchss -if /opt/PI/dat/piarchconv.002 -of
/opt/PI/dat/piarchcomb.001
PIarchss offline archive utility
Input file type: PI 3
Archive input file: /opt/PI/dat/piarchconv.002
Beginning first pass. Sorting input archive.
Archive indicated start time: 2-Mar-98 12:51:41
Archive indicated end time: 3-Mar-98 11:09:30
Archive indicated recordcount: 395
Processing record 1 ...
Primary record load completed.
Records processed: 97
Records with data: 26
Empty records: 71
Records with errors: 0
Records out of time range: 0
Page 168
9.3 - Shut Down the Retired System
$ piconfig
* (Ls - ) PIconfig>
* (Ls - ) PIconfig> @Input piarc.dif
* (Ls - PIARC) PIconfig> sinusoidRetired,2-mar-98,*,
*> sinusoidRetired,2-mar-98,*,
87.71619,GOOD,2-Mar-98 13:37:56
99.23527,GOOD,2-Mar-98 14:39:56
96.20524,GOOD,2-Mar-98 15:44:56
75.77717,GOOD,2-Mar-98 16:57:56
14.20552,GOOD,2-Mar-98 19:31:26
1.545739,GOOD,2-Mar-98 20:31:26
1.869217,GOOD,2-Mar-98 21:31:26
18.17325,GOOD,2-Mar-98 22:40:56
86.39859,GOOD,3-Mar-98 01:33:26
99.15742,GOOD,3-Mar-98 02:38:56
96.37012,GOOD,3-Mar-98 03:43:56
75.96362,GOOD,3-Mar-98 04:57:26
14.35799,GOOD,3-Mar-98 07:30:56
0.7647065,GOOD,3-Mar-98 08:39:56
3.794814,GOOD,3-Mar-98 09:44:56
24.22295,GOOD,3-Mar-98 10:57:56
Digital State,Shutdown,3-Mar-98 11:04:09
Digital State,Pt Created,3-Mar-98 14:29:48
98.3448,GOOD,3-Mar-98 14:30:26
98.2471,GOOD,3-Mar-98 15:30:26
82.16194,GOOD,3-Mar-98 16:39:56
79.05913,GOOD,3-Mar-98 16:48:56
End Repeat...
Take a good look at several points before proceeding.
The piconfig utility maintains and configures PI Server databases such as the Point Database
and the Digital State Table.
The piconfig command line application runs on the PI Home node. You can work
interactively with piconfig or you can supply text files that contain commands and data.
Using piconfig, point information can be configured in a spreadsheet or database tool,
exported to a text file, and then applied to the Point Database.
The piconfig utility can also be used for troubleshooting. If you suspect that you have some
tags that are not configured correctly, you can search for tags that match a certain list of
attributes.
While piconfig is often used for building PI points, there are other utilities that can be
obtained from OSIsoft to make this task easier:
PI Tag Configurator, is an Excel spreadsheet add-in that can facilitate creating
many new tags and modifying the attributes of existing tags in the Pipoint Table.
The PI System Management Tools (PI SMT) includes a PI Point Builder Plug-in
which is useful for editing or creating a small number of tags. PI SMT is available
from the Download Center at the technical support web site, and documentation is
included in the online Help file.
The piconfig utility includes the features of the PIDIFF utility of OpenVMS PI Systems. It
also includes many more features, such as the ability to edit tables other than the Point
Database.
Conversion information for upgrading from PI2 to PI3 may be found on the OSIsoft Web
site.
Page 172
10.3 - Key Concepts for Using Piconfig
The tables PI_Gen, PISubsys, PISubsysStats, PIThread and DBsecurity all require a second
argument. This argument specifies the owner subsystem, or, for PI_Gen, the actual database
file.
Status Commands
The current setting of piconfig can be viewed using the status command.
Page 174
10.3 - Key Concepts for Using Piconfig
10 compressing BYTE D: 1 C: 1
11 creationdate TimeSta D: 2. C: 17-Nov-02 18:39:5
12 creator String D: C:
13 DataAccess String D: o:rw g:r w:r C: o:rw g:rw w:rw
14 DataGroup String D: piadmin C: piadmin
15 DataOwner String D: piadmin C: piadmin
16 descriptor String D: C: 12 Hour Sine Wave
17 DigitalSet String D: system C:
18 displaydigits BYTE D: -5 C: -5
19 engunits String D: C:
20 excdev Float32 D: 1. C: 1.
21 Excdevpercent Float32 D: 1 C: 1.
22 excmax Uint16 D: 600 C: 600
23 excmin Uint16 D: 0 C: 0
24 exdesc String D: C:
25 PointID Uint32 D: 0 C: 2009
26 pointsource String D: Lab C: R
27 pointtype String D: Float32 C: Float32
28 PtAccess String D: o:rw g:r w:r C: o:rw g:rw w:rw
29 PtClassName String D: base C: classic
30 PtGroup String D: piadmin C: piadmin
31 PtOwner String D: piadmin C: piadmin
32 Recno Int32 D: 1 C: 116
33 scan BYTE D: 1 C: 1
34 shutdown BYTE D: 1 C: 1
35 SourceTag String D: C:
36 span Float32 D: 100. C: 100.
37 step BYTE D: 0 C: 0
38 typicalvalue Float32 D: 50. C: 50.
39 zero Float32 D: 0. C: 0.
Each of the table attributes can be viewed, set, or modified. Conceptually, each table in the
piconfig utility has several columns, where the column headers are the attributes. Each row is
a table record. For the PIpoint Table, each row corresponds to a particular tag.
10.3.5 Records
Piconfig views its tables as a collection of records. A record is a collection of fields or
attributes. One of these attributes is the primary key, which uniquely identifies the record
within the current table. This data representation is done for convenience and standardization.
It is not always an accurate image of the actual data.
Consider the following entries in the Snapshot Table:
CDM158 Auto 14-Jun-03 10:39:34
SINUSOID 68.973 14-Jun-03 10:00:00
SINUSOIDU 11.184 14-Jun-03 11:04:00
Attributes
In this example, there is a record for each Snapshot, and each record contains three attributes.
The attributes in this example are tag, value, and time.
Primary Key
Every record contains one attribute that is defined as the primary key, which uniquely
identifies the record. The primary key is the first attribute listed when using the ?atr
command.
When using the select command to specify a record, the primary key must always be used. If
it is not specified piconfig assumes * (all records). Other attributes may be selected in
conjunction.
For example, the primary key for the Pipoint Table is tag. When selecting the subset of tags
with point source F, the primary key needs to be included as follows:
@select tag=*, pointsource=F
Note: Some tables do not support renaming of records, for example piarc and
pisnap tables. Tag is the primary key of these tables. Since Tag is actually a point
attribute, the rename must be down from the pipoint table. Other tables have similar
relationships.
Page 176
10.3 - Key Concepts for Using Piconfig
10.3.7 Mode
Within piconfig, there are six possible working modes, as follows:
(Ls) List mode (read only) Output formatted records from a table to screen or file
(Cv) Convert mode Convert input data from one format into another
Create or Edit
The character t (for true) may be specified with either create or edit mode. This combines the
create and edit modes such that existing records are modified as specified while non-existent
records are created as specified:
@mode create, t
@mode edit, t
The specified mode persists until the next mode command is issued.
Page 178
10.3 - Key Concepts for Using Piconfig
Check Only
The character c (for check) may be specified with either create or edit mode.
@mode create, c
@mode edit, c
In this mode points are validated and errors are reported but no changes are made to the point
database.
For all other tables this mode is identical with the normal edit or create mode.
Check mode can also be specified for Create/Edit.
@mode create, t, c
@mode edit, t, c
The specified mode persists until the next mode command is issued.
Delimited Format
In delimited format, one or more lines of comma-separated attributes describe the format of
the data. One or more lines of comma-separated data values follow. These lines correspond to
the attributes. For example:
@istructure tag, pointsource,pointtype
SINUSOID,R,FLOAT32
As shown above, the command is preceded by the command character (@) while the data are
not.
Note: The same delimiter character is used between piconfig attributes, between
elements of a piconfig command and between both input and output data fields.
Fixed Format
In fixed format, we describe the data structure by one or more lines specifying the attribute,
line number, starting position on the line (counting from 1), and field width. One or more
lines of data values that correspond to the given format follows. For example:
@istructure tag, 1, 1, 12
@istructure pointsource, 1, 14, 1
@istructure pointtype, 1, 19, 7
*
*234567890123456789
SINUSOID R FLOAT32
NEXTPOINT Lab FLOAT16
The lines starting with the asterisk (*) are comment lines and are ignored. Their only purpose
is to improve readability.
The format lines come first and are all grouped together. This defines a record. If there are
more data lines than are specified in the record, piconfig interprets these as additional records
of the same format. This example shows two input records.
Fixed format is the same as used in the OpenVMS PI System PIDIFF utility.
Keyword Format
In keyword format, every input line contains only two parts: the attribute and the value for
that attribute, separated by the delimiter character. The default delimiter character is a
comma ( , ).
The istructure command is not used with this format, as each line contains both data and its
description. For example:
tag, SINUSOID
pointsource, R
pointtype, FLOAT32
To select output attributes in keyword format, use the ostructure command. A single
attribute is specified on each line, as shown below:
Page 180
10.3 - Key Concepts for Using Piconfig
@ostructure tag
@ostructure pointsource
@ostructure pointtype
To output all attributes for the current table, issue the command:
@ostructure *
This works in both keyword and delimited formats.
10.3.10 Operators
The following comparison operators are available:
= equal
<> not equal (!= also works)
> greater than
>= greater than or equal to
< less than
<= less than or equal to
These operators can be used for date, numeric or text fields. Text comparison is based on
ASCII values.
10.3.11 Wildcards
Wildcards, * and ?, may be used in text fields. * matches all characters; ? matches a single
character.
10.3.13 Endsection
The endsection command triggers the processing of selected records. It is not always
necessary to use an endsection command. An endsection is assumed when the end of file is
reached or when a command follows lines of data.
When an input structure is specified, every record is processed as data is entered.
The following example demonstrates how processing occurs in both ways:
d:\pi\adm>piconfig table pisnap
* (Ls - PISNAP) piconfig> ostru tag,value,time
*> ostru tag,value,time
* (Ls - PISNAP) piconfig> @sele tag=sinusoid
* (Ls - PISNAP) piconfig> @ends
SINUSOID,86.71634,20-Nov-02 16:25:30
* (Ls - PISNAP) piconfig> @istru tag
* (Ls - PISNAP) piconfig> sinusoid
*> sinusoid
Page 182
10.3 - Key Concepts for Using Piconfig
sinusoid,86.71634,20-Nov-02 16:25:30
10.3.14 Exit
Exit is the command that terminates the piconfig session. It is not necessary to use this
command when running piconfig in batch mode because the end of file causes piconfig to
execute the current commands and then exit. Quit and Bye has the same effect.
Page 184
10.3 - Key Concepts for Using Piconfig
Redirection of Output
An alternative is to use standard UNIX or Windows I/O redirection from the command line:
$ piconfig < list.inp > list.out
Note: The PI_Gen tables are accessed only on the local machine. Even during a
remote session. This means that modifying PI_Gen tables must be done locally.
Attempting to modify these tables during a remote session will produce a warning
message.
Case Flag All (case- Sets case-sensitivity-ignore mode. Flag may be:
insensitive Data, Names, or All.
) This affects only tables accessed vie the PI_GEN
table – i.e. timeout and firewall.
Echo Flag Data Specifies if input commands and data are echoed
to the output file. Flag may be: Data, Commands,
All, Verbose or None.
Page 186
10.4 - Piconfig Commands and Tables
Exit None None Exits piconfig. (Quit and Bye work the same way.)
Ostructure Structure None Specifies format of output data. Only useful when
in list mode. A warning is issued if this command is
used in mode edit, create, or delete.
Output File None Redirect output to file. If <file> not specified, the
output is directed back to standard output.
Ptclassname Classname Base Specifies the point class: base or classic. Pipoint
Table only.
STYP Structure Type Delimited Set structure type. Valid types are Delimited,
Keyword, and Fixed.
Page 188
10.4 - Piconfig Commands and Tables
Page 190
10.4 - Piconfig Commands and Tables
Note: Changing existing attribute sets – except for changing default values, should
be done with great care, in standalone mode.
Attribute Description
Note: An attribute set has many of the “Attrib, Default, Type” triplet. The ellipsis (…)
following “TYPE” indicates those three may be repeated.
The following piconfig session demonstrates listing the attribute sets on the PI Server:
* (Ls - PIATRSET) PIconfig> @table piatrset
* (Ls - PIATRSET) PIconfig> @ostr set
* (Ls - PIATRSET) PIconfig> @ends
*PIConfig Err> Wild-card specs. missing, default to '*'.
alarmparam
base
classic
sqcalm_parameters
totals
* (Ls - PIATRSET) PIconfig>
Now listing the entire classic then base attribute sets; note use of the ellipsis to repeat the
output:
* (Ls - PIATRSET) PIconfig> @table piatrset
* (Ls - PIATRSET) PIconfig> @ostr attrib, default, type
* (Ls - PIATRSET) PIconfig> @ostr ...
* (Ls - PIATRSET) PIconfig> @istr set
* (Ls - PIATRSET) PIconfig> classic
*> classic
location1,0,Int32
location2,0,Int32
location3,0,Int32
location4,0,Int32
location5,0,Int32
filtercode,0,Int16
squareroot,0,Int16
totalcode,0,Int16
convers,1.,Float32
srcptid,0,Int32
instrumenttag,,String
userint1,0,Int32
userint2,0,Int32
userreal1,0.,Float32
userreal2,0.,Float32
* End Repeat...
* (Ls - PIATRSET) PIconfig> base
*> base
descriptor,,String
exdesc,,String
typicalvalue,50.,Float32
engunits,,String
zero,0.,Float32
span,100.,Float32
pointtype,12,UBYTE
pointsource,Lab,String
scan,1,BYTE
excmin,0,Uint16
excmax,600,Uint32
excdev,1.,Float32
shutdown,1,BYTE
archiving,1,BYTE
compressing,1,BYTE
step,0,BYTE
compmin,0,Uint16
compmax,28800,Uint32
compdev,2.,Float32
creationdate,31-Dec-69 16:00:00,TimeStamp
creator,0,Uint16
changedate,31-Dec-69 16:00:00,TimeStamp
changer,0,Uint16
displaydigits,-5,BYTE
* End Repeat...
Users familiar with classic PI Points will recognize all these attributes. These two attribute
sets, Classic and Base, make up the classic point class.
Note: Editing existing Point Classes should be done with great care – in standalone
mode.
Page 192
10.4 - Piconfig Commands and Tables
Attribute Description
SET The attribute set where attribute in the class were defined. This attribute is only
used in create mode. It is used to specify the attribute sets which comprise the
point class.
The following piconfig session lists the point classes on the server:
* (Ls - PIPTCLS) PIconfig> @ostr class
* (Ls - PIPTCLS) PIconfig> @ends
*PIConfig Err> Wild-card specs. missing, default to '*'.
Alarm
base
classic
SQC_Alarm
Totalizer
Now listing classic point class; this class is built from the classic and base attribute sets:
* (Ls - PIPTCLS) PIconfig> @tabl piptcls
* (Ls - PIPTCLS) PIconfig> @mode list
* (Ls - PIPTCLS) PIconfig> @ostr attrib,default,type
* (Ls - PIPTCLS) PIconfig> @ostr ...
* (Ls - PIPTCLS) PIconfig> @istr class
* (Ls - PIPTCLS) PIconfig> classic
*> classic
descriptor,,String
exdesc,,String
typicalvalue,50.,Float32
engunits,,String
zero,0.,Float32
span,100.,Float32
pointtype,12,UBYTE
pointsource,Lab,String
scan,1,BYTE
excmin,0,Uint16
excmax,600,Uint32
excdev,1.,Float32
shutdown,1,BYTE
archiving,1,BYTE
compressing,1,BYTE
step,0,BYTE
compmin,0,Uint16
compmax,28800,Uint32
compdev,2.,Float32
creationdate,31-Dec-69 16:00:00,TimeStamp
creator,0,Uint16
changedate,31-Dec-69 16:00:00,TimeStamp
changer,0,Uint16
displaydigits,-5,BYTE
location1,0,Int32
location2,0,Int32
location3,0,Int32
location4,0,Int32
location5,0,Int32
filtercode,0,Int16
squareroot,0,Int16
totalcode,0,Int16
convers,1.,Float32
srcptid,0,Int32
instrumenttag,,String
userint1,0,Int32
userint2,0,Int32
userreal1,0.,Float32
userreal2,0.,Float32
* End Repeat...
* (Ls - PIPTCLS) PIconfig>
Attribute Description
Code The internal code, used for point source update signup
The following piconfig session lists the point sources on the server:
* (Ls - PIPTSRC) PIconfig> @ostru ptsrc,code,count,desc
* (Ls - PIPTSRC) PIconfig> @ends
*PIconfig Err> Wild-card specs. missing, default to '*'.
#,15,26,
*,13,1,
1,7,5589,
9,2,11,
?,14,1,
@,10,4,
Page 194
10.4 - Piconfig Commands and Tables
C,4,22,
G,9,18,
L,3,15,
Lab,5,4056,
PIBatch-InternalUse-1,11,2,
PICampaign-InternalUse-1,19,1,
PITest,16,1,
PIUnitBatch-InternalUse-1,8,109,
R,1,9865,
T,6,15,Totalizer Points
U,12,2,
Attribute Description
The default set is called system and contains all the default system states found in a PI2.x
Digital State Table. The System Digital State Set number, SetNo, is 0 (zero).
Once created, a digital state set cannot be deleted.
PHASES
MODES
Page 196
10.4 - Piconfig Commands and Tables
Subsequent lines are treated as input until the next piconfig command is issued.
Note: For sets with more then a few states it is advisable to use an output file, edit
the file, and then use it as input file. As mentioned above, the state must be added or
edited as a whole. See the following explanation about editing the system set.
system
0,??????????
1,
2,?2
3,
4,?4
@istru set
@istru state
@istru ...
system
??????????
""
?2
""
?4
Both examples show only the first 5 states in the system set, and in both cases states 1 and 3
are blank.
Page 198
10.4 - Piconfig Commands and Tables
BATCHACT
PHASES
MODES
VALVESTATESET
(Ls - PIDS) piconfig> @mode edit
(Ed - PIDS) piconfig> @istru set,newset
(Ed - PIDS) piconfig> ValveStateSet,NewValveStateSet
(Ed - PIDS) piconfig> @mode list
(Ls - PIDS) piconfig> @ostructure set
(Ls - PIDS) piconfig> @select set=*
(Ls - PIDS) piconfig> @endsection
SYSTEM
BATCHACT
PHASES
MODES
NEWVALVESTATESET
Value
Page 200
10.4 - Piconfig Commands and Tables
Annot Annotation
To read Snapshot data, use list mode. To change the data, use edit mode. Other modes are not
applicable.
If a numerical Snapshot value is invalid, the PI Server shows the value as “Digital State” and
the status attribute shows the digital state that describes the status. If a numerical value is
valid, the actual value is shown and the status attribute shows the digital state “GOOD.”
To change a digital point value, you can specify either the digital state name or the numeric
offset (digital state number.)
The file pisnap.dif is included with every system. It is a quick way to list Snapshot values.
$ piconfig input pisnap.dif
* (Ls - PISNAP) piconfig> @sele tag=c*
* (Ls - PISNAP) piconfig> @ends
CDEP158,2,GOOD,20-Nov-02 17:02:00
CDF144,Digital State,No Data,20-Nov-02 17:11:42
CDM158,Manual,GOOD,20-Nov-02 17:09:30
CDT158,53.03498,GOOD,20-Nov-02 17:10:00
A second table named Pisnap2 is useful for debugging classic PI API applications. It uses the
PI 2.x concepts rval and istat instead of Value and Status:
Attribute Description
ISTAT Positive integer value for integers, status for invalid real values, or set and state
number for digitals.
In PI 2.x, istat for digital tags is the negative of the state number. In the Pisnap2 Table, istat
contains a 32-bit number that represents both set and state. The set number is in the most
significant 16 bits and the state number is in the least significant 16 bits. The system set
number is 0. Be aware that some PI API functions truncate the most significant 16 bits. Refer
to the PI Server Reference Guide, Appendix B, PI API Limitations, for more information.
String values cannot be used in Pisnap2 Table.
Table and are sent directly to the Archive. You can only view the most recent event in the
Snapshot Table.
The tagname, time stamp, and value must all be specified. The time can be in any of the valid
PI time formats specified in the PI Server Reference Guide, Appendix A.
Select the Snapshot table and prepare for editing.
(Ls - ) piconfig> @table pisnap
(Ls - PISNAP) piconfig> @mode edit
Specify the format of the input data.
(Ed - PISNAP) piconfig> @istruc tag, time, value
The following lines are input data.
RealTag, 13-Aug-03 10:00, 3.81
RealTag, 13-Aug-03 10:05, 2.45
IntTag, *, 5
DigTag, T+8h, CLOSED
Page 202
10.4 - Piconfig Commands and Tables
Value
Annot Annotation
These attributes are the same as the Pisnap attributes. In addition there are some auxiliary
attributes that affect retrieval and editing:
Attribute Description
Starttime and endtime can define both a forward and a backward search.
Events can be added to the Snapshot using the Piarc Table. Events are placed in the Snapshot
if they are more recent than the current Snapshot event; otherwise, they bypass compression
and go straight to the Archive according to the archiving mode specified. When a new
Snapshot event is stored, the previous Snapshot event is sent to the archive, compressed
according to the compression specifications.
Attribute Description
EVEN Interpolated events. The number of evenly spaced events returned between
starttime and endtime is given by the “Count” parameter.
Attribute Description
replaceSp Replace a specified value when multiple values at the same time
appendx as append + no compression; that is, if this is the Snapshot, force into Archive
Note: Do not confuse the Piarc Table mode attribute with the piconfig mode
command. To delete archive events, use the Piarc Table mode attribute=remove in
piconfig edit mode.
Page 204
10.4 - Piconfig Commands and Tables
Note: In remove mode, both value and time must exactly match the existing event. If
the timestamp contains sub-seconds, it might be necessary to expand time
resolution with the timf command in order to make an exact match.
Similarly, the number of decimal digits might need to be increased for floating point
values using the sigd command.
@table piarc
@mode edit,t
@istructure tag, value, time, mode
string1,some text,11:45, append
realtag,12.5,10:44, replace
inttag, 10, t, remove
When adding a new archive event with the edit modes above, you must use:
@mode edit,t
or
@mode create,t
The piconfig selection and modification may be used. For example one might create an input
file (input.txt) with the following command lines
@istructure tag, starttime, endtime, count
@ostructure tag, value, status, time
@ostructure ...
@output labevents.txt
labtag,t,y,100
then redirect this input file into piconfig in order to list some events to an output file called
labevents.txt:
* (Ls - PIARC) piconfig < input.txt
Now one can change or delete all these events. For example:
@mode edit
@istructure tag, value, status, time
@modify value*= 1.1, mode=replace
@input labevents.txt
This will increment all the previously selected events by 10%.
To delete all events for a specified time range (last 7 days in this example) for a given tag you
can place the script below in a file called delevents.dif.
@table piarc
@mode list
@istructure tag, starttime, endtime, count
@ostructure tag, time, value
@ostructure ...
@timf 9
@sigd 9
@output tmpdelevents.dat
%1%,%2%,%3%,10000
@output
*@exit - uncomment this to exit and review before deleting
@mode ed,t
@modify mode=remove
@istructure tag, time
@input tmpdelevents.dat
@exit
Then invoke piconfig as follows:
* (Ls - PIARC) piconfig input delevents.dif,mytag,t-7d,t
Note, in order for the input file and it’s parameters to be taken as one parameter, it’s
important to have no spaces between parameters, as show in the example. Also, note that this
script will delete up to 10000 events, but it can be changed in the script.
Changing Events when there are Multiple Events at the Same Time
The following commands show how to modify a specific value out of several at the same
time using replacesp mode. Note the use of NewValue attribute.
The replace mode would cause the last value at the time to be replaced.
* (Ed - PIARC) PIconfig> @input piarc.dif
* (Ls - PIARC) PIconfig> rpflt1,*,y,100
*> rpflt1,*,y,100
123.,GOOD,24-Jun-03 17:43:01
1123.,GOOD,24-Jun-03 01:00:00
112.,GOOD,24-Jun-03 01:00:00
11.,GOOD,24-Jun-03 01:00:00
1.,GOOD,24-Jun-03 01:00:00
* End Repeat...
* (Ls - PIARC) PIconfig> @mode edit,t
* (Ed - PIARC) PIconfig> @istru tag,value,newvalue,time,mode
* (Ed - PIARC) PIconfig> rpflt1,11,0.11,t+1h,replacesp
*> rpflt1,11,0.11,t+1h, replacesp
* (Ed - PIARC) PIconfig> @input piarc.dif
* (Ls - PIARC) PIconfig> rpflt1,*,y,100
*> rpflt1,*,y,100
123.,GOOD,24-Jun-03 17:43:01
1123.,GOOD,24-Jun-03 01:00:00
112.,GOOD,24-Jun-03 01:00:00
0.11,GOOD,24-Jun-03 01:00:00
1.,GOOD,24-Jun-03 01:00:00
* End Repeat...
Page 206
10.4 - Piconfig Commands and Tables
To set the number of sub-second digits to 4 and turn on time zone information display, you
would enter the command:
@timf 4,t
The time zone information displayed with every Snapshot and archive timestamp is the short
label of time zone and current standard/daylight status. For example, in Pacific Standard
Time, this label would be PST. You can check the labels for your time zone with the pidiag -
tz command.
If you issue the timeformat command with the number of sub-second digits only, time zone
information display will be turned off.
Note: The default time accuracy of 5 digits might compromise a sub-second time-
stamp. Expand to 6 or 7 digits before editing or deleting such events.
Using Annotations
Since release 3.3, piconfig supports annotation to archive values, in both pisnap and piarc
tables. We recommend using piconfig only for reading annotations. Annotations should be
added using PI-SDK applications that are designed for that purpose.
Attribute Definition
UNITNAME Defines the UNIT name. UNITNAME is the primary index of the Pibaunit
Table.
Cannot include the \ character.
Attribute Definition
DataAccess Security attribute, which specifies access to batches created on the unit.
EvalDelay Specifies delay, from batch start, before evaluating product and batch ID
expressions.
MergeConsecutive If non-zero, treats short batch stop and restarts as one contiguous batch.
Page 208
10.4 - Piconfig Commands and Tables
Attribute Description
Alias Unit name and attribute. The syntax for alias names in this table is:
\\unitname\attribute.
Attribute Description
BID Batch ID
ProdID Product ID
NEWUnitName Changing the unit on which a batch is run by altering attribute is not supported.
Note: The PI Batch Subsystem refers to the older PI Server Batch support. The PI
Module and PI Batch Database approach is replacing the PI Batch Subsystem. The
PI SDK contains the best documentation of the Module and Batch Databases.
Note: This table has no real primary key since there is only one record.
The set of attributes available on this table varies with the platform type. The table attributes
are:
IDNumber Unique ID of Computer UNIX (Not all versions of UNIX support this
attribute)
Page 210
10.4 - Piconfig Commands and Tables
Attribute Description
The bytes and messages received and sent refer to all inter-process communications.
Attribute Description
PIPath PI Server root directory on the server. This item is the same for all connections.
Page 212
10.4 - Piconfig Commands and Tables
Attribute Description
Page 214
10.4 - Piconfig Commands and Tables
Attribute Description
The description attribute is used to specify any type of user information, such as address or
title. The user may be added to multiple groups.
Note: Users are assigned to groups using the Piuser table. Attempting to change
the group membership of users via the pigroup table has no affect.
Attribute Description
Attribute Description
PoolName Every thread belongs to a thread-pool. We are mainly interested in the RPC
thread pool, which serves client calls to a subsystem.
Note: The PIThread table is primarily a monitoring tool. We recommend using it only
with in-depth understanding of threads. Specifically, avoid using it for any
modification or thread creation.
Attribute Description
Page 216
10.4 - Piconfig Commands and Tables
Attribute Description
Owner PI user name declared to be the owner of the table. Defaults to Piadmin.
The following examples shows how to access and modify the DBsecurity table.
C:\pi\adm>PIconfig table dbsecurity
* (Ls - DBSECURITY) PIconfig> @ostru dbname, owner,group,access
* (Ls - DBSECURITY) PIconfig> @ends
*PIconfig Err> Wild-card specs. missing, default to '*'.
PIARCADMIN,PIadmin,PIadmin,o:rw g:r w:r
PIARCDATA,PIadmin,PIadmin,o:rw g:r w:r
PIBatch,PIadmin,PIadmin,o:rw g:r w:r
PICampaign,PIadmin,PIadmin,o:rw g:r w:r
PIDBSEC,PIadmin,PIadmin,o:rw g:r w:r
PIDS,PIadmin,PIadmin,o:rw g:r w:r
PIHeadingSets,PIadmin,PIadmin,o:rw g:r w:r
PIModules,PIadmin,PIadmin,o:rw g:r w:r
PIPOINT,PIadmin,PIadmin,o:rw g:r w:r
pisnapss,PIadmin,PIadmin,o:rw g:r w:r
PITransferRecords,PIadmin,PIadmin,o:rw g:r w:r
PIUSER,PIadmin,PIadmin,o:rw g:r w:r
* (Ls - DBSECURITY) PIconfig> @mode ed,t
* (Ed - DBSECURITY) PIconfig> @istru dbname, owner,group,access
Modify the access to archive data and allow the operator group
* (Ed - DBSECURITY) PIconfig> PIARCDATA,PIadmin,operators,o:rw g:rw w:
*> PIARCDATA,PIadmin,operators,o:rw g:rw w:
Modify the access to base subsystem auditing and thread table
* (Ed - DBSECURITY) PIconfig> pibasess,PIadmin,operators,o:rw g:rw w:r
*> pibasess,PIadmin,operators,o:rw g:rw w:r
Modify the access to Update Manager thread table (no auditing in Update Manager)
* (Ed - DBSECURITY) PIconfig> piupdmgr,PIadmin,operators,o:rw g:rw w:r
*> piupdmgr,PIadmin,operators,o:rw g:rw w:r
* (Ed - DBSECURITY) PIconfig> @mode list
* (Ls - DBSECURITY) PIconfig> @ends
*PIconfig Err> Wild-card specs. missing, default to '*'.
PIARCADMIN,PIadmin,PIadmin,o:rw g:r w:r
PIARCDATA,PIadmin,operators,o:rw g:rw w:
pibasess,PIadmin,operators,o:rw g:rw w:r
PIBatch,PIadmin,PIadmin,o:rw g:r w:r
PICampaign,PIadmin,PIadmin,o:rw g:r w:r
PIDBSEC,PIadmin,PIadmin,o:rw g:r w:r
PIDS,PIadmin,PIadmin,o:rw g:r w:r
PIHeadingSets,PIadmin,PIadmin,o:rw g:r w:r
PIModules,PIadmin,PIadmin,o:rw g:r w:r
Attribute Description
Any field specified as NULL string (“”), is ignored when incoming connection are matched
against the table.
Domain, IPHost, AppName, and OSUser must be specified exactly or not at all.
IPAddr and NetMask must be specified together. If you provide a value for one, you
must also provide the other.
PIUser must always be specified as either a currently existing PI user in the User
Database or as a dollar sign ($). The dollar sign must be paired with a $ in either
OSUser or IPHost. If the trust matches incoming credentials and there is no PIUser
Page 218
10.4 - Piconfig Commands and Tables
with the same name, an error occurs at run-time. This method of specification
matches any user or any machine that passes the domain controller validation of their
login credentials.
Note: Piconfig cannot access remotely the General Tables, only on the local
machine. However, the SMT tools have remote access.
PI Timeout Database
This table contains the PI Server timing parameters as well as many other configurable
parameters. Adjustment of these parameters should be done by the PI Server Administrator.
Select this table using the command:
@table PI_GEN, pitimeout
The primary key is NAME. The table attributes are:
Attribute Description
PI Firewall Database
This table is used by the System Manager to control general access to the PI Server by
network address.
Select this table using the command:
@table PI_GEN, pifirewall
The primary key is HOSTMASK. The table attributes are:
Attribute Description
Attribute Description
PI Proxy Database
As of release 3.3, the Proxy Database is no longer in use. During upgrade, its contents are
converted to PI Trust Database records.
10.5.1 Abbreviations
All piconfig commands can be abbreviated to four characters.
10.5.2 Case-sensitivity
In UNIX systems, program and file names are case-sensitive. This includes HP-UX, Digital
UNIX, Solaris, and AIX.
Windows program and file names are case preserving, but not case-sensitive.
The piconfig commands, attribute names and table names are not case-sensitive, but the data
are case-sensitive. The case-sensitivity on PIGEN tables may be changed for both of these
parameters by using the case command.
Page 220
10.5 - Helpful Hints
Note: A field containing the delimiter character must be quoted. A field that starts
with a quote should be quoted using the other type of quote. A field that starts with
one type of quote and contains the other type as well should be quoted, and the
embedded quotes must be escaped. ?
When the output from piconfig is used in another session or by another program such as
Excel, make sure that fields containing the delimiter character are quoted (on output). Using
the quote command does this:
@quote "
or
@quote '
Page 222
10.5 - Helpful Hints
Mode: List
Characters: Command: <@> Delimiter: <,> Comment:<*> Quot:<>
Struc. Type IN: <Delim.> OUT: <Delim.>
Error count: 3 Max: 10
Curent table: <PIPOINT> Cur. Prim.: <> Def. Prim: < >
Nesting level : 0
Node: <127.0.0.1,piadmin>
Page 224
Chapter 11. PI TROUBLESHOOTING AND REPAIR
Data passes through many steps on the way into and out of the Archive. The main strategy to
apply when troubleshooting is to determine which parts of the data path are malfunctioning,
and also, which parts are functioning correctly.
The first step is to isolate the problem to a single computer, either client or server, or to the
network. Follow the steps in the Troubleshooting Checklist to isolate the problem area. A
table of error messages is available in Appendix A: PI Messages on page 281.
The second step is to isolate the problem further to a particular client program or PI
subsystem. See Verifying PI Processes on page 228, and PI System Data Files on page 235,
for help with this.
The third step is to determine the exact cause of the problem. This will lead to a good
understanding of what is needed to fix the problem, repair the damage, and prevent a
recurrence. If needed, go to the Repairs section to repair data files such as Archives or Point
Database.
After working through the Troubleshooting Checklist, you may still not have resolved your
problem. In this case, you will want to call OSIsoft Technical Support for some help. The
technical support engineer will ask for some key information and also may ask to dial into
your system in order to do some hands on troubleshooting.
3. If there is a client problem, check security. Log in as the user piadmin. Check the
setup.log and pipc.log files in the c:\pipc\dat directory. Also check the server central
log file using the pigetmsg utility. A table of error messages is available in Appendix
A: PI Messages on page 281. If a trend in PI ProcessBook “flatlines,” see the section
on p. 255.
4. If there is a server problem, verify that all PI processes are running.
On Windows, type
net start
at the command prompt to list all processes running as Services.
On UNIX, use the piverify.sh utility.
PI Systems may take several minutes to start; loading the Point Database, Snapshot
and Archives takes most of the time. Utilities, such as piartool and piconfig, are not
fully operational until startup has completed.
5. Even if the process is listed as running, it may be in a state where it is not
communicating with pinetmgr. Verify that each PI process is communicating
properly by using the utilities listed in the Verifying PI Processes section below.
6. Try to get the exact error message. Error numbers may be translated to text using:
pidiag -e <errno>
There is a list of error messages in Appendix A: PI Messages on page 281.
7. Note the time of the problem and which subsystems have stopped running. Inspect
the message log using the pigetmsg utility, and the individual process log files. See
Appendix A: PI Messages on page 281.
8. On Windows, try running with pistart.bat, rather than as Services. There may be
additional status messages displayed in the command windows that may be helpful.
9. On HP-UX, verify SHLIB_PATH environment variable is defined correctly. It
should point to the directory /opt/PI/lib.
10. On Solaris, verify LD_LIBRARY_PATH environment variable is defined correctly.
It should point to the directory /opt/PI/lib.
11. If a subsystem crashes, there may be additional information that would be useful to
our developers.
Dr. Watson is the default just-in-time debugger for Windows systems. To install Dr.
Watson as default debugger, run the following command: drwtsn32.exe -i
Dr. Watson process traps unhandled process exceptions, also known as process
crashes. Dr. Watson captures the process state on crash and writes details to
drwtsn32.log. Optionally the entire process image is written to user.dmp. The
location of these files, as well as other Dr. Watson behavior, is configurable. Running
drwtsn32.exe interactively starts the configuration dialog. Recommended settings are
as follows:
• Log File Path: Default location is recommended.
Page 226
11.1 - Troubleshooting Checklist
• Crash Dump: Default name is recommended. Note this file may be over written;
after a process crash copy this file to a safe location.
Number of Instructions: 25
Number of errors to save: 25
Crash Dump Type: Full
Dump Symbol Table: Select
Dump All Thread Contexts: Select
Append to Existing Log File: Select
• Visual Notification: Do not select. Servers typically run unattended; therefore,
there is no user to see the notification.
Sound Notification: Do not select.
Create Crash Dump File: Select
On UNIX systems, look for a file called core in the PI\bin or PI\adm directories. This
is a binary file.
These files are useful only if they were created while running a debug version of PI.
Debug versions are not shipped by default. OSIsoft Technical Support will arrange
for a download of a debug build of PI if necessary.
12. If you have a pinetmgr problem, use:
netstat -a
to determine if there is any other process talking on port 5450. If so, this indicates
that at one time pinetmgr was communicating successfully.
You may need to use piconfig to adjust the timing parameters in the PITimeout
Table. Refer to the section called Tuning the PI System later in this chapter.
13. If you have an Archive or Snapshot problem, use the piartool -as and piartool -ss
utilities to gather more information about the data flow.
14. Next, try retrieving a Snapshot three different ways; the combined results of all three
tests helps pinpoint the source of the problem:
• apisnap from a remote node (uses API + network)
• apisnap from the home node (uses API)
• piconfig < pisnap.dif from the home node (uses internal communication)
To determine if the Archive has been corrupted, use piartool -aw.
15. If this is an Update Manager problem, use the pilistupd utility to see which processes
are signed up for events.
16. Determine if the problem is with all points on all interfaces or just a few points on
some interfaces.
17. Each PI System is distributed with a standard set of points including SINUSOID,
CDEP158, and CDM158. Each PI System is distributed with the Random and
RampSoak Simulators.
18. If this is an interface problem on a remote node, check security. There must be an
entry in the PI Trust Table for that node or specifically for that interface. Also check
the Firewall database. Check the individual interface log files as well as the central
log file using the pigetmsg utility. See Appendix A: PI Messages on page 281. If an
API interface is not able to connect, be sure that the PI Base Subsystem, PI Archive
Subsystem, and PI Snapshot Subsystem are running.
19. If an installation or upgrade problem, check the log file:
• UNIX - /tmp/piinstall.log
• Windows – PIPC\dat\SetupPIServer.log and PIPC\dat\PIServerMaster.log. See
the Getting Started manual for more information.
20. Check ownership and execute permissions on files that are giving trouble. Try
running as Root (UNIX) or Administrator (Windows). If the trouble goes away when
you run as the System Administrator, then you have a permission problem.
21. Read the PI release notes to determine if this is a known problem. Another source of
information is the OSIsoft Technical Support Web site, http//techsupport.osisoft.com,
which has technical notes posted.
If you haven’t solved the problem after working through this checklist, you will need to
phone or email OSIsoft Technical Support.
When PI is running, all of the PI processes should be running. When PI is stopped, all of the
PI processes should be stopped. The exception is pishutev, which only runs briefly at PI
startup.
Even if a process is listed as running, it may be in a state where it is not communicating with
pinetmgr. You can verify that each PI process is communicating properly by using the
utilities outlined in this subsection.
Page 228
11.2 - Verifying PI Processes
11.2.4 Pimsgss
All PI processes send messages to the PI Message Subsystem process, which writes messages
to the PI Message Log.
A simple way to test pimsgss is to run the pigetmsg utility. If pimsgss is not working
correctly, you will see the following:
D:\PI\adm>pigetmsg
Message ID [A], (0-n) (A)ll (T)ail (F)lush (Q)uit (?):
Message Source [*], (?):
Start time in PI format [*-15m], s(K)ip (?):
End time in PI format [*], s(K)ip (?):
Maximum count [], (0-n) (?):
Text mask [*], (?):
Display count [], (0-n) (?):
[-10733] PINET: RPC Resolver is Off-Line.
At PI System startup, there is a short time when pimsgss is not yet running. During this time,
and at any other time when pimsgss is not functioning, PI Systems running on Windows will
direct messages to the system event log. You can read this messages using the Event Viewer
application in the Administrative Tools group. When the pimsgss starts, it will merge
messages from the Windows Event Log into the PI Server Message Log.
The behavior on UNIX differs from the above. PI Systems running on UNIX will send
messages to the individual subsystem ASCII message logs in the PI/log directory when the
pimsgss is not available. These are:
Pinetmgr.log
Pibasess.log
Piarchss.log
Pibackup.log
Pisnapss.log
Piupdmgr.log
Random.log
Rmp_Sk.log
Pipeschd.log
Pibatch.log
Pishutev.log
PIsqlss.log
Pitotal.log
Pialarm.log
$ piconfig
* (Ls - ) piconfig> @table pipoint
*PIConfig Err> Table initialization error (PIPOINT
*@table pipoint
*[-10733] PINET: RPC Resolver is Off-Line
Page 230
11.2 - Verifying PI Processes
$ piartool -ss
Getsnaptablestatistics Failed: [-10733] PINET: RPC Resolver is Off-Line
$ pisnap.sh
PI API version 1.3.9.4
Attempting connection to localhost:5450
Enter tagname: sinusoid
Error: pisn_getsnapshotsx 3745992
Error: piar_getarcvaluex 3745992
Error: piar_getarcvaluesx 100
Tag = SINUSOID Point Number = 1 Type = Real-32
13 Hour Sine Wave!
Snapshot value
Value = ERROR ERROR
Status = ERROR
Latest archive value
Value = ERROR ERROR
Status = ERROR
Archive events are queued when piarchss is not operating correctly. The Event Queue count
is visible from B and piartool -qs.
11.2.9 Pishutev
This PI Subsystem inserts shutdown events into the PI Archive. Although it runs on PI start,
the shutdown events are time stamped with the previous shutdown time. PIShutev exits after
completion; therefore, this process will not be present on systems that have been running for
a while.
Page 232
11.3 - UNIX Process Quotas
pistop_ss.sh piarchss
pistart_ss.sh piarchss
Alternatively, the kill -2 command can be used to stop any PI process. The following
example shows how piarchss is stopped and restarted.
$ cd /export/PI/adm
$ ps -upiadmin
PID TTY TIME COMMAND
9313 ? 0:00 bufserv
834 ttyp4 2:16 random
9335 ? 0:00 iorates
794 ttyp4 0:22 pibasess
1507 ttys1 0:00 ps
760 ttyp4 10:31 PIsnapss
9330 ? 0:00 ioshmsrv
12578 ttyp4 0:00 ksh
726 ttyp4 0:05 pimsgss
777 ttyp4 4:03 piarchss
9320 ? 0:01 mqsrv
9325 ? 0:00 mqmgr
836 ttyp4 0:00 rmp_sk
743 ttyp4 0:09 piupdmgr
709 ttyp4 870:48 pinetmgr
838 ttyp4 0:02 pipeschd
1492 ttys1 0:00 ksh
$ kill -2 777
$ ../bin/piarchss &
[1] 1508
$
Some UNIX systems set process quotas unsuitable for servers. These quotas are used to keep
rogue applications, such as student projects, from monopolizing system resources such as
memory. In general, for systems dedicated as a server, most limits can be set to maximum.
Two key UNIX parameters should be reviewed.
Maximum data segment. This is the maximum private virtual memory size of a
process. The PI Archive and Base Subsystems are memory-intensive. The value of
this parameter should be set to 2 gigabytes, the maximum for 32-bit computers.
Max files/descriptors. This number is the maximum number of file handles or
descriptors a process may open; including TCP/IP connections. This value should be
set well above the maximum number of PI Server connections expected.
If your system has a large process count, you may see errors recorded in the PI Message Log
that report conditions such as no more processes and no more file handles. This can be caused
by a maximum process count limit that is too low. The quota may seem sufficient, but UNIX
often uses spawned processes for operations such as logging in, listing files, network
communications, or just leaving Window sessions open and idle.
Here are some observed behaviors that may be caused by insufficient process count:
Archive shift not completing
PI Archive Subsystem fails to resume normal operations after a shift
Subsystems lose connection with the PI Network Manager
Interfaces and clients lose connection with PI
UNIX commands return the error can’t fork, out of process quota
As a general rule of thumb, you can assume that PI might need as many as 70 processes at
once. Changing this quota varies with the UNIX platform. In all cases, you must log in as
root to do any system configuration.
Page 234
11.4 - PI Server Data Files
11.3.3 HP-UX
Run the sam utility. Select Kernel Configuration, then Configurable Parameters find
“maxuprc” (maximum number of user processes) and “nproc” (maximum number of
processes).
If you change either value, you will need to create a new kernel (sam will ask you about this
when you try to exit), and the new parameters will not take effect until you reboot.
The PI Server data files are located in the PI\dat directory. Archives are likely to be
elsewhere.
Pidiag -fb
Internally, most PI Server data files have the same low-level structure and are referred to as
PIFileBase-type files. The most notable exceptions are PI archive files. However, the
annotation files that correspond to the PI archive files are of type PIFileBase. The pidiag -fb
utility dumps the PIFileBase-type files and can be used to check PIFileBase-type files for
correctness. Pass it the complete pathname of the PIFileBase-type file as a parameter. For
example:
pidiag -fb c:\pi\dat\pidignam.dat
If it returns an error, you can either try to fix it with the following command:
pidiag -fbf c:\pi\dat\pidignam.dat
Note that PI must not be running when you attempt to repair a file. It is enough in most cases
to shutdown the owning subsystem
Piarcmem.dat
This binary file is the Snapshot Database used by pisnapss. It contains the most recent values
that have been sent to PI the Snapshot value for each point when PI is shut down. Pisnapss
periodically writes the latest Snapshot values to this file. This is a pifilebase-type database so
its validity can be checked and restored using pidiag -fb and pidiag -fbf.
Piarstat.dat
This binary file keeps track of registered archives. It is required by piarchss. If you are
having trouble with archive file registration, do not delete this file. Instead, see How to
Repair the Archive Registry in this chapter.
Pidignam.dat
This binary file stores each unique digital state name. This is a pifilebase-type database so its
validity can be checked and restored using pidiag -fb and pidiag -fbf.
Pidigst.dat
This binary file stores the digital sets; it references names stored in the above file. This is a
pifilebase-type database so its validity can be checked and restored using pidiag -fb and
pidiag -fbf.
Page 236
11.4 - PI Server Data Files
Pimapevq.dat
PimaNNNN.dat
These are the memory-mapped Event Queues. Most systems use the default single file
pimapevq.dat. Certain situations require multiple Event Queues; in this case the files take the
naming convention of pimaNNNN.dat where NNNN is an integer.
The memory mapped Event Queue serves two purposes. First, it used for moving events from
the Snapshot Subsystem to the Archive Subsystem. PISnapss places events which pass
compression into this queue. PIArchss takes these events and writes them to the Archive.
Second, this file provides storage of events when the Archive Subsystem cannot process
events such as during archive shifts or when the archive process is shutdown.
This file, as the name implies is a memory-mapped file. Memory mapped files allow for high
speed in-memory access with the security of being safely backed up to disk.
Pilastsnap.dat
This binary file stores the timestamp of the last completed Snapshot flush to disk. On PI
System startup, this timestamp is assumed to be the shutdown time and is used as the
timestamp for shutdown events. On orderly shutdown, this file will contain the true shutdown
time. On a system crash such as a power failure the Snapshot may be as old as the Snapshot
flush cycle time period. The Snapshot flush cycle is controlled by the SnapFlushCycle
timeout parameter, which is 15 minutes by default.
Pimsgtxt.dat
This binary file stores formatted message strings used by the pigetmsg utility. This is a
pifilebase-type database so its validity can be checked and restored using pidiag -fb and
pidiag -fbf.
Pipoints.dat
This binary file stores the Point database. This is a pifilebase-type database so its validity can
be checked and restored using pidiag -fb and pidiag -fbf.
Piptalia.dat
This binary file contains alias information. This is a pifilebase-type database so its validity
can be checked and restored using pidiag -fb and pidiag -fbf.
Piptattr.dat
This binary file stores the point attributes. This is a pifilebase-type database so its validity
can be checked and restored using pidiag -fb and pidiag -fbf.
Piptclss.dat
This binary file stores the point classes. This is a pifilebase-type database so its validity can
be checked and restored using pidiag -fb and pidiag -fbf.
Piptunit.dat
This binary file stores the units. This is a pifilebase-type database so its validity can be
checked and restored using pidiag -fb and pidiag -fbf.
Piusr.dat
This file stores the user database. This is a pifilebase-type database so its validity can be
checked and restored using pidiag -fb and pidiag -fbf.
Piusrctx.dat
This file stores the context database. This is a pifilebase-type database so its validity can be
checked and restored using pidiag -fb and pidiag -fbf.
Piusrgrp.dat
This file stores the group database. This is a pifilebase-type database so its validity can be
checked and restored using pidiag -fb and pidiag -fbf.
Shutdown.dat
This text file contains directives that tell the PI Shutdown Interface which points should
receive shutdown events.
The pilistupd utility shows the size of the queues of events maintained by the Update
Manager. The utility requires that PI be running.
From a command prompt at the PI\adm directory, execute the utility pilistupd. This will
show a simple, although sometimes large, table summarizing the current state of update
signups. The table has five columns:
Producer: This is the source of update notifications. Currently there are five producers.
PI Snapshot Subsystem is a producer of Snapshot events. PI Base Subsystem is a
producer of Point Database and Module Database changes. The Archive Subsystem is a
producer of archive changes. The Batch Subsystem is a producer of Batch Database
changes.
Consumer: Application currently signed up as a consumer of specified producer. For PI
API applications, the consumer name is usually the first 4 letters of the login name of the
user running the application. These names are not unique so the PI Update
Manager assigned ID is appended to the name. PI API applications also have the PI
Network Manager ID appended. These integers are appended to help find specific
Page 238
11.5 - Identifying the Update Manager Issues: the pilistupd utility
consumers. For the PI-SDK, the consumer name is the complete application name with a
colon and a PI-SDK supplied identifier followed by a pipe character and a PI Update
Manager assigned ID.
Qual: This is the qualifier. The qualifier is a producer-specific integer. For example,
Snapshots update stores the requested point ID in the qualifier.
Flags: A producer-specific field.
Pending: Number of events available for the consumer to retrieve. The value goes up and
down as events come in and the consumer pulls them out. Values that increase
continuously might indicate that the consumer is not working properly or disconnected.
Note: The Pending number shows a maximum of 4096 events, even if more events
are in the queue. The Update Manager might limit individual consumers from
accumulating too many pending events. This is a display limitation and does imply
data loss.
-v Show version
-h Help
-t Show only the total number pending for this selection (specific cons./prod.)
In the results, the first entry is PI Batch Subsystem registered as a consumer of Point
Database changes. The integer 1 indicates this is the first consumer to register with the PI
Update Manager.
The second registered consumer is the Totalizer Subsystem.
The third entry is a PI API-based application, probably Performance Equation Scheduler. PI
API applications always have a four-character name with “E” appended. The two subsequent
integers, separated by the pipe ( | ), are the PI Network Manager assigned connection ID and
the PI Update Manager assigned ID. The connection ID is useful in tracking down errant
client applications; for example a ProcessBook display that is not checking for updates. The
PI Network Manager Statistics table can be used to lookup the machine associated with an
ID.
Entries 4 and 5 are also PI API-based applications, probably the Random and RampSoak
interfaces, which are installed by default on the PI Server node. Random interface generates
“sinusoid” points. A trend of sinusoid can indicate whether the Server is providing updates to
the client normally.
Page 240
11.6 - Repairs
11.6 Repairs
Occasionally a PI data file may become corrupt due to a power outage or some other unusual
circumstance. There are utilities available to rebuild corrupted Archives, the Archive registry,
and the Point Database.
...First pass...
...Sorting input archive...
...Output pass...
676 Loaded in 2( 1 + 1 ) Seconds 338 Event/Sec.
739 Archive Total seconds - ratio: 369
In this example, piarch1.fix does not exist prior to the operation It is created as a fixed
Archive the same size as the input Archive because the -f 0 parameter was specified. After it
is created, it may be registered using the piartool -ar utility, and then data events may be
added to the Archive in the usual way.
If the input file were registered prior to the operation, it would be unregistered during the
operation. When the operation is complete, it may be registered again using the piartool -ar
utility.
Note: Every archive has a parallel annotation file, with an extension .ann. In PI
3.3.361.43, the annotation file will be identified incorrectly after renaming its
associated archive file. Since renaming is necessary in this case, unregister the
renamed file after initial registration, and re-register it.
Page 242
11.6 - Repairs
...First pass...
...Sorting input archive...
Failed to unregister input archive: [-10733] PINET: RPC Resolver is
Off-Line
Archive utility not running - or archive not registered
Continue processing...
...Output pass...
1084 Loaded in 2( 0 + 2 ) Seconds 542 Event/Sec.
1038 Archive Total seconds - ratio: 519
In this example, piarch.005.fix does not exist prior to the operation. It is created as a fixed
archive the same size as the input archive because the -f 0 parameter was specified. The end
time of the output archive is left open because the -et 0 parameter was specified.
10. If you are uncertain which of your backed up archives was the Primary Archive
(archive 0) at the time you last made a backup, use pidiag -ahd and examine the
archive dates. The primary should have the latest start date and no end date:
e:\pi\adm>pidiag -ahd ..\dat\piarch001.dat
11. You will need to do the following steps to reconstruct your Archive Manager data
file. After step 9 above make sure no PI process is running, and then execute the
following command from the PI\adm directory:
pidiag -ar
12. This utility will prompt you for the path and filename of the archive that you want to
assign as the Primary Archive. Enter the name (including the full path) of the Primary
Archive (archive 0) before the crash.
13. If the backup was performed using PI Version 3.4.370 or greater, then skip this step
because the snapshot is backed up as of 3.4.370 and there is no need to rename the
piarcmem.dat file. Otherwise, if the backup was performed with a version of PI prior
to 3.4.370, rename the PI\dat\piarcmem.dat to PI\dat\piarcmem.dat.old.
14. If the backup was performed using PI Version 3.4.370 or greater, then skip this step.
Otherwise, execute the Base Subsystem found in PI\bin to re-create the snapshot file:
pibasess -snapfix
15. Restart PI.
16. You will have to manually register all of the other archives that you want mounted.
pidiag -ar only registers the specified primary archive. Register the other archives in
their new locations:
piartool -ar <path_and_archive_file_name>
17. Use piartool -al and the client tools (PI ProcessBook and PI DataLink) to verify that
all the data has been recovered. If the data is intact, you are done. Run the clients
locally, since the PI Server should be isolated from the network. It is very important
to confirm correct PI Server recovery before exposing the PI System to buffered data.
Failing to do so may cause data loss.
18. Connect the PI Server to the network. Verify the PI Server is reachable from clients
on the network. Monitor all buffered interface nodes.
Page 244
11.6 - Repairs
Note: The PI Server will not allow registering archives with overlapping dates. If you
find overlapping dates, you can use pidiag -ahd to check the exact start and end
times.
Page 246
11.6 - Repairs
3. Run pidiag -ad and collect the dump of piarstat.dat, verifying the output.
4. If the results of the dump look good, attempt the automated recovery. Otherwise, use
the interactive one.
5. Restart PI.
6. Check the message log to see if all archives are loaded. If the interactive version is
used, only the Primary Archive will be loaded.
7. Register any remaining archives. If the interactive version was used, all other
archives will need to be registered.
-ad Dumps the current piarstat.dat file. This is used to review the data in the file.
-ar Provides an interactive recovery utility for renaming the old piarstat.dat to piarstat.old and
generating a new one with a single entry - the Primary Archive - provided by the user.
-ara Provides an automated recovery utility that renames the old piarstat.dat to piarstat.old and
generates a new one with all of the entries found in the original file. Any errors will cause the
automated version to abort, and the user should resort to the interactive version.
Typically, this is not a problem because values are written in time order, but it is something to
consider when running pisnapss.exe with the -f option.
PIsnapss will continue to run normally after the fix-up. Control-C the interactive pisnapss
process and restart it as a service.
Note: Snapshots fixed by this procedure will remain set to NULL until a new
snapshot event is fixed. If a point does not receive events regularly the NULL
snapshot may cause problems with applications expecting normal values. A
Snapshot can always be written manually if needed.
ANY new event that is received for a point with a null snapshot will be absorbed into
the Snapshot, even if that event is an out of order event. If an out of order event is
received, then any data that was in the archive after the out of order Snapshot value
will not be visible.
Note: This procedure builds a new snapshot file with Shutdown events in it. The
Snapshot will be updated as the PI System receives new data. If you follow this
procedure when your snapshot file is normal, you will lose data. You should use this
command only when directed by OSIsoft Technical Support.
To do this, shut down pibasess, piarchss, and pisnapss. Rename the file
PI\dat\piarcmem.dat to another name. At a command prompt, change your current directory
to PI\bin and issue the command:
pibasess -snapfix
The PI Base Subsystem will write a message to the screen indicating that Snapshot recovery
mode has been specified and that recovery is in progress. When recovery is complete,
pibasess will write a final message to the screen and exit. You may then restart the PI
System.
This Snapshot recovery command can be run with the entire PI System shut down.
Page 248
11.6 - Repairs
1. If the erroneous future data can be discarded, start the Snapshot Subsystem with -f
flag as explained above.
2. Otherwise, keep the current file, and after the system startup, delete or edit individual
values using piconfig, as explained above.
3. Start the PI Server in base mode. This starts just the minimum required subsystems—
pinetmgr, pimsgss, piupdmgr, pisnapss, piarchss, and pibasess:
pisrvstart -base
4. Register all the old archive files but the previous primary (which contains future data)
pidiag -ahd can be used to examine unregistered archive file header.
5. Create a new primary archive using piartool -ac.
6. Specify a start-time before any events that might be coming in. Specify the end-time
as *. This instructs the Archive Subsystem to register the new archive as primary.
The start time specified must account for all buffered data. If in doubt set the start
time well before the time the problem was first encountered. Offline archive
processing can merge this data with existing archives if necessary.
7. Verify that the PI System is running correctly. Reconnect the Server to the network.
8. Reprocess the old Primary Archive using the offline tool to either filter out the future
data, or correct its time by the required difference.
9. Reprocess the Event Queue into an archive file and correct timestamps as required.
10. Optionally combine these two archive (old primary and result of Event Queue).
11. Register the corrected archive file.
Page 250
11.7 - Tuning the PI Server
Most PI Servers require no tuning and work well with default settings. In some instances, you
may need to make adjustments through the Timeout Database, discussed below.
Error Description
Note: This technique if only used for advanced troubleshooting. This should only be
done under the advice of OSI Technical Support.
Page 252
11.7 - Tuning the PI Server
write time-outs default to 50,000 microseconds, read and write retries default to 250. We
recommend increasing the time-outs in increments of approximately 25% until the errors
disappear. If the errors persist when the timeout values are over 150,000 microseconds, call
OSI Technical Support.
To increase the time-outs:
piconfig> @table pi_gen, pitimeout
piconfig> @mode edit
piconfig> @istructure name, value
piconfig> readtimeout,62500
piconfig> writetimeout,62500
piconfig> readretry,350
piconfig> writeretry,350
piconfig> @endsection
Note: PI Server installation sets all timeout values to well-tested initial values.
Changes to these values should be done under the advice of OSI Technical Support.
Very short timeout values may cause specific utilities to “spin” faster and thus use
more CPU. Before making changes based on CPU consumption, isolate the CPU to
the offending processes. Use available tools to analyze each process. For example,
if pisnapss is in a high CPU state, run piartool -ss and look at Snapshot read and
write rates because excessive rates may be the true source of CPU load.
Activity Grid
The Archive Subsystem provides a tool for monitoring the rate of read-access to the Archive.
This tool creates, over a finite time period, a grid of activity. The grid indicates which users
and points account for the most activity. This monitoring requires significant computing
resources and therefore is normally turned off. Start the activity grid to identify the users that
present the greatest load on the system and the points that are being queried most often. Once
the load on the system is identified, it is best to turn off the activity grid.
To start the activity grid:
Piartool -aag start
Page 254
11.8 - Solving Other Problems
ProcessBook is not retrieving the updates, the pending number continually grows and
does not shrink. This indicates whether the problem is with the PI Server or with the
client application.
5. If the pending updates are growing, try restarting the PI System. If this does not fix
the problem, contact OSIsoft Technical Support for additional assistance. If the
pending updates remain zero, go to step 4.
6. If all the points are signed up for updates, and refreshing the data from the archive
still yields a flatline trend, the problem could be in the archive, in the data source, or
in communications to the data source.
7. To determine if the Server is working, create a trend for a point with data generated
on the Server, such as “sinusoid,” which is generated by the Random Interface on the
Server.
8. If the trend for sinusoid appears correctly, it means that the archive is working and
communication between Server and client is working. Then go to step 6.
9. If the trend for sinusoid does not appear correctly, go to step 5.
10. Verify that the archive program is working (piartool -as, piartool -al)
11. Try inserting data into a test point (using piconfig or PI DataLink) and try trending
this point. If this is successful, go to step 6. If not, contact OSIsoft Technical Support
for additional assistance.
12. If all these tests are successful, the data source for the flatlined points may not be
working. Examine the Source-point attribute of the point to find out which interface
is feeding data for the point in question.
13. Check the PINetstats Table (See Chapter 1, PI System Management) to verify that the
interface program is running and connected to the Server.
14. Verify that the interface program is communicating with the external data source
(DCS system, RDB system, etc.). The documentation for the specific interface should
explain how to do this.
15. If the data source is running successfully, go to step 7.
16. Security may be preventing the process at some point. Examine the interface log files
and the PI Server log files (pigetmsg). Verify that both the data source interface and
PI ProcessBook have the correct access to the system. Examine all messages about
trusts granted or refused.
17. If the points in question have some access restrictions, there must be established trust
logins. The interface must have access as a PI user with WRITE access to the points.
PI ProcessBook must have read access to all these points.
If none of the above steps have resolved the problem, contact OSIsoft Technical Support for
additional assistance.
Page 256
11.9 - COM Connectors
Occasionally, errors are observed when OSI client applications fail to obtain process data. If
the errors are related to a foreign data historian, the applications generally receive error codes
in the range -11200 to -11209, instead of returning data. As usual, you can use the pidiag -e
utility to translate these errors to text.
The source of the error can be the Redirector or the specific COM Connector in use. Errors
may be logged in either the Windows Event Log or the PI Message Log. In general, the
distinction is this:
The Redirector logs information about its own activities to the Windows Event
Application Log. This includes startup, shutdown and loading of COM Connectors.
The PI Subsystems record errors in foreign system point lookup and data retrieval in
the PI System Message Log.
This section gives some guidelines for troubleshooting data retrieval problems from COM
Connectors. As new techniques become available, they will be posted on the OSI Technical
Support COM Connector page, available at http://techsupport.osisoft.com.
Once you have confirmed from this dialog that OSI PI Server Redirector is installed, continue
with the troubleshooting tips below until the problem is solved.
When you are able to clear the problem, you must restart the Redirector. This is done by
shutting down the Base, Snapshot, and Archive Subsystems and restarting them. There is no
method to restart the Redirector alone. The Redirector is not launched if there is no COM
Connector (a.k.a. mapped) points configured on the system.
Page 258
11.9 - COM Connectors
points. The point class may be of any name as long as it contains the above three point
attributes.
Note: This screenshot is from Windows 2000; the Windows Server Properties dialog
box is similar.
The default settings can become a problem if your system generates a log file of 512Mb of
messages within 7 days. You can avoid this problem by specifying a larger event log or by
choosing the Overwrite events as needed radio button.
Page 260
11.9 - COM Connectors
If the COM Connector cannot be loaded, a message to this effect will be logged.
Troubleshooting steps depend on how the COM Connector is implemented.
COM Connectors are of two different types: in-process or out-of-process. The manual for the
specific COM Connector you are using will tell you the Connector type.
Note: In-process COM objects are not visible to the dcomcnfg utility. One way of
seeing the DLLs loaded by the Redirector is to use the ListDLLs utility available
from the SysInternals Web site http://www.sysinternals.com.
Page 262
Chapter 12. FINDING AND FIXING PROBLEMS: THE PIDIAG
UTILITY
The pidiag utility is a collection of tools for diagnostics, information, and simple repairs. It is
designed to help the PI System Manager and OSI Software technical support in gathering
information about a PI System, troubleshooting and solving some common problems.
The following sections explain in detail the various tools included in pidiag. To invoke
pidiag:
pidiag -xxx
where xxx identifies one tool. Depending on the specific tool, some additional parameters
might follow. The optional parameters are summarized in the following table and described
in this section, unless otherwise noted in the table.
Option Description
-ara Auto recover archive manager data file. Described in this chapter.
-cid [ < ServerID > Create Server ID file optionally passing Server ID and PI API ID. The PI
< APIServerID> ] | API ID must be an integer. Server ID may be a GUID or an integer. -
upgrade option creates Server ID file for a system upgrade. Server ID
[-install] | [-upgrade] and PI API ID are set to integer based on host name. -install option
creates Server ID file for a new installation. Server ID is set to a UID.
The PI API ID is set to integer based on host name.
-dapi [hostname] Create and display PI API Server ID based on supplied host name.
Machine host name is used if host name is not supplied.
Option Description
-fbf 'path' <’outpath’> Recover (fix) file base data file index, optionally copying into a new file.
-qd [HeaderOnly| Dump header or all/filtered events from Event Queue file.
RecNo=n |PointId=<id>]
'path'
-rgs [-?] [-u] 'path' Register or unregister COM component by running .rgs script in 'path'.
{ReplaceableParameter
="Value"}
-uuid [count] Create and display "count" UIDs. 1 UID is created if "count" is not
supplied.
-v Version information.
-xa <path> Export audit records. This option is documented in Auditing the PI
[ -st <start> Server.
-et <end>
[-uid <unique id>]
[-xh <schema url>] ]
Page 264
12.1 - General Information
Tools that operate on files, such as compact and repair options should never be used with
open files. This means in general, that they should be used only when the system is down. If
in doubt, consult OSI technical support before using such tools. It is also advisable to make a
backup copy of the data file before compressing or repairing.
The following can be used to display a short help page with all the options.
pidiag -h
pidiag -?
C:\PI\adm>pidiag -t t+1h
21-Oct-02 01:00:00 PDT - Local: 908931600 UTC: 908956800
C:\PI\adm>pidiag -t "*"
21-Oct-02 20:00:10 PDT - Local: 909000010 UTC: 909025210
Page 266
12.2 - Time Utilities
If week is greater than 0, then day is the relative day (1-7) that the rule is applied. A day
of 1 represents Sunday, a day of 2 represents Monday, and so on. For example, a week of
1 and a day of 1 means the first Sunday in April. If week is -1, then day is an absolute
day (1-31).
Time is the time in seconds after midnight that the rule is applied.
Offset is the time in seconds to subtract from standard time to get the local time. For
example, daylight saving time is in effect, -3600 is subtracted from standard time.
Running pidiag -tz with the {time} argument will display the corresponding local and UTC
times in seconds and whether the passed time is in standard or daylight saving time. If the
time string is ambiguous, it is marked with an asterisk (*). Time strings are ambiguous if they
specify a time in the last hour of daylight savings time before the beginning of standard time.
In the northern hemisphere, this occurs in the fall. In the southern hemisphere, this occurs in
the spring.
C:\PI\adm>pidiag -tz "25-Oct-02 01:30:00"
TZ environment variable: <not set>
Standard Time Name: Pacific Standard Time (PST)
Daylight Time Name: Pacific Daylight Time (PDT)
StartYear, EndYear, Month, Week, Day, Time, Offset
1970, 2038, 4, 1, 1, 7200, -3600
1970, 2038, 10, 5, 1, 7200, 0
Passed Time: 25-Oct-02 01:30:00 PDT Local: 1035509400 UTC: 1035534600
If your time zone does not observe daylight savings time, the utility will indicate this.
C:\PI\adm> pidiag -tz
TZ environment variable: <not set>
Standard Time Name: US Mountain Standard Time (UMST)
Daylight Savings Time: <not observed>
The -dump option dumps the whole time zone table. This includes fall/spring changes in
every year. The dump is in comma-separated variable (CSV) format and can be loaded
directly into a spreadsheet, providing all time-change information for the local time zone.
The -dump option can be combined with -brief. The output with this option includes the
year and spring and fall time changes, each marked with “D” or “S” to denote daylight or
standard time.
The -check option generates no output at all, unless the time zone settings on your system
are invalid. The utility is used this way in the installation script on UNIX systems.
PI now supports the loading of a time zone information table from a binary file called
PI\dat\localhost.tz. If this file is present and valid, it is loaded and used for all time
translations. The table can be constructed as follows:
pidiag -tz -dump -brief > myzone.txt
The record of the resulting text file contains year, spring time change, and fall time change.
Edit the file to reflect the actual change times for your time zone. The file need not contain a
record for every supported year; years that are not specified use the operating system
generated rule. To install the new file, issue the command:
pidiag -tz -if myzone.txt -of test.tz
You can check the validity of test.tz by using pidiag to read it again, using the -if command.
pidiag assumes that any file ending in .tz is a binary file; all others are assumed to be text.
The -if command can be combined with any other. For example, to test the date 31-oct-02
01:30 using the new table, issue the command:
pidiag -tz "31-oct-02 01:30" -if test.tz
To dump the contents of a binary file to text, issue the command:
pidiag -tz -if test.tz -dump > test.txt
If the new timezone information table correctly represents the time transitions, copy the
binary file to PI\dat\localhost.tz and restart PI. Doing this does not affect the timestamps of
data already stored by PI, since these timestamps are stored as UTC. It affects only the
translation of these stored times to local times.
The timezone information now stores additional information such as the names of the
applications that created or modified it, and the first time the table was put into service. This
in-service time will be set on first system startup only if it was loaded from
PI\dat\localhost.tz. To see this additional information, issue the command:
pidiag -tz -full
Note: On UNIX systems, this feature can be used to determine whether or not the
operating system recognizes your passed TZ string as valid. Displayed transition
Page 268
12.3 - File-base Utilities
times, however, tend to reflect your system’s current time zone settings. Changing a
UNIX system’s time zone settings requires platform-specific techniques. You should
reboot your UNIX system after changing its time zone settings.
Most of the PI System internal databases are stored as index files with specific internal
organization. We call this structure file-base. The following tools are provided for diagnostics
and repair of such database files. More information is available in PI Server Data Files in the
chapter PI Troubleshooting and Repair.
Caution: Do not use Compact or Recover tools on open files while the system is
running!
Page 270
12.4 - Archive Management
This option creates a new archive manager data file using the data in the existing data file. It
can be used if the index in the current file is corrupted.
This option creates a new archive manager data file. It prompts the user for the full path of
the Primary Archive file. Upon restarting PI, this file will be the only archive registered.
This option is useful when moving a PI Server to another machine, or when running the same
point configuration with different sets of archives.
If the archive manager file is corrupted, try first the -ara option. If that does not help, use -ar
option. More information on using the -ar and -ara options is provided in How to Repair the
Archive Registry in the chapter PI Troubleshooting and Repair.
Note: The command pidiag -ara can be also used to downgrade the format of the
archive registry from 3.4.370 to earlier versions of the PI Archive.
For examples on using the -ahd option, see Restoring a Complete Server from Backup,
Restoring Archive Files from Backup, or Recovering from Unintended Change to System
Time in the chapter PI Troubleshooting and Repair.
Note: This command can only be used if the archive file is not registered, or if the PI
Server is down. If you use it with a registered Archive file, pidiag will return an
access error.
Page 272
12.4 - Archive Management
Looking at archive statistics and in order to maintain best performance, points should not
have more than one or two index records on average. If this is not the case for many points,
compression parameters should be reviewed for these points or the archive files should be
made smaller. In the above example, points 4 and 17 (recnos 4 and 11 respectively) clearly
have an excessive number of index records.
The archive check command will detect and report any errors in the archive file. Errors are
summarized at the end of the report but when running the command, they are sent to the
“standard error” (stderr) stream. As a result, when redirecting the output to a file, the
following syntax should be used so that errors are inserted into the output file report.txt:
pidiag -archk "archive_file" > report.txt 2>&1
Alternatively, the following construct can be used to redirect the output to two different files:
pidiag -archk "archive_file" 1> report.txt 2> errors.txt
The archive errors or corruptions could be the result of failures (crash, unexpected
termination, power failure, etc) or software bugs. In the case this happens, the offline archive
utility can be used to reprocess the corrupted archive file, recover the data and fix all issues.
For more information, see Using the Offline Archive Utility (piarchss) on page 40.
The -archk command can also be run with the optional argument complete, in order to
extract detailed information about the archive file structure. This extra information is similar
to what is provided by the archive walk command (see piartool -aw). It notably includes
point types and statistics (start time, event count, fill ratio) for every index or data record and
for each point in the archive file. The archive header information (see pidiag -ahd above) is
also included at the beginning of the report.
Here is an example of the detailed mode:
D:\PI\adm>pidiag -archk D:\PI\dat\piarch.001 complete
Analyzing archive: D:\PI\dat\piarch.001
-------------------------------------------------------------------------------
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: 101 $]::
Version: 7 Path: D:\PI\dat\piarch.001
State: 3 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 131072 Add Rate/Hour: 1.7
Offsets: Primary: 20/65536 Overflow: 128665/131072
Annotations: 10826/65535 Annotation File Size: 434144
Start Time: 19-Oct-05 12:39:10
End Time: Current Time
Backup Time: Never
Last Modified: 19-Dec-05 18:09:15
recno: 1, id: 1, events: 636, annotations: 0, fr: 89.4% - (Float32)
index array size: 1
0: idxrec id: 1, record pointers: 5, total events: 636
record array size: 5
0: record id: 130516, start: 19-Oct-05 12:39:10, events: 142, fr: 99.4%
1: record id: 130811, start: 30-Oct-05 15:33:27, events: 142, fr: 99.7%
2: record id: 130515, start: 12-Nov-05 09:29:36, events: 142, fr: 99.9%
3: record id: 130210, start: 22-Nov-05 04:44:08, events: 142, fr: 99.9%
4: record id: 128814, start: 15-Dec-05 13:31:42, events: 68, fr: 47.9%
[...]
3.3 5
3.4.363/364 6
3.4.370 7
Note: PIdiag -adg accepts wildcard characters in the “path” argument (example:
“D:\PI\dat\piarch.*”). This allows performing easy downgrade of many archive files in
a single command.
Page 274
12.5 - Server ID Utilities
As of PI 3.3 SR1, the Server ID of the PI Server is stored in the PI\dat\PISysID.dat file. The
first time that any PI-SDK application connects to a PI Server from a given node, the PI-SDK
caches this server ID in the client’s local Registry. On subsequent connections, PI-SDK
applications compare the cached Server ID to the actual Server ID of the PI Server during the
Server.Open call to make sure that a connection is being made to the same PI Server.
Although the PISysID.dat file did not exist before PI 3.3 SR1, the PI Server still returned a
Server ID to PI-SDK applications. The PI Server used a hashing algorithm to determine the
Server ID, which took the name of the machine as input and generated a number as output.
This number was not a globally unique identifier (GUID), which meant that the hashing
algorithm could generate the same numeric identifier from two different machine names.
If PI 3.3 SR1 or greater is installed as a new system, the Server ID is generated as a GUID
and stored in the PISysID.dat file. If PI 3.3 SR1 or greater is installed as an upgrade from a
system that is less than 3.3 SR1, then the Server ID is generated using the old hashing
algorithm and stored in the in the PISysID.dat file.
There are three pidiag options, -dapi, -cid, and -did, that can be used to troubleshoot or to
generate a PISysID.dat file. The -dapi option echoes a Server ID to the standard output using
the old hashing algorithm. The usage is:
pidiag -dapi [hostname]
If hostname is not passed, then the host name of the machine is used in the hashing algorithm.
Here is some example output from the -dapi option.
pidiag -dapi MyServer Host: MyServer API Server ID: 6239
The -cid option generates a new PISysID.dat file. The usage is:
-cid [ < ServerID > < APIServerID> ] |install] | [-upgrade]
The optional APIServerID that can be passed on the command line is not used by any
application. If the optional ServerID is passed on the command line, simply pass the same
identifier for the APIServerID. The -install option causes the Server ID to be generated as a
GUID. The -upgrade option causes the Server ID to be generated using the old hashing
algorithm.
The -did option dumps the contents of the PISysID.dat file.
pidiag -did
Dumping file E:\PI\dat\PISysID.dat
1. MajorVersion: 3
2. MinorVersion: 3
3. MajorBuild: 361
4. MinorBuild: 98
5. ServerID: 1eb5cdbe-0666-43a5-900d-235344ee43ea
6. APIServerID: 91049
A new PISysID.dat file would need to be generated in the following scenario: Suppose that
you have a pre-SR1, PI 3.3 Server that you want to move to a different node. The new
machine will be given the same name as the old machine after the migration is complete.
Install PI 3.3 SR1 on the new node and copy the archive files from the old PI 3.3 system to
the new node. A PISysID.dat file on the new 3.3 SR1 Server will be generated with a GUID
as the Server ID because the 3.3 SR1 install was not an upgrade. It would be desirable to
create a PISysID.dat file with a Server ID that was generated with the old hashing algorithm
so that old PI-SDK applications will not complain when they are connecting to the new
server. This new file can be generated as follows.
pidiag -dapi MyServer Host: MyServer API Server ID: 6239
pidiag -cid 6239 6239
Alternatively, if the name of the new Server has already been changed to MyServer, the new
file can be generated as follows.
pidiag -cid -upgrade
Page 276
12.6 - Performance Counter Utilities (Windows Only)
Interface (the Basic version is included with the PI Server distribution) can easily be set up to
historize the value of these performance counters in the PI Archive, as well as the OS-
provided ones.
The following table shows the list of Performance Counter object names for the main PI
Subsystems:
Important Notes
These object names are case sensitive. PIdiag will return a system error 2 when
mistyped.
These objects are all defined in the global namespace of Windows. As a result, their
names must always be prefixed by the string Global\ (case-sensitive).
Example:
C:\PI\adm>pidiag -gmmf Global\pibasess_Counters
Performance counters for MMF Global\pibasess_Counters
Point Count: 200558
Connector Point Count: 0
Point Create or Edit/sec: 0
Digital State Translations/sec: 165
Wild Card Searches/sec: 200
Point Accesses/sec: 200710
Module Count: 20
Heading Set Count: 0
Heading Count: 0
Module Database Record Count: 24
Module Create or Edit/sec: 0
Heading Set Create or Edit/sec: 0
Heading Create or Edit/sec: 0
Module Database Create or Edit/sec: 0
Module Accesses/sec: 94
Heading Set Accesses/sec: 0
Heading Accesses/sec: 0
Module Database Accesses/sec: 94
12.7 Miscellaneous
Windows Only
Dr. Watson is the default just-in-time Windows debugger. Debuggers, including Dr. Watson,
rely on debug symbols to translate code addresses to line numbers and meaningful text. The
PI System installs these symbols in %SystemRoot%\Symbols\exe directory where
SystemRoot is typically C:\Windows. The system environment variable,
_NT_SYMBOLS_PATH, must include this full path. On a crash, if this path is not included
in _NT_SYMBOLS_PATH the crash symbols will not be correctly interpreted.
Note: The PI Base Subsystem must be shut down for this command to succeed.
Also notice the path argument requires a trailing \ or / character.
Page 278
12.7 - Miscellaneous
d:\pi\adm>pidiag -host
Domain <OSI>
Machine <bilbo>
User <Bagins>
IP Addr <205.171.76.181>
Primary Domain Controller: <\\MASTERDC>
This option also tests the availability of the Domain Controller. This call should complete is a
fraction of a second; if it hangs or takes more than a few seconds to return it indicates the
Domain Controller access may not be fast or consistent. Failure to have prompt access to the
Domain Controller will result in poor PI System performance.
'TypeLib' = s '{8FC8B7AF-0C07-11D4-84C4-
00C04F6102DF}'
}
}
}
pidiag -rgs MYOBJECT.RGS MODULE=
"c:\Program Files\MyProgram\myobject.exe"
Page 280
APPENDIX A: PI MESSAGES
This chapter discusses the messages that PI writes to its message logs during normal
operation. Messages are written to the message log by the PI Message Subsystem. Use the
pigetmsg utility in the PI\adm directory to retrieve messages.
Page 282
>> Snapshot records loaded, count: 13, found: 13, status: [0] Success
0 pisnapmgr 27-Oct-05 16:23:34
>> PIsnapmgr::loadsnaptables: loaded: C:\PI\dat\piarcmem.dat, status:
[0] Success
0 pisnapss 27-Oct-05 16:23:35
>> PI subsystem pisnapss is now running, version: PI 3.4.370.52
0 pisnapss 27-Oct-05 16:23:35
>> WorkingSet Parameters changed, Current settings: 0.195313, 1984MB,
Previous settings: 0.195313, 1.34766MB
0 pisnapss 27-Oct-05 16:23:35
>> Digital State table synchronized with Base Subsystem
0 pisnapss 27-Oct-05 16:23:35
>> Rpcservertablelist successfully registered to pinetmgr.
0 pinetmgr 27-Oct-05 16:23:35
>> Deleting connection: piartool(2568), Shutdown request received from
piartool(2568) (8), ID: 2
0 Connection Statistics 27-Oct-05 16:23:35
>> ID: 2; Duration: 0.03 min.; kbytes sent: 4.90; kbytes recv:
0.42; app: ; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:23:35
>> Deleting connection: piartool(3772), Shutdown request received from
piartool(3772) (8), ID: 3
0 Connection Statistics 27-Oct-05 16:23:35
>> ID: 3; Duration: 0.03 min.; kbytes sent: 4.90; kbytes recv:
0.42; app: ; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:23:36
>> Connection accepted: Process name: piarchss(356) ID: 11
0 pinetmgr 27-Oct-05 16:23:36
>> Connection accepted: Process name: piartool(2720) ID: 12
0 piarchss 27-Oct-05 16:23:36
>> Starting PI process piarchss.
0 pievqreader 27-Oct-05 16:23:37
>> Primary Queue successfully loaded (0 events)
0 piarcmgr 27-Oct-05 16:23:37
>> Primary archive file C:\PI\dat\piarch.001 loaded.
0 piarcmgr 27-Oct-05 16:23:37
>> Archive file C:\PI\dat\piarch.002 loaded.
0 piarcmgr 27-Oct-05 16:23:37
>> Archive file C:\PI\dat\piarch.003 loaded.
0 piarcmgr 27-Oct-05 16:23:37
>> Cache Manager: cache pool set to 2048 records, maximum unflushed
events per point is 256.
0 pinetmgr 27-Oct-05 16:23:37
>> Servertablelist received from: piarchss(356). 5 entries: piarss|1
piarss2|1 piarbatch|1 piarchss_subsysquery|1 piarchss_dbsecurity|1
0 piarchss 27-Oct-05 16:23:38
>> PI subsystem piarchss is now running, version: PI 3.4.370.52
0 piarchss 27-Oct-05 16:23:38
>> WorkingSet Parameters changed, Current settings: 0.195313, 1984MB,
Previous settings: 0.195313, 1.34766MB
0 piarchss 27-Oct-05 16:23:38
Page 284
>> Deleting connection: piartool(3920), Shutdown request received from
piartool(3920) (8), ID: 14
0 Connection Statistics 27-Oct-05 16:23:58
>> ID: 14; Duration: 0.03 min.; kbytes sent: 35.06; kbytes recv:
0.54; app: ; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:23:58
>> Deleting connection: piartool(3544), Shutdown request received from
piartool(3544) (8), ID: 13
0 Connection Statistics 27-Oct-05 16:23:58
>> ID: 13; Duration: 0.03 min.; kbytes sent: 35.21; kbytes recv:
0.42; app: ; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:23:58
>> Deleting connection: piartool(2720), Shutdown request received from
piartool(2720) (8), ID: 12
0 Connection Statistics 27-Oct-05 16:23:58
>> ID: 12; Duration: 0.03 min.; kbytes sent: 26.59; kbytes recv:
0.54; app: ; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:23:58
>> Connection accepted: Process name: pishutev(2540) ID: 20
0 pishutev 27-Oct-05 16:23:58
>> Starting PI process pishutev.
0 pishutev 27-Oct-05 16:24:00
>> PI subsystem pishutev is now running, version: PI 3.4.370.52
0 pishutev 27-Oct-05 16:24:00
>> WorkingSet Parameters changed, Current settings: 0.195313, 10MB,
Previous settings: 0.195313, 1.34766MB
0 pishutev 27-Oct-05 16:24:00
>> Shutdown input file: C:\PI\dat\shutdown.dat.
0 pishutev 27-Oct-05 16:24:00
>> Shutdown events will be written for tag mask *
Point attributes:
shutdown, 1
0 pinetmgr 27-Oct-05 16:24:01
>> Connection accepted: Process name: piartool(3780) ID: 21
0 pinetmgr 27-Oct-05 16:24:03
>> Connection accepted: Process name: pisqlss(3388) ID: 22
0 pisqlss 27-Oct-05 16:24:03
>> Starting PI process pisqlss.
0 pinetmgr 27-Oct-05 16:24:05
>> Servertablelist received from: pisqlss(3388). 3 entries: pisqlss|1
pisqlss_subsysquery|1 pisqlss_dbsecurity|1
0 pinetmgr 27-Oct-05 16:24:05
>> Connection accepted: Process name: piartool(2748) ID: 23
0 pisqlss 27-Oct-05 16:24:06
>> PI subsystem pisqlss is now running, version: PI 3.4.370.52
0 pisqlss 27-Oct-05 16:24:06
>> WorkingSet Parameters changed, Current settings: 0.195313, 10MB,
Previous settings: 0.195313, 1.34766MB
0 pisqlss 27-Oct-05 16:24:06
>> Rpcservertablelist successfully registered to pinetmgr.
0 pinetmgr 27-Oct-05 16:24:08
Page 286
0 pinetmgr 27-Oct-05 16:24:20
>> Deleting connection: piartool(2748), Shutdown request received from
piartool(2748) (8), ID: 23
0 Connection Statistics 27-Oct-05 16:24:20
>> ID: 23; Duration: 0.05 min.; kbytes sent: 38.44; kbytes recv:
0.54; app: piartool; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:24:20
>> Servertablelist received from: pialarm(3300). 3 entries: pialarm|1
pialarm_subsysquery|1 pialarm_dbsecurity|1
0 pinetmgr 27-Oct-05 16:24:20
>> Deleting connection: piartool(3780), Shutdown request received from
piartool(3780) (8), ID: 21
0 Connection Statistics 27-Oct-05 16:24:20
>> ID: 21; Duration: 0.05 min.; kbytes sent: 35.06; kbytes recv:
0.55; app: piartool; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:24:20
>> Connection accepted: Process name: piartool(2592) ID: 29
0 pialarm 27-Oct-05 16:24:21
>> PI subsystem pialarm is now running, version: PI 3.4.370.52
0 pialarm 27-Oct-05 16:24:21
>> WorkingSet Parameters changed, Current settings: 0.195313, 10MB,
Previous settings: 0.195313, 1.34766MB
0 pialarm 27-Oct-05 16:24:21
>> Initializing alarms.
0 pialarm 27-Oct-05 16:24:21
>> Registered to update manager as a consumer
0 pialarm 27-Oct-05 16:24:21
>> Registered for point updates.
0 pialarm 27-Oct-05 16:24:21
>> Initialize group tags (pointsource G )
0 pialarm 27-Oct-05 16:24:21
>> 0 alarm group tags. 0 alarm groups.
0 pialarm 27-Oct-05 16:24:21
>> Restarting from save file C:\PI\dat\pilastalarm.dat
0 pialarm 27-Oct-05 16:24:21
>> 0 alarm tags.
0 pialarm 27-Oct-05 16:24:21
>> Initialize SQC alarm tags (pointsource Q )
0 pialarm 27-Oct-05 16:24:21
>> 0 sqc alarm tags.
0 pialarm 27-Oct-05 16:24:21
>> Rpcservertablelist successfully registered to pinetmgr.
0 pinetmgr 27-Oct-05 16:24:23
>> PInet accepted TCP/IP connection, cnxn ID 30 Hostname:
samson.osisoft.com, 127.0.0.1:1104
0 pinetmgr 27-Oct-05 16:24:23
>> New Pinet 1 connection: PipeE Protocol: 00010008
0 pinetmgr 27-Oct-05 16:24:23
>> New Pinet 1 connection: PipeE Successful Trust-Relation login:
samson.osisoft.com|127.0.0.1|PipeE piadmin.
0 pinetmgr 27-Oct-05 16:24:23
Page 288
>> Deleting connection: piartool(1152), Shutdown request received from
piartool(1152) (8), ID: 27
0 Connection Statistics 27-Oct-05 16:24:32
>> ID: 27; Duration: 0.03 min.; kbytes sent: 39.83; kbytes recv:
0.55; app: piartool; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:24:32
>> Deleting connection: piartool(3256), Shutdown request received from
piartool(3256) (8), ID: 25
0 Connection Statistics 27-Oct-05 16:24:32
>> ID: 25; Duration: 0.03 min.; kbytes sent: 39.83; kbytes recv:
0.55; app: piartool; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:24:38
>> Connection accepted: Process name: piartool(3348) ID: 35
0 pinetmgr 27-Oct-05 16:24:40
>> Connection accepted: Process name: piartool(1240) ID: 36
0 piafserver.exe 27-Oct-05 16:24:43
>> Loading SubSystems from 'C:\Program Files\PIPC\PIAF\SubSystems':
0 pinetmgr 27-Oct-05 16:24:43
>> Connection accepted: Process name: piafserver.exe(3140) ID: 37
0 pinetmgr 27-Oct-05 16:24:44
>> Deleting connection: piartool(2504), Shutdown request received from
piartool(2504) (8), ID: 34
0 Connection Statistics 27-Oct-05 16:24:44
>> ID: 34; Duration: 0.03 min.; kbytes sent: 46.71; kbytes recv:
0.55; app: piartool; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:24:44
>> Deleting connection: piartool(2592), Shutdown request received from
piartool(2592) (8), ID: 29
0 Connection Statistics 27-Oct-05 16:24:44
>> ID: 29; Duration: 0.03 min.; kbytes sent: 41.19; kbytes recv:
0.55; app: piartool; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:24:44
>> Deleting connection: piartool(2628), Shutdown request received from
piartool(2628) (8), ID: 32
0 Connection Statistics 27-Oct-05 16:24:44
>> ID: 32; Duration: 0.03 min.; kbytes sent: 42.55; kbytes recv:
0.55; app: piartool; user: ; osuser: ; trust: ; ip address: ; ip host:
0 pinetmgr 27-Oct-05 16:24:52
>> PInet accepted TCP/IP connection, cnxn ID 38 Hostname:
samson.osisoft.com, 127.0.0.1:1105
0 pinetmgr 27-Oct-05 16:24:52
>> New Pinet 1 connection: RmpSE Protocol: 00010008
0 pinetmgr 27-Oct-05 16:24:52
>> New Pinet 1 connection: RmpSE Successful Trust-Relation login:
samson.osisoft.com|127.0.0.1|RmpSE piadmin.
0 pinetmgr 27-Oct-05 16:24:52
>> PInet accepted TCP/IP connection, cnxn ID 39 Hostname:
samson.osisoft.com, 127.0.0.1:1106
0 pinetmgr 27-Oct-05 16:24:52
>> New Pinet 1 connection: RandE Protocol: 00010008
0 pinetmgr 27-Oct-05 16:24:52
Page 290
>> PInet accepted TCP/IP connection, cnxn ID 44 Hostname:
samson.osisoft.int, 127.0.0.1:1209
PI API-based clients will have a message similar to the following. The client publishes its
name and protocol. The name is a five-character string. The first four letters give the
application name or login name; the fifth character is always E. In this example, the client
name is snapE:
0 pinetmgr 27-Oct-05 17:23:14
>> New Pinet 1 connection: snapE Protocol: 00010008
PI Server then attempts to use the credentials of the incoming connection to locate a record in
the PItrust database. If a match is found, the following message is written:
0 pinetmgr 27-Oct-05 17:23:14
>> New Pinet 1 connection: snapE Successful Trust-Relation login:
samson.osisoft.int|127.0.0.1|snapE piadmin.
If a match is not found, the message is:
0 pinetmgr 27-Oct-05 17:28:14
>> New Pinet 1 connection: snapE No Trust established for:
figaro.osisoft.com|24.20.166.163|snapE using default login.
A default login means that the connection is a member of the world as defined by the security
string associated with PI Server internals such as the point database and archived data. See
Chapter 1, System Management, for a description of the PI Server security model.
PI-SDK-based applications have a similar set of connection establishment messages. There
are two differences. First, the published application name is more detailed. It contains the full
executable name plus the process ID. Second, the trust login information is not published.
Here is a set of messages showing the About PI-SDK application connecting:
0 pinetmgr 27-Oct-05 19:04:44
>> PInet accepted TCP/IP connection, cnxn ID 49 Hostname:
caleb.osisoft.com, 192.1.1.114:4508
0 pinetmgr 27-Oct-05 19:04:44
>> Connection accepted: Process name: AboutPI
SDK.exe(5632):remote(5632) ID: 49
0 pibasess 27-Oct-05 19:04:45
>> Trust <pi3build> Granted to:
OSI\ADMINISTRATOR|caleb|192.1.1.114|AboutPI SDK.exe
(108 ms)
0 pinetmgr 27-Oct-05 19:04:46
>> Successful login ID: 49. Address: 192.1.1.114. Host:
caleb.osisoft.com. Name: AboutPI SDK.exe(5632):remote. User: piadmin.
Trust: caleb
Disconnect Messages
The following messages indicate normal disconnects. The error number (in square brackets)
is given along with its translation.
0 pinetmgr 27-Oct-05 16:25:19
>> Deleting connection: pishutev(2540), Shutdown request received from
pishutev(2540) (8), ID: 20
0 pinetmgr 27-Oct-05 16:44:21
>> Deleting connection: RandE, [-10721] PINET: Client Aborted
Connection. (4), ID: 39 samson.osisoft.com 127.0.0.1:1106
The following messages indicate abnormal disconnects. The error number (in square
brackets) is given along with its translation.
0 pinetmgr 27-Oct-05 19:26:31
>> Deleting connection: snapE, GetQueuedCompletionStatus error:
Network name deleted [64] The specified network name is no longer
available. Connection: snapE (14, 64), ID: 51 samson.osisoft.com
127.0.0.1:1835
Page 292
The following message indicates that an RPC was not completed within the timeout
specified. The requestor passes the timeout when it places the call with pinetmgr. This
timeout is not configurable.
0 pinetmgr 19-Feb-97 17:19:26
[-10722] PINET: Timeout on PI RPC or System Call
Piupdmgr
The pinetmgr utility keeps track of processes that have signed up for updates. It is possible
for a signed-up process to go away without properly unsigning up. If pinetmgr detects this
case, it will remove the dead process from its table and report the following message:
0 piupdmgr 19-Feb-97 17:31:15
>> Consumer <UNKNE|8> timed out! removed...
Error Codes
System error messages usually contain error codes. Error codes are reported in square
brackets. Negative numbers indicate PI System errors. Positive numbers indicate operating
system errors.
Pidiag
Use the pidiag utility to interpret error codes. Do not type the square brackets:
pidiag -e errorcode
This will display the associated error message. For example:
pidiag -e -10722
[-10722] PINET: Timeout on PI RPC or System Call
PIdiag will also translate operating system error codes, which are always positive numbers.
Note that the error code translation takes place on the operating system running pidiag. For
example, on Windows, you could issue the command:
System error messages usually contain error codes. Error codes are reported in square
brackets. Negative numbers indicate PI System errors. Positive numbers indicate operating
system errors.
0 PI_NORMAL Success
-13 PI_ATT_BADDSCODERANGE Digital State Code Out of Range For This Tag
-19 PI_ATT_PTATTZERO Point Attribute Zero Error or Disk Error for Point
Database
-22 PI_ATT_BADTYPVALUE Typical Value Not Between Zero and Top of Range
Page 294
Code Code Identifier Message
-60 PI_ATT_NOPIDAVAIL No more pid slots for retrieving point update lists
-73 PI_EVM_TOOMANYPTS No room for this many points for this list
Page 296
Code Code Identifier Message
-105 PI_ARCH_BADSTARTENDTIME End Time Not After Start Time, or Start Time <0
-112 PI_ARCH_ARCH1OFFLINE Point not created because archive one not on-line
Page 298
Code Code Identifier Message
-516 PI_SQC_RAWTAGMISSING Sqc: raw data tag for SQC calculation not found
-517 PI_SQC_TRIGTAGMISSING Sqc: Trigger Tag for SQC Calculation Not Found
-519 PI_SQC_CHARTEQUALSRAW Sqc: Chart Tag is the Same as the Raw Tag
-528 PI_SQC_CTLLIMNOTINFILE Sqc: Control Limits Not Found in Control Limit File
Page 300
Code Code Identifier Message
-10414 PI_XS_SIMILARTRUST Trust records must differ more than name and
Piuser
Page 302
Code Code Identifier Message
-10478 PI_FB_NULLPATHSTRING Cannot extract file and path from null string
Page 304
Code Code Identifier Message
-10587 PI_PD_NOEDITBASEATT Base attribute set edit not allowed except for
default change
Page 306
Code Code Identifier Message
-11009 PI_AR_RCOBJTOOBIG Event Contents Are Too Big to Fit in Any Record.
Page 308
Code Code Identifier Message
Page 310
Code Code Identifier Message
-11097 PI_AR_BCKMODEMISMTCH: Backup End must follow Start and vice versa.
-11100 PI_AR_SAMETIMEARG: Start time equal end time argument in archive call.
Page 312
Code Code Identifier Message
supported.
-11202 PI_ RDR PI Redirector could not get archived data from
_HISTTIMEDVALUESFAIL foreign system
-11203 PI_ RDR PI Redirector could not get snapshot value from
_SNAPTIMEDVALUEFAIL foreign system
-11204 PI_ RDR _SNAPISLOCALFAIL PI Redirector could not determine whether to cache
snapshot values from foreign system
-11205 PI_ RDR _SNAPSSIGNUP PI Redirector could not signup for updates with
foreign system.
-11206 PI_ RDR PI Redirector could not get updates from foreign
_SNAPSUPDATESFAIL system.
Page 314
Code Code Identifier Message
Page 316
Code Code Identifier Message
Page 318
Code Code Identifier Message
-13007 PI_MSG_BADOPTION1 The query for messages must have end time
and/or total message count in GetMessages
-13008 PI_MSG_BADOPTION2 The query for messages must have start time
and/or total message count in GetMessages
-13009 PI_MSG_BADOPTION3 The query for messages must have start time
and/or end time in GetMessages
Page 320
Table A–12. Error Codes15000-15999, With Messages
Page 322
Code Code Identifier Message
duplicate hierarchical level
Page 324
Code Code Identifier Message
events
Page 326
Code Code Identifier Message
-16863 PI_BCKEVENT_FREEZE_TIMEOUT_W VSS Freeze timed out waiting for VSS thaw
AITING_FOR_THAW_EVENT event
Page 328
Table A–14. Error Codes 17000-17999, With Messages
Page 330
APPENDIX B: PI PERFORMANCE COUNTERS
PI Server has a number of performance counter statistics that can to be viewed using
Microsoft’s Performance Monitor utility (System Monitor in Windows 2000).
The following tables list the statistics that may be viewed.
Attribute Description
Point Count Total number of defined points. This number includes the Connector
Point Count.
Connector Point Count Count of defined points that are mapped points. These are points
that interact with points on a foreign data historian using a COM
Connector.
Digital State Rate at which digital state strings are translated to offsets.
Translations/sec
Wild Card Searches/sec Rate of wild card point searches. This counter represents the rate at
which new searches are started, not the number of points found.
Point Accesses/sec Rate at which point information is accessed, not including point
edits. This will include translations of tag to point id.
Heading Set Count The total number of heading sets in the module database.
Module Database Record The total number of records in the module database.
Count
Heading Set Create or Rate at which heading sets are created or edited.
Edit/sec
Module Database Create or Rate at which MDB records are created or edited.
Edit/sec
Module Accesses/sec Rate at which module information is accessed, not including module
edits.
Heading Set Accesses/sec Rate at which heading set information is accessed, not including
module edits.
Heading Accesses/sec Rate at which heading information is accessed, not including module
edits.
Attribute Description
Read Operations/sec Rate of archive read calls. Each call can return multiple events. The
rate of event retrieval is Events Read/sec.
Primary Archive Number Internal index number of archive current assigned to primary position.
Record Disk Reads/sec Rate of archive disk reads (includes Cache Record Disk Reads/sec).
Overflow Index Record/sec Rate at which index archive records are created.
Overflow Data Record/sec Rate at which data archive records are created.
Cache Clean Rate at which archive cache records are removed from memory.
Operations/sec
Page 332
Attribute Description
Operations/sec
Time to Archive Shift Number of seconds until the archive is projected to shift. This time is
not calculated if the archive is less than 20% full.
Connector Read Rate of calls to read events for mapped points through COM
Operations/sec Connectors. This rate is NOT included in the Read Operations/sec
counter.
Connector Events Rate of events read for mapped points through COM Connectors.
Read/sec This rate is NOT included in the Events Read/sec counter.
Connector Summaries/sec Rate of summaries for mapped points through COM Connectors. This
rate is NOT included in the Events Read/sec counter.
Connector Events Read Time elapsed in milliseconds for one Events Read for a COM
Exec Time Connector point.
Connector Event Read Time elapsed in milliseconds for one Event Read for a COM
Exec Time Connector point.
Connector Summaries Time elapsed in milliseconds for one summaries call for a COM
Exec Time Connector point.
Point Flushes Last Cycle Number of points flushed to disk during last cycle. Busy points might
get flushed several times per cycle.
Unflushed Points Number of points that have at least one unflushed event.
Configured Cache Record Maximum number of cache records in the read-only pool.
Pool
Current Cache Record Current maximum number of cache records, this may be lower that
Pool the configured value due to low memory resources.
Current Max Unflushed Current maximum number of unflushed events per point, this may be
Events/pt lower that the configured value due to low memory resources.
Event Queue Chunk Size Number of events read per Event Queue read operation.
Attribute Description
Out Of Order Rate at which out-of-order events are sent to the snapshot.
Snapshots/sec
Page 334
Attribute Description
Queued Events/sec Rate at which events are sent to the Event Queue.
Connector Snapshots/sec Rate at which events are sent to mapped points through COM
Connectors. This rate is NOT included in the Snapshots/sec counter.
Connector Rate at which events are read from mapped points through COM
GetSnapshots/sec Connectors. This rate is NOT included in the GetSnapshots/sec
counter.
Connector Updates/sec Update events received from COM Connectors. This rate is NOT
included in the Connector GetSnapshots/sec counter.
Connector Snapshot Put Time elapsed in milliseconds for Snapshot Put for COM Connector a
Elapsed Time point.
Connector Snapshot Read Time elapsed in milliseconds for Snapshot Read for a COM
Elapsed Time Connector point.
Connector Updates Time elapsed in milliseconds for Updates for COM Connector points.
Elapsed Time
Number of Overflow Number of overflow queue files (0 if only the primary queue is active).
Queues
Estimated Remaining Estimated maximum number of events with current queue file.
Capacity
Event Queue Total Pages Number of data pages in primary queue file.
Event Queue Used Pages Number of full data pages in primary queue file.
Event Queue Page Rate of data page shifts in primary queue file.
Shifts/sec
Attribute Description
Inserted Messages/sec The number of messages that were inserted into the PI Message
Subsystem from the Application Event Log per second.
Attribute Description
ArcValueCompCalls/sec Rate of RPC calls made to the PI Archive Subsystem for compressed
events.
ArcValueCompEvents/sec Rate at which compressed data events are returned by the PI Archive
Subsystem.
WildcardSearches/sec Rate at which new wildcard searches are initiated in the PI Point
Database.
WildcardPoints/sec Rate at which points are returned when performing wildcard searches
of the PI Point Database.
ArcValueTimedCalls/sec Rate of RPC calls made to the PI Archive Subsystem for interpolated
or timed events.
ArcValueTimedEvents/sec Rate at which interpolated or timed data events are returned by the PI
Archive Subsystem.
SummaryArcValueCalls/se Rate of RPC calls made to the PI Archive Subsystem for summarized
c values (i.e. average, total, standard deviation, etc.).
Dot Variable Rate of "dot" variable evaluations made within the PI SQL Library. A
Evaluations/sec dot variable in SQL is a table alias and column name, such as
"picomp.tag.” This rate is a measure of PI SQL Subsystem
processing not related to obtaining data from other subsystems.
Next Point With Source Rate at which points are returned by the PI Base Subsystem in
Calls/sec searches for points with a specific PointSource attribute.
Page 336
Attribute Description
PostEvents/sec Rate at which data events are posted to the PI Snapshot Subsystem
from execution of SQL INSERT or UPDATE statements.
Attribute Description
Total Point Count The total number of active PI Totalizer Subsystem points.
Attribute Description
Receive Errors The number of times an error occurs during a receive of a message to the
PI Network Manager.
Send Errors The number of times an error occurs during a send of a message to the PI
Network Manager.
Licensing Failures The number of times an application was rejected due to licensing
concerns
Licensing Warnings The number of times an application was warned of licensing concerns
Attribute Description
ArcFindCalls/sec Rate of calls made to the PI Archive Subsystem for finding values.
ArcSummaryCalls/sec Rate of calls made to the PI Archive Subsystem for summarized values.
ArcValueCalls/sec Rate of calls made to the PI Archive Subsystem for compressed events.
FailedEvaluations/sec Rate of PE evaluations that return the digital state Calc Failed.
PI Session Statistics
Attribute Description
Receive Errors The number of times an error occurs during a receive a message by the
PI session.
Send Errors The number of times an error occurs during a send of a message by the
PI session.
Page 338
PI Subsystem Statistics
Attribute Description
Actual Pending Only for internal debugging purpose. You should use it only under the
Transactions suggestion of OSI Technical Support.
Message Complete Time Total message handling time (including results sending).
Lock Contentions/sec Number of lock conflicts (threads waiting for the same lock).
RPC Threads Total Total number of RPC worker threads (query processing).
Attribute Description
Lost events/sec Events lost due to the PI Update Manager database being full.
Max pending events Maximum pending events reached in the PI Update Manager database.
Attribute Description
Lost events/sec Events lost due to the PI Update Manager database being full.
Attribute Description
Page 340
Table B–16. PI Performance Counters
PERF.LOCALHOST.Logical Free Megabytes displays the unallocated space on the disk drive in
Disk(_Total).Free Megabytes megabytes. One megabyte = 1,048,576 bytes.
PERF.LOCALHOST.Memory Page Faults/sec is the overall rate that faulted pages are handled
.Page Faults/sec by the processor. It is measured in numbers of pages faulted per
second. A page fault occurs when a process requires code or data
that is not in its working set (its space in physical memory). This
counter includes both hard faults (those that require disk access)
and soft faults (where the faulted page is found elsewhere in
physical memory). Most processors can handle large numbers of
soft faults without consequence. However, hard faults can cause
significant delays. This counter displays the difference between the
values observed in the last two samples, divided by the duration of
the sample interval.
PERF.LOCALHOST.Process % Processor Time is the percentage of elapsed time that all of the
(piarchss).% Processor Time threads of this process used the processor to execute instructions.
PERF.LOCALHOST.Process An instruction is the basic unit of execution in a computer, a thread
(pibasess).% Processor Time is the object that executes instructions, and a process is the object
created when a program is run. Code executed to handle some
PERF.LOCALHOST.Process hardware interrupts and trap conditions are included in this count.
(pinetmgr).% Processor Time On Multi-processor machines the maximum value of the counter is
PERF.LOCALHOST.Process 100 % times the number of processors.
(pisnapss).% Processor Time
PERF.LOCALHOST.PI Base Total number of defined points. This number includes the
Subsystem.Point Count Connector Point Count.
Page 342
Tag Explain Text
Email Support
Email support is available 24 hours a day, 7 days a week. Send technical support
inquiries, including the problem description and message logs, to:
[email protected]. Technical Support will respond to your inquiry within 24
hours.
Knowledge Center
The Knowledge Center provides a searchable library of documentation and technical
data, as well as a special collection of resources for system managers. For these options,
click Knowledge Center in the Technical Support Web site.
• The Search feature allows you to search Support Solutions, Bulletins, Support
Pages, Known Issues, Enhancements, and Documentation (including User
Manuals, Release Notes, and White Papers).
Page 346
INDEX OF TOPICS
Page 348
PI Server, 6 Case-preserving, 220
Solaris UNIX Systems, 7 Case-sensitive, 220
Windows Services, 6 Digital State Set, 198
backfilling archives flag, 186
creating new primary archive, UNIX operating system, 172
55 Cd command, 186
without compression, 54, 55 Character
backfilling data, 54 special, Changing, 223
Backups t for true, 178, 179
Automating, 66 Classic Point
PI Server, 63 Attributes, 189
Recommendations, 66 Classicctr, 258
Base Subsystem, 230 Clear command, 186
performance counters, 331 Client Applications
Batch Alias Table, 208 Connection Messages, 290
Batch method Security, 125
piconfig, 172 clock
Batch mode, 183 setting on interface nodes, 101
Batch Subsystem clock, system, 23
Batch Unit Table, 207 codes, error
Batch Tables, 209 operating system, 21
BATCHEXPR, 208 COM component
BID register, 279
Batch Subsystem, 209, 214, COM Connector
215
in-process, 262
BIDsearch
out-of-process, 262
Batch Subsystem, 209
troubleshooting, 257, 261
Boolean values, 222
Web site, 257
buffer, 95
Combining Archives, 59
buffering
ComChar, 186, 223
about, 95
Comma Separated Format, 179,
maximum size of buffer, 95 190
recommendations, 95 Command
Buffering ?tbl, 173
PI API, 96 All in piconfig, 186
bufserv Bye, 183
file buffer size, 95 Case, 220
Bye command, 183 character, 186, 223
BytesRecv, 211, 212 piconfig, 172
BytesSent, 211, 212 Comm, 180
C language, API, 96 Endsection, 182
Case command, 220 Error, 184
Page 350
number of archive read Dates
requests, 28 overlapping, 245
out-of-order event Daylight Savings Time
archive, 28 and interface nodes, 101
Overflow Data Record, 30 customizing changes, 267
Overflow Index Record, 30 list of changes, 267
PI Server Performance, 340 Dbsecurity, 173
counter, point, 23 DbsecurityTable, 216
counters Dcomcnfg, 257, 262
performance, 331 Default
CPU Digital State Set, 195
Excessive usage of, 253 default values
CPU usage pigetmsg parameters, 19
by utilities, 252 Delete
Create Mode, 178
Mode, 178 deleting archives, 56
creating archives for old data, 54 deleting connection error message,
creating new primary archives, 55 22
CSV format, 190 Delimited
ctr_lmap, 258 Structure type, 179
ctr_progid, 258 Delimiter, 186
ctr_strmap, 258 Character, 180, 187, 223
data Command, 180
time limit on modifying, 52 Format, 179, 223
Data Digital State, 5, 172
File repairs, 241 Table, 195
Recovering from corrupted Digital State Set
archives, 241 adding, 196
Data Archive capitalization, 198
Adding values, 201 Changing the Name, 198
data buffering default, 195
about, 95 limits, 195
data flow modifying, 197
buffering, 95 Digital State Table
snapshot, 22 merging systems, 153
Database Digital State Value
Firewall, 219 Sending to the Snapshot
Point, 57, 189 database, 200
Timeout, 219 Digital tag
Trust, 218 Creating, 199
Database Security, 173 DigitalSet, 199
Database Security Table, 216 Directory
Page 352
Failed to unregister input archive Command, 176
message, 242 lists all commands, 187
file buffer, 95, See also buffering Hexadecimal notation, 224
maximum size, 95 Hostmask, 173, 219
File corruption, 241 Modify, 120
File handles, 233 HP-UX
File-base Utility, 269 process count, 235
compact, 269 I/O
index, 269 Redirection, 184, 185
Firewall, 219 IBM AIX
Database, 219 process count, 234
Modifying, 118 ID
Security, 117 PINetMgr, 212
troubleshooting, 228 ID Conversion File, piarchss, 43
Fixed index record, 35
Format, 180 Initialization
structure Structure type, 179 archive, 57
Fixed Archive, 36 Input
fixed archives, 33, 35 Command, 183, 220
Flag redirect, 187
Shift-enable, 57 to piconfig, batch files, 183
Flags, 201 Installation
Flatline in a trend Redirector, 257
troubleshooting, 255 Integer Format to String, 266
Force processing, 196 Interactive session
Format piconfig, 172
Delimiter, 179, 182, 223 interface nodes
Fixed, 180 setting clock, 101
Keyword, 180, 186 Interface Nodes
full, archive, 33 definition of, 94
gaps Interface Status Utility, 113
archives, 34 interfaces
General Table Interface and PI API, 96
Timeout, Firewall, Proxy, 219 APS utility, 113
Group definition of, 94
assigning users to, 126 Interface Status Utility, 113
Database, 125 setting system clock, 101
table for, 215 Interfaces
Handle downloading documentation
Batch Subsystem, 209, 214, for, vi
215, 219 internal counters
Help piartool-qs, 25
Page 354
Module Database Security, 116
Repairing, 250 Operators
moving archives, 56 Modify Point Attributes, 189
XE "conversion files, ID" to piconfig, 181
another server, 43 OSBuild, 210
Moving PI Servers, 147 OSIsoft Universal Interface. See
MsgRecv, 211 UNIINT
MsgSent, 211, 212 OSSysName, 210
Name Ostructure, 187
Connection name, 212 Command, 180
naming archives, 52 Ostype, 179, 187
Netmask OSUser
trust logins, 132 trust logins, 133
NetType, 212 OSVersion, 210
Network Out of order event
definitions, display the, 278 counter
Router, 116 archive, 28
Security, 116 out of order events
Network Manager compression, 23
performance counters, 337 out of order events counter, 23
NEWhostmask, 119 Output, 187
Newset keyword, 176 Command, 184
Newtag keyword, 176 overflow events, 25
NEWUnitName, 207 Overflow Offsets
nodes, 94 piartool -al, 47
NT overflow queues, 25
Interface installation overflow XE "primary record"
PIHOME directory, 101 record, 34
Octal notation, 224 Overlapping dates, 245
offline archive utility, 37, 40, 41 Owner
list of parameters, 41 point attribute, 123
Offline Archive Utility Parameter
ID Conversion File, 43 Passing an input file, 184
time conversion file, 44 Passing as Output, 184
Time Filtering, 43 Timing, 219
offline mode Password, 126
pimsgss, 20 blank, 127
offline, message subsystem, 20 changing, 127
OpenVMS default, 127
and PI API, 95 reset piadmin, 278
Operating System Path
Error Codes, 293, 294 piartool -al, 47
Page 356
PI TagConfigurator, 171 number of overflow queues, 25
PI Thread Table, 215 out of order events counter, 23
PI_GEN, 173, 219 point counter, 23
Piadmin, 117, 124, 125 remaining capacity, 25
reset password, 278 total overflow events, 25
Piarc, 173 piartool -ss, 22
Edit mode attribute, 204 PIATRSET, 173
Piarc Table, 202 Pibaalias, 173, 208
piarchss, 37, 40 Pibasess, 230
offline archive utility, 41 Pibatch, 209
Piarchss, 231 PIBatch
piarchss -id, 43 considerations when merging
piarchss offline utility systems, 154
list of parameters, 41 Pibaunit, 173, 207
Piarcmem.dat, 236 Piconfig, 127, 203
piarcreate, 37, 52 Abbreviations, 220
Piarcreate, 52 Commands, 176, 186, 223
piarstat.dat, 56 Configuration.Persistence, 223
Piarstat.dat, 236 Echo command, 184
piartool, 37 Modes, 178
-aw, 49 Overview, 171
creating archives with, 52 Remote sessions, 185
deleting archives, 56 Starting, 172
moving archives, 56 Stopping, 172
-qs, 25 using quotes, 221
registering archives, 56 values sent as strings, 222
unregistering archives, 56 pidemo user account, 125
Piartool, 52 pidiag, 263
-al, 46 about, 21
results from, 47 -ad, 270
-as, 27 -ahd, 271
piartool -ac, 52 -ar, 271
piartool -acd, 52 -ara, 270
piartool -ar, 56 -e errorcode, 265
piartool -au, 56 -fb, 269
piartool -ooo, 23 -fb utility, 236
piartool -ss -fbc <path>, 269
events counter, 23 -fbf <path>, 270
events in queue counter, 24 -h or -?, 265
events read counter, 24 -host, 278
events sent to queue counter, interpreting error messages, 21
24 operating system errors, 21
Page 358
Piusrgrp.dat, 238 piartool -al, 47
Piverify.sh script, 228 primary record, 34
PIVersion, 210 Priority
Point Trust Records, 135
access to, 124 PRODEXPR, 208
data access, 122 ProdIDsearch
Database, 189 Batch Subsystem, 209
Datagroup, 124 Producer
Dataowner, 124 pilistupd utility, 238
object for security, 122 Prompt, 187
Ownership, Changing, 123 ProtocolVersion, 212
Point class, 188 PtClass, 187
Point Attributes Ptclass command, 188
access to, 122 queue
Changing Owner, 123 number of overflow events, 25
Modifying, 189 number of overflow queues, 25
With Operators, 189 remaining capacity, 25
Point Class queue, event
Base, 188 monitoring, 25
Point Class Database, 192, 194 Quit command, 183
point counter, snapshot, 23 Quote, 187
Point Database, 57, 188 character, 223
migration from PI2, 224 Quote marks
Repairing, 250 used in piconfig, 221
table name, 188 RampSoak, 232, 240
PointID, 200 Random, 240
PointSource attribute, 103 Random Simulator, 232
Command line parameters, 102 record
PoolName, 215 archive, 34
predicting archive shifts, 47 Record, 188
primary archive, 33 attributes, 175
Primary Archive, 35, 46 Record Size
Recovering, 242 piartool -al, 47
primary archives records
creating new, 55 determining percentage used,
failing to register, 55 47
Primary index listing details, 49
Connection, 212 Records
Primary key, 172 Trust, Weighting, 135
Default, 181 Recovery tool, 247
Primary Offsets Recsep, 187
RecvErrors, 211, 212
Page 360
shift predicting, 47 Modify, 189
shift, archive, 33 Special Characters, Changing, 223
Shift-enable flag, 57 Specifications
Shutdown Events, 4 Compression, 122
Shutdown.dat, 4, 5, 238 Spreadsheet, 190
Sigd, 188 SQL Subsystem
Sign up for updates, 293 performance counters, 336
Significant decimal digits, 188 Start
sinusoid, 232 Messages, 281
Site-specific files, 2 PI, 1
size of file buffer, 95 UNIX, 3
size, archive records, 34 Windows, 2
Smit utility, 234 piconfig, 172
SMT Redirector, 258
about, vi Starting
snapshot PI, 2
event count, 22 Starttime, 203
events counter, 23 State
events in queue counter, 24 piartool -al, 47
events read counter, 24 STATE, 195
events sent to queue counter, State Sets
24 listing, 195
listing current information, 22 statistics
monitoring data flow, 22 performance counters, 331
number of overflow queues Status, 188
counter, 25
command, 173
out of order events counter, 23
PI processes, 228
point counter, 23
Stdout, 2
remaining queue capacity, 25
Stop
total overflow events counter,
PI, 1
25
on UNIX, 4
Snapshot, 5
on Windows, 3
list values, 201
piconfig, 172
repairing, 247
String to Integer Format, 266
Subsystem
Structure, 187, 188
Adding digital state
values, 200 Specifications, 181
recovering, 248 Type, 179
Troubleshooting, 230 STYP, 188
Snapshot Subsystem Stype, 179
performance counters, 334 Subnet, 118
Span specifying for trust login, 132,
143
Page 362
Attributes, 207 shutdowns, 135
conversion file, 44 Trust Records
Filtering, 43 Weighting, Score, 135
future times in Snapshot Tuning
removing, 248 Utilities timeout value, 252
piconfig millisecond, 206 Tuning the PI System, 251
piconfig TimeFormat, 206 Type
Time Zone, 266, 268 Files, 236
utilities, 265 piartool -al, 47
time limits on modifying data, 52 UniInt
Time Transformation Processing, downloading documentation
245 for, vi
conversion file, 246 UnitName, Batch Subsystem, 207,
time zones 209
and interface nodes, 101 Universal Interface
TimeFormat, 206 downloading documentation
for, vi
TimeNum, 200
UNIX, 212
Timenum Attributes, 207
Case-sensitive, 220
Timeout Database, 219
Sockets protocol, 251
Timestamp
UNIX Process
Corrections, 44
Stopping, 232
Millisecond, 207
UNIX Process Quotas, 233
Timformat, 188
Unregister Archive
Timing Parameters, 219, 251
list unregistered files, 271
Totalizer Subsystem
unregistering archives, 56
performance counters, 337
Update Manager, 30
totalUpdateQueue, 31
MaxUpdateQueue, 31
TotalUpdateQueue, 31
Pending Update Limit, 31
Troubleshooting
Statistics, 340
Checklist, 225
TotalUpdateQueue, 31
PI Update Manager, 230
Troubleshooting, 230
Redirector, 257
Upgrade
Strategy, 225
Post Upgrade Tasks on UNIX,
Trust Database, 128, 218
147
defining a record, 130
User
fields, 131
Adding, 127
how to configure, 131
Database, 126
Trust Login, 128
Name and Password Security,
evaluating, 134 125
examples, 137 Passwords
installation, 136 changing, 127
network definitions, 278
Page 364
Auditing the PI Server
PI3 Server
Version 3.4.370
Worldwide Offices
OSIsoft, Inc. is the owner of the following trademarks and registered trademarks: PI System, PI ProcessBook,
Sequencia, Sigmafine, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known to be
trademarks or service marks have been appropriately capitalized. Any trademark that appears in this book that
is not owned by OSIsoft, Inc. is the property of its owner and use herein in no way indicates an endorsement,
recommendation, or warranty of such party's products or any affiliation with such party of any kind.
Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)
of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
Copyright Notice
Unpublished -- rights reserved under the copyright laws of the United States
PREFACE – USING THIS GUIDE
Auditing the PI Server is part of the OSIsoft PI Server Documentation Set. It explains your
options for maintaining an audit trail of your process data in the PI Server. Consult the
Introduction to PI System Management or PI Server System Management Guide for more
information regarding PI Server administration tools discussed in this guide.
You can download the most recent version of the PI Server Documentation Set from the
OSIsoft Technical Support Web site (http://techsupport.osisoft.com).
The PI Server Documentation Set includes the following user guides.
Title Subject
PI Server Reference Guide A comprehensive reference guide for the PI Server, including
details on databases and data flow, including exception and
compression.
Auditing the PI Server A guide to maintaining a good audit trail of your process data in the
PI Server.
PINet and PIonPINet User A guide to PINet/OpenVMS and PIonPINet packages (PI PN)
Guide which allow parts of a PI for OpenVMS display system to run
transparently on a PINet node.
Related Documentation
OSIsoft provides a variety of documentation to help you use and understand the PI Server,
interfaces and client tools. Each interface has its own manual, and each client tool has its own
online help and/or user manual.
PI Server System Managers should read the UniInt End User Manual, which describes the
OSIsoft Universal Interface (UniInt). Many PI interfaces are based upon UniInt, and this
guide can provide a deeper understanding of interface design.
The PI Server provides two sets of powerful tools that allow system administrators and users
to perform system administration tasks and data queries.
The PI Server includes many command-line tools, such as pidiag and piartool. The
PI Server Documentation Set provides extensive instruction for performing PI Server
administrative tasks using command-line tools.
The PI System Management Tools (SMT) is an easy-to-use application that hosts a
variety of different plug-ins, which provide all the basic tools you need to manage a
PI System. You access this set of tools through a single host application. This host
application is sometimes referred to as the SMT Host, but it is more commonly called
the System Management Tools or SMT.
You can download the latest version of SMT from the Technical Support Web site:
http://techsupport.osisoft.com
In addition to extensive online help that explains how to use all of the features in the SMT,
the SMT includes the Introduction to PI System Management user guide.
Page iv
Preface – Using this Guide
Monospace Consolas monospace is used for: To list current Snapshot information every 5 seconds,
type: CODE examples use the piartool -ss command. For example:
"Consolas" COMMANDS to be typed on the
font command line (optionally with
arguments or switches)
System INPUT or OUTPUT such
as excerpts from log files and other
data displayed in ASCII text
Bold consolas is used in the
context of a paragraph
Light Blue - Links to URL / Web sites, and email http://www.osisoft.com/procedures.aspx
Underlined addresses [email protected]
Index of Topics.................................................................................................................................31
Page x
Chapter 1. PI SERVER AUDITING
The PI Server includes two independent mechanisms that record extensive audit records.
These mechanisms record the data that are added, edited, or removed from specific PI Server
database files, as well as other events or changes to configuration that occur in the PI Server.
The PI Audit Database provides enhanced auditing capabilities that meets stringent
auditing requirements. It logs changes to 14 key PI system database tables, including
changes made to Archive Data, to PI System configuration, and to system security
settings. The PI Audit Database stores audit records in three separate, protected Audit
Database files. Audit Database security measures ensure the integrity of audit
records, and therefore the validity of the audit trail.
The PI Audit Trail Message Log provides basic auditing capabilities that meet
many less-regulated auditing needs. The PI Audit Trail Message Log logs changes to
incoming data only. Audit messages are added to the PI System Message Log, which
is automatically managed by the PI System.
You may use either or both audit methods, depending on your requirements.
Note: Some changes made to Audit Database settings, such as changes to the
Timeout Table, are captured in the Audit Trail Message Log, not in the Audit
Database itself.
In addition to the methods described in this guide that you can use to store, export, and
review audit records, OSIsoft provides the PI System AuditViewer utility, which enables you
to view and manage Audit Database records. The AuditViewer is available as a separate
package with its own documentation. It is introduced in section 1.3, The PI AuditViewer.
The PI Audit Database records changes to the data stored in key databases in the PI system.
In addition to recording direct changes to PI Server databases, the Audit Database keeps
detailed records of changes made to the configuration of the PI System that affect the way in
which applicable data is recorded, accessed or changed. Audit Database records include PI
Server system changes that affect:
Data collection
Data access
Metadata (Module data and Batch data)
Editing of existing data in the Snapshot or Data Archive
Schema (Point Class and Attribute Sets)
For example, the exception and compression specifications for a point affect what is written
to the Data Archive. Similarly, the digital set definition for a point affects the interpretation
of events written to and read from the Archive. To effect a stringent audit of the data that the
PI Server stores in the Data Archive requires an auditable trail of changes made to both the
Point Database and the Digital State Set Database.
Security settings affect the security and integrity of data and data collection. To track security
changes that may affect data integrity, changes to the User, Group, and Trust Databases
(which determine who can access the PI System) are also recorded to the Audit Database.
In This Guide
Audit Database Design and Administration is explained on page 5
PI Snapshot Subsystem Considerations are discussed on page 9.
Audit Database Procedures are provided on page 10.
Procedures to Enable Auditing on PI Server databases is described on page 10.
Procedures to Set Subsystem Auditing Mode are provided on page 12 .
Procedures to Archive and Create New Audit Database Files are provided on page
12.
Procedures to Export Audit Records to XML are provided on page 13.
Audit Database File Contents are explained on page 15.
Example Audit Records are provided on page 16.
When the PI Audit Trail Message Log is enabled, specified PI system data updates and
activities are logged to the Audit Trail Message Log. The Audit Trail Message Log records
changes made to the Snapshot and Data Archive, including the Batch Database.
Instructions for managing and monitoring the PI System Message Log is provided in
Monitoring PI System Health in the PI Server System Management Guide.
Page 2
1.3 – The PI AuditViewer
In This Guide
The PI Audit Trail Message Log is described on page 25.
Procedures to Enable Logging of Archive and Snapshot Changes are on page 26.
Procedures to Enable Logging of PI Batch Database / SDK Object Changes are on
page 28.
PI AuditViewer allows you to search for and display audit records in the PI Audit Database.
It allows you to sort, filter, and organize audit records in a grid format. It is an essential tool
for analyzing and validating a PI system for compliance with a company's implementation of
cGMP. It facilitates the generation of selected reports in Windows file formats, to comply
with FDA audit requests.
Because AuditViewer can change auditing status and control the execution of PI system
processes, certain restrictions are in place:
Note: Earlier versions of PI AuditViewer are not compatible with the current release
of PI (3.4.370).
Page 4
Chapter 2. THE PI AUDIT DATABASE
This section describes how Audit Database records are collected, protected, and managed.
You must understand basic mechanisms to be able to configure the Audit Database for
desired behavior and for essential housekeeping tasks.
System administration tasks include:
Enable auditing of PI subsystem databases.
Set auditing offline to enable viewing or export of database records, or for the
management of Audit Database files.
Archive Audit Database files and create new files, to maintain manageable file sizes
and validated audit trails.
Understand the mechanism for Audit Database file creation failure, and the creation
of alternate Audit Database files.
PI User
PI Group
PI Trust
PI Modules
PI Headings
PI Batches
PI Unit Batches
PI Transfer Records
PI DB Security
Point Class
Attribute Set
Note: Each of the three audited subsystems can add audit records to the Audit
Database. However, audited subsystems cannot modify or delete existing audit
records.
Page 6
2.1 – Audit Database Design and Administration
For each audit-enabled subsystem, you must set auditing “online” to enable the collection of
audit records, and “offline” to enable system administration on the Audit Database or audit
records. See section 2.3.1, Enable Auditing for procedures.
Note: Open or creation failures and successes are reported to the PI Server
Message Log.
When a new Audit Database file is created, a record is added to the file to indicate the
creation date and time.
When an existing Audit Database file is opened, it is read entirely to determine the number of
records in the file. The current EnableAudit bit mask value and the audit record count is
written to the Message Log. For example, a successful open message is:
0 pibasess 20-Oct-05 19:40:33
>> Audit Enable Mask: -1
Audit file contains 310 Records
The first concern is that large Audit Database files may compete for hard drive space
with other data files (including the event queue file, pieventq.dat.)
The second concern is that upon startup and/or entering auditing online mode, each
subsystem reads the entire corresponding Audit Database file. A large file can
considerably slow down subsystem startup – or the return to auditing online mode.
The third concern is that audit files that are very large will invariably cause greater PI
system problems.
The solution is to adhere to the following Audit Database file size recommendations.
Eventually, you must remove, safely store, and create new Audit Database files. See section
2.3.3, Archive and Create New Audit Database Files, for instructions.
Each Audit Database file should not exceed 100 MB. Files this large may be very slow to
process, or impossible for PI Audit Viewer to index. Furthermore, if any file grows larger
than 2 GB (2**31 bytes), it will cause problems for the associated subsystem.
Replacement requirements vary by site. Some interfaces and applications make periodic
changes to the Archive database. These changes can cause the PI Base subsystem audit file to
grow quite fast. For example, PI-APS modifies a property of a module to indicate the latest
scan, which results in two audit records. If PI-APS scans every 5 minutes, 576 audit records
will be generated every day.
Page 8
2.2 – PI Snapshot Subsystem Considerations
Note: Since auditing is enabled only at startup, the audit record cache process will
work only if the subsystem is placed in audit mode at startup.
Regardless of auditing mode, the PI Snapshot subsystem always accepts new, edited, and
snapshot deletion requests. While auditing mode is offline, requests that generate an audit
record are cached for the Audit Database. When auditing returns to online mode,
pisnapssAudit.dat is opened if it exists, or is created if it does not, the cache is processed and
audit records are written to the Audit Database. This process occurs if auditing online mode is
initiated automatically (through audit offline mode timeout) or by system administrator
command.
To avoid the creation of alternate Audit Database files during Audit Database maintenance:
1. Invoke auditing offline mode (vs. stopping the subsystem)
2. Immediately copy or move the audit file to a different directory
3. Restore auditing online mode
Value to Enable
Database Table Subsystem Bit Hexadecimal Decimal
Point PI Base 0 1h 1
Digital State 1 2h 2
Page 10
2.3 – Audit Database Procedures
Value to Enable
Database Table Subsystem Bit Hexadecimal Decimal
User 5 20h 32
Group 6 40h 64
Set the EnableAudit parameter value to -1 to enable auditing on all database tables that
support auditing. Set the EnableAudit parameter to 0 or remove the parameter altogether to
disable auditing on all corresponding databases. Note that you must restart the affected
subsystems for changes to take effect.
To enable auditing for the Point Database (which has a bit mask value of 1) and Digital State
Database (which has a bit mask value of 2) set the EnableAudit parameter to 3 (= 1 + 2.)
Similarly, set the EnableAudit parameter to 131 (= 1 + 2 + 128) to enable Point, Digital
State, and Trust Database auditing.
Numeric values must be entered into the timeout table as decimal numbers. Hexadecimal
(base 16) notation is more convenient for creating or examining the bit mask value entered
into the EnableAudit parameter. It is easier to use hexadecimal notation to create the desired
bit mask and convert to decimal for entry into the timeout table. Conversely, it is easier to
read a decimal entry from the timeout table and convert to hexadecimal in order to interpret
the value as a bit mask.
Page 12
2.3 – Audit Database Procedures
PI Archive
piartool –systembackup start –subsystem piarchss
copy ..\log\piarchssaudit.dat ..\pi\temp
del ..\log\piarchssaudit.dat
piartool –systembackup end –subsystem piarchss
PI Base
piartool –systembackup start –subsystem pibasess
copy ..\log\pibasessAudit.dat ..\temp
del ..\log\pibasessAudit.dat
piartool –systembackup end –subsystem pibasess
PI Snapshot
piartool –systembackup start –subsystem pisnapss
copy ..\log\pisnapssAudit.dat ..\temp
del ..\log\pisnapssAudit.dat
piartool –systembackup end –subsystem pisnapss
Export Procedure
Subsystem auditing must be offline or the subsystem must be stopped to export records
directly from the Audit Database files.
Note: Once subsystem auditing is offline, several subsystem operations are blocked.
Therefore, it is best to copy the file promptly to a different directory for access, and to
re-start the affected subsystem or place auditing online, as soon as possible.
The following is the minimum syntax, which exports all records in the specified file:
pidiag –xa "audit file path"
For example:
pidiag –xa ..\temp\pibasessAudit.dat
Optional Arguments
Time Range
You can specify the start time and end time to constrain output to audit records during a time
range. Use the –st and –et arguments to specify the range of time, in PI Time Format. (For a
discussion of PI Time Format, see Appendix A, PI Time Format in the PI Server Reference
Guide.)
The first audit record on or before the start time through the last record on or after the end
time is displayed. For example:
Pidiag –xa ..\temp\pibasessAudit.dat –st "21-Feb-99 13:00:00" –et "*"
This displays the first audit record on or before 1:00 PM, February 21, 1999, through the
current time.
Note: Space ( ) characters and asterisk (*) characters in command line arguments
confuse command line interpretation. Avoid confusion by enclosing the time
arguments in double quote " " characters as shown in the above example.
Schema
The exported XML includes a reference to URLs for XSD (XML Schema Definition) files.
The XSD files are a formal declaration of the schema. The schema describes and constrains
the content of the Audit Database output.
Page 14
2.4 – Audit Database File Contents
OSIsoft specifies the URL of a default PI Audit Database schema that is W3C-compliant. The
default OSIsoft schema reference included in the exported XML is:
<PIAudit xmlns="xml.osisoft.com-schemas-piaudit"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xml.osisoft.com-schemas-piaudit
http://xml.osisoft.com/Schemas/PIAudit">
In certain cases it may be advantageous to specify a different reference for a schema. For
example, an application running on a computer behind a firewall may not have access to XSD
files on the Internet.
The schema may be specified on the command line by the –xh export header option. The
schema specified replaces everything inside the PIAudit tag in the default PIAudit schema
reference. Specifying this argument has no other effect.
For example, use the following command to refer to the schema located at
http://xml.yourcompany.com/Schemas/PIAudit:
Pidiag –xa ..\temp\pibasessAudit.dat –xh "xmlns=\"xml.osisoft.com-
schemas-piaudit\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-
instance\" xsi:schemaLocation=\"xml.osisoft.com-schemas-piaudit
http://xml.somecompany.com/Schemas/PIAudit\""
Note: Double quote (") characters embedded in command line parameters must be
escaped with a backslash (/) character.
A useful case is when you wish to bypass a corporate firewall by placing the XML XSD file
in the same directory as the XML file. You can obtain a copy of the default PIAudit.xsd file at
http://xml.osisoft.com/Schemas/PIAudit. You should save the displayed page as a local file
named PIAudit.xsd, and then move the file into the same directory where exported XML files
are stored.
The following command will export the XML with a reference to the PIAudit schema
PIAudit.xsd in the same directory as the exported XML:
Pidiag –xa ..\temp\pibasessAudit.dat –xh "xmlns=\"xml.osisoft.com-
schemas-piaudit\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-
instance\" xsi:schemaLocation=\"xml.osisoft.com-schemas-piaudit
PIAudit.xsd\""
Even though this still refers to the XML namespace definitions at
http://www.w3.org/2001/XMLSchema-instance, most readers such as Microsoft Internet
Explorer or Microsoft Excel use cached or built-in definitions so they will not need to
connect to the Internet.
Each Audit Database file is comprised of a header followed by the audit records. The header
states file path and name used during creation, the creation date, and EnableAudit mask
value. An audit record is created for each of the three action types: Add, Edit, and Remove.
On Add or Remove, the record contains the entire object definition. On Edit, just the changes
are shown.
Each database that supports auditing utilizes a general audit record format. The following are
table views of the generalized audit record.
Field Description
PIUser User who made change (Exception: In audit records from the PI Archive
subsystem, ID=0. See examples on page 21.)
ID Affected Record ID
Changes Table of specific changes. On Add and Remove, the change indicates each
attribute setting. On Edit, the change shows the before and after value of
changed attributes
Field Description
On Adds, the current property setting is shown in the After field. The Before field is empty.
On Removes, each property is shown in the Before field. The After field is empty.
The following sections show example audit records for each of the supported databases.
2.5.1 PI Points
The table below shows the audit record that results from a PI user called PIAdmin modifying
the compression specifications of the point with an id=9.
Page 16
2.5 – Example Audit Records
Changes
Compmin 10 0
Changes
Changes
DigitalState Code 3 3
Changes
Attribute set edits and point class edits involve four steps:
1. The original set is renamed to a temporary name.
2. The new set with desired attributes is added.
3. Implicit point class and point edits are performed.
4. If the first three steps are successful, the original set with temporary name is removed
from the database.
Each of these steps is audited. For additional information, see the PI Server Reference
Guide.
Changes
Name MyPtClass
Attribute1 Attribute1value
AttributeN AttributeNvalue
Page 18
2.5 – Example Audit Records
2.5.5 PIUsers
The table below shows an audit record for the description change for user Pidemo.
Changes
2.5.6 PIGroups
The table below shows an audit record for the removal of group Tests.
Changes
2.5.7 PITrusts
The table below shows an audit record for the creation of a PITrust:
Changes
Changes
2.5.8 PI Snapshot
Snapshot and Archive audit records are slightly different than the other databases. First, for
efficiency, only the Point ID for the affected point is shown. The Tag Name is not shown
because including it would hinder performance by requiring a query to the PI Base subsystem
to translate the Point ID to Tag Name. Second, the Event Timestamp as well as the Point ID
are included because they are needed to describe the record being modified.
The table below shows an audit record for Point ID 1852, showing the snapshot value being
changed from 99.99 to 14:
Changes
Value 99.99 14
Flags Null S
Notice that “Flags” has changed from empty to “S”. This is the substituted flag that PI Server
sets when an event is edited.
2.5.9 PI Archive
Archive modification attempts are posted via the Snapshot subsystem. The Snapshot
subsystem performs some validation. On successful validation, it creates an audit record
indicating it is a removal attempt or an edit attempt.
The attempt is then forwarded to the Archive subsystem for completion. If the modification is
successful, the Archive subsystem creates a corresponding audit record.
Removal
For Archive event removal, passing the value is optional. If it is passed, it is displayed in the
Snapshot audit record.
Page 20
2.5 – Example Audit Records
The user is identified through the Snapshot audit record but is shown as 0 in the Archive audit
record.
The following are the audit records generated by PISnapss and PIArchivess when an event
is deleted from the Archive:
Removal – PISnapss
Changes
Removal – PIArchivess
Changes
Value 3 Null
Edit
For an Edit call, the Before value is not displayed in the PISnapss audit record. The
corresponding archive record does pass and displays the old value. The user name is
displayed only in the Snapshot record. User ID is shown as 0 in the Archive audit record.
The following are the audit records generated by PISnapss and PIArchivess when an event
is edited in the Archive:
Edit – PISnapss
Changes
Edit – PIArchivess
Changes
Value 3 3.14159
2.5.10 PI DBSecurity
The table below shows an audit record for the edit of the DBSecurity entry for the PIPoint
table corresponding to group owner change and access change:
Changes
The table below shows an audit record for the creation of a DBSecurity entry for the
PIUpdmgr subsystem:
Page 22
2.5 – Example Audit Records
Changes
Note that new entries in the DBSecurity table can only be created by PIConfig. Once entered,
any DBSecurity table entry can be edited by the SMT, subject to security access limitations.
Modules
Modules are actually an array of module values. Modules support change over time. Each
module value represents the module that was in effect for a given time period. Therefore, a
module audit record is actually a module value change record.
A module value is uniquely identified by the module unique ID and the module effective
date. This is different from most audit records that just need the record ID for unique
identification. For example, the Point Database only needs the Point ID to identify the record.
The following is an example of a module record identification. It consists of the unique ID,
effective date, and name:
UniqueID=541061d0-748b-4dfb-99c5-c37b12a44fda, 31-Dec-69 16:00:01"
Name="Flatten"
Module Hierarchy
Modules are hierarchical. A module may have parent modules and child modules. Although,
inserting a module into a parent module is effectively an edit of both parent and child module,
the Audit database only shows this modification as a change to the parent.
Child modules are inserted into a specific value of the parent. This is an explicit edit of a
module value. The parent references of a child are not assigned to specific value. All module
values that represent this child implicitly acquire the link to the parent. Since it is implied a
child module was edited and to avoid clutter and confusion in the Audit database, only the
change to the parent is shown. The inserting of a child into a module is shown as a change to
the module’s Children attribute.
The following represents the change to that attribute when adding a child. Notice the after
value has the additional unique ID of the child that was inserted.
PIModuleAttribute="Children"
Before=f127f0e5-1237-48c7-beae-42bcc5a8d99c
After=f127f0e5-1237-48c7-beae-42bcc5a8d99c, 0c260103-8909-4007-9d14-
60f169feb3b4
PI Properties
PI Properties are hierarchical. Properties can have properties, which can have properties, etc.
Since properties do not have unique identifiers, a rename is indistinguishable from a deletion
followed by an addition.
Adding a PI Property is shown as an edit to the module by showing the parent property the
property was added to. All modules have an implicit root property called \\PIProperties.
The following are details of adding a root property with a value of 106.
PIProperty Name="Prop-106" ParentUNC_Name="\\PIProperties"
Value=106
Here are details of adding a sub-property to the above property.
PIProperty Name="Sub-Prop" ParentUNC_Name="\\PIProperties\Prop-106"
Value=99
The above examples focus only on the attribute that changed. The audit record contains
information that complete identifies the modified module. Also, renaming a property is
shown as a deletion followed by an addition in a single audit record.
PI Batches
PI Batch subsystem audit records are much like Module audit records. PIProperties are
handled identically as Module properties. Inserting a PIUnitBatch is similar to inserting a
child module: the PIUnitBatches property shows the list of Unique IDs that represent the
PIUnitBatches. The reference to the PIUnitBatch gains to the PIBatch is also shown as an
edit to the PIUnitBatch.
PI Unit Batches
PIUnitBatches only have one unique issue, which is showing changes to the PISubbatches
collection. This is handled similarly to PIProperties. Since sub-batches are uniquely
identified, renames can be represented as a rename.
Page 24
Chapter 3. THE PI AUDIT TRAIL MESSAGE LOG
You can configure the PI Server to create an audit trail on certain edits to the Data Archive or
to the PI Batch Database/SDK objects.
Audit Trail messages do not conflict with the Audit Database described in the previous
chapter. You may use either technique, or both.
Audit trail messages are logged to the PI Message Log database. These messages are
accessible through PI SMT, PI SDK, or the pigetmsg command. Consult the PI Server
System Management Guide for more information on file sizes and file management of the
Message Log.
When this feature is enabled, all deletions or edits to Data Archive events are logged.
Logging of archive value edits is a two part process involving both the Snapshot subsystem
and the Archive subsystem. The Snapshot subsystem is aware of the name of the PI user
requesting the change and, if the change is an edit, the new value. It does not know the old
value, since this value is known only by the Archive subsystem. The Archive subsystem, on
the other hand, does not know the PI user, but does know the original value being replaced.
To generate a complete record of the change, both subsystems write a message to the
Message Log. The message source name is Archive Edit for both, so that the messages can be
conveniently filtered.
3.3.1 Structure of Audit Trail Messages for Archive and Snapshot Changes
Archive Audit Trail messages always contain the following information:
Field Description
Field Description
Point ID Point ID
Page 26
3.4 – Log PI Batch Database/SDK Object Changes
PIBatch and PIUnitBatch object changes and deletions are recorded after logging is
enabled.
Both of these objects are automatically created and modified by Batch-aware interfaces.
These interfaces create and modify PIBatch or PIUnitBatches many times during normal
operation. Excessive log messages are avoided by logging only significant changes to
PIBatch and PIUnitBatch objects. Object creation is never logged. Object deletion is always
logged.
3.4.1 Structure of Audit Trail Messages for PI Batch Database/SDK Object Changes
When logging is enabled, the following changes are logged for each of these objects:
Field Description
All messages are recorded under the message source of PIBatchDb Edit along with the edit
time. The messages always record the pre-edit Start Time, pre-edit Batch ID, and Unique
ID. The other attributes are only reported if they are changed.
Here are some typical Audit Trail messages:
0 PIBatchDb Edit 1-Feb-01 13:34:02
>> Edit completed> PIBatch BID2 (9ce16c30-7bda-41ca-9010-bc57becf08e3)
1-Feb-01 13:33:49
New Start 1-Feb-01 13:33:50. Old Start 1-Feb-01 13:33:49
Page 28
TECHNICAL SUPPORT AND RESOURCES
Email Support
Email support is available 24 hours a day, 7 days a week. Send technical support
inquiries, including the problem description and message logs, to:
[email protected]. Technical Support will respond to your inquiry within 24
hours.
Knowledge Center
The Knowledge Center provides a searchable library of documentation and technical
data, as well as a special collection of resources for system managers. For these options,
click Knowledge Center in the Technical Support Web site.
• The Search feature allows you to search Support Solutions, Bulletins, Support
Pages, Known Issues, Enhancements, and Documentation (including User
Manuals, Release Notes, and White Papers).
• System Manager Resources include tools and instructions that help you
manage: Archive sizing, Backup scripts, Daily Health Check, Daylight Saving
Time configuration, PI Server security, PI System sizing and configuration, PI
Trusts for Interface Nodes, and more.
Page 30
INDEX OF TOPICS
Page 32
Index of Topics
PI3 Server
Version 3.4.370
Worldwide Offices
OSIsoft, Inc. is the owner of the following trademarks and registered trademarks: PI System, PI ProcessBook,
Sequencia, Sigmafine, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known to be
trademarks or service marks have been appropriately capitalized. Any trademark that appears in this book that
is not owned by OSIsoft, Inc. is the property of its owner and use herein in no way indicates an endorsement,
recommendation, or warranty of such party's products or any affiliation with such party of any kind.
Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)
of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
Copyright Notice
Unpublished -- rights reserved under the copyright laws of the United States
PREFACE – USING THIS GUIDE
The PI Server Reference Guide provides comprehensive information and instructions that
System Administrators need to understand, plan, administer and troubleshoot the PI Server,
PI subsystems, and PI System interfaces.
This guide includes the following topics:
Overview of all PI Databases
Data flow in the PI System
PI Point Classes and Attributes
Class Edit and Type Edit
Exception Reporting
Compression Testing
Security
SQL Subsystem
PI Time Format and Conversions
Overview of the PI Application Programming Interface (PI API)
This guide assumes that the System Administrator has a working understanding of PI Server
tools and utilities such as PIConfig, PIDiag and PIArtool. For additional information about
these command-line tools and other PI System setup and configuration procedures, see the PI
Server System Management Guide.
For a broader overview of the PI System architecture and system administration, see
Introduction to PI System Management.
The PI Server Documentation Set provides complete PI Server information and system
management procedures. It includes seven user guides, described below.
Tip: Updated user guides with the most up-to-date information may be available for
download from the OSIsoft Technical Support Web site:
(http://techsupport.osisoft.com).
Introduction to PI A guide to the PI Server for new users and administrators. It explains PI
System Management system components, architecture, data flow, utilities and tools. It provides
instruction for managing points, archives, backups, interfaces, security and
trusts, and performance. It includes a glossary and resource guide.
PI Server Installation A guide for installing, upgrading and removing PI Servers on Windows and
and Upgrade Guide UNIX platforms, including cluster and silent installations.
PI Server System An in-depth administration guide for the PI Server, including starting and
Management Guide stopping systems, managing the Snapshot, Event Queue and Data Archive,
monitoring system health, managing backups, interfaces, security, and
moving and merging servers. Includes comprehensive instructions for using
command-line tools: PIConfig, PIDiag, and PIArtool, and in-depth
troubleshooting and repair information.
PI Server Reference A comprehensive reference guide for the system administrator and
Guide advanced management tasks, including: databases; data flow; PI Point
classes and attributes, class edit and type edit; exception reporting;
compression testing; security; SQL subsystem; PI time format; and
overviews of the PI API, and PI-SDK System Management Tool (SMT).
Auditing the PI An administration guide that explains the Audit Database, which provides a
Server secure audit trail of changes to PI System configuration, security settings,
and Archive Data. It includes administration procedures to enable auditing, to
set subsystem auditing mode, to create and archive database files, and to
export audit records.
PINet and PIonPINet A systems administration guide, including installation, upgrade and
User Guide operations, for PINet for OpenVMS and PIonPINet, which support migration
and interoperability between PI2 and PI3 Systems.
Page iv
Preface - Using this Guide
Monospace Consolas monospace is used for: To list current Snapshot information every 5 seconds,
type: Code examples use the piartool -ss command. For example:
"Consolas" Commands to be typed on the
font command line (optionally with
arguments or switches)
System input or output such as
excerpts from log files and other
data displayed in ASCII text
Bold consolas is used in the
context of a paragraph
Light Blue - Links to URL / Web sites, and email http://www.osisoft.com/procedures.aspx
Underlined addresses [email protected]
Related Documentation
OSIsoft provides a full range of documentation to help you understand and use the PI Server,
PI Server Interfaces, and PI Client Tools. Each Interface has its own manual, and each Client
application has its own online help and/or user guide.
The UniInt End User Manual describes the OSIsoft Universal Interface (UniInt), which is
recommended reading for PI Server system managers. Many PI Interfaces are based upon
UniInt, and this guide provides a deeper understanding of principals of Interface design.
The PI Server provides two sets of powerful tools that allow system administrators and users
to perform system administration tasks and data queries.
The PI Server includes many command-line tools, such as pidiag and piartool. The
PI Server Documentation Set provides extensive instruction for performing PI Server
administrative tasks using command-line tools.
The PI System Management Tools (SMT) is an easy-to-use application that hosts a
variety of different plug-ins, which provide all the basic tools you need to manage a
PI System. You access this set of tools through a single host application. This host
application is sometimes referred to as the SMT Host, but it is more commonly called
System Management Tools or SMT.
You can download the latest version of SMT from the Technical Support Web site:
http://techsupport.osisoft.com
In addition to extensive online help that explains how to use all of the features in the SMT,
the SMT includes the Introduction to PI System Management user guide.
Page vi
QUICK TABLE OF CONTENTS
Table of Tables.................................................................................................................................xv
Page x
Table of Contents
Page xii
Table of Contents
Index of Topics...............................................................................................................................135
Page xiv
TABLE OF TABLES
The PI System is a set of software modules for plant-wide monitoring and analysis. It acts as
a data server for Microsoft Windows-based client applications. Operators, engineers,
managers, and other plant personnel use a variety of client applications to connect to the PI
Server to view plant data stored in the PI Archive or in external data storage systems.
The PI Server typically runs on one computer, while PI interfaces and client applications run
on a variety of other computers on the network. Such a distributed data collection architecture
offers several advantages over a monolithic architecture, including scalability, robustness,
and flexibility.
A PI Server includes:
PI Server Subsystems: The processes, called subsystems, that comprise the PI Server.
Configuration and administrative utilities.
Interfaces, including Random and Ramp Soak for simulated data, and PerfMon,
SNMP and Ping for monitoring purposes.
PI API and PI-SDK. This software is included with the PI Server for internal use by
the applications on the PI Server.
This chapter provides an introduction to these elements of the PI Server, and explains the
structure of the PI Server File system.
The PI Server consists of several interlocking processes, which this book refers to as
subsystems. The executable for each of the PI subsystems is installed in the PI\bin directory.
Six PI subsystems make up the core PI Server. Generally, the system cannot function to a
minimum level without these subsystems. Some subsystems depend on other subsystems for
proper behavior. All subsystems will wait for any dependent subsystems. The core PI
subsystems are listed in the following table.
Archive piarchss.exe Stores and serves the data after it Requires the PI
comes out of the Snapshot Snapshot Subsystem.
subsystem. Data consists of multiple
timestamped measurements for each
data point. This includes values such
as on/offs, pressures, flows,
temperatures, setpoints, etc.
Base pibasess.exe Maintains the Point Database, Digital Requires the PI Update
State Table and configuration Manager
databases for user and group
security. It also hosts the PI Module
Database.
Message pimsgss.exe Records status and error messages Messages are routed to
for the PI Server in a control log file. the Windows Event log
or UNIX standard
output if this subsystem
is not available.
Snapshot pisnapss.exe Stores the most recent event for each Requires the PI Update
point. Applies compression, sends Manager.
data to the Event Queue, and serves
Snapshot events to the client
applications.
In addition to the core PI Subsystems, the PI Server includes additional subsystems such as
Batch and Performance Equation Scheduler. These subsystems do not need to be running in
order for PI to be running. Some of these subsystems are licensed separately and might not be
installed on your PI Server.
Page 2
1.2 - Configuration and Administrative Utilities
Other Subsystems
Redirector piudsrdr.exe The Base, Archive, and Snapshot Subsystems use the
Redirector to obtain data from the external systems.
Shutdown pishutev.exe Determines when the PI system was stopped and writes
shutdown events to points configured to receive these events
(runs only at startup and then stops)
The PI Server for Windows and UNIX includes several utilities that are used to configure
points, monitor the data flow, manage the archives, and configure the security settings.
The PI Server comes with a wide variety of configuration and administrative utilities:
piarchss PI\bin PI Offline Archive Utility. This is actually the archive subsystem
executable—which you can run with command-line options, as a utility.
piarcreate PI\adm Archive creation utility. Once created, Archive files can be mounted
using piartool.
piartool PI\adm PI Archive Tool. This utility includes many commands to monitor,
inspect or modify the state of a running PI Server.
piconfig PI\adm A tool for configuring PI Server databases, such as the Point database
and the Digital State table.
pilistupd PI\adm A tool for monitoring the Update Manager, specifically for looking at
Event Queues.
pisqlss PI\bin Pisqlss is actually the SQL Subsystem—which you can run with
command-line options, as a utility.
piversion PI\adm Use piversion –v to get the version and build numbers of the PI Server.
To view usage information for any of these utilities, use the -? argument. For example:
pilistupd -?
Page 4
1.3 - Interfaces Installed with the PI Server
Each PI Server includes several interfaces. Two of these, Random and Ramp Soak, are
simulator interfaces. They can be configured to simulate random, sinusoidal, and batch data.
These are installed on the PI Home Node, but may be run remotely.
Three additional interfaces are useful for monitoring the health of your system and network.
Each is limited to a maximum of 512 performance points in the Point Database and can only
be run on the PI Home node.
PerfMon reads Performance Counters on Windows systems and stores the values in
PI points,
SNMP collects performance data from computer systems and network routers using
the Simple Network Management Protocol, and stores the values in PI points.
Ping monitors the network availability of computer systems by pinging them and
stores the response times in PI points.
A version of the interface without the 512-point limit may be purchased separately.
The PI Application Programming Interface (PI API) is a library of functions that allow
programmatic access to the PI System, both for data archiving and for retrieval. OSIsoft uses
the API internally to create interfaces that run on a variety of platforms. Users may also use
the API for their own applications.
The PI API is a library of functions that may be called from C, Visual Basic, or other
languages. These functions let you read and write values from the PI Server. They also let
you retrieve point configuration information.
The PI API also provides the ability to buffer data that is being sent to PI. This allows PI to
be taken offline for software or hardware upgrades without compromising data collection.
When PI becomes available again, the buffered data are then forwarded to PI.
API nodes are UNIX or Windows workstations that run programs such as interfaces that are
based on the PI API.
The PI Server file organization is a little different for Windows and UNIX platforms. Refer to
the section for the appropriate operating system.
Directory Contents
PI\dat Contains databases such as points and digital states. This is also the
default directory for Archive files and the Event Queue.
PI\interfaces Contains interfaces that were installed with previous versions of PI. Is
not present on new PI Server installations, but might be present on
Servers that are running upgrades.
The PI directory structure for Windows systems differs depending on whether the system is a
new installation or an upgrade.
Page 6
1.5 - PI Directory Structure
Directory Contents
PI/log Contains all PI log files. Log files for the interfaces may also be found in the
PI\interfaces subdirectories.
PI/patches Contains miscellaneous files that may be needed for some installations.
Page 8
Chapter 2. PI DATA FLOW
This chapter describes the flow of data through a PI Server and interfaces. PI typically stores
data in the PI Data Archive, which is managed by the PI Archive Subsystem. However,
Windows-based PI Servers can also retrieve data from foreign data-storage systems. Foreign
data-storage systems are, for the purposes of this book, any data systems other than the PI
Data Archive.
This chapter begins by explaining the flow of data from data sources to the PI Data Archive.
Later sections discuss data retrieval, both from the PI Data Archive and from foreign data
storage systems. This chapter contains the following sections:
Data Flow from Data Sources into the PI Archive begins on page 9
Data Retrieval from the Archive begins on page 13
PI Data Retrieval with Foreign Data Sources begins on page 14
Note: In the PI Server for UNIX, there is no COM Connector capability. All data must
be stored in the PI Data Archive.
The fundamental unit of data storage in the PI System is called an event. An event consists of
a timestamp, a value, and a status. In the simplest terms, interfaces collect data from data
sources, then send these data to the PI Server in the form of events. The PI Server then stores
these events in the PI Archive. This simple view of PI data flow is shown in the following
illustration.
In reality, the data flow is more complex than the preceding illustration indicates. The most
important thing to understand about PI data flow is that PI does not save every single event
that an interface collects. Instead, PI stores only significant events. A significant event is one
that is essential for recreating the original data. PI discards events that are not significant.
This section provides a more detailed description of the data path that an event follows from
the data source to the PI Data Archive and describes the places in the data path where PI
evaluates a point to see whether it is significant. The basic steps along the path are as follows:
1. The interface collects the data from the data source. The data sources can be almost
anything, including Distributed Control Systems (DCSs), Programmable Logic
Controllers (PLCs), lab systems, Supervisory Control and Data Acquisition systems
(SCADA), process models, and other business information systems. PI Performance
Equations, ACE, and Totalizer are also all data sources.
2. Each different data source needs a PI interface that can interpret it. Most PI interfaces
run on a separate computer, called an Interface Node. (The Interface Node is
sometimes also called the API Node.)
3. The PI interface uses exception reporting to determine which events to pass on the PI
Server and which are not needed. Exception reporting is a simple linear test that
determines whether the incoming value is significantly different from the existing
value. You set the specifications for exception reporting in the tag attributes for each
point. By tuning these exception specifications, you can ensure that the interface
passes on only values that are of interest to you.
4. The interface sends significant events to the buffering service, if the buffering service
is configured for that interface.
5. The buffering service sends the events on to the PI Server or, if the Interface Node
cannot connect to the PI Server, the buffering service holds the data until the Server
connection is restored. This is an important mechanism for safeguarding your data, so
it’s important to configure buffering for your interfaces, where possible.
Page 10
2.1 - Data Flow from Data Sources into the PI Archive
6. When an interface sends an event to the PI Server, it goes first into the Snapshot
Subsystem. The Snapshot Subsystem holds a “snapshot” of each point in the point
configuration database. This snapshot includes: the current value of the point, the last
archived value, compression specifications, and security attributes.
7. The Snapshot uses the information about each point to decide what to do with
incoming events for that point. If an event is out of order, the Snapshot sends it
straight to the archive. If the event is not out of order, the Snapshot Subsystem
applies the compression test.
8. PI uses the compression test to decide whether an event is significant. As in
exception reporting, you set the specifications for compression in the tag attributes
for each point. Unlike exception reporting though, compression testing is not linear.
PI uses a very sophisticated compression algorithm to determine whether it needs a
particular value in order to accurately reconstruct the data curve for a particular point.
9. If the event passes the compression test, the Snapshot sends it to the PI Event Queue.
10. The Archive Subsystem retrieves events from the Event Queue. Since the Event
Queue is a memory-mapped file, the events in it are persistent. This means that they
are recoverable in cases of unexpected crashes or delays.
SnapShot
1
2 Queue(s)
3
4 Compress
5
New Event
file(s)
Cache
0 m
RecNo 0
Other
On-Line
Archives
n Primary
Archive
Page 12
2.2 - Data Retrieval from the Archive
stores events for a point in memory until the data reaches certain configurable limits on size
and/or time since the last write to disk. Then the Write Cache data for that point is written to
the Archive files. By holding events for each point up to the specified limits, PI reduces the
frequency of disk access, improving overall performance.
Specifically, write cache events are flushed to disk at the following times:
When the Write Cache for a particular point reaches the maximum size, the data for
that point (and just for that point) is flushed to disk. The maximum number of events
in the Write Cache for each point is 256, but this is configurable by the
Archive_MaxWriteCachePerPoint setting in the timeout table.
Every record in the Write Cache is flushed at least once every Flush Cycle. The
default cycle is 900 Seconds (15 minutes) and can be configured using the timeout
parameter Archive_SecondsBetweenFlush.
Many applications request data from the PI Server system, for example, trends or PI
DataLink. Every such request translates into a low level call to the archive that retrieves the
raw data, values and timestamps. This raw data is always exactly what was put into the
archive by the interface. However, there are two exceptions where the data-retrieval functions
generate an extra event.
When the request spans a time period with no mounted Archive files, a digital state of Arc
OffLine is inserted one second after the end of the last scanned Archive file. This prevents
the interpolation of data over an unknown period, for example when an archive is offline for
maintenance.
This option is active by default but can be disabled by setting the timeout parameter:
MarkArchiveGaps, 0
Similarly, when requests for data go into the future, a NoData digital state is inserted one
second after the current time. If the Snapshot is in the future, then the NoData digital state is
inserted one second after the Snapshot, in order to prevent data extrapolation into the future.
The PI server rejects Snapshots more than 10 minutes into the future.
Requests for data before the oldest registered archive also return NoData.
Since these two digital states are used within the PI Server, we recommend not inserting them
into the archive as this can lead to misinterpretation of data-retrieval results.
The size of the Read Cache is configurable and, by default, a single point can use as many as
512 records from the pool. This number is configurable with the
Archive_CacheRecordsPerPoint parameter (the maximum value is half the cache pool).
Assuming enough memory resources, the limit on the total number of records in the Read
Cache is set to 4 times the point count, but can be manually overwritten by the
Archive_CacheRecordPool parameter.
You can use piartool -cas (cache statistics) to view cache information for a point, and
piartool -cad (cache diagnostics) to dump the information in both the read and write caches.
Data are sometimes not stored in the Archive or Snapshot Subsystem. They may be stored in
an external or ‘foreign’ data source. The Base, Archive, and Snapshot Subsystems can
request data from foreign data storage systems through modules called COM Connectors.
Each COM Connector is coded to interact with a specific foreign data system. A separate
COM Connector must be installed to communicate with each specific foreign data system.
A PI Server system may have any number of COM Connectors installed. Since the identity of
the COM Connector to use is determined on a point-by-point basis, a single PI Server system
can access any number of foreign data systems. It is not necessary to dedicate an installation
of PI Server strictly to communication with external systems.
The core Subsystems of the PI Server do not communicate directly with COM Connectors.
Instead, the Subsystems send requests to the PI Server Redirector, which acts as a request
broker. The Redirector loads one or more COM Connectors and forwards the requests to
them.
Note: The Redirector is a module in PI Server for Windows only. PI Server for UNIX
does not support the use of COM Connectors or the Redirector.
The Redirector and the COM Connectors are COM objects, implemented using Microsoft
Component Object Model (COM) technology. The Redirector is installed as part of the PI
Server. COM Connectors are installed separately.
COM Connectors are installed on the PI Server, but are not loaded into the Server’s memory
until needed. When PI shuts down, the Redirector and all COM connectors are automatically
unloaded from memory.
COM Connectors may be in-process or out-of-process COM objects. In-process COM objects
are .dll files, while out-of-process COM objects are .exe files. OSIsoft has developed some
COM Connectors to specific data systems. Others may be available from vendors or
integrators. In general, the decision to build an in-process vs. an out-of-process COM object
is made by the COM Connector developer.
The PI Server Redirector is an out-of-process COM object. It does not run as a service, which
means it will not be found in the Services control panel applet. When the Redirector is
running, system managers will be able to see a process called piudsrdr.exe in the Processes
tab of the Windows Task Manager.
Page 14
2.3 - PI Data Retrieval with Foreign Data Sources
Client applications are not aware of the difference between data retrieval from the PI Data
Archive and data retrieval from a foreign data storage system using a COM Connector. In all
cases, the application connects to the PI Network Manager. Each point from which data are
retrieved is identified by a tag, and has attributes stored in the PI Point Database, regardless
of the source of the data. The differences in data flow are implemented by the Snapshot and
Archive Subsystems. Details are in the sections Retrieval of Snapshot Data and Retrieval of
Archive Data, below.
The PI Server sends data to client applications in exactly the same way, regardless of whether
the data is stored in the Archive Subsystem or in a foreign data source. The same is true of
data requests from PI Server Subsystems such as the Totalizer, the Alarm Subsystem, and the
Performance Equation Scheduler.
The PI Server can put new data into a foreign data system if it is supported by the COM
Connector for the foreign data system.
ctr_progid COM program ID, as stored in the Windows registry. This name is used to
invoke the COM Connector object when needed.
ctr_lmap Longword mapping parameter. ctr_lmap and ctr_strmap are passed to the
COM Connector so that it can locate the appropriate foreign system point.
ctr_strmap String mapping parameter. ctr_lmap and ctr_strmap are passed to the
COM Connector so that it can locate the appropriate foreign system point.
PI Server ships with a point class called classicctr that contains these three point attributes as
well as the base and classic attribute sets. You can create this point class by executing the
script PI\adm\classicctr.dif using the piconfig utility. You may also use the contents of this
script as a basis for your own point class definition.
You construct points according to the specifications of the point class. A complete list of
point attributes is listed in PI Server Databases on page 19 in the Point Database section.
Point creation and maintenance are done using the PI TagConfigurator, a Microsoft Excel
spreadsheet-based tool, or piconfig, a script-based tool.
Whenever the point information indicates that the requested point is a mapped point, the
Redirector will obtain data values from the corresponding foreign system point.
Figure 2-2. Data Flow through Snapshot Subsystem, Redirector, and COM Connector
Page 16
2.3 - PI Data Retrieval with Foreign Data Sources
If archive values for a mapped point are requested, the data path is different. In this case, the
Archive Subsystem requests the value from the Redirector, which in turn obtains the value
from the appropriate COM Connector
Figure 2-3. DataFlow through Archive Subsystem, Redirector, and COM Connector
2.3.6 Compression
PI Server does apply the PI Data Archive’s data compression algorithm to mapped foreign
points. If the COM Connector supports putting new data values into the foreign system, then
that system is responsible for their storage. The foreign system may or may not support
compression.
Page 18
Chapter 3. PI SERVER DATABASES
The PI Server includes several databases that store PI configuration information and process
data. The two main databases are the Point Database and the Data Archive. Other parts of the
system, including the Snapshot Subsystem, the Digital State Table, and Module Database,
support the main databases.
System Management Tools as well as a set of command line utilities are used to configure
and manage the PI Server.
See also PI Server System Management, and documentation about free System Management
tools posted on the OSIsoft Web site.
The most important configuration database is the Point Database. This contains the list of
points that are either recorded in the PI Data Archive or mapped to points in foreign data
systems when COM Connectors are used. The points whose data are stored in PI Data
Archive are sometimes called native PI points. The points whose data are stored in foreign
data systems are interchangeably referred to mapped points or COM Connector points. The
Point Database stores configuration information for each point as a list of point attributes.
Attributes are grouped into attribute sets, which in turn are grouped into point classes. The
Base class, Totalizer class and Classic class are some of the point classes commonly used in
PI. When a point is created, it is assigned a point class, which restricts the point to a specific
set of attributes.
For a complete explanation of the PI point classes and point attributes, refer to PI Point
Classes and Attributes on page 41.
The most important process information database is the Data archive. The archive is a
historical record of values for each point in the Point Database.
The Data Archive contains the time-stamped values for all the points in the Point Database.
The time-stamped values are stored in a set of disk files. Each file covers a different,
non-overlapping time period. Three archive files are created during installation. Additional
archives can be created when needed, using the utilities provided. The archive files may vary
in size.
Caution: When you delete a point, the records for that point in the current archive
are made available for reuse. A consequence of this is that all history is irrecoverably
lost for the deleted point. Records in old Archive files that contain data for the
deleted point are not directly accessible. However, the data can be recovered using
the Offline Archive Utility using an ID-conversion table.
3.3 Snapshot
The Snapshot Database contains the most recent value, status, and time stamp for each point
in the Point Database.
The Snapshot database piarcmem.dat contains mostly frequently updated data. If this file is
damaged it can be rebuild using pibasess –snapfix. Snap fix rebuilds this file based on the
point database and sets all values to a Shutdown status; normal data collection quickly
replaces Shutdown statuses with new values. Many PI Systems have a few points that update
very infrequently; in this case these values will remain at Shutdown until a new Snapshot
value is received.
The PI Snapshot Subsystem actually maintains several databases. The pimapevq.dat
maintains the Event Queue. If pimapevq.dat (or pimq####.dat, where #### is a hexadecimal
number between 0000h and FFFFh) is corrupted, pisnapss may not be able to start. In this
case the file can be renamed and pisnapss will create a new one. Offline archive recovery
tools can be used to recover data from this file. The file pilastsnap.dat maintains the Snapshot
time of the newest event. This is used to determine the PI Server shutdown time. This file is
overwritten every 10 minutes and during PI Server shutdown.
Two utilities provide access to the Snapshot Database. The pisnap.sh (UNIX) or pisnap.bat
(NT) utility can be used to view the contents of the Snapshot. The piconfig utility can be used
to both view and modify the contents of the Snapshot.
3.4 Annotations
Every value in the Snapshot or the Archive may be annotated. An annotation can be of any
data type.
Page 20
3.4 - Annotations
Annotations can be accessed via the PI-SDK. Text annotations can be added and edited using
piconfig. This option should only be used for testing and verification.
Applications using the PI-SDK can add/edit annotations for a specified Archive event.
The Batch Database uses annotations to store the following object types:
PIBatches
PIUnitBatches
PITransferRecords
Note: The PI SDK supplies a programmatic interface for creating, accessing and
editing annotations. The PI SDK User Guide and online help are the best source for
details on valid variants for annotations.
Annotations are best understood with a simplified description of creating and accessing them.
For example:
1. A PI-SDK based application creates a variant. Variants can be of many types, such as
strings, an array of strings, various numeric types, etc. For this example, the variant is
an array of strings. The first string may be a lab technician’s name, the second string
may be a comment.
2. This same application creates a timed value, for example, a value and timestamp that
represent a manual measurement made on a piece of lab equipment. The variant
created above is associated with the timed value—the value is now annotated. The
PI-SDK is used to make this association. In this example, the annotation contains the
technician making the measurement and an associated comment.
3. The annotated value is then sent to the PI Snapshot. This is sent just as any other
event. The difference is that the event also contains the annotation.
4. Annotated events will always bypass compression. Upon reaching the Snapshot, the
annotated event is sent to the Archive via the Event Queue.
5. From the queue, the annotated event is written to the cache. Then, a few special steps
are taken writing the annotated event to the Archive.
First the target Archive and the Archive’s Annotation file is found. The variant that
represents the annotation is written to the Annotation file. On writing to the file, the
annotation is assigned a handle. The handle represents where in the Annotation file
the annotation was written.
Finally, the annotation handle is written to the event and the event is written to the
Archive. The event contains the timestamp, value and handle to the associated
annotation.
6. Annotation retrieval starts by accessing the event. The event is accessed by normal
PI-SDK data access, such as get plot values or get archive value. Annotations may be
quite large, so annotations are never returned by normal Archive access. The PI-SDK
represents events as timed values.
7. The PI-SDK timed value, if annotated, supports retrieving the annotation. Annotation
retrieval requires a call the PI Server, where the annotation handle is used to read the
annotation from the Annotation file and return it to the caller.
8. Annotations may be edited and posted back to the PI Server to replace an existing
annotation. This works like any Archive event edit, except the event is annotated.
Filling an archive will cause a shift of both the Archive and Annotation file; filling an
Annotation file will cause a shift of both the Archive and Annotation file.
Annotation files grow as annotations are added; they generally use significantly less
space than the Archive. On most systems the Archive fills before the Annotation file.
The annotation size is limited by the Event Queue page size, which has a default size of 1MB
and a maximum size of 8MB. You set Event Queue page size using the timeout parameter,
Snapshot_EventqueuePageSize.
Annotation file statistics are shown with the archive listing utility piartool –al. The following
is output from an archive listing:
Archive[0]: D:\PI\dat\piarch.033 (Used: 1.8%)
PIarcfilehead[$Workfile: piarfile.cxx $ $Revision: $]::
Version: 7 Path: D:\PI\dat\piarch.001
State: 4 Type: 0 Write Flag: 1 Shift Flag: 1
Record Size: 1024 Count: 131072 Add Rate/Hour: 1.7
Offsets: Primary: 20/65536 Overflow: 128673/131072
Annotations: 10826/65535 Annotation File Size: 434144
Start Time: 19-Oct-05 12:39:10
End Time: Current Time
Backup Time: Never
Last Modified: 19-Dec-05 13:10:32
In the above listing, the Archive file is d:PI\arc\piarch.033. The corresponding Annotation
file is d:PI\arc\piarch.033.ann. There are 10,826 annotations; with room for a total of 65,535.
This number is configurable with the parameter Archive_MaxAnnotations, which only
controls the number of annotations in the primary archive. Note however that Annotation
files are limited to 2GB in size. In the above example, the Annotation file is 434,144 bytes (or
424KB).
The Annotation file always is identical path and name to the archive with the .ann suffix. As
archives are loaded, Annotation files are loaded, using this naming convention. The
Annotation file is created if it does not exist. It is important the Archive and Annotation files
remain together—most importantly when a backed up archive is restored.
System management needs for Annotation files are simple—keep the Archive file
and corresponding Annotation file together:
• Archive backups should copy the Annotation file to the same backup location.
Page 22
3.5 - Digital State Table
The Digital State Table contains the digital state sets. A digital state set has a name and
consists of a list of states, sometimes called digital state strings. For example, we can define
the digital state set Valve-state-set as containing the two states OPEN and CLOSE.
When retrieving digital state strings using the PI API, note that the state strings will be
truncated to 79 characters.
State Use
I/O Timeout Interfaces use this state to indicate that communication with a remote device has
failed.
No Data Data-retrieval functions use this state for time periods where no archive values
for a tag can exist. 10 minutes into the future or before the oldest mounted
archive.
Under Range For float16 point types, this state indicates a value that is less than the zero for
the tag.
Over Range For float16 point types, this state indicates a value that is greater than the top of
range (zero+span) for that tag.
Pt Created A tag is given this state when it is created. This is the value of a tag before any
values have been put into the system for that tag.
Shutdown All tags that are configured to receive shutdown events get set to this state on
system shutdown.
Arc Off-line Used by data-retrieval functions to indicate a period of time not covered by any
mounted archive.
Bad Input Interfaces use this state to indicate that a device is reporting bad status.
The System Digital State Set also contains all of the digital state strings found in the PI 2.x
Digital State Table. See the PI Server System Management Guide for details on how to get a
list of these.
Note: The last possible state in the System Digital State Set (number 16383) is
reserved for the PI System’s internal usage. OSIsoft recommends minimizing
changes to the System Digital State Set. At most, you can translate the states into
another language without changing their meaning. Digital points should use a user-
defined digital set. Not the System Digital State Set.
Page 24
3.6 - Timeout Database
The PI Timeout database, also called the Timeout Table contains a variety of PI Server
configuration parameters. Originally the PI Timeout database contained only timing
parameters, but other PI Server settings are now included in the Timeout database. In most
cases, the default values for these parameters are best, however in some situations you might
want to adjust one or more parameters to tune the PI Server performance.
All <subsysname>_Writ 10 – 900 Startup only PI internally keeps track of the last
eModTimesToFileP (60 sec) modified date of most of the files that it
eriod needs to back up. The last modified times
for each subsystem are updated every
WriteModTimesToFilePeriod. The
smaller the period, the more accurate the
last modified time will be.
A complete list of backed up files along
with their last modified dates can be listed
with the piartool –backup –identify -
verbose command. For archives, the last
modified date can also be viewed with
piartool –al.
Note for Archive files:
When a value is written to a PI point, the
value is not actually written to the archive
until the archive cache is flushed. The
maximum period between archive flushes
is set with the
Archive_SecondsBetweenFlush timeout
parameter. After the cache is flushed, the
last modified time will be updated within
WriteModTimesToFilePeriod seconds.
Archive Archive_AutoArchiv - before every Automatic Archive file creation on shifts. If
eFileRoot (path + shift present, this parameter defines the path
name prefix) and file name prefix to be used for new
archives. Example: "C:\PI\arc\auto_"
Page 26
3.6 - Timeout Database
Archive Archive_CacheTrim 1 – 75 startup only Percentage to trim the read and write
Percent (40 %) cache when low physical memory
resources are detected.
Page 28
3.6 - Timeout Database
Archive Cache_FreelistSize 1000 – startup only Size of the list of reusable cache records
100000 that were discarded from the read-only
(10000 record pool. This parameter should only
records) be changed upon recommendation from a
technical support engineer.
Archive MarkArchiveGaps 0–1 startup only Return special "Arc Off-line" events when
(1 boolean) Archive files are taken offline or when time
gaps are detected in mounted archives.
The archive offline markers are primarily
useful to prevent any mis-interpolation of
data across missing archives.
Page 30
3.6 - Timeout Database
Page 32
3.6 - Timeout Database
NetManager connectionlocktimeo 1 – 1000 startup only Amount of time to wait for a connection
ut (90 sec) locked by another thread.
NetManager connectionwait 1000 – startup only Amount of time for a new TCP/IP
1000000 connection to become writable.
(30000
msec)
NetManager DefaultUserAccess 0–1 startup only Enable guest (or "world") access to the PI
(1 boolean) Server.
NetManager HealthCheckInterval 60 – 1000 startup only Frequency at which health checks are
(1800 sec) performed between NetManager and the
PI Subsystems. NetManager will close
connections if subsystems don't respond
to health checks.
NetManager keepalive -1 – 1 startup only TCP/IP keepalive option. A value of -1 is
(-1 sec) the system default, 0 indicates disabled.
NetManager minbufsize 1 – 1000 startup only TCP/IP send and receive buffers
(8 KB)
NetManager pinetmgr 1– startup only Subsystem wait time after every main loop
10000000 iteration.
(10000
µsec)
Page 34
3.6 - Timeout Database
SQL pisqlss 1– startup only Subsystem wait time after every main loop
10000000 iteration.
(12000µsec)
Totalizer pitotal 1– startup only Subsystem wait time after every main loop
10000000 iteration.
(12000µsec)
UpdateMan MaxUpdateQueue - startup only Maximum number of events per consumer
ager (4095) held in the Update Manager.
UpdateMan PIUPD_TimeoutKill 0–1 startup only Remove timed out consumers in addition
ager Cons (0) to removing all pending events.
UpdateMan piupdmgr 1– startup only Subsystem wait time after every main loop
ager 10000000 iteration.
(12000
µsec)
UpdateMan TotalUpdateQueue - startup only Maximum number of events in Update
ager (100000 Manager for all consumers.
events)
Utilities CheckUtilityLogin 0–1 startup only Force an interactive login from console
(0) utilities (piconfig, pisetpass).
Utilities pigetmsg 1 – 1000000 startup only Subsystem wait time after every main loop
(1000µsec) iteration.
Utilities pilistupd 1 – 1000000 startup only Subsystem wait time after every main loop
(1000µsec) iteration.
Page 36
3.7 - Firewall Database
Readtimeout Time in microseconds to block in select call while reading and assembling a
message
Readretry Number of retries to attempt while reading and assembling a message. Retries
are attempted only on fatal errors, which are: EAGAIN, EWOULDBLOCK,
ENOBUFS, and EIO.
The following message in pinetmgr.log (PI 3.1 build 2.74 and later) indicates that the
READTIMEOUT or WRITETIMEOUT timing parameter reached the set limit.
PIstream::recv(SOCK_Stream *, int): select failed1 0
The following message in the application standard out indicates that the READRETRY or
WRITERETRY timing parameter reached the set limit.
PIstream::recv(SOCK_Stream *, int): max retries exceeded
The PI Firewall is a security feature that allows the PI Server Manager to control access to the
PI Data Archive at the IP network address level. System administrators can allow or deny
access by specific computers this way. More information is available in PI Server System
Management Guide, Chapter 1, PI System Management.
As of release 3.3, the Proxy Database is no longer in use. The Trust Database replaces it.
During upgrade, existing proxy entries are converted to trust entries.
The Trust Database is used to grant PI client application access to the PI Server
automatically. This is necessary for PI API and PI-SDK applications that run unattended,
such as interfaces. It also allows for PI-SDK applications to support single user logons. The
process authorizes the use of the access rights of a specific PI Server user.
The PI System Administrator creates records in the Trust Database, mapping credential
attributes such as Domain name, IP host name, IP address, Application name, and Operating
System Username to a PI user.
Trusts can be specified exactly or by allowing entry, for example, to a group of users from a
given domain.
The connecting application and PI Server obtain information about the client’s credentials.
During client connection, the Trust Database is scanned for a match with the client’s
credentials. If a match is found, the application is granted the access rights of the specified PI
user.
It is possible that more than one trust record matches the incoming entry specifications. In
such cases, the entry that matches the entry most closely will be granted access.
See PI Server System Management Guide, Chapter 1, PI System Management, for more
details on configuring trust database records.
The Trust Database includes all the previously defined PIproxy records.
The PI User Database is where all PI users are defined. They may be assigned to groups.
Groups must already be defined in the PI Group Database. Passwords are also stored here.
Users maintain their passwords using the pisetpass utility.
The PI Group Database is where all PI groups are defined. Members of each group may be
viewed here. Membership is assigned only in the PI User Database.
The PI Module Database stores and maintains all the data objects associated with the Module
Database. This includes PIModules, PIHeadingSets, and PIHeadings. PIBasess maintains
this database. All access to the PI Module Database is provided by the PI-SDK.
The PI Batch Database is the database for the PI Batch objects supported by the PI-SDK. This
database is independent of the PI Batch Subsystem and the databases it maintains. The PI
Batch Database is actually part of the PI Archive and is therefore, maintained by the PI
Archive Subsystem. All access to the PI Batch Database is provided by the PI-SDK.
The following table provides a list of database files for your reference. The files are
organized by the subsystem to which they belong.
PIbasess Databases
Page 38
3.14 - List of Database Files
PIbasess Databases
piptsrcind.dat Point Source index file. This is an index that allows for quick lookup by
pointsource. This file is rebuilt automatically if it does not exist.
PIModuleUnitDb.dat Batch process unit index--an index of all modules with the IsPIUnit flag set
to true. Automatically rebuilt if it does not exist.
piptcomind.dat Index of com connector points. Automatically rebuilt if it does not exist.
PIMsgss Databases
PINetmgr Databases
PIShutev Databases
Pisnapss Databases
PIbasess Databases
PISqlss Databases
Page 40
Chapter 4. PI POINT CLASSES AND ATTRIBUTES
A point is any measurement or calculation that is stored in the data archive. Points can
represent transmitter readings, manual inputs, status control limits, and so on.
Note: The terms point and tag are sometimes used interchangeably, but the tag is
actually the name of the point.
The configuration information for each point is stored as a list of attributes in the Point
Database.
The Point Database has several different point classes, such as Base and Classic.
Point class is assigned when the point is created. Each point class has a different set of
attributes which define the parameters that describe a point. Default is Base point class.
The Base point class contains 39 attributes. Other point classes, such as Totalizer and Classic,
include more attributes, in addition to the 39 attributes from the Base point class. The
Totalizer Point Class is discussed in the PI Server Applications Guide.
Use the piconfig ptclass command to access the attributes belonging to a particular point
class. For example, to display the attributes of the Classic point class, you would type:
@table pipoint
@ptclass classic
@?atr
As a shortcut, you can specify the point class name while setting the pipoint table with a
single piconfig command:
@table pipoint,classic
The piconfig command ptclass is not to be confused with the attribute ptclassname.
The Base class is a common set of attributes that all other point classes include. This section
describes the user-assigned base class point attributes. The Base class also includes a set of
system-assigned attributes that users cannot edit. See System-Assigned Attributes on page 55.
4.2.1 Tag
The Tag attribute is the name of the point. Each Tag must be unique to a PI System. Since the
tag is the name that identifies the point to users, it’s a good idea to use a consistent tag-
naming convention that is meaningful to people in your organization. For example, you could
reserve the first two characters of a tag to indicate a unit name or an area of the plant. You
could reserve another 6 characters to match the standard instrument tag, and so on.
Tags may be any length and can include letters, numbers, and spaces. Tags are subject to the
following constraints:
The first character must be alphanumeric, ‘_’, or ‘%’
No control characters are allowed; such as linefeeds or tabs
The following characters are not allowed:
* ’ ? ; { } [ ] | \ ` ‘ “
(However, these characters are allowed in other tag attributes, such as the descriptor.)
Any tags that follow the above rules are, technically, allowed. However, be aware some legal
characters, such as the ‘_’, are used by other applications in special ways. For example, SQL
uses ‘_’ as a wild card. Using these in tags, may cause problems with these applications.
Note: The PI API functions pipt_tag and pipt_updates truncate the tag to 12
characters. Routines pipt_findpoint, pipt_wildcardsearch, pipt_taglong, and
pipt_tagpreferred will report only the first 80 characters.
Case Sensitivity
The system preserves the case of all strings, including the tag, but searches are not case-
sensitive. For example, a string entered as BatchStart is stored exactly as entered. Subsequent
retrievals of this string retain the same capitalization. A search for this string does not require
that the capitalization match.
4.2.2 PtClassName
The PtClassName attribute needs to be defined at point creation time. PtClassName defines
what attributes a point is to have. Prior to PI 3.4.370 the point class of a point could not be
changed once the point was created. In versions 3.4.370.x or greater it can be edited. See
Point Class Edit.
Page 42
4.2 - Base Class Point Attributes
4.2.3 PointType
There are many point types in the PI Server. PointType is assigned when the point is created.
Prior to PI 3.4.370.x this attribute could not be changed, but in versions 3.4.370 or later it can
be edited. See Point Type Edit.
Digital Used for points whose value can only be one of several discrete states, such as
ON/OFF or Red/Green/Yellow. Nearest equivalent to the PI 2.x Digital type.
Int16 Used for points whose values are 15-bit unsigned integers (0 to 32767). Nearest
equivalent to the PI 2.x Integer type.
Int32 Used for points whose values are 32-bit signed integers (-2147450880 to
2147483647). PI reserves the lowest 32K values of the 32bit range for digital states.
Float16 Used for floating point values, scaled. The accuracy is one part in 32767. Nearest
equivalent to the PI 2.x Real type.
Blob Binary large object – Used to store any type of binary data up to 976 bytes.
Timestamp Used to store values of type Timestamp. Any Time/Date in the Range 1-jan-1970 to
1-Jan-2038
4.2.4 NewTag
The NewTag attribute is used for renaming tags.
4.2.5 Descriptor
The Descriptor is a text field that appears on various client application displays and may be
used in reports. It may be of any length up to 65,535 characters. When this value is read
through the PI API it is truncated to 26 characters.
Be aware that some interfaces use the descriptor for tag configuration on external system.
Having quotes or wild card characters might lead to confusion when these attributes are
passed to other applications.
4.2.6 ExDesc
The Extended Descriptor is a text field of any length (although it is truncated to 80
characters when reported through PI API). For most points, it is used only to provide
additional information for documentation. Several interfaces use this attribute to encode
additional configuration information.
Page 44
4.2 - Base Class Point Attributes
4.2.7 TypicalValue
The Typical Value is used only to document an example of a reasonable value for this point.
For a numeric tag, it must be greater than or equal to the zero, and less than or equal to the
zero plus the span.
4.2.8 DigitalSet
Only Digital type tags use the DigitalSet attribute. It is irrelevant for other type tags and can
be ignored.
A collection of digital states is called a digital state set. For example, a digital state set can
consist of two states {OPEN, CLOSED}. You might also define a digital state set that
consists of {RED, GREEN, BLUE, YELLOW, and ORANGE}. Typically there will be many
digital state sets defined for a system.
For digital points, the DigitalSet attribute specifies the name of the digital state set associated
with the tag. The DigitalSet attribute has no meaning for non-digital tags. However all tags
are associated with the system state set. The system state set contains a collection of all the
states that may be used for any point. Examples are Shutdown, Over Range, I/O Timeout, etc.
4.2.9 Zero
A zero is required for all numeric data type points to indicate the lowest value possible. It
does not have to be the same as the instrument zero, but that is usually a logical choice.
Certain interfaces require that the zero and span match the instrument system range; see the
interface documentation for details.
The zero is the bottom of the range used for scaling float16 values in the PI Archive. If the
value for a float16 type point is less than the bottom of range, it is recorded in the archive as
Under Range. The digital state is substituted for the under range value when the archive
cache is flushed to disk. The zero is also used when defining a PI ProcessBook trend with a
vertical scale of database.
This attribute is not used for non numeric points.
4.2.10 Span
The Span is the difference between the top of the range and the bottom of the range. It is
required for all numeric data type points.
For float16 point types, the span is used with the zero for scaling values in the archive. The
span must be a positive value. If the value for a point type float16 point is greater than the top
of range, it is recorded in the archive as “Over Range.” For other point types, zero and span
do not affect the values recorded in the archive.
The span is also used when defining a PI ProcessBook trend with a vertical scale of database.
This attribute is not used for non numeric points.
collected before the edit. The new zero and span are used for data collected after the edit.
When span is changed, the exception and compression deviation percents are preserved. This
means that the excdev and compdev fields, which are expressed in engineering units, are
modified internally. If any of the deviation fields is specified in the editing operation they
take precedence.
Note: Some interfaces might use Zero/Span information to filter incoming data.
These interfaces often convert out of range data to digital states over range and
under range, however, interfaces might use Zero/Span configuration in other ways.
The PI Server itself does not change out of range data except for tags of type
Float16.
4.2.12 EngUnits
The engineering unit string describes the units of the measurement. You may use any string,
and the string may be of any length. However, the PI API will retrieve only the first
12 characters. The PI-SDK does not truncate the string.
Examples include:
DEGF
Degrees Centigrade
Gal/Min
Gallons Per Minute
‘“Hg
Engineering unit strings are case preserving and case-insensitive. The system trims leading
and trailing blanks are trimmed during input.
A single quote (‘) in a string must be preceded by a double quote (“). Similarly, a double
quote in a string must be preceded by a single quote. Long strings can be used for more
readable engineering units.
4.2.13 PointSource
The PointSource attribute is a string that associates a tag with an interface or PI module. In
order for an interface to read or write to a point, the PointSource attribute must match the
point source setting for that interface.
The default point source is “Lab.” Use this for points that are not associated with any
interface to specify lab-input points.
The ‘%’ (percent) character has also special meaning for SQL and other applications. Using it
as a point source can lead to confusion. Similarly, it is advisable to avoid using ‘?’ or ‘*’ as
point source character.
4.2.14 SourceTag
For data output to other systems, the SourceTag is the PI tag of the data source. For example,
you can define a tag ABC to receive data using point source A, then define another tag DEF
Page 46
4.2 - Base Class Point Attributes
to send this information to another instrument system using point source B. The source tag
for tag DEF would be ABC. This attribute is used by some interfaces, while other interfaces
use the extended descriptor (ExDesc) for this information.
The SourceTag attribute is not stored in the Point Database. It is only a more readable
representation of the srcptid attribute which holds the source point ID. srcptid does not exist
in all point classes. For example, it is part of the classic point class but not of base. If you try
to edit SourceTag for points of point-classes that do not have the attribute, you get an error.
the deviation. For points associated with interfaces that send exception reports, the
CompMin should be 0.
CompMax: Events are also archived if the elapsed time is greater than the maximum
time. The recommended maximum time specification is one work shift (e.g., 8
hours). Duplicate values will be archived if the elapsed time exceeds CompMax.
Under no circumstances does this cause PI to generate events; it only filters events
that are externally generated.
CompDev: The most important compression specification is the deviation,
CompDev. Setting this value too low causes too little data compression and wastes
space in the archive. Setting this value too high causes loss of useful data. For most
flows, pressures, and levels, use a deviation specification of 1 or 2 percent of span.
For temperatures, the deviation should usually be 1 or 2 degrees.
CompDevPercent: This is similar to CompDev, but it specifies the compression
deviation in percent of Span rather than in engineering units. If one is changed by
user, the other is automatically changed to be compatible. If both are changed at once
CompDevPercent takes precedence.
For non numeric tags, CompDev and CompDevPercent are ignored. They will be displayed
by applications as zero.
4.2.19 Archiving
The Archiving flag must be set to ON (1) for a point to be archived. This flag can be set to
OFF (0) to stop archiving of a point.
4.2.20 Step
The Step flag affects only numeric points. It defines how numeric archived values are
interpolated. The default behavior, step OFF (0), treats archived values as a continuous
signal. Adjacent archived values are linearly interpolated. For example, at 12:00:00, the value
101.0 is archived and at 12:01:00, the value 102.0 is archived. A request for the archive value
at 12:00:30 would return 101.5.
A step flag of ON (1) treats the archived values discretely. Adjacent archived values are not
interpolated; an archived value is assumed constant until the next archived value.
For example:
At 12:00:00, the value 101.0 is archived,
At 12:01:00, the value 102.0 is archived,
Page 48
4.2 - Base Class Point Attributes
DisplayDigits
The DisplayDigits attribute controls the format of numeric values on screens and in reports.
Zero or a positive number indicates the number of digits to display to the right of the decimal
point. A negative number indicates the number of significant digits to display. In this case,
the absolute value of DisplayDigits is the number of significant digits.
The following table shows how a value of 23.45 would appear on the screen for different
values of DisplayDigits:
DisplayDigits Format
3 23.450
2 23.45
1 23.5
0 23.
DisplayDigits Format
-1 2E+001
-2 23.
-4 23.45
Shutdown Flag
In some cases it is useful to record, to PI Points, when the Archive was shut down. That way
there is a clear indication of a gap in the data collection. Points may be configured so that PI
will automatically add a shutdown event with the timestamp of the PI Server shutdown.
These events are called shutdown events.
The shutdown flag for a point is set to TRUE (1) to indicate that shutdown events should be
recorded for this tag. The default is TRUE.
For points collected from interfaces on distributed collection nodes, set this flag to FALSE
(0) because data buffering in PINet or PI API will retain the data until the home node is
running again. Therefore, there are no data gaps to identify with shutdown events.
Many sites configure points that store laboratory test values so that the lab test points will not
receive shutdown events. Lab values are assumed to be constant between tests. Inserting
shutdown events for these points can be misleading.
The shutdown flag is used in conjunction with the configuration file dat\shutdown.dat.
Standard OSI interfaces rely on classic attributes. Use the Classic point class for all points
using a PI interface that uses the InstrumentTag or location code attributes.
4.3.3 SquareRoot
Some interface programs use the square root code. Check the manual for your interface.
Page 50
4.3 - Classic Point Class Attributes
4.3.5 Filtercode
The Filtercode indicates the time constant of a first-order filter used to smooth incoming
data. OSIsoft recommends not altering incoming data by leaving this code at its default value
of 0. The other options are:
1 10
2 60
3 120
4 600
4.3.6 Totalcode
The Totalcode was used by the PI System for OpenVMS to control Totalizer processing. PI
for Windows and UNIX do not use Totalcode. See Totalizer Subsystem in the PI Server
Applications Guide for instructions on configuring the Totalizer for PI for Windows and
UNIX.
4.3.7 Srcptid
This is the PI point number corresponding to the tag specified in the SourceTag attribute. If
this attribute is edited, PI will change SourceTag to the corresponding tag. This attribute
should not be altered directly; change SourceTag instead.
4.3.8 Convers
The Convers attribute was used by the PI System for OpenVMS to control Totalizer
processing. PI for Windows and UNIX does not use Convers. See Totalizer Subsystem in the
PI Server Applications Guide for instructions on configuring the Totalizer for PI for
Windows and UNIX.
The PI API protocol defines the ExcMax and CompMax attributes as a signed 16-bit integer.
If the PI Server stores a value that is larger than 32,767, the value returned by the PI API will
be 32,767.
PI-SDK applications will obtain from the PI Server a signed 32-bit integer values for
ExcMax and CompMax.
COM Connectors allow the PI Server to obtain data from foreign data systems. To do this,
you must create a special PI Server point whose attributes identify the location of the data in
the foreign system.
The term map is used throughout this manual to mean making a relationship between a point
on the foreign system and a point on the PI Server. During PI Server operation, clients make
requests for data by using PI Server point information. The PI Server will then obtain data
from the foreign system point to which the PI Server point is mapped.
The PI Server does not use a specific value of the PointSource attribute to identify mapped
points. A specific point class name is not needed either. Instead, you must define a point class
that includes the following attributes:
When you create a point, at a minimum you must specify the tag attribute. For all other
attributes, if you don’t assign a value to that attribute, then PI uses the default value. The
default values for PI point attributes are listed in the following table.
Page 52
4.5 - Default Values for Point Attributes
Point Default
Class Field Name Value Limits
Classic Convers 1
Base DataAccess O:rw g:r w:r Owner, group, and world may be
assigned read, write, or no access
(blank)
Base DigitalSet no default Used only for digital tags This must
be specified when the point is
created.
Classic Filtercode 0
Point Default
Class Field Name Value Limits
Classic Location1 0
Classic Location2 0
Classic Location3 0
Classic Location4 0
Classic Location5 0
Base NEWTag
Base PtAccess O:rw g:r w:r Owner, group, and world may be
assigned read, write, or no access
(blank)
Classic Srcptid 0
Classic Totalcode 0
Classic UserInt1 0
Classic UserInt2 0
Page 54
4.6 - System-Assigned Attributes
Point Default
Class Field Name Value Limits
Classic UserReal1 0
Classic UserReal2 0
Base Zero 0
When you create a point, several attributes are assigned by the system. You cannot change
the values of these attributes.
4.6.1 Creator
The user who created the point.
4.6.2 CreationDate
The date and time when the point was created.
4.6.3 Changer
The last user to edit the attributes for this point.
4.6.4 ChangeDate
The date and time when the attributes for this point were last edited.
4.6.5 PointID
The PointIdentifier is a unique number that identifies the point internally. PointID is never
reused, even when a point is deleted. This is the PI PointIDentifier that is passed as a
parameter to most of the PI API functions. In the PI API Manual, this identifier is referred to
as the point number, or PtNum.
4.6.6 RecNo
The record number is a read-only point attribute that contains the point's primary record
number in the archive. This is useful when using tools such as piartool -aw to examine the
archives. RecNo is not to be confused with the PointID attribute.
5.1 Introduction
A PI point consists of a set of attributes. What attributes a point has is uniquely determined
by its point class. A PI point class consists of a group of PI point attribute sets, each of which
consists of some attributes. The attributes of a point is therefore built by grouping attributes
into attribute sets, and then grouping the attribute sets into a point class and assigning the
point to this point class. A PI point class cannot consist of attribute sets that have overlapping
attributes.
Point class is assigned to a point when it is created. Prior to PI 3.4.370 it was not possible to
change the attributes of a point once it is created and assigned to a point class. In PI 3.4.370.x
or greater users can edit and delete attribute sets and point classes.
1. Attributes ExcMax and CompMax in base attribute set may now be edited from
uint16 to uint32.
2. It is now also possible to switch a point from one class to another, new or existing, so
that the same point can continue to collect data seamlessly even though its collection
mechanism has changed. For example, one can convert a Totalizer point to a PE
point, which belongs to classic point class, or vice versa, while keeping the same tag.
3. The user can also change the attributes of a point by adding or removing or changing
the types of attributes in the point class of the point. This affects all points that belong
to that point class.
4. By allowing addition, removal and edit of the attributes of point classes, we can
allow the same points to retain their history and continue to collect new data even
when the attribute requirements of the data collecting applications change.
5.2 Overview
Page 58
5.2 - Overview
The command PIartool –standalone 1 puts the system in stand alone mode (no clients
can connect), and PIartool –standalone 0 sets it in normal operating mode. PIartool –
standalone 2 queries what mode the system is in.
There are some restrictions on which attribute sets and point classes may be edited or deleted.
Below is a summary of the restrictions:
Allow adding attribute(s) to any set except for the Base attribute set.
Note: Any attribute added to a predefined set cannot be removed due to rules
2b, 7a and 9a below: the predefined attribute sets are required by predefined
point classes and predefined point classes may not be deleted. So, they are
always in-use. It is recommended that the user create a new attribute set with
new attributes when expanding a point class rather than adding new attributes to
a predefined set. For the list of predefined attribute sets and point classes see
Appendix.
Allow deleting attributes from a set except from predefined sets (those created by
OSI) if they are required attributes
In-use attribute sets
Disallow renaming attributes
Allow renaming attribute sets except
• Predefined attribute sets
Allow deleting attribute sets except
• Predefined attribute sets
• In-use attribute sets
Allow adding attribute sets to any point class
Allow deleting attribute sets from a point class except from
• Predefined classes (created by OSI) if they are required attribute sets1
• In-use point classes
Allow renaming point classes except
• Predefined point classes
Allow deleting point classes except
• Predefined point classes
In-use point classes
These restrictions were imposed to protect the attribute sets and point classes that PI system
itself uses as building blocks. These restrictions can limit the user’s ability to easily undo
1 Predefined point classes and their required attribute sets are listed in the Appendix.
some actions. To demonstrate how involved undoing some actions can be, suppose that a user
added an attribute set to a point class by mistake. In order to restore the original point class,
all the tags in this class need to be edited to belong to another class so that the class is no
longer in-use. Then the undesired attribute set can be removed from the point class. Finally,
the points can be edited back to the original point class.
It is CRUCIAL to make a backup of the point database before attempting to edit attribute sets
or point classes. One can delete attribute sets from predefined point class as long as the class
is not in use and the set to be deleted is not a required set for that point class. Remember that
any attribute added to a predefined attribute set cannot EVER be removed.
piconfig utility can be used to perform these edits and deletes after placing PI server in stand
alone mode using PIartool utility as discussed above. Examples are shown in the following
sections as appropriate.
The following sub-sections discuss three operations that modify the PI Attribute Set database:
Attribute Set Create
Attribute Set Delete
Attribute Set Edit
Page 60
5.3 - Attribute Sets Database Edit
Float32 (0)
Bool (0)2
2 Note that Boolean values will show as either 1 or 0 instead of true or false. All non-zeros are interpreted as true,
and 0 is interpreted as false.
typicalvalue
engunits
zero
span
pointtype
pointsource
scan
excmin
excmax
excdev
shutdown
archiving
compressing
step
compmin
compmax
compdev
creationdate
creator
changedate
changer
displaydigits
The built-in attributes are added to all points. Their types and defaults cannot be modified by
user. However, the values of non system-assigned attributes such as PtOwner, PtGroup,
PtAccess, DataOwner, DataGroup, DataAccess, DigitalSet, ExcDevPercent,
CompDevPercent, SourceTag and NEWTag can be modified by user.
Base attribute set is created by OSI and its edit is severely restricted. See Attribute Set Edit
for further details. Attribute name checks are case-insensitive.
Page 62
5.3 - Attribute Sets Database Edit
@istru ...
MyAttributeSet
MyAttribute1,BYTE,
MyAttribute2,int32,2
MyAttribute3,string,”Default string”
MyAttribute4,,
@ends
MyAttribute4 will be assigned the type float32, and default of 0.0. The
following lists the attribute set just created.
@table piatrset
@mode list
@ostru set
@ostru attrib,type,default
@ostru ...
@select set=MyAttributeSet
@ends
The output will look like
MyAttributeSet
MyAttribute1,BYTE,0
MyAttribute2,Int32,2
MyAttribute3,String,Default string
MyAttribute4,Float32,0.
* End Repeat...
*----------
@table piatrset
@mode delete
@istru set
MyAttributeSet
@ends
When finished place the system back in normal mode.
PIartool –standalone 0
Page 64
5.3 - Attribute Sets Database Edit
Note that implicit point edit does not validate the point configuration. That is, if a point with
improper configuration (e.g. a Totalizer point with no sourcetag) is implicitly edited, the
implicit edit will succeed although direct edit of the point would have failed validation.
In implicit point edits, additional, if any, attributes are assigned default values until the user
explicitly edits them later. That is, consider a point belonging to a class with base attribute set
and another attribute set called MyAttributeSet. Suppose that MyAttributeSet originally
contained MyAttribute1, MyAttribute2, and MyAttribute3, but was edited to include another
attribute called MyAttribute4. The point will be implicitly edited and will now have the
additional attribute MyAttribute4. This attribute will be set to the default by the implicit edit
process.
Descriptor String
Exdesc String
Typicalvalue float32
Engunits string
Zero float32
Span float32
Pointtype ubyte
Pointsource string
Scan uint16
Excdev float32
shutdown byte
Archiving byte
Compressing byte
Step byte
Compmin uint16
3 PI versions earlier than 3.3 were shipped with uint16 type for excmax and compmax.
Compdev float32
Creationdate timestamp
Creator uint16
Changedate timestamp
Changer uint16
Displaydigits byte
Built-in Attributes
Built-in attributes are part of every PI point, but do not belong to any particular attribute set.
The types and defaults of built-in attributes, which are frequently mistaken as belonging to
the base attribute set, do not belong to any attribute set explicitly and cannot be edited. This is
not to say that individual point’s built-in attribute values cannot be edited. Non system-
assigned attribute values may be edited.
Page 66
5.3 - Attribute Sets Database Edit
@mode edit
@istru set
@istru attrib,type,default
@istru ...
MyAttribSet
MyAttrib1,int32,22
MyAttrib2,String,default string
MyAttrib3,float32,
MyAttrib4,uint16,1
@ends
Now list the resulting set:
@table piatrset
@mode list
@ostru set
@ostru attrib,type,default
@ostru ...
@select set=MyAttribSet
@ends
MyAttribSet
MyAttrib1,Int32,22
MyAttrib2,String,default string
MyAttrib3,Float32,0.
MyAttrib4,Uint16,1
Editing an attribute set works just like PI digital set edit. Attribute name, type and default
should all be explicitly redefined. If a pre-existing attribute is not specified in the new
definition, it will be permanently removed from the set. If the user had not wanted to edit the
existing attributes, but only wanted to add a new attribute MyAttrib4, he still would have had
to specify all attributes in his definition. That is, doing the following
@table piatrset
@mode edit
@istru set
@istru attrib,type,default
@istru …
MyAttribSet
MyAttrib4,uint16,1
@ends
would have produced MyAttribSet containing only one attribute, namely MyAttrib4.
If an attribute set is edited, and its pre-existing attribute name is specified, but not the type
and default, float32 and value 0.0 will be assigned overwriting the original type and default.
If only the type is specified by the user, a new default will be assigned even if the type is
identical to the previous one. The default of MyAttrib3 attribute was changed to 0.0 from the
original 5.0 because it was not explicitly specified in the edit.
When done with the edit, place the system back in normal mode so that applications can
connect.
PIartool –standalone 0
Renaming an attribute set does not trigger any implicit edits of point classes or points and
does not require standalone mode either.
Informational Messages
Messages such as will not be directly returned to the edit initiating application (e.g. piconfig)
are sent to the PI Message subsystem. Examples of these messages are information regarding
the status (success or failure) of 4 steps involved in edit (rename the old set, add a new set,
implicitly edit dependent point classes and points, and remove the old set) and the number of
dependent point classes found, etc. These messages are useful in verifying that the steps are
carried out correctly during the edit.
Rollback
Attribute set edit triggered point class edits, and their dependent point edits are all committed
to disk as they occur. If an error occurs during implicit edits the remaining edits are aborted.
Those edits that already succeeded are rolled back, and the original set is restored. Then the
user can resolve the cause of the edit failure and re-edit.
Note: In rollback all implicitly edited point classes and points are reconstructed from
the original attribute set which is still in the database under a temporary name. Since
no attribute may be removed from its set if the set is in use, the original attributes
should have remained in the set and retained their values in implicit point edits
unless the new type and original type were incompatible and the values had to be
set to the new defaults. In such a case, the original attribute values of the affected
points cannot be recovered.
Successful rollbacks are audited if the base subsystem is enabled for auditing4. Like any other
types of edits, unsuccessful rollbacks are not audited.
Regardless of success of the rollback the error for the failed edit will be returned to the user.
Additional messages may be found in PI message log.
If the rollback fails an error is logged in PI Message log, and the rollback is aborted. PI points
database may end up with some points belonging to the original point class (under a
temporary name) and others to the new point class (under the original class name) containing
the new attribute set. The cause of the rollback failure needs to be resolved and then the
4 Any action that changes an attribute set, a point class or a point in the database will be audited if auditing is
enabled and the edit was successfully completed.
Page 68
5.3 - Attribute Sets Database Edit
system needs to be restored manually. This can be done by using a good system backup or by
following the procedure outlined in the next section. Once the system is restored, the user can
resolve the cause of the actual edit failure and then re-edit.
If keeping the original attribute set name or point classes is not important user can stop here
and just delete the original point classes and the attribute set. If it is necessary to keep the
original set and the point classes, continue.
1. Edit the original dependent point classes to exclude the set that contains undesired
attributes.
2. Edit the original attribute set removing the undesirable attributes.
3. Add this set back to the original point classes.
4. Edit the points back to the original classes.
Once the dependent points are all converted back to the original classes in the previous step,
the interim point classes and the set created in step 1 and 2 can now be deleted.
Indirect (i.e. implicit) edit of PI point class database was discussed in the Attribute Set Edit
section. Point class database can also be directly modified by a user via one of the following
three operations: creation, deletion and edit.
Page 70
5.4 - Point Classes Database Edit
In piconfig
@table piptcls
@mode delete
@istru class
MyPtClass
@ends
Back to normal mode.
PIartool –standalone 0
MyPtClass
base,classic
*----------
Let’s add attributes MyAttribute1 (string) and MyAttribute2 (int32) to this point class. In
order to do this, create an attribute set, say MyAttributeSet, as follows.
@table piatrset
@mode create
@istru set
@istru attrib,type,default
@istru ...
MyAttributeSet
MyAttribute1,string,my default string
MyAttribute2,int32,22
Then check it was correctly created.
@table piatrset
@mode list
@ostru set
@ostru attrib,type,default
@ostru ...
@select set=MyAttributeSet
@ends
You should see
MyAttributeSet
MyAttribute1,String,my default string
MyAttribute2,Int32,22
* End Repeat...
*----------
Edit MyPtClass to include this attribute set. The system needs to be in standalone mode. Type
the following in command window.
PIartool –standalone 1
In piconfig define the attribute sets that should belong to the point class.
@table piptcls
@mode edit
@istru class
@istru set,...
MyPtClass
base,classic,MyAttributeSet
Check that these attributes now form MyPtClass. You should see
* (Ed - PIPTCLS) PIconfig> @mode list
* (Ls - PIPTCLS) PIconfig> @ostru class
* (Ls - PIPTCLS) PIconfig> @ostru set,...
* (Ls - PIPTCLS) PIconfig> @select class=MyPtClass
* (Ls - PIPTCLS) PIconfig> @ends
MyPtClass
Page 72
5.4 - Point Classes Database Edit
base,classic,MyAttributeSet
*----------
To see all attributes that are in this point class type the following.
@table pipoint
@ptclass MyPtClass
@?atr
The following list will appear
1 - Tag String D: !#!#!# C:
2 - NEWTag String D: C:
3 - archiving BYTE D: 1 C:
4 - changedate TimeSta D: 31-Dec-69 16:00:00 C:
5 - changer Uint16 D: 0 C:
6 - compdev Float32 D: 2. C:
7 - Compdevpercent Float32 D: 2 C:
8 - compmax Uint32 D: 28800 C:
9 - compmin Uint16 D: 0 C:
10 - compressing BYTE D: 1 C:
11 - convers Float32 D: 1. C:
12 - creationdate TimeSta D: 31-Dec-69 16:00:00 C:
13 - creator Uint16 D: 0 C:
14 - DataAccess String D: o:rw g:r w:r C:
15 - DataGroup String D: piadmin C:
16 - DataOwner String D: piadmin C:
17 - descriptor String D: C:
18 - DigitalSet String D: system C:
19 - displaydigits BYTE D: -5 C:
20 - engunits String D: C:
21 - excdev Float32 D: 1. C:
22 - Excdevpercent Float32 D: 1 C:
23 - excmax Uint32 D: 600 C:
24 - excmin Uint16 D: 0 C:
25 - exdesc String D: C:
26 - filtercode Int16 D: 0 C:
27 - instrumenttag String D: C:
28 - location1 Int32 D: 0 C:
29 - location2 Int32 D: 0 C:
30 - location3 Int32 D: 0 C:
31 - location4 Int32 D: 0 C:
32 - location5 Int32 D: 0 C:
33 - myattribute1 String D: my default string C:
34 - myattribute2 Int32 D: 22 C:
35 - PointID Int32 D: 0 C:
36 - pointsource String D: Lab C:
37 - pointtype String D: Float32 C:
38 - PtAccess String D: o:rw g:r w:r C:
39 - PtClassName String D: MyPtClass C:
40 - PtGroup String D: piadmin C:
41 - PtOwner String D: piadmin C:
42 - Recno Int32 D: 1 C:
43 - scan BYTE D: 1 C:
44 - shutdown BYTE D: 1 C:
45 - SourceTag String D: C:
46 - span Float32 D: 100. C:
47 - squareroot Int16 D: 0 C:
48 - srcptid Int32 D: 0 C:
49 - step BYTE D: 0 C:
50 - totalcode Int16 D: 0 C:
51 - typicalvalue Float32 D: 50. C:
52 - userint1 Int32 D: 0 C:
53 - userint2 Int32 D: 0 C:
54 - userreal1 Float32 D: 0. C:
55 - userreal2 Float32 D: 0. C:
56 - zero Float32 D: 0. C:
Place the system back in normal mode.
PIartool –standalone 0
Informational Messages
Messages such as will not be directly returned to the user are sent to the PI Message
subsystem. Examples of these messages are information regarding the status of four steps
involved in point class edit (rename the original class, add a new class, implicitly edit
dependent points, remove the original class) and the number of dependent points found, etc.
Rollback
As in the case of an attribute set edits point class edit triggers implicit point edits. If an
implicit point edit fails, all previously successful implicit point edits are rolled back. New
class is deleted, and the original class’s name is restored.
Page 74
5.4 - Point Classes Database Edit
5 This scenario is unlikely, but if it ever happens, it can be rectified by editing the class.
In some cases, it is more desirable to modify the value of point’s ptclassname attribute (of
type string) to another point class rather then editing the point class it belongs to. A PI point’s
ptclassname attribute edit is supported just as any other point edit.
As in the case of implicitly edited point, the attributes of the point are rebuilt. The important
difference is that unlike in an implicit point edit, some existing attributes may get removed.
The reason is that a point class edit disallows removing any attributes if there are any
dependent points. This effectively prevents points losing existing attributes inadvertently.
However, if the user deliberately moves a point from one class to another and the new point
class does not contain some of this point’s current attributes, they are deleted without
prompting.
When a point’s ptclassname attribute is changed, the new point class’ attributes will be
compared against the existing ones. New attributes will be added and set to default values.
Existing ones will be copied if they are in the new point class. Compatible types retain their
values and incompatible types are set to new defaults value. Attributes that do not belong to
the new point class are removed.
When editing a point via piconfig new attributes can be modified simultaneously. That is, it
is ok to edit the ptclassname attribute and include new attributes that only belong to the new
point class and did not previously belong to the point’s old class. However, the target class
needs to be set before such an edit is attempted.
To illustrate, try editing a point that belongs to Totalizer point class to Classic point class in
piconfig as follows.
@table pinpoint
@ptclass Totalizer
@mode edit
@istru tag,ptclassname,location4,pointsource
The following error will be returned.
*piconfig Err> Unknown parameter <location4> in structure
*@istru tag,ptclassname,location4,pointsource
*piconfig Err> Complete Structure line removed
*@istru tag,ptclassname,location4,pointsource
This is because @ptclass Totalizer sets the environment for this edit to Totalizer point class,
which does not have location4 attribute. Set the environment to the target point class, Classic,
by using @ptclass Classic first if you want to edit the ptclassname attribute and new
attributes unique to the target point class at the same time.
@ptclass classic
@istru tag,ptclassname,location4,pointsource
tagname,classic,1,C
If it is not necessary to edit the ptclassname attribute and new attributes at the same time,
issuing
@ptclass classic
is not necessary since ptclassname is a built-in attribute and every point has this attribute.
Page 76
5.6 - Point Database Audit
Both Attribute Sets and Point Classes have been added to the Audit database. EnableAudit
parameter in PITimeout Table bit6 will be used for Attribute Sets audit database and bit 4 for
Point Classes audit database. Note that audit records will cascade if dependent point classes
and points are implicitly edited.
Point DB 0 1
Attribute Sets DB 2 4
Point Classes DB 4 16
6 Starts from 0.
Field Description
PI Database PIPointAttributeSets
The name of the attribute set is treated as if it was an attribute and is shown as Name item.
The audit DB exported in XML format also indicates what type the attribute’s value is.
The following are Audit Record and Change Record Definitions for point classes database
edit.
Page 78
5.6 - Point Database Audit
PI Point Classes DB
Audit Record Definition
Field Description
PI Database PIPointClasses
The name of the point class is treated as if it was an attribute and is shown as Name item.
PI Points DB
Audit Record Definition
Field Description
5.7 Thread-safety
Attribute set and point class edits rely on the locking mechanism at the global level for thread
safety. Both of these edits lock the entire points database, and it will not be accessible to the
user. That is, two users cannot simultaneously initiate attribute sets and or point classes.
Point edits, however, get the lock (same global lock as attribute set edits and point class edits)
per point basis. To be more specific, a point edit thread releases the global lock while it
updates the Snapshot, and re-acquires it when the snap update is completed. While the thread
is waiting for the synchronous RPC to PI Snap subsystem to return, the point’s edit status flag
is set, and no other thread can edit the point. If another thread has acquired the lock in that
time, the point edit thread cannot re-acquire the lock and the point edit fails.
This temporary lock release mechanism during point edit was implemented to optimize PI
Base Subsystem’s performance and ensure other requests can still be serviced should the
synchronous RPC to update PI Snap take a long time.
Because of this mechanism, it is possible that while an implicit point edit is in progress it
releases the lock, another (but explicit) point edit acquires the lock, and the implicit point edit
as well as all remaining implicit edits fail or vice versa. The scenario described above is
rarely anticipated, but the users should be aware of it, and should NOT attempt to initiate
both attribute set or point class edits and explicit edits simultaneously. Since client
applications ore remote piconfig sessions cannot connect while the system is in stand alone
mode, this situation can be easily avoided if the administrator does not simultaneously launch
multiple point edits and point class edits simultaneously in parallel (local) piconfig sessions.
Page 80
Chapter 6. PI POINT TYPE EDIT
6.1 Introduction
In PI 3.4.370.x or greater a point’s type can be edited just like other attributes. That is, if
listing the point's type as shown below shows the point type as int32,
@mode list
@ostru tag,pointtype
@istru tag
MyTag
only the following operation is needed in piconfig to change its point type to float32.
@mode edit
@istru tag,pointtype
MyTag,float32
@ends
Under the hood, changing a point’s point type causes the Archive Subsystem to close the
current archive record and start a new one with the new type info in the header.
When a point’s pointtype attribute is changed, already archived history of the point will not
change unless the archive is processed off-line. Off-line archive processing will actually
convert the old type events to events of the new type. This allows the user a choice between
keeping the old data type events and converting them all to the new type.
Upon archive record activation, the old type event will be coerced to the new point type if
possible.
If the value does not fit in the new point type, Coercion Failed digital state will be returned
by default. If Archive_DataCoercionPolicy parameter (see below) is defined in PI timeout
table, an appropriately translated digital state will be returned. PI Server does not log a
warning in PI Message subsystem upon point type edit.
Also if the current Snapshot value cannot be coerced to the new type at the time of the point
type edit, the edit will fail even though the value will actually be archived in the record of the
old type. The point will remain the previous type, and the archived data will look as before.
However, piartool –aw will show two new records since the last archived event’s record.
One will be for the attempted new type, and another for the previous (i.e. current type). The
first of these (the record created for the attempted new type) will remain un-filled thereafter.
To illustrate, suppose a point named int16_typedit had the following archived values and was
of type int16.
6-Oct-2005 13:51:53,27
6-Oct-2005 14:21:54,32767
6-Oct-2005 14:44:56,4
6-Oct-2005 14:51:51,Pt Created
Then it was edited to type int32, and three new values were added.
6-Oct-2005 14:52:01,-10
6-Oct-2005 14:52:03,2147483647
6-Oct-2005 14:52:05,-16
The last value -16 is still in the Snapshot. Try editing the point back to int16 type again by
typing the following in piconfig.
@table pinpoint
@ptclass classic
@mode edit
@istru tag,pointtype
int16_typedit,int16
@ends
The edit will fail and the following error will be returned to piconfig since int16 type doesn’t
allow negative values.
[-10005] Subscript Under Range
Note that this is an error status. An error status like this returned by a point type edit
operation should be distinguished from Coercion Failed which is a System Digital State
which acts as a place holder for an event that failed to coerce.
To see what happens to the archive records when a user tries to edit a point’s type and the
operation fails, launch archive walk by typing
piartool –aw
Something like the following will be shown:
Enter Archive Number: 0
Enter Record Number: 130
Point ID: 1219 Record Number: 130
Chain Record Number - Next: 0 Prev: 0 Index: 0
Record Version: 3 Data type: 8
Flags - Index:1 Step:0 Del:0 Dirty:0
Sizes - Record 1024 Data: 998
Parent Archive 00000000 Data Head: 26
Event Count: 4
Storage (bytes) - Available: 998 Used: 29
Enter Record #, <CR> next rec (p)rev (e)vents (a)rchive # (q)uit:
7 There are events in this example before Pt Created event because data were back-filled to create the example.
Page 82
6.1 - Introduction
Type “e” (without the quotes) and press Enter to view the events for the point.
PIarcrecord[$Workfile: piarrec.cxx $ $Revision: 71 $]::
Point ID: 1219 Record Number: 130
Chain Record Number - Next: 0 Prev: 0 Index: 0
Record Version: 3 Data type: 8
Flags - Index:1 Step:0 Del:0 Dirty:0
Sizes - Record 1024 Data: 998
Parent Archive 00000000 Data Head: 26
Event Count: 4
Storage (bytes) - Available: 998 Used: 29
4 Event(s):
0: 29-Sep-05 14:00:03, S,O,A,S,Q [0,0,0,0,0]: 96688
1: 6-Oct-05 14:52:01, S,O,A,S,Q [0,0,0,0,0]: 96730
2: 6-Oct-05 14:58:57, S,O,A,S,Q [0,0,0,0,0]: 96687
3: 6-Oct-05 14:58:57, S,O,A,S,Q [0,0,0,0,0]: 96686
Enter Record #, <CR> next rec (p)rev (e)vents (a)rchive # (q)uit:
Then type 96688 and press Enter to open this Index record:
PIarcrecord[$Workfile: piarrec.cxx $ $Revision: 71 $]::
Point ID: 1219 Record Number: 96688
Chain Record Number - Next: 96730 Prev: 0 Index: 130
Record Version: 3 Data type: 6
Flags - Index:0 Step:0 Del:0 Dirty:0
Sizes - Record 1024 Data: 998
Parent Archive 00000000 Data Head: 26
Event Count: 4
Storage (bytes) - Available: 998 Used: 22
4 Event(s):
0: 6-Oct-05 13:51:53, S,O,A,S,Q [0,0,0,0,0]: 2
1: 6-Oct-05 14:21:54, S,O,A,S,Q [0,0,0,0,0]: 32767
2: 6-Oct-05 14:44:56, S,O,A,S,Q [0,0,0,0,0]: 4
3: 6-Oct-05 14:51:51, S,O,A,S,Q [0,253,0,0,0]: 0
Enter Record #, <CR> next rec (p)rev (e)vents (a)rchive # (q)uit:
Press Enter to see the next record. Notice the Data type for the following record is “8”, which
is Int328:
PIarcrecord[$Workfile: piarrec.cxx $ $Revision: 71 $]::
Point ID: 1219 Record Number: 96730
Chain Record Number - Next: 96687 Prev: 96688 Index: 130
Record Version: 3 Data type: 8
PI Server 3.4.370
Installation and New Feature Guide Page 89
Flags - Index:0 Step:0 Del:0 Dirty:0
Page 84
6.2 - Error handling
An example of the situation mentioned in the preceding paragraph would be a point going
from an integer type to a digital type and then to a string and then back to integer. If the last
Snapshot for this tag was of type int16 and value 1, the integer would have been coerced to a
digital and the appropriate digital state during the subsequent type edit. This digital state
would have been coerced to a string after that. By the time the point is edited back to integer
type, we have a string (whatever the digital state representation was, say, “Closed”) that
needs to be coerced to int16 and can’t. It would only be coercible if it were a digital because
the coercion process would use the offset.
Out of order events that are sent to the archive after the point type change will go into the
archive as the point type that was in effect at the time of the event’s timestamp.
Below is the matrix of allowed type coercions.
int16 int32 float16 float32 float64 digital string blob timestamp
int16 ok ok5 ok ok ok ok N/A N/A
If coercion is impossible from the stored type to the current point type, what is returned or
whether a value will be returned, is determined by Archive_DataCoercionPolicy. This PI
timeout parameter can have one of the following values:
If coercion fails during off-line archive processing, values will be replaced as dictated by the
above policy.
Page 86
Chapter 7. EXCEPTION REPORTING AND COMPRESSION
TESTING
Exception reporting and compression testing offer you the opportunity to tune your PI points
for maximum efficiency. Each PI point has attributes that you can set to specify compression
and exception reporting specifications for that point. How you set those specifications will
impact the flow of data from the Interface Node to the Server for that point (exception
reporting) and the efficiency of data storage in the Archive for that point (compression
testing). Exception reporting and compression testing are sometimes confused, but it’s
important to understand the distinctions:
Exception Reporting: Exception reporting takes place on the Interface Node. The
point of Exception reporting is to reduce the communication (I/O) burden between
the PI Server and the Interface Node by filtering out “noise”. As networks have
improved and I/O capacity has become less of an issue, some PI System Managers
have essentially turned exception reporting off, by setting the exception deviation to
zero. OSIsoft recommends that you set the exception deviation to slightly smaller
than the precision of the instrument.
Compression Testing: Compression testing takes place on the Server. The Snapshot
Subsystem performs the compression test. The point of compression testing is to
store data efficiently in the PI Data Archive. More efficient data storage allows for
longer periods of on-line data on the same disk-space. The idea here is not to store an
event that PI can essentially “recreate” by extrapolating from surrounding events.
Unlike exception reporting, which is a simple linear test, the compression test uses a
sophisticated algorithm, called the swinging door compression algorithm, to
determine whether an event is significant.
The exception reporting process is the process that interfaces use to evaluate new events to
determine whether they are significant. The interface sends the significant events to the PI
Server and discards the events that are not significant. The purpose of exception reporting is
to avoid sending random changes—changes that are smaller than the instrument can actually
measure—from the interface to the PI Server.
The interface compares each new value to the previously sent value. The interface sends the
new value to the PI Server only if it is different from the previous value by an amount larger
than the value in the ExcDev attribute.
Exception reporting uses a simple dead band algorithm to determine whether to send events
to PI. For each point, you set exception reporting specifications (the ExcDev, ExcMin and
ExcMax attributes) to create the dead band. The interface ignores values that fall inside the
dead band.
Interface programs that do exception reporting apply the following algorithm whenever a new
value is received. A new value is compared to the last value reported. If the new value does
not fall within the dead band, an exception occurs. When an exception occurs, the interface
sends the event (both timestamp and value) that caused the exception and the previous event
to the Snapshot.
The new value is not reported unless:
The difference between the new value and the last value is greater than the exception
deviation specification
and
The difference between the times of the new and last values is greater than or equal to the
exception minimum time specification
or
The difference between the timestamp of the new value and the timestamp of the last
reported value is greater than or equal to the exception maximum time specification.
Note that the time between exception reports might be greater than the exception maximum
time if no new values are received by the interface for a point. Neither the PI Server nor the
interface will ‘create’ data.
Some interfaces do not support exception reporting. See the documentation for your interface
to determine whether it supports this capability. Manually entered data are not normally
reported by exception so that every value can be retained.
Most OSIsoft interfaces report new events on exception. The exception algorithm relies on
the following parameters:
Exception Maximum: Maximum time span between exceptions, expressed in
seconds. This value is configured for each point in the attribute "ExcMax".
Exception Minimum: Minimum time span between exceptions, expressed in
seconds. This value is configured for each point in the attribute "ExcMin".
ExcDev: Dead band when exceeded causes an exception. This is configured for each
PI Point in either the ExcDev or ExcDevPercent attribute.
OldEvent: Value/status/timestamp of last event sent to the Snapshot--this is the last
event that passed exception report.
PrevEvent: Value/status/timestamp of last event compared to determine whether or
not to send to the Snapshot.
NewEvent: Value/status/timestamp of event to test for exception.
Exception reporting works by comparing the new event to the old event as follows.
Page 88
7.1 - Exception Reporting
If the time new event timestamp and old event timestamp is greater than or equal the
excmax, the new event is sent to the Snapshot.
For digital points, if the new value differs from the old value, the new event is sent to
the Snapshot regardless of excmin time.
For numeric points, if the status changes from good to bad, or bad to good, the new
event is sent to the Snapshot.
For numeric points, if the time between the old event and the new event is greater
than or equal to excmin and the absolute value of the difference between the new
value and the old value is greater than excdev, the value is sent to the Snapshot.
If the new event was sent to the Snapshot, the old event is replaced by the new event.
The last step is a test to see if the PrevEvent should also be sent the Snapshot. If the
PrevEvent was not equivalent to the original OldEvent, the PrevEvent is sent to the
Snapshot. The only time the PrevEvent is not sent to the Snapshot is when two consecutive
exception reports send the new event to the Snapshot. The PrevEvent is used to accurately
indicate what really happened to the value; without it, a step change would look like a ramp
change. Basically, if a measurement holds steady for hours, then makes a step change, just
sending the new value to the Snapshot results in interpolating between the old value and the
new value. By also sending the PrevEvent, the step change is stored.
7.1.2 ExcMin
The ExcMin attribute (Exception Minimum) is a dead band after the previous value. This is
used to suppress noise. It is specified in seconds. A new data value that is received before the
end of the ExcMin interval will be discarded.
7.1.3 ExcMax
The ExcMax attribute (Exception Maximum) puts a limit on the length of time that values
can be discarded due to exception testing. For example, it is possible for the incoming data to
be a single value for many days. If ExcMax is set to 28800 seconds (8 hours) then a value
will not be discarded due to exception if the previous event timestamp was more than 28800
seconds before that. Note that the interface does not manufacture data. If there are no
incoming values within 28800 seconds, then nothing will be passed to the PI Server.
The Snapshot Subsystem uses compression testing to determine which events it should pass
to the Archive for storage. The point of compression testing is to store just enough data to
accurately reproduce the original signal.
For example, in the following illustration, all the events fall on the same straight line. In a
simple case like this, you don’t actually need to store all the points on the line. If you store
just two points, you can exactly recreate the point value for any other time.
This line can be reconstructed from any two of these events. So the most efficient storage
would be to store only the first and last events (A and B) rather than storing all the events.
Further, no accuracy is sacrificed. If a user wants to retrieve the value at any point along the
line, it can be interpolated from the values that have been stored.
This simple example illustrates how PI applies data compression. In practice, the curves are
more complex than straight lines, and the compression specifications for each tag must be
tuned properly to achieve a balance between storage efficiency and accuracy.
The same principle applies to compressing real-world data. PI uses a sophisticated
compression algorithm to determine which events it needs to keep in order to provide an
accurate data history. The CompDev, CompMin and CompMax attributes allow you to
control the “granularity” of the compression algorithm.
When a new Snapshot arrives, the previous one is evaluated according to the compression
specifications to see if it is a significant event. If so, it is sent to the Event Queue. If not, it is
discarded. This process is called compression.
There are three instances where an event will bypass the compression process and be put in
the Event Queue:
If the Compressing attribute for the point is set to OFF.
If the timestamp is older than the timestamp of the current snapshot. Such an event is
considered out of order.
Page 90
7.2 - Compression Testing
Note: The maximum time specification does not guarantee that a value will be
written to the Archive within a certain time. The Archive waits for events to be sent to
it. It does not check to see if a point has timed out. It does not 'create' new values.
Eng
Unit
A compression deviation blanket
Value drawn to this point would not
include all points since the most
recently archived value, so the
Most recently previous value would be
archived value archived.
Compression
Deviation
Specification
Time
You can adjust the compression parameters to produce efficient archive storage without
losing significant data. The compression maximum time is usually set to one value for all
points in the system. It should be large enough that a point that does not change at all uses
very little archive space. A compression maximum time of one work shift (for example, 8
hours) is often a good choice.
Use the compression minimum time (CompMin) to prevent an extremely noisy point from
using a large amount of archive space. This parameter should be set to zero for any point
coming from an interface that does exception reporting. In this case, the exception minimum
time should be used to control particularly noisy points. For a data acquisition system with a
slow scan time, this parameter is not important. There are few cases where you want to use a
non-zero compression minimum time.
The most significant compression parameter is the deviation specification, CompDev. This
parameter is often adjusted after the point is defined. A reasonable starting point is one or two
percent of span for transmitters and 0.5 to 1.0 degrees for thermocouples. Look at trend
displays to find points for which the reproduction of the data is not acceptable. The goal is to
filter out instrument and process noise and still record significant process changes. The effect
of changing the compression deviation is not predictable.
For digital points, any change is a significant change. Only the compression maximum and
minimum time are important. The compression deviation specification is ignored for digital
points.
Page 92
7.2 - Compression Testing
The PI Server is typically used in production systems in which correct and reliable operation
is important. For this reason, a number of security mechanisms are available to protect
against both willful and accidental tampering with the system. These include operating
system security, physical security, network security, and several levels of PI System security.
See the PI Server System Management Guide for details on managing the PI Server security.
The PI Firewall provides a first level of access control, based on the network address of the
client. If a connection request successfully passes the PI Firewall, the user ID and password
provide another level of PI access security.
The PI Server has its own user identification and password security.
Client applications are responsible for prompting the user for the login name and password,
and passing this information to the PI Server for authentication.
Users control their own passwords. Use the pisetpass utility to change user passwords. A null
password is allowed but is not generally recommended.
Security applies to point data and point attributes. The archive data for a point is assigned an
owner and a group. The attributes of the point (such as zero, span, compression
specifications, etc.) may be assigned to a different owner and different group, with
independently assigned access permissions.
Users may be assigned to multiple groups, but they don’t have to be assigned to any groups.
There is not necessarily any relationship between the owner and the group.
Security applies to databases owned by the PI Server. Access can be controlled to the Batch,
Campaign, Digital State, Heading Sets, Modules, Point, Transfer Records, User, and
Individual Subsystem Thread and Auditing Table. Each table can be assigned to a different
owner and different group. Access permissions can be different for the owner and the group.
A mechanism for proxy access is provided, primarily to allow interfaces to access the PI
Server for Windows without modifications such as adding login code. The mechanism is
called PI Trust Logins.
Page 96
Chapter 9. PI SQL SUBSYSTEM
The PI SQL Subsystem (pisqlss) prepares and executes SQL statements directed at the PI
Server. The primary users of this subsystem are the PI ODBC Driver and the PI-SDK. This
driver conforms to the ODBC API standards and makes PI data appear to be organized into
data tables. PI ODBC 1.1.2 or later is required to connect to PI Server.
OSIsoft’s implementation of SQL gives applications access to the PI Point Database,
Snapshot, and Archive.
This chapter begins with a discussion of the architecture of the PI SQL Subsystem. It then
outlines the available configuration methods for the PI SQL Subsystem and discusses testing
and troubleshooting techniques. Supporting information, such as details of OSIsoft’s
implementation of SQL, can be found in the PI ODBC Driver Manual.
SQL processing capability is also implemented in the PI System for OpenVMS. Differences
between the two are discussed in this chapter.
9.1 Architecture
This subsection outlines the operation of the PI SQL Subsystem and its interaction with the PI
API.
This discussion is provided as background material. You do not need to understand the details
of the subsystem’s operation in order to use it.
If connection between the client and Server is lost, the PI SQL Subsystem retains any
statement handles allocated by the client. These handles become orphaned and cannot be
accessed again. The handles will be de-allocated when the PI SQL Subsystem shuts down.
During shutdown, pisqlss will report the total number of handles allocated during its run, and
how many orphaned handles were aborted.
9.1.2 Concurrency
The PI SQL Subsystem handles SQL processing for all client connections to the PI Server for
Windows and UNIX.
Operations such as parsing an SQL statement and fetching results are relatively inexpensive.
Execution, however, can potentially take time and system resources as data are obtained from
other subsystems.
There are some differences in SQL processing between the PI Server for Windows and UNIX
and the PI System for OpenVMS. This section outlines these differences.
Convers 0.0
Filtercode 0
location1, location2, 0
location3, location4,
location5
Page 98
9.3 - Configuration
Squareroot 0
Totalcode 0
The keyword pointnumber originally came from the pidiff utility in PI for OpenVMS. This
name is also used in the PI API User Guide. Most PI API calls require a 32-bit integer
PointIdentifier (pt or ptnum - referenced in the PI API User Guide as PI point number).
9.3 Configuration
No advance configuration is necessary to start pisqlss. It is started and stopped exactly the
same way as other subsystems. On Windows, pisqlss can be run as a service.
Note: The use of an initialization file may change in a later release to an alternate
method. At that time, any site-specific settings found in the initialization file will be
migrated.
This section outlines configuration using the initialization file and command line arguments.
Refer to client product documentation for instructions on changing SQL processing settings
from the client application.
Details of the settings can be found in Appendix B of the PI ODBC Driver Manual.
Page 100
9.3 - Configuration
Command Line
Argument Description
-o (Letter “o”, not zero). Options. The options are specified in a comma-separated
list of tokens. The interpretation of the tokens is not case-sensitive. See the
following table for the list of supported options.
-t SQL query timeout, in seconds. If this time expires, pisqlss will cause the query
to return either a timeout error, or a subset of the actual results, if the
“SUBSET” option is set. See the table of options below.
-ts Default value of the timestep column in the PIINTERP table. This value can be
overridden for any query by specifying a timestep constraint in your SELECT
statement.
AGGRTIMESTART Causes all queries of the aggregate tables to use the time at which the
interval starts to identify the aggregate; the default is to use the time at
which the aggregate period ends.
EXECSAFE If set, the query will not execute if the PI SQL determines that a query is
too unspecific and would take too long to execute.
QEP Causes the gateway to dump a query execution plan to a file called
pisql_n.qep in the \pi\log\ directory on the PI Server. “n” in the file name
represents the handle number.
SUBSET If a query times out while this option is in effect, pisqlss will return a subset
of the actual results with no error. (See Note 2, below.)
TRACE Writes a summary of every Prepare (that is, query parsing) and Execute
operation by pisqlss to the file sqltrace.log in your \pi\log\ directory. See
also the “LOG” option above.
Note 1: This file is generated in all PI Server configurations, except while not running
as a service on Windows. In this case, output is directed to standard output, which is
the command window.
Note 2: If this option is in effect, it is important to note that the results returned do not
represent the actual final results of the query. When query development is complete,
this option should be removed.
Refer to the Troubleshooting section in this chapter for details of the information generated in
the sqltrace.log file by the LOG and TRACE options.
Page 102
9.4 - Troubleshooting
This examples shows a system manager about to restart the PI SQL Subsystem while setting
the default timestep to 7200 seconds and turning on TRACE mode.
Note: This works one time only. If you close the Services applet, then reopen and
reselect your service, you will not see your command line arguments from the last
run. This method cannot be used to provide command line parameters to services
started automatically when your Windows system boots.
9.4 Troubleshooting
Unexpected errors may be generated when using an ODBC application to communicate with
the PI Server for Windows and UNIX.
This section outlines techniques to help you validate the operation of the PI SQL Subsystem
and to log its processing steps.
To exit ipisql, type the command exit followed by a semi-colon. The error code from the
processing of the last SQL statement is the return code of the ipisql utility. This allows error
detection if ipisql is used in a script.
Submitting Queries
SQL statements can be typed at the prompt and terminated with a semi-colon ( ; ). This
causes the query to be sent to PI. The query can span multiple lines. The prompt for
subsequent lines looks like:
_PISQL>
You can use as many lines as you like.
You can also process queries stored in a text file using the FILE command:
PISQL>file myquery.txt;
A query in a file need not be terminated with a semi-colon; the query will be processed when
the end of the file is reached.
A query file may contain more than one query. If this is the case, a semi-colon must be used
to separate the queries.
Query files may contain the FILE command.
ipisql Options
The ipisql utility supports several options that can be specified on the command line.
Most of the options are exactly the same as the command line options for the PI SQL
Subsystem itself, specifically timeout (-t), timestep (-ts) and options (-o). For more
information, see Command Line Arguments on page 100.
The options argument supports the same option tokens as pisqlss, except LOG and TRACE.
In addition, ipisql supports the option token ANSISQLVAL, which is not supported as a
command-line option for pisqlss.
The full list of command line arguments are supported by ipisql is as follows:
Page 104
9.4 - Troubleshooting
Command Line
Argument Description
-f Identifies a query file. If this argument is used, ipisql executes the query in
the specified file and exits. A command prompt will not be displayed.
-node Identifies the PI Server node to which to connect. The name to use is the PI
Server computer’s network name. When connecting to a PI Server for
Windows and UNIX, you must either suffix “:5450” to this name, or specify “-
port 5450”.
-p0...-pn SQL parameter values. The first parameter is –p0 (i.e. zero), the second is –
p1, and so on. You may specify as many SQL parameters as you like, and
need not specify all of them; ipisql will prompt for any additional parameter
values needed. The SQL parameter values are in effect throughout the entire
ipisql session.
-port TCP\IP port number. Default value is 545. You may choose to add “:portnum”
to the end of the node name when providing the “node” argument.
-t SQL query timeout, in seconds. If this time expires, pisqlss will cause the
query to return either a timeout error, or a subset of the actual results,
depending on the “SUBSET” option in effect for pisqlss.
-ts Default value of the timestep column in the piinterp table. This value can be
overridden for any query by specifying a timestep constraint in your SELECT
statement.
-username Username. If this argument is not present, ipisql will not attempt to validate
your identity; default access rights will apply.
For example, to execute query in the file myquery.txt against the PI 3.2 System larry using a
default timestep of 2 minutes, issue the command:
ipisql –ts 120 –f myquery.txt –node larry:5450
If the file myquery.txt contains the statement:
select * from picomp where tag = ? and time >= ?
you might avoid the prompt for SQL parameter values by issuing the command:
ipisql –f myquery.txt –p0 sinusoid –p1 "today"
Page 106
9.4 - Troubleshooting
Windows
When running as a service on Windows, the PI SQL Subsystem can be directed to abort
processing the current statement and to release the virtual memory it has acquired without
shutting down.
To do this, you must send a pause command to the pisqlss. Three techniques are available for
doing this:
Start the Services control panel applet. Select the PI SQL Subsystem from the list and
click the “Pause” button.
From a command line prompt, issue the command:
net pause pisqlss
From a command line prompt, issue the command:
\pi\bin\pisqlss –pause
A message will be written to the message log indicating that the pisqlss has been paused. The
query in progress when this command is issued will return immediately with an error –10743
(i.e., RPC resolver temporarily off-line). Attempting execution of any new query when the
subsystem is in this state will also return this error.
To resume normal operation, you must send a continue command to the pisqlss. There are
three techniques available for doing this:
Start the Services control panel applet. Select the PI SQL Subsystem from the list and
click the Continue button.
From a command line prompt, issue the command:
net continue pisqlss
From a command line prompt, issue the command:
\pi\bin\pisqlss –continue
A message will be written to the message log indicating that the pisqlss has been continued.
Shutting down and restarting the subsystem can be done at any time and is equally effective.
This is the only option available when running the PI SQL Subsystem on Windows
interactively.
UNIX
Shutting down and restarting the PI SQL Subsystem is the only technique currently available
for aborting expensive queries on UNIX. Use the kill –2 command to stop the pisqlss.
Page 108
9.4 - Troubleshooting
Many PI System utilities prompt for a date and time. The PI time formats are:
Relative
Absolute
Combined
Relative time is some number of days, hours, minutes, or seconds. The leading sign (+ or -) is
required.
+/- d | h | m | s
The default starting point for relative time is usually the current time. Therefore, a time of -8h
is eight hours before the current time. Fractional times may be entered. For example, use -
1.5d for one and one-half days. Only a single operator is supported, + or -. For example, this
is not supported:
-1d+1h
Page 112
A.2 - Absolute Time
The last line of the output reflects the passed time. It is marked with an asterisk (*) which
means that the time string would be ambiguous if specified without the time zone name.
Other features of the pidiag –tz command are outlined in PI Server System Management
Guide, Chapter 12, Finding and Fixing Problems: the pidiag Utility.
For the DD-MMM-YY hh:mm:ss.ssss format, if any of the date fields are left out, they
default to the current date. Time fields default to 00.
A.2.2 Examples
Caution should be used with the default settings. Here are some examples of timestamps that
may be confusing.
The confusion comes from the ambiguity in the first two examples above. Following this
theme, when minutes are added to the next examples, the time stamps are still similar.
The difference in the two notations is evident when a date is added to the time. When a date
is added to the front of the time the default notation is hh:mm:ss.ssss not :hh:mm:ss.ssss.
If extra colons and times are added that is greater than the given DD-MMM-YY
hh:mm:ss.ssss format the last part of the time will be disregarded.
A value for the seconds must be used if sub-seconds are used. Hence caution should also be
used when considering timestamps containing sub-seconds.
Combined time scales use both an absolute and a relative time. The absolute part of the time
can be *, T, Y, or a day of the week.
A.3.1 Examples
Page 114
APPENDIX B: PI TIME CONVERSIONS
This section describes how timestamps are converted between Windows and UNIX PI
Servers (PI Servers) and OpenVMS (PI 2.x). The PI API is based on PI 2.x timestamps; all
references to PI 2 System time also apply to PI API time.9
PI 2 Systems timestamp is based on number of seconds since January 1, 1970 00:00:00 local
time. It is important to emphasize local time. There are at least two limitations to this
convention: daylight savings time changes and PI data access from time zones outside of the
PI System Server time zone.
Daylight Savings Time transitions on PI 2 Systems cause one hour of duplicate timestamps
during the transition from daylight saving time (DT) to standard time (ST) and a one-hour
discontinuity during the ST-DT transition. The ST-DT transition only causes data display
problems. The DT-ST transition, unless special procedures are followed, overwrites one hour
of data, resulting in data loss. The following two tables show actual timestamps during these
two transitions for an PI 2 Server in California, USA.
9 The extended PI API introduces a time object consisting of time zone information. The discussion applies to
non-extended PI API. See the PI Application Programming Interface manual for detail.
The first table shows two identical moments in time represented by two different times in the
PI 2 Server. The second table shows two unique one-hour spans sharing the same times in the
PI 2 Server.
Page 116
B.4 - Timestamps on PI Server Systems
Both timestamps represent the same moment in time, but have different values. An interface
running on the PINet/VMS node would write values that the Server treats as three hours in
the future.
The PI Servers solve this problem by internally storing time based on Coordinated Universal
Time (or UTC:Universal Time, Coordinated). A given moment in time is represented by the
same timestamp regardless of PI Server location. Feeding data from multiple PI Server
satellite nodes scattered around the world into one PI Server poses no time problems.
Data sources based on the PI API or data from PI 2 Net nodes pose a conversion problem.
The timestamps arrive at the Server in PI 2 Server format and must be converted to PI Server
format.
PI 2 Server timestamps are converted to PI Server format on the PI Server. Therefore all
conversions assume the local time and ST/DT state of the PI Server. Conversions are applied
to incoming data (such as data arriving from an interface) and outgoing data (such as archive
values for a PI Process Book trend). Data from a PINet/VMS node in a time zone different
from the PI Server will have conversion errors. Likewise, data from a PI Server destined to a
PI API-based application in a different time zone will also have conversion errors.
PI Servers contain a translation layer that identifies connections from PINet/VMS nodes and
PI API applications. The layer translates calls to appropriate PI Server calls and translates
values and timestamps to PI Server values and timestamps.
The timestamp conversion algorithm is quite simple. The offset between local time and
Universal Coordinated Time is calculated and used as shown in the following two equations:
OpenVMS PI Server based time = PI Server based time – offset
PI Server based time = OpenVMS PI Server based time + offset
The offset calculation requires the PI Server’s operating system to be correctly configured to
the correct time zone and ST/DT status. The offset value will vary by one hour during the
year on systems that honor ST/DT. For example a computer in California will have an offset
of 8 hours during standard time and 7 hours during daylight time. The offset is updated within
5 minutes of actual DT/ST transitions.
The following two tables show time conversions from a PI API-based interface flowing into a
PI Server in California during daylight savings time transitions.
These two tables demonstrate how the PI Server solves the data overlap problem of the DT to
ST transition and the continuity problem of the ST to DT transition. However, there is a
limitation to this conversion algorithm. It is assumed that arriving timestamps are from the
current DT/ST state, that is, a timestamp from ST written to the PI Server during DT will be
converted using the DT offset.
Data flowing from a PI Server to a PI API based application uses a slightly different
timestamp conversion algorithm. If the timestamp conversion algorithm from PI 2 to PI
Server were reversible, the PI Server’s ability to solve the data overlap and discontinuity
problems of DT/ST transitions would not be viewable from a PI API application. Conversion
from PI Server timestamps to PI 2 Server based timestamps uses a constant offset value, that
is, the offset value is not a function of the timestamp being converted. The current offset
value in effect is used to convert any archive value regardless of whether the archive value
Page 118
B.7 - How PI Client Applications Handle DST Changes
represents a value during daylight time or standard time. Here’s a table of examples, again
representing systems in California, USA:
This table shows conversion of identical PI Server timestamps when called during ST and
during DT; the resulting PI 2 System Time is different in each case. Although this appears to
be ambiguous behavior, it allows preservation of correct DT/ST transitions.
The PI API time parsing/formatting routines have been modified to handle this behavior. The
PI API detects the server type and invokes parsing/formatting routines that account for this
behavior. Applications that make no assumption of PI timestamps and use PI parsing and
formatting routines will behave correctly. Applications that invoke non-PI time formatting
techniques may report invalid times.
Archive timestamps in PI Server are stored as universal times; thus the PI Server is not
impacted by daylight savings time. This is in contrast to PI 2.x, where there is a one-hour
hole in the data during the springtime change, and one hour of data is discarded during the
fall time change.
The client applications reflect the daylight savings time changes as follows: it is up to the
displayer to apply an interpretation. OSIsoft does not choose the day that the changes take
place; our software responds to the system time of the local machine.
The PI API will interpret the time according to the local client machine's settings. The time
zone setup information is part of the PC configuration. The PI API queries the operating
system to find out if a time is in daylight savings time or not. Operating systems other than
OpenVMS have the dates of the daylight savings transition times built in. A table of
transition dates is maintained which spans decades.
It is interesting to examine a PI ProcessBook trend that spans a daylight savings time change.
On the day of the springtime change, against a PI Server System, a trend would show
continuous and complete data for 23 hours (midnight to midnight). If the time changes on 3
April at 2:00 a.m., one could watch a theoretical clock during this transition and at exactly
01:59:59.99999999999... the clock would change to 3:00:00. The x-axis will be missing the
60 minutes between 2 a.m. and 3 a.m. There will not be a 2:00:00 marker.
On the day of the fall time change, against a PI Server System, a trend would show
continuous and complete data for 25 hours (midnight to midnight) on the day of the fall time
change. If the time changes on 31 October at 2:00 am, one could watch a theoretical clock
during this transition and at exactly 01:59:59.99999999999... the clock would change to
1:00:00. The x-axis will have the 120 minutes between 1a.m. and 2 a.m. There will be two
consecutive 2:00:00 markers.
On the day of the springtime change, against a PI 2.x system, a trend would show continuous
data for 24 hours (midnight to midnight). If the time changes on 3 April at 2:00 am, one could
watch a theoretical clock during this transition and at exactly 01:59:59.99999999999... the
clock would change to 3:00:00. The PI 2.x Server must adjust its time, and will interpolate
(adding records to the archive as necessary) in order to span the 1-hour gap. The x-axis will
show the 60 minutes between 2 a.m. and 3 a.m., and the values displayed are the interpolated
data.
On the day of the fall time change, against a PI 2.x system, a trend would show discontinuous
and incomplete data for 24 hours (midnight to midnight). If the time changes on 31 October
at 2:00 a.m., one could watch a theoretical clock during this transition and at exactly
01:59:59.99999999999... the clock would change to 1:00:00.
The PI 2.x Server must adjust its time, and the System Administrator gets to choose which
hour of data to discard. This data is lost forever, and will never be displayed by any
application. The x-axis will show only 60 minutes between 1 a.m. and 2 a.m., with no
indication that data was discarded.
Archive timestamps in PI Server are stored as the number of seconds past January 1, 1970.
Two-digit years from 00 through 69 are interpreted as 21st century. Two-digit years from 70
through 99 are interpreted as the 20th century (1900s). For example, 70 translates to 1970; 00
translates to 2000; and 37 translates to 2037.
Page 120
APPENDIX C: PI API AND TOOLKIT USAGE
C.1 Overview
C.1.1 PI API
The PI API is a library of routines originally written to access a PI 2.x System
programmatically. Before the PI-SDK, all of the Microsoft Windows-based PI client
applications (such as PI ProcessBook) were based on the PI API. Today most PI interfaces
continue to use the PI API, and the library is the only programming method supported on
both Windows and UNIX.
The PI API routines reflect the PI 2.x architecture. For example, in PI 2.x, tag descriptors are
limited to 26 characters, while in PI Server the limit is 65535. The PI API routine
pipt_descriptor ( ) returns a maximum of 26 characters even when the PI Server is running
on Windows or UNIX.
PI API version 1.2 first introduced features to take advantage of the PI 3.x architecture. This
included:
Sub-second timestamps
Access to string data types
Beginning with PI API 1.4, new functions were added to take further advantage of the PI 3.x
architecture. This includes support for long tag names, multi-character point sources, and
reading UTC time from the server. These features are only supported when accessing PI
3.4.370 and later.
The PI Server contains a translation layer to provide backward compatibility with most PI
API routines. The translation layer translates calls to appropriate PI Server calls and translates
values and timestamps to PI Server values and timestamps. However, limitations do exist.
These limitations are documented in this appendix.
This section assumes knowledge of the PI API. Refer to the PI Application Programming
Interface Manual for details.
Snapshot Subsystem does not have information about archive events unless the passed time is
the Snapshot itself or the latest archive event. In all other cases, these routines return 0
(success) and pass the request to the archive subsystem via the Event Queue. If the required
event does not exist the archive subsystem sends an error to the PI event log.
piar_replacevalue ( )
This routine replaces a single value for the passed time. Replaced archived values require
approximately twice the archive space to accommodate “edited” flags. Therefore, replacing
large amounts of archived values requires significant free archive space.
piar_panvalues ( )
This routine, if passed a count of 0 will always return error -1. PI 2 behavior is to return the
timestamp if an event exists at the passed timestamp or -103 if now events exist at the passed
timestamp.
piel_addevnt ( )
A call to piel_addevent will create an entry in the PI System message log as follows:
0 Eventlogger 19-Sep-96 11:31:02
>> [Group,3,Type,4,timestamp,19-Sep-96 11:31:02]
This is where the message text goes.
The user name will always be Eventlogger. The timestamp is the time the message arrived in
the Message Subsystem. The second line contains group, type, and passed timestamp in
square brackets, followed by the passed message text.
piel_evntactn ( )
This is not supported in the current version of PI Server.
pipt_dates ( )
Rather than returning a PI user name, the creator and changer arguments return a string
containing a number. The number is associated with the PI user name internally on the
Server.
pipt_descriptor ( )
Although the length of a point descriptor has no practical limit, this PI API function returns a
maximum of 26 characters, for compatibility with PI 2.x.
pipt_digcode ( )
Although the length of a digital state string has no practical limit, this PI API function uses
only the first 12 characters, for compatibility with PI 2.x.
Page 122
C.2 - PI API Usage on PI Server
PI Server is designed to support multiple digital state sets, whereas PI 2.x supports a single
state set. The System Digital State Set is provided for backward compatibility with PI 2.x.
The same digital state string may appear multiple times in the System Digital State Set; it
may appear a single time in a custom state set. In PI Server, the state number and the digital
state code both refer to the same number.
Pipt_digcode ( ) returns the first instance it finds, using the following algorithm:
Search through the digital state sets, from lowest set number to highest. This means
that the System Digital State Set (number 0) will always be searched first.
Search through the given digital state set, from lowest state number to highest.
If found, the digital state is returned as a 32-bit value. The high bit is set; this makes it a
negative number. The next 15 bits indicate the state set number. The low 16 bits indicate the
state number. There is no way to request a subsequent instance of the string.
pipt_digcodefortag ( )
Although the length of a digital state string has no practical limit, this PI API function uses
only the first 12 characters, for compatibility with PI 2.x.
pipt_engunitstring ( )
Although the length of an engineering unit string has no practical limit, this PI API function
returns at most the first 12 characters.
pipt_engunstring( )
This function is called with the point number substituted for the engineering unit code
parameter.
pipt_excspecseng
Excmin and excmax are passed internally as short integers. This limits the values to +/-
32767. If the excmax value for a point is larger than 32767, it will be returned as 32767.
pipt_exdesc ( )
Although the length of an extended descriptor has no practical limit, this PI API function
returns a maximum of 80 characters.
pipt_findpoint ( )
Although the length of a tag name has no practical limit, this PI API function uses a
maximum of 80 characters.
pipt_nextptwsource ( )
Although the length of a point source string has no practical limit, this PI API function
requires that the point source be a single character only. It will not recognize point source
strings longer than a single character. The passed point number is not used. The first call to
this function begins searching for the matching point source at point number 1. Subsequent
calls return the next point in the PI Server point database that matches the passed point
source.
pipt_pointid ( )
This function should not be used; use pipt_findpoint ( ) instead.
pipt_pointsource ( )
Although the length of a point source string has no practical limit, this PI API function
returns the first character only.
pipt_tag ( )
Although the length of a tag name has no practical limit, this PI API function uses a
maximum of 12 characters. Delimiters are not included, as this was a PI 2.x concept.
pipt_totalspecs ( )
This is not supported in the current version of PI Server.
Page 124
C.2 - PI API Usage on PI Server
pipt_updates ( )
Although the length of a tag name has no practical limit, this PI API function uses a
maximum of 12 characters for compatibility with PI 2.x.
pipt_wildcardsearch ( )
Although the length of a tag name has no practical limit, this PI API function uses a
maximum of 80 characters for compatibility with PI 2.x. Subfields are not used, as this is a
PI 2.x concept.
pisn_“X” ( ) {etc.}
The following discussion is for pisn_getsnapshot ( ), pisn_getsnapshots, pisn_putsnapshot
( ), pisn_putsnapshotq ( ), pisn_putsnapshots ( ), pisn_sendexceptionq ( ) and
pisn_sendexceptions ( ).
pitm_formtime ( ) or pitm_systime ( )
Sometimes the PI API appears to be off by several hours when translating the time. This is
usually a configuration problem.
You must set the time zone and daylight savings time correctly on both server and client
machines. In WinNT and Win95, set this using Control Panel, Date/Time.
For 16-bit applications, you can set the TZ environment variable. Thirty-two-bit applications
should not use this, especially if the site is not in the United States.
The TZ environment variable will overwrite the settings of the Time zone settings of the
Operating System in the Control Panel. If you use the TZ variable, the Daylight Saving Time
change will be calculated with a fixed algorithm, which is only valid for the United States.
The result is that if you are anywhere else in the world, DST will start and end at the wrong
time. For 16-bit software there is no solution to get this working properly for non-U.S. sites at
the moment.
If you use pitm_systime to retrieve number of seconds past Jan 1, 1970, you should also use
pitm_formtime to translate this to a string. If you mix PI API time functions with
Microsoft C++ time functions (time and localtime) you may get results that are off by several
hours.
Here is an excerpt from Microsoft's MSDN Run-time Library Reference:
The _tzset function uses the current setting of the global environment variable TZ to
assign values to three global variables:
_daylight, _timezone, and _tzname.
TZ is a Microsoft extension and not part of the ANSI standard definition of localtime.
These variables are used by the _ftime and localtime functions to make corrections from
coordinated universal time (UTC) to local time, and by the time function to compute
UTC from system time.
Use the following syntax to set the TZ environment variable:
set TZ=tzn[+ | -]hh[:mm[:ss] ][dzn]
where
Page 126
C.3 - PI Toolkit Usage on PI Server
Tzn = Three-letter time-zone name such as PST. You must specify the correct offset
from UTC.
Dzn = Three-letter daylight-savings-time zone such as PDT. These three letters can be
anything you like. If DST is never in effect in the locality, set TZ without a value for
dzn.
For example, to set TZ to correspond to the current time zone in Germany, you can use
one of the following statements:
set TZ=GST1GDT
set TZ=GST-1GDT
These strings use GST to indicate German standard time, assume that Germany is one
hour ahead of UTC, and assume that DST is in effect.
If TZ is not set, _tzset attempts to use the time zone information specified by the
operating system. If _tzset cannot obtain this information, it uses PST8PDT by default,
which signifies Pacific Time zone.
Localtime corrects for the local time zone if the user first sets the global environment
variable TZ.
This section assumes knowledge of the PI Toolkit. Refer to the PI System Manual, Volume
II, for OpenVMS for details.
GetCompSpecs ( )
See comments for the PI API function pipt_compspecs ( ).
GetCompSpecsEng ( )
See comments for the PI API function pipt_compspecs ( ).
GetDigCode ( )
See comments for the PI API function pipt_digcode ( ).
GetDigPointers( )
See comments for the PI API function pipt_digpointers ( ).
GetEngCode( )
This function returns with engUnitCode equal to 0.
GetEngUnits( )
This function returns with engUnitCode equal to pt if pt is less than 32768, else it returns
with engUnitCode equal to 0.
GetExcSpecsEng( )
See comments for the PI API function pipt_excspecseng ( ).
Page 128
APPENDIX D: PREDEFINED ATTRIBUTE SETS AND POINT
CLASSES
D.1.1 alarmparam
Attribute Type Default
action1 String
action2 String
action3 String
action4 String
action5 String
AutoAck String yes
ControlAlg String
ControlTag String
Deadband Float32 0.
Options String
ReferenceTag String
Srcptid Int32 0
test1 String
test2 String
test3 String
test4 String
test5 String
txt1 String
txt2 String
txt3 String
txt4 String
txt5 String
D.1.2 base
Attribute Type Default
Archiving BYTE 1
Changedate TimeStamp 31-Dec-69 16:00:00
Changer Uint16 0
Compdev Float32 2.
Compmax Uint32 28800
Compmin Uint16 0
Compressing BYTE 1
Creationdate TimeStamp 31-Dec-69 16:00:00
Creator Uint16 0
Descriptor String
Displaydigits BYTE -5
Engunits String
Excdev Float32 1.
Excmax Uint32 600
Excmin Uint16 0
Exdesc String
Pointsource String Lab
Pointtype UBYTE 12
Scan BYTE 1
Shutdown BYTE 1
Span Float32 100.
Step BYTE 0
Typicalvalue Float32 50.
Zero Float32 0.
D.1.3 classic
Attribute Type Default
Convers Float32 1.
Filtercode Int16 0
Instrumenttag String
location1 Int32 0
location2 Int32 0
Page 130
D.1 - Predefined Attribute Sets
location3 Int32 0
location4 Int32 0
location5 Int32 0
Squareroot Int16 0
Srcptid Int32 0
Totalcode Int16 0
userint1 Int32 0
userint2 Int32 0
userreal1 Float32 0.
userreal2 Float32 0.
D.1.4 sqcalm_parameters
Attribute Type Default
AutoAck String yes
ChartType Int32 0
ClearOnLimitChange String true
ClearOnStart String false
CLTag String
CommentTag String
LCLTag String
LSLTag String
Mixture String
OneSideofCL String
Options String
OutsideControl String
OutsideOneSigma String
OutsideTwoSigma String
PIProductLimits String no
ProductTag String
ReferenceTag String
ResetTag String
SQCAlarmPriority Int32 0
Srcptid Int32 0
Stratification String
TestStatusTag String
Trend String
UCLTag String
USLTag String
WaitOnLimitChange String false
D.1.5 totals
Attribute Type Default
CalcMode String timeweighted
CompValue String ON
Conversion Float32 1.
EventExpr String
FilterExpr String
Function String Total
MovingCount Int16 2
Offset String +0m
Offset2 String +0m
Options String
PctGood Float32 85.
Period String +1h
Period2 String +2m
RateSampleMode String natural
ReportMode String Running
Srcptid Int32 0
TotalCloseMode String clock
Zerobias Float32 0.
Page 132
TECHNICAL SUPPORT AND RESOURCES
Email Support
Email support is available 24 hours a day, 7 days a week. Send technical support
inquiries, including the problem description and message logs, to:
[email protected]. Technical Support will respond to your inquiry within 24
hours.
Knowledge Center
The Knowledge Center provides a searchable library of documentation and technical
data, as well as a special collection of resources for system managers. For these options,
click Knowledge Center in the Technical Support Web site.
• The Search feature allows you to search Support Solutions, Bulletins, Support
Pages, Known Issues, Enhancements, and Documentation (including User
Manuals, Release Notes, and White Papers).
• System Manager Resources include tools and instructions that help you
manage: Archive sizing, Backup scripts, Daily Health Check, Daylight Saving
Time configuration, PI Server security, PI System sizing and configuration, PI
Trusts for Interface Nodes, and more.
Page 134
INDEX OF TOPICS
ptGroup, 49 Classes
recNo, 55 PtClassName attribute, 42
scan, 47 Classes, base point class, 41
shutdown, 50 Classic Point
sourceTag, 47 Definitions, 98
span, 45 Classic Point class, 50
squareRoot attribute, 50 classicctr point class, 52
srcptid attribute, 51 classicctr.dif, 52
step, 48 Client Applications
system-assigned, 55 Security, 95
tag name restrictions, 42 COM connectors, 14
totalcode attribute, 51 classicctr.dif file, 52
typicalValue, 45 creating point class for, 52
userInt and userReal attributes, longword mapping parameter,
51 52
zero, 45 mapped points, 52
Bad Input digital state, 23 point attributes for, 52
Bad status, 23 program ID parameter, 52
Base class, 41 string mapping parameter, 52
Base Point Class COM objects, 14
Point Attributes, 98 Combined Time Format, 114
Batch Database, 38 Command
bin directory, 6 Ptclass, 41
Blob point type, 43 Command Line Arguments
Buffering SQL Subsystem, 100
PI API, 6 UNIX, SQL Subsystem, 102
Build number, 4 Windows, SQL Subsystem,
C language, 6 102
Capitalization CompDev, 90, 91
case sensitivity in searches, 42 Point attribute, 53
digital state sets, 25 CompDev attribute, 47
Case sensitivity CompDevPercent, 53, 91
digital state names, 25 CompDevPercent attribute, 47
for tags, 42 CompMax, 90, 91
ChangeDate, 53 Point attribute, 53
point attribute, 55 CompMax attribute, 47
Point attribute, 55 CompMax Point attribute range of
values, 51
Changer, 53
CompMin, 90, 91
point attribute, 55
Point attribute, 53
Changing zero/span, 46
CompMin attribute, 47
Chsrc file
Compressing attribute, 47
UNIX, 8
Page 136
Index of Topics
Page 138
Index of Topics
Page 140
Index of Topics
Page 142
Index of Topics
Page 144
Index of Topics
Page 146
PI Server Applications User Guide
PI3 Server
Version 3.4.370
Worldwide Offices
OSIsoft, Inc. is the owner of the following trademarks and registered trademarks: PI System, PI ProcessBook,
Sequencia, Sigmafine, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known to be
trademarks or service marks have been appropriately capitalized. Any trademark that appears in this book that
is not owned by OSIsoft, Inc. is the property of its owner and use herein in no way indicates an endorsement,
recommendation, or warranty of such party's products or any affiliation with such party of any kind.
Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)
of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
Copyright Notice
Unpublished -- rights reserved under the copyright laws of the United States
PREFACE – USING THIS GUIDE
The PI Server Applications User Guide explains how to use PI Server Applications.
PI Server Applications are supplemental subsystems that you can run in conjunction with the
PI Server to provide additional functionality. PI Server Applications are not necessary to
run the PI Server, and are typically licensed separately.
The PI Server Applications included in this guide are:
PI Performance Equations Scheduler
PI Performance Equations Recalculator
PI Steam Functions Module
PI Batch Database
PI Totalizer Subsystem
PI Alarm Subsystem
PI Real-Time Statistical Quality Control (SQC)
This guide provides full administration and end-user instructions for the PI Server
Applications listed above. An additional PI Server Application, the PI Batch Generator
Interface (PIBaGen), is not discussed in this guide. For information regarding PIBaGen, see
the PI Batch Generator User Guide.
Installation Note
The PI Server and Server Applications are distributed together as one installation. Your
ability to use any one of the PI Server Applications depends upon your EULA (End-user
License Agreement.) Contact OSIsoft Technical Support for licensing information.
The PI Server Documentation Set includes seven user guides, described below.
Tip: Updated user guides, which provide the most up-to-date information, are
available for download from the OSIsoft Technical Support Web site
(http://techsupport.osisoft.com).
Introduction to PI A guide to the PI Server for new users and administrators. It explains PI
System Management system components, architecture, data flow, utilities and tools. It provides
instruction for managing points, archives, backups, interfaces, security and
trusts, and performance. It includes a glossary and resource guide.
PI Server Installation A guide for installing, upgrading and removing PI Servers on Windows and
and Upgrade Guide UNIX platforms, including cluster and silent installations.
PI Server System An in-depth administration guide for the PI Server, including starting and
Management Guide stopping systems, managing the Snapshot, Event Queue and Data Archive,
monitoring system health, managing backups, interfaces, security, and
moving and merging servers. Includes comprehensive instructions for using
command-line tools: PIConfig, PIDiag, and PIArtool, and in-depth
troubleshooting and repair information.
PI Server Reference A comprehensive reference guide for the system administrator and
Guide advanced management tasks, including: databases; data flow; PI Point
classes and attributes, class edit and type edit; exception reporting;
compression testing; security; SQL subsystem; PI time format; and
overviews of the PI API, and PI-SDK System Management Tool (SMT).
Auditing the PI An administration guide that explains the Audit Database, which provides a
Server secure audit trail of changes to PI System configuration, security settings,
and Archive Data. It includes administration procedures to enable auditing, to
set subsystem auditing mode, to create and archive database files, and to
export audit records.
PINet and PIonPINet A systems administration guide, including installation, upgrade and
User Guide operations, for PINet for OpenVMS and PIonPINet, which support migration
and interoperability between PI2 and PI3 Systems.
Page iv
Preface - Using this Guide
Monospace Consolas monospace is used for: To list current Snapshot information every 5 seconds,
type: Code examples use the piartool -ss command. For example:
"Consolas" Commands to be typed on the
font command line (optionally with
arguments or switches)
System input or output such as
excerpts from log files and other
data displayed in ASCII text
Bold consolas is used in the
context of a paragraph
Light Blue - Links to URL / Web sites, and email http://www.osisoft.com/procedures.aspx
Underlined addresses [email protected]
Related Documentation
OSIsoft provides a full range of documentation to help you understand and use the PI Server,
PI Server Interfaces, and PI Client Tools. Each Interface has its own manual, and each Client
application has its own online help and/or user guide.
The UniInt End User Manual describes the OSIsoft Universal Interface (UniInt), which is
recommended reading for PI Server system managers. Many PI Interfaces are based upon
UniInt, and this guide provides a deeper understanding of principals of Interface design.
The PI Server provides two sets of powerful tools that allow system administrators and users
to perform system administration tasks and data queries.
The PI Server includes many command-line tools, such as pidiag and piartool. The
PI Server Documentation Set provides extensive instruction for performing PI Server
administrative tasks using command-line tools.
The PI System Management Tools (SMT) is an easy-to-use application that hosts a
variety of different plug-ins, which provide all the basic tools you need to manage a
PI System. You access this set of tools through a single host application. This host
application is sometimes referred to as the SMT Host, but it is more commonly called
System Management Tools or SMT.
You can download the latest version of SMT from the Technical Support Web site:
http://techsupport.osisoft.com
In addition to extensive online help that explains how to use all of the features in the SMT,
the SMT includes the Introduction to PI System Management user guide.
Page vi
QUICK TABLE OF CONTENTS
Table of Tables...............................................................................................................................xvii
Page x
Table of Contents
Page xii
Table of Contents
Page xiv
Table of Contents
Index of Topics...............................................................................................................................369
Page xvi
TABLE OF TABLES
Table 2–1. Attributes that Require a Special Setting for Calculated Points.............................11
Table 3–1. Glossary of Recalculation Terms ...........................................................................20
Table 3–2. Types of PE Point / Time Relationships.................................................................24
Table 3–3. Recalculator Startup Options .................................................................................38
Table 3–4. Recalculator Debug Levels and Output .................................................................40
Table 4–1. Operands in Performance Equations.....................................................................46
Table 4–2. Examples of Time Syntax ......................................................................................50
Table 4–3. PE Operators, Listed by Type, with Examples ......................................................52
Table 4–4. PE Arithmetic Operators ........................................................................................53
Table 4–5. Valid Operations on Time Values ..........................................................................54
Table 4–6. Relational Operators in Performance Equations ...................................................55
Table 4–7. Prefix Operators .....................................................................................................56
Table 4–8. Conjunction, Disjunction and Inclusion Operators .................................................57
Table 4–9. Operator Priority.....................................................................................................58
Table 4–10. Functions Grouped by Type.................................................................................62
Table 4–11. Functions Listed Alphabetically............................................................................65
Table 5–1. Engineering Units.................................................................................................185
Table 5–2. Supported Functions ............................................................................................186
Table 5–3. Digital States Returned ........................................................................................187
Table 5–4. Input Range for Each Function ............................................................................187
Table 6–1. PIBAUNIT Table Attributes ..................................................................................242
Table 6–2. Configuration Differences from PI BA in PI2 (OpenVMS)....................................245
Table 6–3. PIBAALIAS Table Attributes ................................................................................248
Table 6–4. PIBATCH Table Attributes ...................................................................................250
Table 7–1. Five Major Parameters that Affect Totalizer.........................................................258
Table 7–2. Totalizer Point Class Attribute Set .......................................................................260
Table 7–3. Allowed Combinations of TotalCloseMode and ReportMode ..............................273
Table 7–4. Viable Function and CalcMode Options...............................................................274
Table 7–5. Conversion Factors for Units ...............................................................................283
Table 7–6. PI for OpenVMS and PI for NT and UNIX Equivalents ........................................289
Table 8–1. Alarm Point Class Attributes ................................................................................294
Table 8–2. Example Test Comparisons and the Alarm Status ..............................................296
Table 8–3. Viable Argument Data Types for Operators.........................................................297
Table 8–4. Comparisons of the Is_In Operator......................................................................301
Table 8–5. Comparisons of the Not_In Operator ...................................................................302
Table 8–6. Comparisons of the Includes Operator ................................................................303
Table 8–7. Comparisons of the CondEQ Operator................................................................304
Table 8–8. Examples Using First Syntax (Condition Priority) ................................................305
Table 8–9. Examples Using Second Syntax (StateName) ....................................................305
Table 8–10. Combiner Logic Examples .................................................................................306
Table 8–11. Sample Alarm Conditions ..................................................................................308
Table 8–12. Three-state Acknowledgement Status ...............................................................309
Table 8–13. Single Priority Alarm State Set...........................................................................309
Table 8–14. Example Three-priority-level System .................................................................309
Table 8–15. Alarm Digital State Set with Three Priorities......................................................310
Table 8–16. Example Digital Alarm State Set with One Priority ............................................311
Table 8–17. Example Digital Alarm Set with Three Priorities ................................................311
Table 8–18. PointFunc Options..............................................................................................313
Table 8–19. Example Alarm Group........................................................................................313
Table 8–20. One Priority Alarm Set .......................................................................................323
Table 8–21. Three Priority Alarm Set.....................................................................................324
Table 8–22. Single Priority Alarm Set (Digital Base Set) .......................................................327
Table 8–23. Three Priority Alarm Set (Digital Base Set)........................................................329
Table 9–1. Precedence of SQC Alarm's Pattern Tests.........................................................343
Table 9–2. Summary of Associated Points ...........................................................................347
Table 9–3. TestStatusTag Bits Indicate SQC Alarm State ...................................................349
Table 9–4. Examples of TestStatusTag values ....................................................................349
Table 9–5. Values of the ResetTag.......................................................................................350
Table 9–6. SQC_Alarm Point Class Attributes .....................................................................352
Table 9–7. Valid ChartType Values ......................................................................................355
Table 9–8. Pattern Test Configuration Examples .................................................................357
Table 9–9. Default DigitalSet for SQC Alarms ......................................................................360
Table 9–10. Informational Messages ....................................................................................363
Table 9–11. Error Messages: Serious Errors........................................................................364
Page xviii
TABLE OF FIGURES
Page xx
Chapter 1. PI SERVER APPLICATIONS
The power of the PI System is enhanced by the PI Server Applications, which work on top of
the PI Server. PI Server Applications are a set of processing tools that help you get more out
of your data by automating specific processes.
The PI Server Applications and reference sections included in this guide are:
Chapter 2 – PI Performance Equations Scheduler
Chapter 3 – PI Performance Equations Recalculator
Chapter 4 – PI PE Syntax and Functions Reference
Chapter 5 – PI Steam Functions Reference
Chapter 6 – PI Batch Database
Chapter 7 – PI Totalizer Subsystem
Chapter 8 – PI Alarm Subsystem
Chapter 9 – PI Real-Time Statistical Quality Control (SQC)
Page 2
1.1 - PI Server Applications Overview
This chapter explains how to create calculated points using the PI Performance Equations
(PE) Scheduler. The PE Scheduler allows you to implement sophisticated online calculations
without having to program in high-level languages.
The PE Scheduler provides an equation syntax and library of built-in functions that allow you
to perform a wide variety of calculations on PI data. (See Chapter 4: PI Performance
Equations Syntax and Functions Reference.) Performance Equations can work with
frequently-updating Snapshot and Archive values, whereas tools such as spreadsheets only
have access to Archive data and limited access to Snapshot update values.
PE Scheduler allows you to easily implement sophisticated, real-time calculations, such as:
• Unit performance
• Real-time cost accounting
• Real-time yield accounting
• Grade-based costing
• Batch summary
• Conversions and totalizations not performed by PI Totalizer
• Logical operations
• Calculating aggregates
Each Performance Equation is associated with a PI point, and the calculation results are
stored in the PI Archive as a calculated point, or PE point. You can configure a PE point to
be evaluated periodically by the Performance Equation Scheduler on a time-based basis, or
when an event is received on a specified trigger point, called event-based scheduling. The
Scheduling Method is discussed in Section 2.5.
This chapter includes the following topics:
Section 2.1, About Calculated Points, on page 6
Section 2.2, About the PE Subsystem, on page 6
Section 2.3, Procedure to Create Calculated Points, on page 7
Section 2.4, Determine Scan Classes and Point Source, on page 8
Section 2.5, Choose a Scheduling Method, on page 11
Section 2.6, Set Attributes for Calculated Points, on page 11
Section 2.7, Tips and Troubleshooting, on page 15
Calculated points perform calculations on one or more PI points. Calculated points are similar
to other PI points, but they use the Performance Equation Subsystem as the point source. (The
point source is specified in pipeschd.bat in the \pi\bin directory.) The PE Scheduler performs
the calculations specified for the point at the scheduled time (based on "time" or "event") and
sends the result to the Snapshot.
Note: In this guide, Calculation Points are also referred to as PE Points and these
two terms are used interchangeably.
To create a calculated point, you put a calculation expression in the Extended Descriptor
(ExDesc) attribute field and you set the point source to the point source for the PE subsystem.
The value for the calculated point at any given time is the result of this calculation
expression. The PE Scheduler calculates a new value for the point according to the schedule
you define for it, either at regular intervals or using an event trigger.
You can use calculated points in other calculations, graph them in trend displays, or include
them in reports, just like any other point.
The PE Scheduler works a lot like an interface, except that it runs locally, on the PI Server. It
has an associated point source location and scan classes. The PE Scheduler evaluates the
calculation expression for each calculated point according to the schedule you configure for
that point, and sends the resulting value and timestamp to the Snapshot. Calculated points are
subject to exception and compression tests, just as other points are.
Like an interface, the PE Subsystem needs to be running in order to calculate data and send it
to the Snapshot. The PE Scheduler executable is located in the PI/bin directory and is called
pipeschd.exe.
Page 6
2.3 - Procedure to Create Calculated Points
On Windows computers, the PE subsystem typically runs as a Windows service and you
manage it as you would any other Windows Service. The PE Scheduler service is called the
PI Performance Equation Scheduler. Open the Services control panel (Control Panel >
Administrative Tools > Services), right-click on the PI Performance Equation Scheduler
service, then start, stop or restart the service.
On UNIX, use the ps command to determine the process ID, and then use the kill command
to stop the process:
$ ps -aef | grep pipeschd
piadmin 25688 1 1 Sep 14 ? 35:22 ./pipeschd /Q /ps=C /ec=24 /f=00:
$ kill -2 25688
To perform a calculation on PI data, you must create a PI point; put your calculation
expression in the ExDesc attribute field; set the PointSource attribute to the point source
specified in the pipschd.bat file; and set location4 to the Scan class.
Follow these steps to perform a calculation on PI data:
1. Determine the scan classes and point source. (See Determine Scan Classes and Point
Source on page 8.)
2. Choose a scheduling method. You can use either clock-based scheduling or event-
based scheduling. (See Choose a Scheduling Method on page 11.)
3. Create the point, and set the required attributes. (See Set Attributes for Calculated
Points on page 11.) Create a new PI point using the PI tool of your choice, such as PI
Tag Configurator or piconfig. Set the required attributes as follows:
• PointSource: Set PointSource to the point source location specified in
pipeschd.bat on Windows, or pipeschd.sh on UNIX. The default point source
location for calculated points is the ASCII character, C, but you can edit
pipeschd.bat to use another single alphanumeric ASCII character.
• Location4: If you're using clock-based scheduling for this calculation, put the
appropriate scan class in location4. The available scan classes are listed in
pipeschd.bat. If you're using event-based scheduling, leave location4 blank.
PE Points use the scan classes and point source configuration for the PE Subsystem defined
in pipeschd.bat on Windows, and pipeschd.sh on UNIX. By default, pipeschd.bat is located
in the directory PI\bin where PI\ is the path to the main directory in your PI installation.
Note: Make a note of the character. This is the value you must use for the
PointSource attribute on all calculated points.
Page 8
2.4 - Determine Scan Classes and Point Source
4. Edit all existing calculated points to reflect the new point source.
5. Start the PE Subsystem.
next time there is a change to (or from) daylight savings time. UTC scan classes don't have
this problem because they force the scan class scheduling to sync with UTC, rather than local
time.
The position within the startup command line defines the scan classes; that is, the first /f=
refers to scan class 1, the second /f= refers to scan class 2, etc. Simply add more /f=
parameters to define more scan classes. The calculated point is assigned to a scan class using
the location4 attribute. For example, if location4 is set to 2, the PE point will be evaluated
every 2 minutes.
Page 10
2.5 - Choose a Scheduling Method
The attributes you set for a calculated point depend in part on the type of scheduling you use
for the point. Each calculated point must use either clock (time-based) scheduling or event
scheduling:
Clock Scheduling: With clock scheduling, you use scan classes to schedule the
calculation. The PE Scheduler calculates a new value for the point at the specified
intervals, such as every hour, every five seconds, every 20 minutes, etc. You can
optionally specify an initial start time for the calculation interval.
For clock-scheduled points, define the PE calculation expression in the ExDesc
attribute field and specify a scan class in the location4 attribute field. (See Set the
ExDesc Attribute for Clock-Scheduled Points and Set the Location4 Attribute: Scan
Class, on page 12.)
Event Scheduling: With event scheduling, you configure the calculation to occur
when a specified point gets a new Snapshot value. For example, you might want a
calculation performed whenever the point ba:level.1 receives an update event.
For event-scheduled points, put both the PE expression and the trigger tag name in
the ExDesc attribute field (see Set the ExDesc Attribute for Event-Scheduled Points
on page 13) and set the location3 attribute field to specify the timestamp of the point.
(See Set the Location3 Attribute: Timestamp, on page 12).
Table 2–1 lists the attributes that require a special setting for calculated points.
Table 2–1. Attributes that Require a Special Setting for Calculated Points
Attribute Requirement
ptClassName Classic.
PointSource Set to value specified in pipeschd.bat file (or
pipeschd.sh on UNIX). The default value is C.
location3 Output timestamp setting for event-based
scheduling.
location4 Put the scan class here for clock-scheduled
points. Leave blank for event-based points.
ExDesc This is where you put your performance
equation.
scan Set the scan attribute to 1 (the default value)
All point attributes that are not listed in Table 2–1 work just the same as they do for other
points. However, the following attributes do not apply to calculated points:
• Location2
• Location5
• UserInt1
• UserInt2
• UserReal1
• UserReal2
• EventTag
• InstrumentTag
• SquareRoot
For an explanation of scan classes and how to configure them, see Find the PE Subsystem
Scan Classes, on page 9.
Page 12
2.6 - Set Attributes for Calculated Points
Note: If the equation begins with a single quote (') and you are working with PI Tag
Configurator, enclose the calculation expression in parentheses. Otherwise Excel will
remove the single quote.
Page 14
2.7 - Tips and Troubleshooting
TagTot Example
In this example, the goal is to use the TagTot function to obtain a total on a point that has
engineering units other than the default per day. RateTag has engineering units of gallons per
hour and the objective is to get the number of gallons for the previous day.
If PctGood(‘RateTag’, ‘y’, ‘t’)>85 then TagTot(‘RateTag’, ‘y’, ‘t’)*24
else “Bad Total”
First, the performance equation checks the percent of good values starting from the midnight
yesterday to the midnight of the current day. If the percentage is greater than 85, then a total
of RateTag is calculated for that given period. The total is multiplied by 24 hours per day to
obtain the units of gallons. If the percentage is less than or equal to 85, the digital state of
Bad Total is given. In this example, although the RateTag would have an integer or real
point type, digital states only in the SYSTEM Digital State Set are allowed.
Page 16
2.7 - Tips and Troubleshooting
The source data do not meet the minimum pctgood value in a summary calculation.
For example, TagAvg('sinusoid', '*-1h', '*', 80) will result in Calc Failed if
less than 80% of the values for sinusoid are good for the last hour.
Runtime data type conversion fails. For example, suppose the PE point is a digital
point and has the expression 'StringTag'. If the string source tag StringTag has a
string that cannot be converted to a digital state either in the PE point’s digital state
set or the System Digital State Set, then the result will be Calc Failed.
Page 18
Chapter 3. PI PERFORMANCE EQUATIONS
RECALCULATOR
The PE Recalculator automatically adjusts values of PE points when values of points used in
PE expressions are added, changed, or deleted. Delayed or out-of-order Snapshot events can
also trigger recalculations.
The Recalculator supports multi-level (but not recursive) dependencies and takes into account
the resulting time dependency. Explicit time dependency expressions and time-related
functions are supported as well. Some point attributes of the dependent PE point and the
source points are considered.
Like other standard PI subsystems, Recalculator runs on a PI Server Home Node, either as a
service, or manually as a console application. When Recalculator is started as a service,
messages are sent to the PI Message Subsystem and additional debug output may be sent to a
log file. When Recalculator is started as an application, messages are written to the console.
There are several limitations and side effects to keep in mind, due to compression and other
factors, which are described in this chapter.
It is important to realize that recalculation “is expensive” as it bypasses exception reporting,
may retrieve a lot of Archive data for many tags, and may generate many out-of-order events.
All of these factors place a significant overhead on a PI Server. In addition to these
considerations, check that any affected Archive file contains the point definitions and has
sufficient space.
Name Description
Dependent A PI point that normally receives its values from the PE Scheduler when it
Point evaluates an expression. These are also the points that are modified by the PE
Recalculator when necessary.
Source Point A PI point whose tag appears in a PE expression. In general, additions, changes,
and deletions of source point values trigger recalculations.
Absolute A date/time expression that evaluates to the same time regardless of the time of
Timestamp the calculation. Examples include '10-oct-99' and '01-jan-70.'
Relative A date/time expression defining an offset from the actual time of the calculation.
Timestamp Examples include '+7h' and '-30d'.
Note: One exception to this rule occurs when a Relative Timestamp appears as one of the
two time arguments of a PI PE Archive retrieval function. If the other time is an absolute time,
it becomes the basis time.
Basis Time The time to which the offset defined by the Relative Timestamp is applied. When
evaluating PE point values, the PE Recalculator will determine the basis time of
the dependent values to be corrected and will apply the offsets from that basis.
Combination A date/time expression consisting of an absolute timestamp and a relative
Time timestamp as an offset. Examples include 'T+7h.'
Page 20
3.2 - PE Recalculator Functionality
Name Description
Inversion Changing the sign of a Relative Timestamp offset in order to define the period of
time requiring recalculation. For example, if an expression reads,
"TagVal('input', '*-1h')", then PE point values up to one hour after an
'input' event, or '*+1h', must be recalculated.
When the PE Scheduler starts, it finds the PE points by scanning the PI Point Database for
points with a specific point source, usually C.
Since the Recalculator sends events to the same PE points, it also scans the PI Point Database
on startup, scanning for the same point source. By default, all PE points are considered for
recalculation. If you wish, you may assign values to the Location1 attribute of any PE point.
The Recalculator can be configured to consider only points with a specific Location1
parameter value.
The PE Scheduler will sign up for exceptions for any event trigger points. The Recalculator
signs up for Archive events of all source points. The reason for the difference is that the
Recalculator must be aware of any changes to any source point, not just event trigger points.
Only events that were not handled in time by the PE Scheduler are considered by the
Recalculator. The timestamp of the source point event has to be older than the Snapshot time
of the corresponding dependent PE point. The delay caused by the normal scan cycle does not
trigger a recalculation.
Recalculation is done in two steps: For a source point event, first the affected PE point
periods are found. Then, all these periods are processed for existing events to replace, and
new events to insert. When inserting new events, their timestamps are derived from the
timestamps of the source events.
Generally, there are three main questions:
Which dependent PE points are affected?
What time range has to be recalculated?
How do other point attributes influence the recalculation?
These questions are discussed here and lead to a definition of different recalculation types.
The recalculation types are described in a subsequent section.
TimeCalc: In the first example, if the value of xsource at 12-Jan-98 12:12:00 is changed,
TimeCalc at 12-Jan-98 20:12:00 (8 hours later) has to be recalculated.
CalcInt: In the second example, the expression has to be recalculated for a 1-hour period past
the time of a modification of xsource.
AllCalc: If the value of xsource at 12-Jan-98 08:00:00 were to be modified, then all values of
the PE point after 12-Jan-98 08:00 would have to be recalculated whenever xsource is in a
bad state.
Page 22
3.2 - PE Recalculator Functionality
Note: The ability to recalculate events may be affected if either of these attributes
are set to 0. It is impossible to accurately correct history if there were no original
events to adjust.
3.2.7 Location1
The Location1 attribute may be used to exclude points or to schedule multiple instances of
the Recalculator for performance reasons. This corresponds to the number in the /in startup
parameter or in the Instance Registry setting. By default, all PE points are examined for
recalculation.
The types of the relationship between a PE point and time are summarized below, and
explained in subsequent sections.
Page 24
3.3 - Types of PE Point / Time Relationships
The PE always uses the values prior to the beginning of the scan cycle. In the
example above, T2Calc is always one cycle behind TestCalc. The cycle is defined
by the scan class of the PE points and by the scan parameters in pipeschd.bat.
To insert a value, PE uses the system time, not the timestamp of an event trigger
point by default.
As the calculated point may depend on more than one source point, the Archive is examined
for events until the next event of the modified source point. All these events have to be
recalculated. See Figure 3–1.
Additional input
Source 1
Source 2
Dependent
Note: With Step = 0, entering a single event into the Data Archive always affects the
period between the previous and the next unmodified event. If you intend to enter a
single peak or to mark the last “originally good value”, you have to enter additional
events.
Modified input
Source
Dependent
!
Page 26
3.3 - Types of PE Point / Time Relationships
M odified
Source
?2 ?2 Source
D ependent
?1
?3 ?3
A dditional O riginal result based
on sam e source
Figure 3–3. Recalculation Period on Type = Simple, Step=0, PE Point with Compression
Recalculator inserts extra events at the beginning and the end of the modified period (?3) if
necessary, so there are no new results without changed input. Due to the compression
algorithms, the new values may still be slightly different from the original interpolated
values.
Recalculator inserts extra events according to the modified source point event. Recalculator
does not insert additional events due to unmodified source events (?2).
Recalculator recalculates all existing dependent events in the time range affected by the
modified source event (?1). It does not simulate the exception reporting and compression
algorithm.
Conditional Dependency
“If-then-else” constructions are evaluated only during recalculation. The point and time
dependency is stated by parsing the expression in the ExDesc parameter for all cases on
startup.
Examples
Tag Expression
TestCalc If BadVal('TestCalc') then 0 else (if 'TestCalc' > 9999 then 0
else 'TestCalc' + 1)
EvCount Event=CountMe, if BadVal('EvCount') then 0 else ('EvCount' + 1)
TestCalc increments by one on every scan cycle and resets if the value is bad or is larger than
9999.
EvCount shows the number of events for the point CountMe.
The BadVal() constructions are required to quit any non-numeric initial state (Shutdown,
PtCreated).
These recursive calculations are very sensitive to the previous state of the variable and may
give different results when they have already been recalculated before. In example 2
(EvCount), there is no possibility to detect all events from the Archive. Additionally, they
would generally result in a recalculation of the whole period up to now.
For these reasons, PE points depending recursively on themselves are generally excluded
from recalculations.
There is no explicit limit on the number of levels to detect a recursive dependency.
A Æ B Æ C Æ … (any number of PE points) … Æ Z Æ A
Page 28
3.3 - Types of PE Point / Time Relationships
Modified input
‘*+3h’
Source
‘*+3h’ Dependent
The algorithm described for type = Simple (without explicit time dependency) is applied to a
period shifted by the indicated offset. Extra events are not created.
For the example here, this results in a recalculation period for the dependent PE point from
t1=(prevevent(source) + 3h) to t2=(nextevent(source) + 3h). See Figure 3–4.
Note: Future references '*+nX' are syntactically correct. Based on actual values,
they result in ‘No Data’ or ‘Bad’. On recalculation, they may result in numeric
values. These are processed normally without error messages.
Examples
Tag Expression
BASEVAL TagVal(‘xsource’,’T’)
DIFFVAL 'xsource' – TagVal('xsource','T')
BASEVAL holds the midnight value of xsource of each day. If this value changes, all
Archive values of BASEVAL for that day have to be modified. Every recalculation on this
day yields the same new result. If there are changes of xsource at other timestamps, nothing
is recalculated.
DIFFVAL has to be recalculated for the whole day, when xsource at midnight is modified.
Other changes of xsource affect values of DIFFVAL only at the event timestamp of xsource,
and the period of time between the previous and next events of xsource. The period of time
between the new xsource event and the next xsource event would have to be recalculated if
the Step point attribute is 1. See Figure 3–5.
xsource
DIFFVAL
00:00 00:00
This dependency type requires that both time parameters be relative to the calculation time.
Expressions like '-1h' are valid as one of the time parameters. They are interpreted relative to
the other.
Page 30
3.4 - Special PE Time Functions
value of sinusoid does not force the recalculation of the dependent PE point for the whole
next day.
The calculation itself uses the time parameters correctly, so requesting a recalculation
manually could be used as a workaround, if necessary.
A change in an absolute timestamp in an expression does not cause recalculation of the whole
Archive automatically. If this function is desired, you have to run the Recalculator as a
console application, stating which point and time period has to be recalculated.
Some of the time functions in the PE library change the data type of their arguments, or
extract information from timestamps. This category of time functions requires special
consideration.
If the input string is a variable, evaluation at compile time is impossible: Any automatic
recalculation is suppressed.
A simple form of filter, assuming no compression, with scan-based values; this avoids
recursive use of the PE point:
('xsource' + (PrevVal('xsource', '*')*9) / 10
Yesterday’s average value:
TagAvg('xsource', 'Y', 'T')
Performs an integration (sum) on xsource since tsource’s value first exceeded 10.0
yesterday; assuming xsource has a per day EngUnit:
TagTot(xsource, FindGt(tsource,'Y','T',10.0),'T')*24
These functions have several time parameters, defining a time range of Archive values to use.
See the limits of the Time Range Reference type, earlier in this chapter.
PrevEvent(), or NextEvent () return an absolute timestamp outside a given time range. This
means theoretically that we cannot determine the reverse time. Practically they return the
neighbor timestamp to the input timestamp. This is the same algorithm the recalculation
performs anyway (if source point’s Step=0). Therefore, no extra time dependency is
evaluated. This applies also to the functions PrevVal() and NextVal().
There are some restrictions and limitations on the Recalculator’s ability to reprocess
Performance Equation expressions. This section outlines these limitations.
Page 32
3.6 - Recalculation Limitations
Points used by the Recalculator are completely defined by the requirements of the PE
subsystem. For more information regarding point configuration, see Chapter 2, PI
Performance Equation.
In addition, the Location1 parameter is used. The Location1 value does not influence the
operation of the PE Scheduler.
The Recalculator uses the Point Name and Step parameters from the source points. The
Recalculator signs up for events of the source points, which may belong to any point source.
The Recalculator is scheduled with the point source class of PE points, and uses the following
parameters of the dependent PE points: Extended Descriptor (ExDesc), Point Source, Scan
flag, Archiving flag, Location 4, and Point Type, as described below.
3.7.4 Scan
The Scan flag must be set to 1 for the PE Scheduler to work on this point. The Recalculator
does not use or change the Scan flag.
3.7.5 Archiving
Archiving has to be set to 1 for the PE Scheduler to create Archive events of this point. The
Recalculator does not use or change the Archiving flag, but the Archiving flag must be set to
1.
3.7.6 Location1
By default, the Recalculator considers all PE points as candidates for recalculation and does
not use this attribute value. However, if there is a parameter "/IN=n" where n > 0) in the
startup file or an Instance value in the Registry, only points with the corresponding value in
Page 34
3.8 - Start Recalculator as a Service
Location1 are recalculated. This feature can be used to assign PE points into recalculation
groups.
3.7.7 Location4
This parameter specifies the scan class used by PE Scheduler.
3.7.8 PointType
As with the PE Scheduler, the point types Int16, Int32, Float16, Float32, Float64, Digital
and String may be used.
3.7.9 Step
This value for the source point is used to determine if any event any time prior to the
scheduled event must be examined. See Point Dependency Considerations, on page 21.
The Recalculator can run as a Windows service, to automatically recalculate PE points that
have source points that receive edits, deletions, or new delayed or out-of-order events.
The Recalculator module is normally installed automatically when the PI Server is installed.
This section explains how to configure the PE Recalculator startup.
Page 36
3.8 - Start Recalculator as a Service
Click the Automatic radio button. The Recalculator will start automatically on your next
reboot.
Note: When specifying file names in the script, be sure to use full path names.
You can also set some of these options by editing the Windows NT/2000 Registry. See
Section 3.8.3, Specify Options, for details.
Some of these options are best used only when the Recalculator is started manually. See
section 3.9, Start Recalculator Manually, for details.
Parameter Description
/in=0 Interface number (corresponds to Location1 point
attribute). Omitting this parameter or a value of 0 means
ignore Location1 values.
/output=c:\….\pirecalc.log Module-specific debug log file pathname. The default
output is to the screen, if run as console application.
/ex[ecute]=tag,start[,stop][,TEST] Recalculate a specific PE point and exit. This option can
accept one timestamp to specify a point in time, or two
timestamps to specify a range. Adding the word 'TEST'
causes the display of recalculated results with no
storage in PI.
Wildcard characters can be used in the tag. If present,
an /in= startup parameter is checked, too.
This option may only be used only in manual mode.
/deb=0 Debug level. See Table 3–4 for debug level options.
/ps = C
Specifies the point source of the points on which the module will operate. This parameter is
taken from the PE Scheduler startup script file, pipeschd.bat.
/in = 1
This parameter corresponds to the Location1 attribute of a point. If you omit this parameter
or set it to zero, all PE points, determined by the /ps parameter in pipeschd.bat, are checked
for recalculations.
/f = 00:00:30[,00:00:00]
This parameter is set in pipeschd.bat. It defines the scan frequency for different scan classes.
There is no limit on the number of scan classes. An offset may be added.
Page 38
3.8 - Start Recalculator as a Service
These parameters in combination with the Location4 point attribute determine where an
existing PE event is searched, or if a new event is created. The offset portion is not used.
/output = c:\pi\log\pirecalc.log
The /output option causes Recalculator to generate debug output and error messages and
send them to PI\log\pirecalc.log. If you omit this parameter and start Recalculator (manually)
as a console application, output is sent to the console window.
If you start Recalculator as a service and the output parameter is missing, output goes to the
PI System Message Log. Use the PIGetMsg utility or PIHealthCheck to retrieve this
information. Debug messages are not sent to the PI System Message Log.
/execute = tagmask,starttime[,endtime][,TEST]
The “/execute” mode allows you to test or modify single Dependent PE points. Use this
option only when you manually start the Recalculator.
For example: "/execute=tag1,12-dec-98 15:00:00" means, recalculate the PE point tag1
at the given timestamp, then exit.
For starttime and endtime the PI time syntax is allowed.
Note: Do not use quotes around tagname and time. If this option contains space
characters (timestamps require a space between date and time), enclose the whole
option in double quotes.
Tagmask is searched among the tags with the same point source as stated in
parameter /ps in pipeschd.bat.
If a parameter /in is present, Location1 is checked, too.
Tagmask can contain wildcard characters * and ?. All matching points are
recalculated.
If there are two time parameters, they define a time range to be recalculated.
If there is a single time parameter and no event exists at that time - within limits
given by the corresponding scan cycle, a new Archive event is created.
If the additional sub-parameter TEST is applied, the results are not stored in the Data
Archive but are printed only, according to the /output parameter.
This mode doesn’t work when run as a service.
The option keyword may be abbreviated up to "/ex=".
/deb=0
The module is able to print additional debug information into the module-specific log file,
depending on the debug level used. The amount of log information increases with the value.
All information of lower levels is included.
Table 3–4 lists allowed debug values, and output.
Debug
Level Output
0 Start / Version / Number of points / Stop (As sent to Message Subsystem). Test mode
results. Internal errors.
1 Additional information about module operation. Examples: startup parameter / defaults,
results of dependency check on start/update.
2 Information about problems that will be handled by the module and will not cause data
loss. Start of a recalculation period.
3 Display result dependency. More calculation period info.
4 Print out each calculation the program performs. Only for onsite test purposes. Use this
mode if directed by OSI Tech Support. Log file might increase rather quickly.
5 More information than Level 4.
6…8 Additional internal debugging information
9 Maximum internal dump output.
Note: Startup file settings located in pi\bin\pirecalc.bat have priority over Registry
settings.
If there is no path information for DebugLogFile, the standard PI Server log directory \PI\log\
is assumed.
Page 40
3.8 - Start Recalculator as a Service
The example above shows the Recalculator service configured for a debug level of 1, with a
debug log file specified.
A normal installation has neither Registry keys nor the pirecalc.bat file.
\pi\bin\pirecalc.exe –remove
And proceed as described above.
Alternatively to different .bat files, you may add the Instance=# Registry value as described
in Section 3.8.3, Specify Options. The Registry key pirecalc2 might look like this:
You can start Recalculator as a console application instead of, or as well as, a Windows
service. This is useful if you want to watch debug message output on the screen, or to
reprocess Performance Equation expressions on demand.
Page 42
3.10 - Stop Recalculator
If you start Recalculator in single execution mode (that is, manually with the parameter
/execute), the module stops itself when finished. If you start Recalculator as a console
application, use the <Ctrl>-C or <Ctrl>-<Break> key command.
If you start Recalculator as service, you can stop it via the Control Panel, or with the
command: (where PI\ is the full path of the PI directory)
PI\bin\pirecalc –stop
or
net stop pirecalc
Page 44
Chapter 4. PI PERFORMANCE EQUATIONS SYNTAX AND
FUNCTIONS REFERENCE
The Performance Equations (PE) Scheduler allows you to easily implement sophisticated,
real-time calculations, using data in the PI System. (See Chapter 2, PI Performance
Equations Scheduler.)
The PE Scheduler includes an equation syntax and a library of built-in functions, which allow
you to easily perform a wide variety of calculations on PI data. Typical calculations include
unit performance, real-time cost accounting, real-time yield accounting, heat and material
balances, batch summary, conversions and totalizations not performed by PI Totalizer, logical
operations, and calculating aggregates.
This chapter provides comprehensive instructions for using Performance Equations syntax
and functions, and includes the following topics:
Section 4.1, Performance Equations Syntax, on page 45
Section 4.2, Performance Equations Functions, on page 60
Section 4.3, List of Built-in Functions, on page 61
Section 4.4, Performance Equations Functions Reference, on page 70
The PE Scheduler evaluates the first example as the value of TagA plus the value of TagB.
The second example is 3 minus the value of TagC. The third example is 7 times the square
root of TagD.
You can construct more complex PE expressions, just as you can in arithmetic. The PE
Scheduler performs most operations in the same order as they'd be performed in a
mathematical expression. For a complete listing of PE operator priority, see Operator
Priority, on page 58.
Use parentheses to group together expressions you want to evaluate first:
The first example above evaluates as the sum of the values of TagA and TagB, divided by the
difference of 3 minus TagC. The second example is TagA divided by the sum of TagA and
TagB. The third example is 3 plus the product of 7 and the square root of TagD.
Page 46
4.1 - Performance Equations Syntax
Number Operands
You can use numbers in Performance Equations. The PE Scheduler processes all numbers as
floating point numbers. Examples of numbers include:
3.14159
299792458
299792458.
0.671
.671
6.71e-1
Note: The second and third examples are equal, as are the fourth, fifth, and sixth.
Tagnames in Expressions
If you use the tagname in an expression, PE evaluates the tagname as that point's value at the
current time. For example:
3 + 'sinusoid'
is equal to the value of sinusoid at the current time (see note), plus three. The same value
results from the expression:
3 + TagVal('sinusoid', '*')
Note: The exception is when this expression is used in a PE point, the PE point is
event-based, and the Location3 attribute is set to one.
Page 48
4.1 - Performance Equations Syntax
"14-Dec-97"
Note: Character strings might look like tagnames or time expressions, as in the
second and third examples above. In some cases, the string in the third example
might be interpreted as a time. The difference is that a character string is enclosed in
double quotes (for example, "string") while a tagname must be enclosed in single
quotes (for example, 'tagname') and a time expression may be enclosed in either
single or double quotes.
PI Time Expressions
PI allows three basic types of time expressions: relative time, combined time, and absolute
time.
Relative Time
Relative time expressions are some number of a number of days, hours, minutes, or
seconds, specified with either a leading plus sign or a leading minus sign.
The reference time, or starting time, for the relative time expression is usually the current
time. In PEs, we recommend you use a combined time expression, rather than a relative
time expression.
+1d
-24h
-3m
+24s
Combined Time
A combined time expression is a specific reference time, followed by a relative time
expression. In Performance Equations, you enclose the combined time expression in
single quotes (or double quotes, if you are passing the time expression to a PE function as
a string).
'*+8h'
'18-dec-02 -3m'
'T+32s'
Combined time expressions should contain only a single operator. If you add additional
operators, you get unpredictable results. For example, the following are not valid time
expressions:
'*+1d+4h'
'T-1d+12h'
Absolute Time
Absolute time expressions are everything else—in other words, any time expression that
is neither a relative nor a combined time expression is an absolute time expression. When
using absolute time expressions in PEs, put the time expression in single quotes.
'*'
'14-Dec-97'
TagVal('Sinusoid', "1-Jun-2000")
'11-Nov-96 2:00:00.0001'
't'
Times as Strings
You can also pass a time expression as a string to a function that expects a string. In this case,
enclose the time expression in double quotes, rather than single quotes.
Page 50
4.1 - Performance Equations Syntax
'sinusoid' = "Shutdown"
is true if the numeric point sinusoid contains the digital state Shutdown from the System
Digital State Set.
Meaning
Operator Operator Syntax Example (A, B, C and D are all operands)
Type
Arithmetic + A + B Addition: A + B
– A – B Subtraction: A minus B
* A * B Multiplication: A times B
/ A / B Division: A divided by B
Page 52
4.1 - Performance Equations Syntax
Meaning
Operator Operator Syntax Example (A, B, C and D are all operands)
Type
Arithmetic Operators
PE operators include the simple arithmetic operators in Table 4–4.
For a complete list of all PE operators, see List of all Performance Equation Operators on
page 52.
Page 54
4.1 - Performance Equations Syntax
Note: The timestamp returned is the result of T mod P or T mod N added to January
1, 1970 Universal Coordinate Time (UTC). So depending on the time zone, different
results are expected; in some case, even an error value is returned. In PI for
OpenVMS systems, the use of T mod P or T mod N returns P.
Relational Operators
A relational operator (one of <, =, >, <=, <>, and >=) returns a value of 0 for false or 1 for
true. You can use these operators to compare numbers, times, digital states, or character
strings. With relational operators, you can compare bad values, or values of different types
without generating an error.
Operator Meaning
< Less than
= Equal to
> Greater than
<= Less than or equal to
<> Not equal to
>= Greater than or equal to
If one of the two operands is the digital type, then the PE subsystem compares the
digital operand to the digital state of the other operand, if it exists. For example:
'sinusoid' = DigState("Shutdown")
If the sinusoid point has a digital state Shutdown, then this expression returns a value
of 1 (i.e., true). Otherwise, it returns a value of 0 (i.e., false)
If one of the two operands is the string type and the other is neither digital nor string
type, then the PE subsystem compares the string operand to the digital state of the
other operand, if it exists. This allows the string substitution of its corresponding
digital state; i.e., Shutdown and DigState("Shutdown") would be the same.
Time Comparisons
You can perform all comparisons, including in, on times.
'*+20m' >= '*+300s'
PrevEvent('tag1', '*') > PrevEvent('tag2', '*')
If a comparison is true, the result is 1; otherwise, it is 0.
Prefix Operators
A prefix operator is simply an operator that appears to the left of its operand, for example, "-
x".
Operator Meaning
– Negation
Not Complementation: Returns 1 if operand is 0 (or rounding to 0) and 0 otherwise
The expression following a prefix operator should be numeric. If you use a tagname as the
operand, make sure that the point returns a number. Note too, that even points that typically
return a number, sometimes return a digital state, such as Shutdown. Valid examples include:
-3
Not 7
-TagVal ('sinusoid')
Not Cos('ba:level.1')
-StateNo('DigitalTag')
Not TagBad('StringTag'))
The last two examples use digital and string points (DigitalTag and StringTag) but these are
used as arguments to functions that return numbers (StateNo and TagBad).
Page 56
4.1 - Performance Equations Syntax
Time Comparisons
You can use the Inclusion operators (in.., in()) on time expressions. If the comparison is
true, the result is 1; otherwise, it is 0.
If-Then-Else Expressions
The if–then–else operator is a compound operator whose operands are used as follows:
if expr0 then expr1 else expr2
where expr0, expr1, and expr2 are expressions. If expr0 is true (nonzero), this operator
returns the value of expr1; it returns the value of expr2 if expr0 is false (zero).
Here are some examples:
if 'tag1' > 50 then "overlimit" else "good"
if 'tag1'= 1 then Sin('tag2') else if 'tag1'= 2 then Cos('tag2') else
Tan('tag2')
if 'tag3'<> "shutdown" then (if 'tag1' > 'tag2' then 'tag1' else 'tag2')
else "error"
'*' + (if 'tag2' = 0 then 3600 else 0)
Note: You must include the 'if,' the 'then,' and the 'else.' Nested operations are
supported.
^ 8 R-L
Not 7 L-R
*, /, mod 6 L-R
+ , – 5 L-R
And 2 L-R
Note: The Not operator has a priority between ^ and *. This differs from
conventional priority schemes.
You can use parentheses anywhere to affect the order of calculation. Regardless of operator
priority, operations within parentheses are evaluated before operations outside those
parentheses. For example, (2+3) * 5 equals 25 while 2 + 3 * 5 equals 17.
Page 58
4.1 - Performance Equations Syntax
cannot add two character strings, or multiply two times together. Additionally, the built-in
functions might require particular data types for particular arguments.
Type Checking
At compile time, the PE subsystem checks type compatibility as far as possible. This process
catches some errors, such as trying to add a number to a character string.
However, not all type compatibility errors can be detected at compile time. The expression
'sinusoid' / 2.0
works well if sinusoid has a numeric value, but if sinusoid is equal to the digital state
Shutdown the expression returns an error (Calc Failed).
pipetest
At the pipetest equation prompt, type in the equation you want to test. If the equation syntax
is not valid, pipetest displays a syntax error. If the syntax is valid, pipetest displays the result
of the equation.
In addition to all the basic arithmetic operators, the PE subsystem provides a large number of
built-in functions that you can use to perform more complex operations, such as taking the
sine or cosine of a point value, taking the average of a tag's value over time, etc.
Page 60
4.3 - List of Built-in Functions
The PE Scheduler provides a wide range of built-in functions that make it easier for you to
perform calculations on PI data. (Note that you can also use Steam Table Functions in PEs.)
Note: Immediately below, are two tables that provide a complete listing of all built-in
PE functions. One table lists functions grouped by type, and the the other is
arranged alphbetically.
Page 62
4.3 - List of Built-in Functions
Page 64
4.3 - List of Built-in Functions
Name Meaning
Abs Absolute value
Acos Arc cosine
AlmAckStat Alarm acknowledgement status code
AlmCondition Condition code number for Alarm State
AlmCondText Alarm condition as text
AlmPriority Alarm priority number
Arma Dynamic response from Auto Regressive Moving Average model
Ascii ASCII character code for a character
Asin Arc sine
Atn Arc tangent
Atn2 Arc tangent (two arguments)
Avg Average
BadVal See if a value is bad (not a number or time)
Name Meaning
Bod Timestamp for beginning of the day for given time
Bom Timestamp for beginning of the month for given time
Bonm Timestamp for first of the next month for given time
Char String for ASCII character code(s)
Compare Wild comparison of two strings
Concat Concatenate two or more strings
Cos Cosine
Cosh Hyperbolic cosine
Curve Get value of a curve
Day Day of the month from a time
DaySec Seconds since midnight from time
Delay Introduce time delay
DigState Get digital state from a string
DigText Text for a digital state
EventCount Number of Archive events
Exp Exponential
FindEq Timestamp when point = value
FindGE Timestamp when point >= value
FindGT Timestamp when point > value
FindLE Timestamp when point <= value
FindLT Timestamp when point < value
FindNE Timestamp when point ~= value
Float Conversion of string to number
Format Formatting of a numerical number
Frac Fractional part of number
Hour Hour from a time
Impulse Dynamic response characterized by impulse response shape
InStr Instance of a sub-string
Int Integer part of number
IsDST Test whether a time is in local daylight savings time
IsSet Test if a PI value is annotated, substituted, or questionable
LCase Conversion of all characters to lower case
Len Length of a string
Page 66
4.3 - List of Built-in Functions
Name Meaning
Left First characters in a string
Log Natural logarithm
Log10 Common logarithm
LTrim Removal of blanks on the left side of a string
Max Maximum
Median Median selector
MedianFilt Select the median value of time series
Mid Extraction of a sub-string from a string
Min Minimum
Minute Minute from a time
Month Month from a time
NextEvent Time of a point's next Archive event
NextVal Point's next value after a time
Noon Timestamp for local noon of day of a time
ParseTime Convert character string to time
PctGood Percent of good time in a period
Poly Evaluate polynomial
PrevEvent Time of a point's previous Archive event
PrevVal Point's previous value before a time
PStDev Population standard deviation
Range Range of minimum to maximum value
Right Last characters in a string
Round Round to nearest unit
RTrim Removal of blanks on the right side of a string
Second Second from a time
Sgn Numerical sign
Sin Sine
Sinh Hyperbolic sine
Sqr Square root
SStDev Sample standard deviation
StateNo The code number of a digital state
StDev Time-weighted standard deviation
String String representing any PI value
Name Meaning
TagAvg Time-weighted average
TagBad See if a point has an abnormal state
TagDesc Get a point's descriptor
TagEU Get a point's engineering unit string
TagExDesc Get a point's extended descriptor
TagMax Maximum value in a period
TagMean Event-weighted average
TagMin Minimum value in a period
TagName Get a point's name
TagNum Get a point's ID
TagSource Get a point's point source character
TagSpan Get a point's span
TagTot Time integral over a period
TagType Get a point's type character
TagTypVal Get a point's typical value
TagVal Point's value at a time
TagZero Get a point's zero value
Tan Tangent
Tanh Hyperbolic tangent
Text Concatenation of strings for a series of PI value arguments
TimeEq Total period when point = value
TimeGE Total period when point >= value
TimeGT Total period when point > value
TimeLE Total period when point <= value
TimeLT Total period when point < value
TimeNE Total period when point ~= value
Total Sum
Trim Removal of blanks on both sides of a string
Trunc Truncate to next smaller unit
UCase Conversion of all characters to upper case
Weekday Day of the week from a time
Year Year from a time
Yearday Day of the year from a time
Page 68
4.3 - List of Built-in Functions
Abs
Format
Abs(x)
Arguments
x
Must be an integer or real number.
Returns
The absolute value of x.
Exceptions
If x is not an integer or real number, returns an error value.
Examples
Abs(1)
Abs(-2.2)
Abs('tag1')
Abs('tag1'- 'tag2')
Page 70
4.4 - Performance Equations Functions Reference
Acos
Return the inverse (or arc) cosine of an integer or real number. The inverse cosine of x is the
angle in radians whose cosine is equal to x.
Format
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.
Examples
Acos(1-.5)
Acos(-.5)
If 'tag1' < 1 and 'tag1' > -1 then Acos('tag1') else 0
See Also
Asin, Atn, Atn2, Cos, Cosh, Sin, Sinh, Tan, Tanh
AlmAckStat
Format
AlmAckStat(alm)
Arguments
alm
An alarm tagname.
Returns
The acknowledgement status code for the given Alarm State. Possible values are:
0 - acknowledged (or no alarm)
1- unacknowledged
2 - missed alarm
Exceptions
If the argument is not a digital state tagname, an error condition is returned.
Examples
AlmAckStat('alarmtag')
See Also
AlmCondition, AlmCondText, AlmPriority
Page 72
4.4 - Performance Equations Functions Reference
AlmCondition
Format
AlmCondition(alm)
Arguments
alm
An alarm tagname.
Returns
The code number of the condition for the alarm tagname.
Exceptions
If the argument is not a digital state tagname, an error is returned.
Examples
AlmCondition('alarmtag')
See Also
AlmAckStat, AlmCondText, AlmPriority
AlmCondText
Format
AlmCondText(alm)
Arguments
alm
An alarm tagname.
Returns
The condition text for the condition represented by the alarm status.
Exceptions
If the argument is not a digital state tagname, an error condition is returned.
Examples
AlmCondText('alarmtag')
See Also
AlmAckStat, AlmCondition, AlmPriority
Page 74
4.4 - Performance Equations Functions Reference
AlmPriority
Format
AlmPriority(alm)
Arguments
alm
A digital state value from a PI Alarm State Set.
Returns
The priority of the given alarm. Priorities are small positive integers. Priority 0 is an alarm
that is never unacknowledged.
Exceptions
If the argument is not from a valid Digital State Set for alarms, an error condition is returned.
Examples
AlmPriority('alarmtag')
See Also
AlmAckStat, AlmCondition, AlmCondText
Arma
Calculate dynamic response for Auto Regressive Moving average model as shown in Figure
4–1.
Format
Arma(in, runflag, (a1, a2, … aN),(b0, b1, b2, … bN))
Arguments
The denominator and numerator coefficient series are enclosed in parenthesis with a comma
between the two. There must be only one more term (b0) in the numerator than denominator.
Both in and runflag may be any expression that evaluates to a number.
in
Must be an integer or real number.
runflag
Non-zero enables filter to run.
a1,a2,…
Coefficients of past output terms.
b0, b1,b2…
Coefficients of the present and past input terms of the model.
Returns
The next output value in time series response to past and present input.
ut = a1 * ut-1 + a2 * ut-2 + … + an * ut-n + b0 * yt +
b1 * yt-1 + b2 * yt-2 + … + bn * yt-n
Where ut is model output at time t, now. ut-1 is output one sample interval in the past. yt is
the input signal at time t. If runFlag expression result is 0, the model is reset. Depending on
the number of coefficients used, Arma stores the inputs and outputs until an evaluation of the
model is available. For example, in
Arma( 'input_tag', 1, ( 0. ,1), ( 1, -1 ,1))
Arma stores two previous values of the input and output. Hence when the point is first
created, no good results will be given until two prior values of the input have been stored.
From then on, the two most current previous values will be stored.
Exceptions
Arma will give different results depending on which type of scheduling is used. In scan class
scheduling, the interval between time series values depends on the scan class and gives values
at evenly spaced time intervals. On the other hand, event based scheduling is dependent on a
trigger from another point. If the exception deviation is not zero, the intervals for events will
be not be evenly spaced in time and hence Arma will give results that are not trustworthy.
Page 76
4.4 - Performance Equations Functions Reference
Arma is not supported in the pipetest utility or in PI DataLink. If the input point is not a real
number or integer, Arma will return an error.
Examples
Derivative: Arma('input_tag', 1, (0.), (1, -1))
Integration: Arma('input_tag', 1, (1.), (.05, 0.))
Second order filter: Arma('input_tag', 1, (.25,.25), (.1,.25,.15 ))
∆ ∆
b2 a2
∆ ∆
b3 a3
...
...
∆ ∆
bn an
Ascii
Format
Ascii(String)
Arguments
string
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.
Examples
Ascii( "D" ) = 68
Ascii( string('cdm158' ) )
Page 78
4.4 - Performance Equations Functions Reference
Asin
Return the inverse (or arc) sine of a number. The inverse sine of x is the angle in radians
whose sine is equal to x.
Format
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, returns an error value.
Examples
Asin(TagVal('tag1','y'))
Asin(-0.5)
Asin('tag1')
See Also
Acos, Atn, Atn2, Cos, Cosh, Sin, Sinh, Tan, Tanh
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.
Format
Atn(x)
Arguments
x
Must be an integer or real number.
Returns
The inverse tangent of x, in radians.
Exceptions
If x is not an integer or real number, returns an error value.
Examples
Atn(1)
Atn(-2.2)
Atn('tag1')
Atn('tag1'- 'tag2')
See Also
Acos, Asin, Atn2, Cos, Cosh, Sin, Sinh, Tan, Tanh
Page 80
4.4 - Performance Equations Functions Reference
Atn2
Calculate the inverse (or arc) tangent of a pair of numbers, which represent a point on the
plane. If you draw a line between the point whose Cartesian coordinates are (a, b) and the
origin, the angle between that line and the x-axis is the inverse tangent of (a, b).
Format
Atn2(a, b)
Arguments
a
Must be an integer or real number.
b
Must be an integer or real number.
Returns
The inverse tangent of (a, b), in radians.
Exceptions
If a or b is not an integer or real number, returns an error value.
Examples
Atn2(TagVal(‘tag1’,‘y’),TagVal(‘tag1’, ‘y’))
Atn2(1,1)
Atn2(‘tag1’, ‘tag2’)
See Also
Acos, Asin, Atn, Cos, Cosh, Sin, Sinh, Tan, Tanh
Avg
Format
Avg(x1, x2, ..., xn)
Arguments
x1...xn
May be numbers, times, or periods but all must be the same data type.
Returns
The average of the arguments. The result is the same data type as the operands.
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.
Examples
Avg(TagVal('tag1','y'),TagVal('tag1', 'y'),1,2)
Avg('y', 't', '14-Dec-97', '14 8:00')
Avg('tag1', 'tag2')
Page 82
4.4 - Performance Equations Functions Reference
Badval
Test a value to see if it is bad. For real and integer points, a bad value is a digital state value.
For Digital points, a bad value is a digital state value outside its own Digital State Set.
Format
Badval(x)
Arguments
x
A value to be tested.
Returns
1 if the value is bad
0 if the value is not bad
Exceptions
Returns 1 for blob points. Returns 0 for character strings.
Examples
BadVal('tag1')
BadVal('digitaltag')
BadVal(TagVal('stringtag', '14-Dec-97 8:00:00'))
Bod
Format
Bod(time)
Arguments
time
A time expression.
Returns
Timestamp for the start of the day.
Exceptions
None.
Usage Note
This function is useful for establishing a time at a unique clock time independent of the
length of particular days.
Examples
Bod('*')
Bod('y')
Bod(FindEq('tag1', '14-Dec-97', '+17d',50))
See Also
Bom, Bonm, Noon
Page 84
4.4 - Performance Equations Functions Reference
Bom
Format
Bom(time)
Arguments
time
A time expression.
Returns
Timestamp for the start of the month.
Exceptions
None.
Usage Note
This function is useful for establishing a time at a unique clock time independent of the
length of particular days.
Examples
Bom('*')
Bom(PrevEvent('tag', '*'))
Bom(FindEq('tag1', '14-Dec-97', '+17d',50))
See Also
Bod, Bonm, Noon
Bonm
Gets the timestamp for midnight at the beginning of the next month.
Format
Bonm(time)
Arguments
time
Time expression.
Returns
Timestamp for the start of the next month.
Exceptions
None.
Usage Note
This function is useful for establishing a time at a unique clock time independent of the
length of particular days.
Examples
Bonm('*')
Bonm('y')
Bonm(FindEq('tag1', '14-Dec-97', '+17d',50))
See Also
Bod, Bonm, Noon
Page 86
4.4 - Performance Equations Functions Reference
Char
Format
Char( n1 [, n2, … ] )
Arguments
n1, n2, ...
Numeric numbers or expressions.
Returns
A string built from the character codes.
Exceptions
If an argument is not a number, returns an error.
Examples
Char(65) = "A"
Char(80, 73) = "PI"
Char(6 * 9) = "6"
Compare
Format
Compare(str1, str2 [,casesen])
Arguments
str1, str2
Strings. Str2 may contain wild characters.
casesen (optional)
Flag indicating if the comparison is case sensitive.
casesen = 0 the comparison is case insensitive (default)
casesen = 1 the comparison is case sensitive
Returns
1 if Str1 = Str2
0 otherwise
Exceptions
Wild characters in str1 are not treated as wild.
Examples
compare("?","a") = 0
compare("What","wh") = 0
compare("What","wha?") = 1
compare("What","wh*") = 1
compare("What","wh*", 1) = 0
Page 88
4.4 - Performance Equations Functions Reference
Concat
Format
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. If you need blanks, you must add them yourself.
Note
Consider using Text, which is more general and more precise in many cases than Concat.
Examples
Concat("shut", "down") = "shutdown"
See Also
Text
Cos
Format
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.
Examples
Cos('tag1')
Cos(1)
Cos(1.1)
See Also
Acos, Asin, Atn, Atn2, Cosh, Sin, Sinh, Tan, Tanh
Page 90
4.4 - Performance Equations Functions Reference
Cosh
Format
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 value.
Examples
Cosh('tag1')
Cosh(.9)
Cosh(1)
See Also
Acos, Asin, Atn, Atn2, Cos, Sin, Sinh, Tan, Tanh
Curve
Format
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
Returns the y value on the curve corresponding to the value of x. Linear interpolation is used
between points defining the curve. 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.
Examples
curve('tag1', (0,100) (100,0) ) //inverter
curve('tag3', (25,25) (75,75) ) //limiter
Page 92
4.4 - Performance Equations Functions Reference
Day
Format
Day(time)
Arguments
time
A time expression.
Returns
The day of the month of time, in the range 1–31.
Exceptions
None.
Examples
Day('*')
Day('t')
Day(FindGt('tag1', '*-30d', '*',50))
See Also
DaySec, Hour, Minute, Month, Second, Weekday, Year, Yearday
DaySec
Format
DaySec(time)
Arguments
time
A time expression.
Returns
The number of seconds of time since midnight, in the range 0–86399.
Exceptions
None.
Usage Note
This function is the same as the Time function in the PI 2.x Performance Equation package.
For example, if the current time is 8:30 am, DaySec('*') returns 30600.
Examples
DaySec('*')
DaySec('t')
DaySec(FindGt('tag1', '*-30d', '*',50))
See Also
Day, Hour, Minute, Month, Second, Weekday, Year, Yearday
Page 94
4.4 - Performance Equations Functions Reference
Delay
Delay line, the output tracks the input. For use in real time calculations, in pipeschd.exe for
example, this function might be a better choice than Prevvalue.
Format
Delay( x, runflag, n )
Arguments
x
Must be an integer or real number.
runflag
Non-zero enables filter to run.
n
Length of the delay, integer.
Returns
The input signal delayed by n calculation intervals. For scan class scheduling, the calculation
interval is based on the scan class. For event based scheduling, the calculation interval will be
dependent on the trigger and the exception deviation.
Exceptions
Delay is not supported in the pipetest utility or in PI DataLink. If the input point is not a real
number or integer, Delay will return an error. Delay will return Calc Failed until n scans
have elapsed after startup.
Examples
Delay('tag1',1,2)
DigState
Translate a character string representing a digital state into its corresponding digital state.
Format
DigState(s1 [, x])
Arguments
s1
A character string representing a digital state.
x (optional)
A digital point in which the character string represents a digital state. If omitted, all Digital
State Sets, starting with the System Digital Set, are searched for the given string.
Returns
A digital state
Exceptions
If the character string does not represent a digital state in the Digital State Set of the reference
digital point, the function returns Calc Failed. If digital point is omitted and character string
does not represent a digital state in any of the digital sets, Calc Failed is returned.
Examples
DigState("digitalstring", 'digitaltag')
StateNo(DigState("digitalstring", 'digitaltag'))
Page 96
4.4 - Performance Equations Functions Reference
DigText
Format
DigText(tagname)
Arguments
tagname
A tagname that represents a digital state variable.
Returns
The text for the digital state.
Exceptions
If the argument is not a digital state tagname, an error condition is returned.
Examples
DigText('alarmtag')
DigText('cdm158' )
DigText('nondigitaltag') would not compile and returns an error message
EventCount
Find the number of Archive events for a point over a given time.
Format
EventCount(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname. This point must represent a continuous variable.
starttime
Must be a time expression representing the beginning of the time range to search.
endtime
Must be a timestamp, greater than starttime; the end of the time range to search.
pctgood (optional)
Minimum time percentage over the given time range, that the point's archived values must
good.
Returns
Number of Archive events for the point within the specified interval.
Exceptions
If the point has no good values or the pctgood minimum is not reached for the given time
range, returns an error value.
Caution
When endtime is a future time (for example, '*+1h'), TagCount might include the system
digital state No Data and thus is larger the number of events stored in the PI Archive. Avoid
using a future time if possible.
Examples
EventCount('tag1', 'y', '*')
EventCount('tag1', '14-Dec-97', '+1d',70)
EventCount('tag1', '14-Dec-97', '15-Dec-97')
Page 98
4.4 - Performance Equations Functions Reference
Exp
Return the exponential of an integer or real number. This is the number ex, where e =
2.7182818...
Format
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.
Examples
Exp('tag1')
Exp(TagVal('tag1','14-Dec-97'))
Exp(11)
FindEq
Find the first time, within a range, when a point is equal to a given value.
Format
FindEq(tagname, starttime, endtime, value)
Arguments
tagname
A tagname enclosed in single quotes.
starttime
A time expression representing the beginning of the time range to search Relative times are
relative to endtime if endtime is not itself a relative time.
endtime
A time expression representing the end of the time range to search. Relative times are relative
to starttime if starttime is not itself a relative expression. If endtime is earlier than starttime,
the range is searched backwards.
value
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 given range, for which the point was equal to
the given value.
Exceptions
If the point was never equal to the given value, FindEq returns an error value.
Usage Note
FindEq interpolates between Archive events, if necessary, to find the value it is looking for.
Examples
FindEq('tag1', 't', '*',40.0)
FindEq('digitaltag', '-1d', '*', TagVal('digitaltag', '14-Dec-97'))
FindEq('digitaltag', '14-Dec-97', '*', "On")
Page 100
4.4 - Performance Equations Functions Reference
FindGE
Find the first or last time, within a range, when a point is greater than or equal to a given
value.
Format
FindGE(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
A time expression representing the beginning of the time range to search or a time relative to
endtime, if endtime is a time.
endtime
A time expression representing the end of the time range to or a time (in seconds) relative to
starttime, if starttime is a time. If endtime is earlier than starttime, the range is searched
backwards.
value
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 given range, for which the point was greater
than or equal to the given value.
Exceptions
If the point was always less than the given value, FindGE returns an error value.
Usage Note
FindGE interpolates between archive events, if necessary, to find the value it is looking for.
Examples
FindGE('tag1', 't', '*',40.0)
FindGE('digitaltag', '-1d', '*', TagVal('digitaltag', '14-Dec-97'))
FindGE('tag1', '-1d', '*','tag2')
FindGT
Find the first time, within a range, when a point is greater than a given value.
Format
FindGT(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
A time expression representing the beginning of the time range to search. Can be a time
relative to endtime if endtime is a time.
endtime
End of the time range to search, time expression or time (in seconds) relative to starttime if
starttime is a time. If this time is earlier than starttime, the range is searched backwards.
value
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 given range, for which the point was greater
than the given value.
Exceptions
If the point was never greater than the given value, FindGT returns an error value.
Usage Note
FindGT interpolates between Archive events, if necessary, to find the value it is looking for.
Examples
FindGT('tag1', 't', '*',40.0)
FindGT('tag1', '-1d', '*',40.0)
FindGT('digitaltag', '-1d', '*', TagVal('digitaltag', 'y'))
Page 102
4.4 - Performance Equations Functions Reference
FindLE
Find the first time, within a range, when a point is less than or equal to a given value.
Format
FindLE(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search; time expression or time relative to endtime if endtime
is a time.
endtime
End of the time range to search, timestamp or time (in seconds) relative to starttime if
starttime is a time. If this time is earlier than starttime, the range is searched backwards.
value
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 given range, for which the point was less than
or equal to the given value.
Exceptions
If the point was always greater than the given value, FindLE returns an error value.
Usage Note
FindLE interpolates between Archive events, if necessary, to find the value it is looking for.
Examples
FindLE('tag1', 't', '*',40.0)
FindLE('tag1', -3600, '*',40.0)
FindLE('tag1', 'Saturday', '*',40.0)
FindLT
Find the first time, within a range, when a point is less than a given value.
Format
FindLT(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search; time expression or time relative to endtime if endtime
is a time.
endtime
End of the time range to search, time expression or time (in seconds) relative to starttime if
starttime is a time. If this time is earlier than starttime, the range is searched backwards.
value
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 given range, for which the point was less than
the given value.
Exceptions
If the point was never less than the given value, FindLT returns an error value.
Usage Note
FindLT interpolates between Archive events, if necessary, to find the value it is looking for.
Examples
FindLT('tag1', 't', 3600,40.0)
FindLT('tag1', -1h, '*',40.0)
FindLT('tag1', '14-Dec-97 01:00:00.0001, '*',40.0)
Page 104
4.4 - Performance Equations Functions Reference
FindNE
Find the first time, within a range, when a point is unequal to a given value.
Format
FindNE(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search; time expression or time relative to endtime if endtime
is a timestamp.
endtime
End of the time range to search, time expression or time (in seconds) relative to starttime if
starttime is a time. If this time is earlier than starttime, the range is searched backwards.
value
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 given range, for which the point was unequal to
the given value.
Exceptions
If the point was always equal to the given value, FindNE returns an error value.
Examples
FindNE('tag1', 'y', '*',40.0)
FindNE('tag1', '14-Dec-97', '*',40.0)
FindNE('tag1', '14-Dec-97', 'Monday',40.0)
Float
Format
Float(x)
Arguments
x
A string or number.
Returns
A number for a numeric string and Calc Failed for a non-numeric string. If x is already a
number, x is returned.
Examples
Float(12.3) = 12.3
Float('sinusoid')
Float("-12.3") = -12.3
Page 106
4.4 - Performance Equations Functions Reference
Format
Format
Format(num, format [,num_type ])
Arguments
num
A number (real or integer).
format
Format-control string. This is the same as that used by the C language function Sprintf.
num_type (optional)
Number-type character. This must be either R(eal) or I(nteger). The default is R.
Returns
A formatted string.
Examples
Format('sinusoid', "%3.3f", "R") = "66.890"
Format(45, "%3.3d") = "045"
Format(45, "%3.3d", "I") = "045"
Format(45, "%3.3d", "R") = "000" (Don't do this!)
Frac
Format
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.
Usage Note
By definition: Int(x) + Frac(x) = x.
Examples
Frac('tag1')
Frac(1.1)
Frac(TagVal('tag1', '14-Dec97'))
Page 108
4.4 - Performance Equations Functions Reference
Hour
Format
Hour(time)
Arguments
time
A time expression.
Returns
The hour of time, in the range 0–23.
Exceptions
None.
Examples
Hour('*')
Hour('Saturday')
Hour('t')
See Also
Day, DaySec, Minute, Month, Second, Weekday, Year, Yearday
Impulse
Format
Impulse(tagname, runflag, i1,i2 … )
Arguments
tagname
Must be a tagname for a numerical point.
runflag
Non-zero enables filter to run.
i1, i2, …
Unit impulse response specifying dynamic model, text sequence of numbers.
Returns
Dynamic model output as function of time.
u(t)=i1*u(t-1) + i2*u(t-2) + …
Where u(t) is the current output and u(t-1) is the output one sample interval in the past.
Exceptions
Impulse gives different results depending on which type of scheduling is used. In clock
scheduling, the interval between time series values depends on the scan class and gives values
at evenly spaced time intervals.
On the other hand, event-based scheduling is dependent on a trigger from another point. If the
exception deviation is not zero, the intervals for events are not evenly spaced in time—hence
Impulse gives results that are not trustworthy. Impulse is not supported in the pipetest utility
or in PI DataLink. If the input point is not a real number or integer, Impulse returns an error.
Examples
Impulse('tag1',1,1,1,1)
Page 110
4.4 - Performance Equations Functions Reference
InStr
Determine the location within a string where a sub-string match is first found.
Format
InStr([start,] str1, str2 [,casesen])
Arguments
start (optional)
An integer specifying which character in str1 to start the comparison. Must be larger than or
equal to 0.
str1, str2
Two strings and/or points with string pointtypes to be compared.
casesen (optional)
Flag indicating if the comparison is case sensitive.
casesen = 0 the comparison is case insensitive (default)
casesen = 1 the comparison is case sensitive
Returns
0 if str2 is not a sub-string of str1 starting from the start position; otherwise, the location of
character where str2 first matches the characters in str1 from the start position.
Exceptions
Wild characters are not treated as wild.
Examples
InStr("What", "At") = 3
InStr("What What What", "What") = 1
InStr("what", "At", 1) = 0
InStr(4,"what","At") = 0
InStr('StringTag', "Error") = 1 (if the tag value for 'stringtag' is
"Error")
InStr('StringTag',"StringTag") = 0 (if the tag value for 'stringtag' is
"Error")
Int
Format
Int(x)
Arguments
x
A number or string.
Returns
The integer part of x. If x is a string, it is first converted into a number.
Exceptions
If x is not a number or a numeric string, returns Calc Failed.
Examples
Int('tag1')
Int(1)
Int(2.1)
Int("2.1")
Page 112
4.4 - Performance Equations Functions Reference
IsDST
Determine if a time expression is in a daylight saving time (DST) period on the local
machine.
Format
IsDST(time)
Arguments
time
A time expression.
Returns
1 if the time is in a DST period and 0 otherwise.
Exceptions
If the argument is not a time value, an error condition is returned.
Examples
IsDST('*')
IsDST('*-182.5d')
IsDST('t')
IsDST('timestringtag')
IsSet
Format
IsSet(pivalue, select)
Arguments
pivalue
Any PI value. May be an integer, real number, digital state, or character string.
select
A string but only the first character is considered. "a" for annotated; "s" for substituted; and
"q" for questionable. It is case-insensitive.
Returns
1 if true and 0 otherwise.
Exceptions
None.
Examples
IsSet('sinusoid', "a")
IsSet('sinusoid', "annotated")
IsSet('sinusoid', "annotatted is mispelled")
IsSet('stringtag',"annotatiiion is mispelled but it does not matter.")
IsSet('stringtag',"A")
IsSet('alarmtag1',"q")
IsSet('stringtag',"s")
Page 114
4.4 - Performance Equations Functions Reference
LCase
Format
LCase(strexp)
Arguments
strexp
Must be a string.
Returns
A string that has been converted to lowercase.
Exceptions
If the argument is not a string, returns an error value.
Examples
LCase("Stringtag") = "stringtag"
LCase('Stringtag') = "error" if the Snapshot value for the stringtag
equals "Error"
See Also
UCase
Left
Format
Left(str, len)
Arguments
str
A string.
len
An integer.
Returns
len characters of the string from the left.
Exceptions
If the arguments are not of the required types, returns an error.
Examples
Left("Stringtag", 3) = "Str"
Left('Stringtag', 3) = "Err" if the Snapshot value for the stringtag
equals "Error"
See Also
Mid, Right
Page 116
4.4 - Performance Equations Functions Reference
Len
Format
Len(str)
Arguments
str
A string.
Returns
The length of a string.
Exceptions
If the argument is not a string, returns an error value.
Examples
Len("Stringtag") = 9
Len('Stringtag') = 5 if the Snapshot value for the stringtag equals
"Error"
Log
Format
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.
Examples
Log('*')
Log(14)
Log(TagVal('tag1', '14-Dec-97'))
See Also
Log10
Page 118
4.4 - Performance Equations Functions Reference
Log10
Format
Log10(x)
Arguments
x
Must be an integer or real number greater than zero.
Returns
The common logarithm of x.
Exceptions
If x is zero or negative, or not a number, returns an error value.
Examples
Log10('*')
Log10(14)
Log10(TagVal('tag1', '14-Dec-97'))
See Also
Log
LTrim
Format
LTrim(str)
Arguments
str
A string.
Returns
A string with leading blanks removed.
Exceptions
If str is not a string, an error value is returned.
Examples
LTrim(" Stringtag") = "Stringtag"
LTrim("Stringtag ") = "Stringtag "
LTrim('Stringtag') = "Error" if the Snapshot value for the stringtag
equals " Error"
See Also
RTrim, Trim
Page 120
4.4 - Performance Equations Functions Reference
Max
Format
Max(x1, x2, ..., xn)
Arguments
x1...xn
May be numbers, times, or time periods, but all must be the same.
Returns
The maximum of the arguments. The result has 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 value.
Examples
Max('*', 'y', 'Saturday')
Max(14, 'tag1', 14.5, TagVal('tag2','14-Dec-97'))
Max('*'-'*-h', 't'-'y', TimeEq('tag1', 'y', 't',50))
See Also
Min
Median
Format
Median(x1, x2, ..., xn)
Arguments
x1...xn
May be only integers, real numbers, times, or time periods, but all arguments must be the
same data type.
Returns
The median value of the input arguments. If the number of arguments is even, the average of
the two middle values is returned.
Exceptions
Arguments whose run-time values are digital states are ignored. The function must have
greater than two arguments that evaluate to non-digital states; otherwise, Median returns an
error value.
Usage Note
Median allows for mixed integer and real data types. Median follows the data type of the first
argument. Hence if the first argument is a point that evaluates to an integer then all the other
entries will be converted to integers by truncation (not by rounding).
Examples
Median('*', 'y', 'Saturday')
Median(14, 'tag1', 14.5, TagVal('tag2','14-Dec-97'))
Median('*'-'*-1h', 't'-'y', TimeEq('tag1', 'y', 't',50))
Page 122
4.4 - Performance Equations Functions Reference
MedianFilt
Return the median value of the last specified number of values of a time series.
Format
MedianFilt( tagname, runflag, number )
Arguments
tagname
Must be a numerical point.
runflag
Non-zero enables filter to run.
number
The number of series elements to be considered. A numeric constant greater than or equal to
3.
Returns
The median value of the last number values in the series of values.
Exceptions
Arguments whose run-time values are digital states are ignored. MedianFilt is not supported
in the pipetest utility or in PI DataLink. If all values are digital states, MedianFilt returns an
error value.
Examples
MedianFilt('tag1',1,3)
Mid
Format
Mid(str, start [,len])
Arguments
str
A 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 left 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.
Examples
Mid("Stringtag", 3) = "ringtag"
Mid("Stringtag", 3, 2) = "ri"
Mid('Stringtag', 1, 1) = "E" if the Snapshot value for the stringtag
equals "Error"
See Also
Left, Right
Page 124
4.4 - Performance Equations Functions Reference
Min
Format
Min(x1, x2, ..., xn)
Arguments
x1...xn
May be numbers, times, or time periods, but all must be the same data type.
Returns
The minimum of the arguments. The result has the same data type as the arguments.
Exceptions
Arguments whose run-time values are digital states are ignored. If all values are digital states,
Min returns an error value.
Examples
Min('*', 'y', 'Saturday')
Min(14, 'tag1', 14.5, TagVal('tag2','14-Dec-97'))
Min('*'-'*-1h', 't'-'y', TimeEq('tag1', 'y', 't',50))
See Also
Max
Minute
Format
Minute(time)
Arguments
time
A time expression.
Returns
The minute of time, in the range 0–59.
Exceptions
None.
Examples
Minute('*')
Minute('1')
Minute('*-1h')
See Also
Day, DaySec, Hour, Month, Second, Weekday, Year, Yearday
Page 126
4.4 - Performance Equations Functions Reference
Month
Extract the month from a time expression.
Format
Month(time)
Arguments
time
A time expression.
Returns
The month of time, in the range 1–12.
Exceptions
None.
Examples
Month('*')
Month('1')
Month('*-1h')
See Also
Day, DaySec, Hour, Minute, Second, Weekday, Year, Yearday
NextEvent
Find the time of a point's next Archive event after a given time.
Format
NextEvent(tagname, time)
Arguments
tagname
A tagname.
time
A time expression.
Returns
The timestamp of the next Archive event for tagname after time.
Exceptions
If point has no Archive data after time, returns an error value.
Examples
NextEvent('tag1','*')
NextEvent('digitaltag', '*')
See Also
NextVal, PrevEvent, PrevVal, TagVal
Page 128
4.4 - Performance Equations Functions Reference
NextVal
Find the value of a point's next Archive event after a given time.
Format
NextVal(tagname, time)
Arguments
tagname
A tagname.
time
A time expression.
Returns
The value of the next Archive event for tagname after time.
Exceptions
If point has no Archive data after time, returns an error value.
Examples
NextVal('tag1','*-1h')
NextVal('digitaltag', '14-Dec-97')
See Also
NextEvent, PrevEvent, PrevVal, TagVal
Noon
Format
Noon(time)
Arguments
time
A time expression.
Returns
A timestamp corresponding to noon of the day of the input time.
Exceptions
None.
Usage Note
This function is useful for establishing a unique clock time independent of the length of
particular days.
Examples
Noon('*')
Noon('14-Dec-97')
See Also
Bod, Bom, Bonm
Page 130
4.4 - Performance Equations Functions Reference
NoOutput
Format
NoOutput()
Arguments
None
Usage Note
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. The output of this function in pipetest.exe is "NoOutput() Called".
Example
If 'PITag' < 100 or 'PItag' > 0 then 'PITag' else NoOutput()
ParseTime
Format
ParseTime(s)
Arguments
s
Must be a character string in PI time format.
Returns
The timestamp corresponding to s.
Exceptions
If s is not a character string, or if there is a syntax error, returns an error value.
Usage Note
There is no difference between ParseTime("14-Nov-92") and the time expression '14-Nov-
92', except that the ParseTime call definitely takes more time. This is because the time
expression (enclosed in single quotes) is evaluated at compile time, not run time.
If you write ParseTime('14-Nov-92') (using single quotes, not double quotes) the parser will
detect an error, because the expression in single quotes is already translated to a timestamp at
compile time.
The expression ParseTime(":12:00:00") is not the same as the time expression ':12:00:00'.
The ParseTime expression is evaluated at runtime and translated using '*' as the relative time
base, while the time expression is evaluated at compile time and uses the time the expression
is parsed as the relative time base.
Examples
ParseTime("14-Dec-97")
ParseTime("t")
Page 132
4.4 - Performance Equations Functions Reference
PctGood
Find the time percentage, over a given range, when a point's archived values are good.
Format
PctGood(tagname, starttime, endtime)
Arguments
tagname
A tagname.
starttime
Must be a time expression, the beginning of the time range to search.
endtime
Must be a time expression, greater than starttime; the end of the time range to search.
Returns
An integer or real number from 0.0 to 100.0: the percentage of the given time when the point
had good values.
Examples
PctGood('tag1', 'y','*')
PctGood('tag1', '-1h', '*')
Poly
Format
Poly(x, c0, ..., cn)
Arguments
x
The variable. It must be an integer or real number.
c0...cn
The 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.
Examples
Poly('tag1',1,1)
Page 134
4.4 - Performance Equations Functions Reference
PrevEvent
Find the time of a point's previous Archive event before a given time.
Format
PrevEvent(tagname, time)
Arguments
tagname
A tagname.
time
A time expression.
Returns
The timestamp of the previous Archive event for tagname before time.
Exceptions
If point has no Archive data before time, returns an error value.
Examples
PrevEvent('tag1', '*')
PrevEvent('tag1','14-Dec-97')
See Also
NextEvent, NextVal, PrevVal, TagVal
PrevVal
Find the value of a point's previous Archive event before a given time.
Format
PrevVal(tagname, time)
Arguments
tagname
A tagname.
time
A time expression.
Returns
The value of the previous Archive event for tagname before time.
Exceptions
If point has no Archive data before time, returns an error value.
Examples
PrevVal('tag1', '*')
PrevVal('tag1','14-Dec-97')
See Also
NextEvent, NextVal, PrevEvent, TagVal
Page 136
4.4 - Performance Equations Functions Reference
PStDev
Return the standard deviation of two or more arguments, where those arguments represent the
whole population. The standard deviation of a population x1...xn is
∑x i
Format
PStDev(x1, x2, ..., xn)
Arguments
x1...xn
May be numbers or time expressions, but all must be the same.
Returns
The standard deviation of the arguments. If the arguments are numbers, the result is a
number; if the arguments are times or time periods, the result is a time period.
Exceptions
Arguments whose run-time values are digital states are ignored. If all values are digital states,
PStDev returns an error value.
Usage Note
In most cases you should use Sstdev instead of PstDev. Sstdev calculates the standard
deviation of a sample.
Examples
PStDev('tag1', 'tag2')
PStDev('*','14-Dec-97', 'y')
PStDev('*'-'y','14-Dec-97'-'*', '-1h')
See Also
SStDev
Range
Find the difference between a point's maximum and minimum values during a given time,
according to values stored in the PI Archive.
Format
Range(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname. This point should represent a continuous variable.
starttime
Must be a time expression, the beginning of the time range to search.
endtime
Must be a time expression, greater than starttime; the end of the time range to search.
pctgood (optional)
Minimum time percentage over the given time range, that the point's archived values must
good.
Returns
The difference between the point's maximum and minimum values during the given time.
Exceptions
If the point has no good values or the pctgood minimum is not reached in the given time
range, returns an error value.
Caution
The OverRangeStat and UnderRangeStat digital states are not taken into account when
calculating this value.
Examples
Range('tag1', 'y', '*')
Range('tag1','-1h', 'y')
Range('tag1','y', '+1h',70)
Page 138
4.4 - Performance Equations Functions Reference
Right
Format
Right(str, len)
Arguments
str
A string.
len
An 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.
Examples
Right("Stringtag", 3) = "tag"
Right('Stringtag', 4) = "rror" if the Snapshot value for the stringtag
equals "Error"
Right("Stringtag", 20) = "Stringtag"
See Also
Left, Mid
Round
Format
Round(x [, unit])
Arguments
x
Must be an integer or real number or time expression.
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 period. If unit is omitted, Round rounds to the
nearest integer (for a number) or second (for a time period).
Returns
The nearest value to x which is an integer multiple of unit. Returns the same data type as x.
For more information, see the examples below.
Exceptions
If x is a string, or if unit is of the wrong data type, returns an error value.
Examples
Expression Value Comments
Round(12.499) 12.0 Round to nearest integer
Round(12.500) 13.0 Half a unit rounds up
Round(12.8, 10) 10.0 Round to nearest ten
Round('14-Dec-97 11:47, '+1h') 14-Dec-97 12:00 Round to nearest hour (returns timestamp)
Round('18:47' –'15:00','+1h') 10800 Round period to nearest hour (returns
period in seconds)
Note: Round to the nearest day results in a timestamp of the closest day in UTC time and not
local time.
Usage Note
If x is time and unit is omitted this routine has no effect: times are accurate only to 1 second.
See Also
Trunc
Page 140
4.4 - Performance Equations Functions Reference
RTrim
Format
RTrim(str)
Arguments
str
A string.
Returns
The source string with trailing blanks removed.
Exceptions
If str is not a string, an error value is returned.
Examples
RTrim("Stringtag ") = "Stringtag" "
RTrim(" Stringtag") = " Stringtag"
RTrim('Stringtag') = "Error" if the Snapshot value for the stringtag
equals "Error "
See Also
LTrim, Trim
Second
Format
Second(time)
Arguments
time
A time expression.
Returns
The second of time, in the range 0–59.
Exceptions
None.
Examples
Second('*')
Second('y')
Second('*-1h')
See Also
Day, DaySec, Hour, Minute, Month, Weekday, Year, Yearday
Page 142
4.4 - Performance Equations Functions Reference
Sgn
Format
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.
Examples
Sgn('tag1')
Sgn(1)
Sgn(0)
Sin
Format
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.
Examples
Sin('tag1')
Sin(1)
Sin(1.1)
See Also
Acos, Asin, Atn, Atn2, Cos, Cosh, Sinh, Tan, Tanh
Page 144
4.4 - Performance Equations Functions Reference
Sinh
Format
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.
Examples
Sinh('tag1')
Sinh(1)
Sinh(0.9)
See Also
Acos, Asin, Atn, Atn2, Cos, Cosh, Sin, Tan, Tanh
Sqr
Format
Sqr(x)
Arguments
x
Must be an integer or real number greater than or equal to zero.
Returns
The square root of x.
Exceptions
If x is negative, or is not a number, returns an error value.
Examples
Sqr('tag1')
Sqr(2)
Sqr(2.1)
Page 146
4.4 - Performance Equations Functions Reference
SStDev
Return the standard deviation of two or more arguments, where those arguments represent a
sample of a larger population. The standard deviation of a sample x1...xn is equal to
∑ (x − µ)
2
i
n −1
∑x i
Format
SStDev(x1, x2, ..., xn)
Arguments
x1...xn
May be numbers or time expressions, but all must be the same.
Returns
The sample standard deviation of the arguments. If the arguments are numbers, the result is a
number; if they are times or time periods, the result is a time period (number of seconds).
Exceptions
Arguments whose run-time values are digital states are ignored. If there are not at least two
numeric values, SStDev returns a zero.
Usage Note
In the rare case where you have the entire population, rather than a sample, you might use the
function PstDev, rather than SStDev.
Examples
SStDev('tag1', 'tag2', TagVal('tag1', 'y'))
SStDev('y', 't', '14-Dec-97')
SStDev(1, 2, 1.1)
See Also
PStDev
StateNo
Format
StateNo(digstate)
Arguments
digstate
A digital state 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.
Usage Note
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.
Examples
StateNo('digitaltag')
StateNo(TagVal('digitaltag', '*-1h'))
Page 148
4.4 - Performance Equations Functions Reference
StDev
Find the time-weighted standard deviation of a point over a given time, according to values
stored in the PI Archive.
Format
StDev(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname. This point must represent a continuous variable.
starttime
Must be a time expression representing the beginning of the time range to search.
endtime
Must be a time expression, greater than starttime; representing the end of the time range to
search.
pctgood (optional)
Minimum time percentage over the given time range, that the point's archived values must be
good.
Returns
The point's time-weighted standard deviation over the given time.
Exceptions
If the point has no good values or the PctGood minimum is not reached for the given time
range, returns an error value.
Caution
If the point has few good Archive values during the time period, this function's result may not
be trustworthy. Use the PctGood function to find out what percentage of the values is good.
Examples
StDev('tag1', 'y', '*')
StDev('tag1', '14-Dec-97', '+1d',85)
StDev('tag1', '14-Dec-97', '15-Dec-97')
See Also
PctGood
String
Format
String(anyvalue)
Arguments
anyvalue
Any expression. It may be of any of the normal PI System data types.
Returns
The string representing the value argument.
Exceptions
None.
Examples
String(12.23) = "12.23"
String('sinusoid')
String('pidigital')
String('*')
String("Hello, PI user!") = "Hello, PI user! "
Page 150
4.4 - Performance Equations Functions Reference
TagAvg
Find the time-weighted average value of a point over a given time, according to values stored
in the PI Archive.
Format
TagAvg(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname. This point must represent a continuous variable.
starttime
Must be a time expression representing the beginning of the time range to search.
endtime
Must be a time expression, greater than starttime; representing the end of the time range to
search.
pctgood (optional)
Minimum time percentage over the given time range, that the point's archived values must be
good.
Returns
The point's time-weighted average value over the given time.
Exceptions
If the point has no good values or the pctgood minimum is not reached for the given time
range, returns an error value.
Caution
If the point has few good Archive values during the time period, this function's result may not
be trustworthy. Use the PctGood function to find out what percentage of the values are good.
Examples
TagAvg('tag1', 'y', '*')
TagAvg('tag1', '14-Dec-97', '+1d',70)
TagAvg('tag1', '14-Dec-97', '15-Dec-97')
See Also
PctGood
TagBad
Test if a point has an abnormal state at a given time. If the point's type is R or I, any digital
state is abnormal. If the point is type D, the states that are defined for that point are normal;
all others are abnormal.
Format
Tagbad(tagname [, time])
Arguments
tagname
A tagname.
time (optional)
A time expression. If omitted, the current time ('*') is used.
Returns
0 if the point's state at time is normal, 1 if it is abnormal.
Exceptions
If point does not exist, or has no archived value at time, returns an error value.
Usage Note
Badval can test any value or expression; TagBad can only test a point.
Examples
TagBad('tag1', '*')
TagBad('digitaltag', '14-Dec-97')
TagBad('tag1', 'y')
See Also
Badval
Page 152
4.4 - Performance Equations Functions Reference
TagDesc
Format
TagDesc(tagname)
Arguments
tagname
A tagname.
Returns
The point's descriptor.
Exceptions
If point does not exist, returns an error value.
Examples
TagDesc('tag1')
TagDesc('digitaltag')
TagEU
Format
TagEU(tagname)
Arguments
tagname
A tagname.
Returns
The point's engineering units.
Exceptions
If point does not exist, returns an error value.
Examples
TagEU('tag1')
Page 154
4.4 - Performance Equations Functions Reference
TagExDesc
Format
TagExDesc(tagname)
Arguments
tagname
A tagname.
Returns
The point's extended descriptor.
Exceptions
If point does not exist, returns an error value.
Examples
TagExDesc('tag1')
TagMax
Find the maximum value of a point during a given time, according to values stored in the PI
Archive.
Format
TagMax(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname.
starttime
A time expression indicating the beginning of the time range to search. Relative times are
relative to endtime, if endtime is not itself a relative time. For example:
TagMax('tag1', '-1h', '*',95)
Here, the starttime is one hour before the endtime, which is now ('*').
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not
itself a relative time. This time must be after starttime.
pctgood (optional)
Minimum time percentage over the given time range, that the point's archived values must be
good.
Returns
The point's maximum value during the given time.
Exceptions
If the point has no good values or the pctgood minimum is not reached for the given time
range, returns an error value.
Caution
The OverRange digital state is not taken into account when calculating this value.
Examples
TagMax('tag1', 'y', '*')
TagMax('tag1', '-1h', '*',95)
TagMax('tag1', '14-Dec-97', '+1h')
Page 156
4.4 - Performance Equations Functions Reference
TagMean
Find the average value of a point over a given time, according to values stored in the PI
Archive.
Format
TagMean(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname. This point must represent a continuous variable.
starttime
Must be a time expression representing the beginning of the time range to search.
endtime
Must be a time expression, greater than starttime; representing the end of the time range to
search.
pctgood (optional)
Minimum time percentage over the given time range, that the point's archived values must
good.
Returns
The point's average value over the given time. Notice that the average is not time-weighted.
Exceptions
If the point has no good values or the pctgood minimum is not reached for the given time
range, returns an error value. Unlike some other summary functions, TagMean does not
interpolate any value on the boundary. Thus, if there is no Archive event between the
specified interval, an error value is returned.
Caution
If the point has few good Archive values during the time period, this function's result may not
be trustworthy. Use the PctGood function to find out what percentage of the values is good.
Examples
TagMean('tag1', 'y', '*')
TagMean('tag1', '14-Dec-97', '+1d',70)
TagMean('tag1', '14-Dec-97', '15-Dec-97')
See Also
PctGood
TagMin
Find the minimum value of a point during a given time, according to values stored in the PI
Archive.
Format
TagMin(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname. This point should represent a continuous variable.
starttime
Beginning of the time range to search. Relative times are relative to endtime, if endtime is not
itself a relative time.
endtime
Relative times are relative to starttime, if starttime is not itself a relative time. This time must
be after starttime.
pctgood (optional)
Minimum time percentage over the given time range, that the point's archived values must
good.
Returns
The point's minimum value during the given time.
Exceptions
If the point has no good values or the pctgood minimum is not reached for the given time
range, returns an error value.
Caution
The UnderRange digital state is not taken into account when calculating this value.
Examples
TagMin('tag1', 'y', '*')
TagMin('tag1', '-1h', '*',90)
TagMin('tag1', '14-Dec-97', '+1h')
Page 158
4.4 - Performance Equations Functions Reference
TagName
Format
TagName(tag)
Arguments
tagname
A tagname.
Returns
The point's name.
Exceptions
If point does not exist, returns an error value.
Examples
TagName('tag1')
TagNum
Format
TagNum(string)
Arguments
string
A tagname in double quotes.
Returns
The point's number.
Exceptions
If point does not exist, returns an error value.
Examples
TagNum("tag1")
Page 160
4.4 - Performance Equations Functions Reference
TagSource
Format
TagSource(tagname)
Arguments
tagname
A tagname.
Returns
The point's point source character.
Exceptions
If point does not exist, returns an error value.
Examples
TagSource('tag1')
TagSpan
Format
TagSpan(tagname)
Arguments
tagname
A tagname.
Returns
The point's span. If the point's type is Digital this is an integer whose value is the number of
digital states defined for the point.
Examples
TagSpan('tag1')
TagSpan('digitaltag')
Page 162
4.4 - Performance Equations Functions Reference
TagTot
Find the totalized value (time integral) of a point over a given time, according to values
stored in the PI Archive.
Format
TagTot(tagname, starttime, endtime [, pctgood])
Arguments
tagname
A tagname. This point must represent a continuous process flow.
starttime
Beginning of the time range to search. Relative times are relative to endtime, if endtime is not
itself a relative time.
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not
itself a relative time.
pctgood (optional)
Minimum time percentage over the given time range, that the point's archived values must be
good.
Returns
The point's totalized value over the given time.
Exceptions
If the point has no good values or the PctGood minimum is not reached for the given time
range, returns an error value.
Caution
If the point has few good Archive values during the time period, this function's result may not
be trustworthy. Use the PctGood function to find out what percentage of the value is good.
Usage Note
The system chooses a scale factor such that the integral will be 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 a point measured in gallons per minute, you must 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 point's engineering units.
Some PI sites have the default total period configured to be per-hour rather than per-day. If
you are at one of these sites, your conversion factor will differ.
Examples
TagTot('tag1', 'y', '*')
TagTot('tag1', '-1h', '*',85)
TagTot('tag1', '14-Dec-97', '+1h')
See Also
PctGood
Page 164
4.4 - Performance Equations Functions Reference
TagType
Format
TagType(tagname)
Arguments
tagname
A tagname.
Returns
The point's type character.
Exceptions
If point does not exist, returns an error value.
Examples
TagType('tag1')
TagType('digitaltag')
TagTypVal
Format
TagTypVal(tagname)
Arguments
tagname
A tagname.
Returns
The point's typical value. If the point's type is R or I, this is a number; if the point's type is D,
this is a digital state (character string).
Exceptions
If point does not exist, returns an error value.
Examples
TagTypVal('tag1')
TagTypVal('digitaltag')
Page 166
4.4 - Performance Equations Functions Reference
TagVal
Format
TagVal(tagname [, time])
Arguments
tagname
A tagname.
time (optional)
A time expression. If you omit this argument, '*' is used.
Returns
The archived value of tagname at time. This value is interpolated unless the point has
resolution code 4.
Exceptions
If point does not exist, or has no archived value at time, returns an error value.
Examples
TagVal('tag1')
TagVal('digitaltag')
TagVal('tag1','*')
See Also
NextEvent, NextVal, PrevEvent, PrevVal
TagZero
Format
TagZero(tagname)
Arguments
tagname
A tagname.
Returns
The point's zero value. If the point's type is R or I, this is a number; if the point's type is D,
this is a digital state (character string).
Exceptions
If point does not exist, returns an error value.
Examples
TagZero('tag1')
TagZero('digitaltag')
Page 168
4.4 - Performance Equations Functions Reference
Tan
Format
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 value.
Examples
Tan('tag1')
Tan(1)
Tan(1.1)
See Also
Acos, Asin, Atn, Atn2, Cos, Cosh, Sin, Sinh, Tanh
Tanh
Format
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.
Examples
Tanh('tag1')
Tanh(1)
Tanh(1.1)
See Also
Acos, Asin, Atn, Atn2, Cos, Cosh, Sin, Sinh, Tan
Page 170
4.4 - Performance Equations Functions Reference
Text
Format
Text(val1 [, val2, … ])
Arguments
val1, val2, …
Any expression. These may be of any of the normal PI System data types.
Returns
A string that is the concatenation of strings representing the argument values.
Examples
Text('sinusoid')
Text("The value for tag sinusoid is at ", '*', " is ", 'sinusoid') =
"The value for tag sinusoid at 1-Jun-00 17:07:18 is 89.09"
See Also
Concat
TimeEq
Find the total time, within a range, when a point is equal to a given value.
Format
TimeEq(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search. Relative times are relative to endtime, if endtime is not
itself a relative time.
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not
itself a relative time. This time must be after starttime.
value
Must be an integer or real number or digital state (character string); the value to search for.
Returns
The time period within the given range, for which the point was exactly equal to the given
value.
Exceptions
None.
Examples
TimeEq('tag1', 't', '*',40.0)
TimeEq('digitaltag', '-1d', '*',TagVal('digitaltag', '14-Dec-97'))
TimeEq('digitaltag', '14-Dec-97', '*', "On")
See Also
TimeGE, TimeGT, TimeLE, TimeLT, TimeNE
Page 172
4.4 - Performance Equations Functions Reference
TimeGE
Find the total time, within a range, when a point is greater than or equal to a given value.
Format
TimeGE(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search. Relative times are relative to endtime, if endtime is not
itself a relative time.
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not
itself a relative time. This time must be after starttime.
value
Must be an integer or real number or digital state (character string); the value to search for.
Returns
The time period within the given range, for which the point was greater than or equal to the
given value.
Exceptions
None.
Usage Note
TimeGE interpolates between Archive events, if necessary, to find the times when the point
crossed the given value.
Examples
TimeGE('tag1', 't', '*',40.0)
TimeGE('digitaltag', '-1d', '*',TagVal('digitaltag', '14-Dec-97'))
TimeGE('digitaltag', '14-Dec-97', '*', "On")
See Also
TimeEq, TimeGT, TimeLE, TimeLT, TimeNE
TimeGT
Find the total time, within a range, when a point is greater than a given value.
Format
TimeGT(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search. Relative times are relative to endtime, if endtime is not
itself a relative time.
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not
itself a relative time. This time must be after starttime.
value
Must be an integer or real number or digital state (character string); the value to search for.
Returns
The time period within the given range, for which the point was greater than the given value.
Exceptions
None.
Usage Note
TimeGT interpolates between Archive events, if necessary, to find the times when the point
crossed the given value.
Examples
TimeGT('tag1', 't', '*',40.0)
TimeGT('digitaltag', '-1d', '*',TagVal('digitaltag', '14-Dec-97'))
TimeGT('digitaltag', '14-Dec-97', '*', "On")
See Also
TimeEq, TimeGE, TimeLE, TimeLT, TimeNE
Page 174
4.4 - Performance Equations Functions Reference
TimeLE
Find the total time, within a range, when a point is less than or equal to a given value.
Format
TimeLE(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search. Relative times are relative to endtime, if endtime is not
itself a relative time.
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not
itself a relative time. This time must be after starttime.
value
Must be an integer or real number or digital state (character string); the value to search for.
Returns
The time period within the given range, for which the point was less than or equal to the
given value.
Exceptions
None.
Usage Note
TimeLE interpolates between Archive events, if necessary, to find the times when the point
crossed the given value.
Examples
TimeLE('tag1', 't', '*',40.0)
TimeLE('digitaltag', '-1d', '*',TagVal('digitaltag', '14-Dec-97'))
TimeLE('digitaltag', '14-Dec-97', '*', "On")
See Also
TimeEq, TimeGE, TimeGT, TimeLT, TimeNE
TimeLT
Find the total time, within a range, when a point is less than a given value.
Format
TimeLT(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search. Relative times are relative to endtime, if endtime is not
itself a relative time.
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not
itself a relative time. This time must be after starttime.
value
Must be an integer or real number or digital state (character string); the value to search for.
Returns
The time period within the given range, for which the point was less than the given value.
Exceptions
None.
Usage Note
TimeLT interpolates between Archive events, if necessary, to find the times when the point
crossed the given value.
Examples
TimeLT('tag1', 't', '*',40.0)
TimeLT('digitaltag', '-1d', '*',TagVal('digitaltag', '14-Dec-97'))
TimeLT'digitaltag', '14-Dec-97', '*', "On")
See Also
TimeEq, TimeGE, TimeGT, TimeLE, TimeNE
Page 176
4.4 - Performance Equations Functions Reference
TimeNE
Find the total time, within a range, when a point is unequal to a given value.
Format
TimeNE(tagname, starttime, endtime, value)
Arguments
tagname
A tagname.
starttime
Beginning of the time range to search. Relative times are relative to endtime, if endtime is not
itself a relative time.
endtime
End of the time range to search. Relative times are relative to starttime, if starttime is not
itself a relative time. This time must be after starttime.
value
Must be an integer or real number or digital state (character string); the value to search for.
Returns
The time period within the given range, for which the point was unequal to the given value.
Exceptions
None.
Examples
TimeNE('tag1', 't', '*',40.0)
TimeNE('digitaltag', '-1d', '*',TagVal('digitaltag', '14-Dec-97'))
TimeNE('digitaltag', '14-Dec-97', '*', "On")
See Also
TimeEq, TimeGE, TimeGT, TimeLE, TimeLT
Total
Format
Total(x1, x2, ..., xn)
Arguments
x1...xn
May be numbers or time periods, but all must be the same.
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.
Examples
Total('tag1', 'tag2', TagVal('tag1', 'y'),40.0)
Total('t'-'y', '+1h')
Page 178
4.4 - Performance Equations Functions Reference
Trim
Format
Trim(str)
Arguments
str
A string.
Returns
The source string with leading and trailing blanks removed.
Exceptions
If str is not a string, an error value is returned.
Examples
Trim(" Stringtag ") = "Stringtag"
Trim(" Stringtag is a string tag. ") = "Stringtag is a string tag."
See Also
LTrim, RTrim
Trunc
Truncate a number or time to the next lower unit.
Format
Trunc(x [, unit])
Arguments
x
Must be an integer or real number, time expression, or time period.
unit (optional)
The size of the unit to truncate 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 period. If unit is omitted, Trunc truncates to
the next lower integer (for a number) or second (for a time period).
Returns
The largest value smaller than x which is an integer multiple of unit. Returns the same data
type as x. For more information, see the examples below.
Exceptions
If x is a string, or if unit is of the wrong data type, returns an error value.
Examples
Expression Value Comments
Trunc(12.999) 12.0 Truncate to next lower integer
Trunc(18.75, 10) 10.0 Truncate to next lower ten
Trunc('14-Dec-97 14-Dec-97 Truncate to next lower hour
11:47','+1h') 11:00
Trunc('18:47' – 10800 Truncate period to next lower hour
'15:00','+1h') (returns period in seconds)
Note: Trunc to the next lower day results in a timestamp of the next lower day in
UTC time, not local time.
Usage Note
If x is a time, and unit is omitted, this routine has no effect, as times are only accurate to one
second.
See Also
Round
Page 180
4.4 - Performance Equations Functions Reference
UCase
Format
UCase(strexp)
Arguments
strexp
Must be a string value.
Returns
An uppercase string.
Exceptions
If the argument is not a string, returns an error value.
Examples
UCase("Stringtag") = "STRINGTAG"
UCase('Stringtag') = "ERROR" if the Snapshot value for the stringtag
equals "Error"
See Also
LCase
Weekday
Format
Weekday(time)
Arguments
time
A time expression.
Returns
The day of the week of time, in the range 1–7, where 1 represents Sunday.
Exceptions
None.
Examples
Weekday('*')
Weekday('t')
See Also
Day, DaySec, Hour, Minute, Month, Second, Year, Yearday
Page 182
4.4 - Performance Equations Functions Reference
Year
Format
Year(time)
Arguments
time
A time expression.
Returns
The year of time, in the range 1970–present.
Exceptions
None.
Examples
Year('*')
Year('t')
See Also
Day, DaySec, Hour, Minute, Month, Second, Weekday, Yearday
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.
Format
Yearday(time)
Arguments
time
A time expression.
Returns
The day of the year of time, in the range 1–366, where 1 represents January 1.
Exceptions
None.
Examples
Yearday('*')
Yearday('t')
See Also
Day, DaySec, Hour, Minute, Month, Second, Weekday, Year
Page 184
Chapter 5. PI STEAM FUNCTIONS REFERENCE
The PI PE Steam Functions Module (PI Steam) makes available functions that calculate the
thermodynamic properties of steam within Performance Equations. The steam functions are
also available in a COM library, PISteamFunctions.dll, which is distributed by other OSIsoft
products, such as ACE.
For each steam function, there are two function calls: one in English units and another in SI
units. The engineering units for the variables in the steam functions are listed in Table 5–1.
Table 5–2 lists the supported functions in PI Steam.
Page 186
5.2 - Range of Steam Functions
These digital states are standard and are installed with PI Server. The format for each formula
is listed in the reference section.
Table 5–4 lists the valid range in English units of the input variables for each of the steam
functions. The PI Steam functions should compute the same results as the equations given in
the ASME Steam Tables, 6th Edition. Besides the accuracy quoted by the ASME Steam
Tables, you should be aware of the issues raised in Functions that use Temperature and
Pressure as Independent Variables on page 187, and Functions that use Enthalpy or Entropy
as an Independent Variable on page 188.
Page 188
5.3 - Steam Property Reference States
practical use of the steam function involves steam with vapor fraction higher than 0.5, the
ASME equation is not modified.
For the HPS and SPH functions in the wet steam region, the ASME routines use the equation
(Hvap = T*Svap) and the saturated vapor values to compute the result. The functions do not
check if the input enthalpy or entropy is less than those of the saturated liquid and the
extrapolated value is returned.
For the TPH and TPS function in the wet steam region, the ASME routines just check
whether the input enthalpy or entropy is less than that of the saturated vapor at the given
pressure. If the input enthalpy or entropy is less than the saturated vapor value, the saturated
temperature is returned as the answer. The functions do not consider the case where the input
enthalpy or input entropy is less than that of the saturated liquid an error state.
Similarly, for the XPH and XPS functions, the ASME routines do not consider the input
enthalpy or entropy out of bound even when they are greater than saturated vapor properties
or less than saturated liquid properties. The functions return 1.0 as the vapor fraction when
the input enthalpy or entropy is greater than the saturated vapor properties. Input enthalpy or
entropy less than the saturated liquid properties results in negative vapor fraction rather than
an error state.
Though the ASME routines have inadequate checks for the wet steam region, OSI did not
modify these routines because in reality, the steam functions are not used in regions where
the input checks would cause a problem.
One final feature, for pressure above the critical point (3208.2 psia), the VPH, VPS, HPS,
SPH, TPH and TPS functions compute valid results for states corresponded to temperature
greater than 682 degrees F. but less than the critical temperature, 705.47 degrees F, even
though these states are considered compressed water rather than steam.
Triple Point
Triple point of water is at 273.16 degree K or 0.01 degree C or 0.018 degree F.
Celsius Scale
The Celsius temperature is exactly Tk - 273.15.
Critical Point
Critical point of steam is at 647.3 degree K and 22,120 kpa, or 705.47 degree F and 3208.3
psia.
Reference State
The specific internal energy and specific entropy of the liquid phase were fixed at zero at the
triple point of water.
StmEng_TsatP
Format
StmEng_TsatP(P)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 3208.2 psia.
Returns
Computed saturation temperature in degrees F. or Error digital state.
Sample Values
Pressure Temperature
10. 193.21
100. 327.82
1000. 544.58
Page 190
5.4 - Steam Functions Reference
StmEng_HsatP
Format
StmEng_HsatP(P)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 3208.2 psia.
Returns
Computed specific enthalpy for saturated vapor in BTU/lbm or Error digital state.
Sample Values
Pressure Vapor Enthalpy
10. 1143.4
100. 1187.2
1000. 1192.9
StmEng_SsatP
Format
StmEng_SsatP(P)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 3208.2 psia.
Returns
Computed saturated vapor specific entropy in BTU/lbm/R or Error digital state.
Sample Values
Pressure Entropy
10. 1.7879
100. 1.6027
1000. 1.3910
Page 192
5.4 - Steam Functions Reference
StmEng_VsatP
Format
StmEng_VsatP(P)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 3208.2 psia.
Returns
Saturated vapor specific volume in ft3/lbm or Error digital state.
Sample Values
Pressure Volume
10. 38.42
100. 4.431
1000. 0.44596
StmEng_PsatT
Format
StmEng_PsatT(T)
Arguments
T
Steam temperature in degree F. The valid range is 32 to 705.47 degree F.
Returns
Computed saturation pressure of the steam in psia or Error digital state.
Sample Values
Temperature Pressure
100. 0.9492
400. 247.26
700. 3094.33
Page 194
5.4 - Steam Functions Reference
StmEng_HsatT
Format
StmEng_HsatT(T)
Arguments
T
Steam temperature in degree F. The valid range is 32 to 705.47 degree F.
Returns
Computed specific enthalpy for saturated vapor in BTU/lbm or Error digital state.
Sample Values
Temperature Vapor Enthalpy
100. 1105.1
400. 1201.0
700. 995.2
StmEng_SsatT
Format
StmEng_SsatT(T)
Arguments
T
Steam temperature in degree F. The valid range is 32 to 705.47 degree F.
Returns
Computed saturated vapor specific entropy in BTU/lbm/R or- Error digital state.
Sample Values
Temperature Entropy
100. 1.9825
400. 1.52735
700. 1.1390
Page 196
5.4 - Steam Functions Reference
StmEng_VsatT
Format
StmEng_VsatT(T)
Arguments
T
Steam temperature in degree F. The valid range is 32 to 705.47 degree F
Returns
Computed saturated vapor specific volume in ft3/lbm or Error digital state
Sample Values
Temperature Volume
100. 350.39
400. 1.863
700. 0.0752
StmEng_VPT
Calculates the vapor specific volume as a function of pressure and temperature—all variables
expressed in English units. Only use for superheated or dry saturated steam. An error of -1 (or
input out of range digital state) will be resulted for input temperature lower than the
saturation temperature for the input pressure. However, the function computes for the full
range of temperature for input pressure greater than the critical pressure.
Format
StmEng_VPT(P, T)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
T
Steam temperature in degree F. The valid range is 32 to 1600 degree F.
Returns
Computed vapor specific volume in ft3/lbm or Error digital state.
Sample Values
Pressure Temperature Volume
300. 1000. 2.8585
800. 1000. 1.047
1400. 1000. 0.5809
5000. 1000. 0.13118
Page 198
5.4 - Steam Functions Reference
StmEng_VPTL
Calculates the liquid specific volume as a function of pressure and temperature—all variables
expressed in English units. Only use for liquid water condition. An error of -1 (or input out of
range digital state) will be resulted for input temperature higher than the saturation
temperature for the input pressure. However, the function computes for the full range of
temperature for input pressure greater than the critical pressure.
Format
StmEng_VPTL(P, T)
Arguments
P
Pressure of the water in psia. The valid range is 0.088589 to 16000 psia.
T
Water temperature in degree F. The valid range is 32 to 1600 degree F.
Returns
Computed liquid specific volume in ft3/lbm or Error digital state.
Sample Values
Pressure Temperature Volume
300. 100. 0.016115
800. 100. 0.016091
1400. 100. 0.016062
5000. 100. 0.015897
StmEng_VPH
Calculates the vapor specific volume as a function of pressure and enthalpy—all variables
expressed in English units. Use for both superheated or wet steam.
Format
StmEng_VPH(P, H)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
H
Specific enthalpy of the steam in BTU/lbm. The valid range is -1 to 1860 BTU/lbm.
Returns
Computed vapor specific volume in ft3/lbm or Error digital state.
Sample Values
Pressure Enthalpy Volume State
300. 1526.2 2.8585 Superheated
800. 1511.4 1.047 Superheated
1400. 1493.2 0.5809 Superheated
5000. 1364.6 0.13118 Superheated
300. 1122. 1.3904 90 % vapor
Note: The computed result may differ slightly from that computed using the
saturated liquid volume, saturated vapor volume and vapor fraction. The difference
increases with the moisture content of the steam.
Page 200
5.4 - Steam Functions Reference
StmEng_VPS
Calculates the vapor specific volume as a function of pressure and entropy—all variables
expressed in English units. Use for both superheated or wet steam.
Format
StmEng_VPS(P, S)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
S
Specific entropy of the steam in BTU/lbm/R. The valid range is -0.1 to 3.0 BTU/lbm/R.
Returns
Computed vapor specific volume in ft3/lbm or Error digital state.
Sample Values
Pressure Entropy Volume State
300. 1.7964 2.8585 Superheated
800. 1.6807 1.047 Superheated
1400. 1.6096 0.5809 Superheated
5000. 1.4001 0.13118 Superheated
300. 1.4183 1.3904 90 % vapor
Note: The computed result may differ slightly from that computed using the
saturated liquid volume, saturated vapor volume and vapor fraction. The difference
increases with the moisture content of the steam.
StmEng_HPT
Format
StmEng_HPT(P, T)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
T
Steam temperature in degree F. The valid range is 32 to 1600 degree F.
Returns
Computed vapor specific enthalpy in BTU/lbm or Error digital state.
Sample Values
Pressure Temperature Enthalpy
300. 1000. 1526.2
800. 1000. 1511.4
1400. 1000. 1493.2
5000. 1000. 1364.6
Page 202
5.4 - Steam Functions Reference
StmEng_HPTL
Format
StmEng_HPTL(P, T)
Arguments
P
Pressure of the water in psia. The valid range is 0.088589 to 16000 psia.
T
Water temperature in degree F. The valid range is 32 to 1600 degree F.
Returns
Computed liquid specific enthalpy in BTU/lbm or Error digital state.
Sample Values
Pressure Temperature Enthalpy
300. 100. 68.788
800. 100. 70.106
1400. 100. 71.684
5000. 100. 81.081
StmEng_HPS
Calculates the vapor specific enthalpy as a function of pressure and entropy—all variables
expressed in English units. Use for both superheated or wet steam.
Format
StmEng_HPS(P, S)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
S
Specific entropy of the steam in BTU/lbm/R. The valid range is -0.1 to 3.0 BTU/lbm/R.
Returns
Computed vapor specific enthalpy in BTU/lbm or Error digital state.
Sample Values
Pressure Entropy Enthalpy State
300. 1.7964 1526.2 Superheated
800. 1.6807 1511.4 Superheated
1400. 1.6096 1493.2 Superheated
5000. 1.4001 1364.6 Superheated
300. 1.4183 1122. 90 % vapor
Note: Even if the input entropy is less than that of the saturated liquid, the function
still computes the enthalpy by extrapolation without setting an error state.
Page 204
5.4 - Steam Functions Reference
StmEng_SPT
Calculates the vapor specific entropy as a function of pressure and temperature—all variables
expressed in English units. Only use for superheated or dry saturated steam. An error of -1 (or
input out of range digital state) will be resulted for input temperature lower than the
saturation temperature for the input pressure. However, the function computes for the full
range of temperature for input pressure greater than the critical pressure.
Format
StmEng_SPT(P, T)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
T
Steam temperature in degree F. The valid range is 32 to 1600 degree F.
Returns
Computed vapor specific entropy in BTU/lbm/R or- Error digital state.
Sample Values
Pressure Temperature Entropy
300. 1000. 1.7964
800. 1000. 1.6807
1400. 1000. 1.6096
5000. 1000. 1.4001
StmEng_SPTL
Calculates the liquid specific entropy as a function of pressure and temperature—all variables
expressed in English units. Only use for compressed water. An error of -1 (or input out of
range digital state) will be resulted for input temperature higher than the saturation
temperature for the input pressure. However, the function computes for the full range of
temperature for input pressure greater than the critical pressure.
Format
StmEng_SPTL(P, T)
Arguments
P
Pressure of the water in psia. The valid range is 0.088589 to 16000 psia.
T
Water temperature in degree F. The valid range is 32 to 1600 degree F.
Returns
Computed liquid specific entropy in BTU/lbm/R or- Error digital state.
Sample Values
Pressure Temperature Entropy
300. 100. 0.12936
800. 100. 0.12905
1400. 100. 0.12868
5000. 100. 0.12645
Page 206
5.4 - Steam Functions Reference
StmEng_SPH
Calculates the vapor specific entropy as a function of pressure and enthalpy—all variables
expressed in English units. Use for both superheated or wet steam.
Format
StmEng_SPH(P, H)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
H
Computed vapor specific enthalpy in BTU/lbm. The valid range is -1.0 to 1860 BTU/lbm.
Returns
Computed vapor specific entropy in BTU/lbm/R or- Error digital state.
Sample Values
Pressure Enthalpy Entropy State
300. 1526.2 1.7964 Superheated
800. 1511.4 1.6807 Superheated
1400. 1493.2 1.6096 Superheated
5000. 1364.6 1.4001 Superheated
300. 1122. 1.4183 90 % vapor
Note: Even if the input enthalpy is less than that of the saturated liquid, the function
still computes the entropy by extrapolation without setting an error state.
StmEng_TPH
Format
StmEng_TPH(P, H)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
H
Specific enthalpy of the steam in BTU/lbm. The valid range is -1 to 1860 BTU/lbm.
Returns
Computed steam temperature in degree F. or Error digital state.
Sample Values
Pressure Enthalpy Temperature State
300. 1526.2 1000. Superheated
800. 1511.4 1000. Superheated
1400. 1493.2 1000. Superheated
5000. 1364.6 1000. Superheated
300. 1122. 417.35 90 % vapor
Note: Even if the input enthalpy is less than that of the saturated liquid, the function
still returns the saturated temperature as the answer without setting an error state.
Page 208
5.4 - Steam Functions Reference
StmEng_TPS
Format
StmEng_TPS(P, S)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 16000 psia.
S
Specific entropy of the steam in BTU/lbm/R. The valid range is -0.1 to 3.0 BTU/lbm/R.
Returns
Computed steam temperature in degree F. or Error digital state.
Sample Values
Pressure Entropy Temperature State
300. 1.7964 1000. Superheated
800. 1.6807 1000. Superheated
1400. 1.6096 1000. Superheated
5000. 1.4001 1000. Superheated
300. 1.4183 417.35 90 % vapor
Note: Even if the input entropy is less than that of the saturated liquid, the function
still returns the saturated temperature as the answer without setting an error state.
StmEng_XPH
Calculates the steam quality (vapor fraction) as a function of pressure and enthalpy—all
variables expressed in English units. Use only for wet steam.
Format
StmEng_XPH(P, H)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 3208.2 psia.
H
Specific enthalpy of the steam in BTU/lbm. The valid range is -1 to 1860 BTU/lbm.
Returns
Computed steam quality (vapor fraction) or Error digital state.
Sample Values
Pressure Enthalpy Steam Quality
300. 1122.0 0.9
800. 1130.4 0.9
1400. 1117.7 0.9
Note: If the input enthalpy is greater than that of the saturated vapor, the function
returns 1.0 as vapor fraction. If the input enthalpy is less than that of the saturated
liquid, the function would compute negative vapor fraction without setting an error
state.
Page 210
5.4 - Steam Functions Reference
StmEng_XPS
Calculates the steam quality (vapor fraction) as a function of pressure and entropy—all
variables expressed in English units. Use only for wet steam.
Format
StmEng_XPS(P, S)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 3208.2 psia.
S
Specific entropy of the steam in BTU/lbm/R. The valid range is -0.1 to 3.0 BTU/lbm/R or
Error digital state.
Returns
Computed steam quality (vapor fraction).
Sample Values
Pressure Entropy Steam Quality
300. 1.4183 0.9
800. 1.3458 0.9
1400. 1.2923 0.9
Note: If the input entropy is greater than that of the saturated vapor, the function
returns 1.0 as vapor fraction. If the input entropy is less than that of the saturated
liquid, the function would compute negative vapor fraction without setting an error
state.
StmEng_HPX
Calculates the steam specific enthalpy as a function of pressure and quality (vapor fraction)—
all variables expressed in English units. Use only for wet steam.
Format
StmEng_HPX(P, X)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 3208.2 psia.
X
Steam quality (vapor fraction). Valid range is from 0.0 to 1.0.
Returns
Computed specific enthalpy of the steam in BTU/lbm or Error digital state.
Sample Values
Pressure Steam Quality Enthalpy
300. 0.9 1122.0
800. 0.9 1130.4
1400. 0.9 1117.7
Page 212
5.4 - Steam Functions Reference
StmEng_SPX
Calculates the steam specific entropy as a function of pressure and quality (vapor fraction)—
all variables expressed in English units. Use only for wet steam.
Format
StmEng_SPX(P, X)
Arguments
P
Pressure of the steam in psia. The valid range is 0.088589 to 3208.2 psia.
X
Steam quality (vapor fraction). Valid range is from 0.0 to 1.0.
Returns
Computed specific entropy of the steam in BTU/lbm/R or- Error digital state.
Sample Values
Pressure Steam Quality Entropy
300. 0.9 1.4183
800. 0.9 1.3458
1400. 0.9 1.2923
StmSI_TsatP
Format
StmSI_TsatP(P)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 22119.8 kpa.
Returns
Computed saturation temperature in degree C. or Error digital state.
Sample Values
Pressure Temperature
50. 81.345
1000. 179.88
10000. 310.96
Page 214
5.4 - Steam Functions Reference
StmSI_HsatP
Format
StmSI_HsatP(P)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 22119.8 kpa.
Returns
Computed specific enthalpy for saturated vapor in J/g.
Sample Values
Pressure Vapor Enthalpy
50. 2646.0
1000. 2776.2
10000. 2727.7
StmSI_SsatP
Calculates the saturated vapor specific entropy as a function of pressure—all variables
expressed in SI units.
Format
StmSI_SsatP(P)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 22119.8 kpa.
Returns
Computed saturated vapor specific entropy in J/g/K or Error digital state.
Sample Values
Pressure Entropy
50. 7.5947
1000. 6.5828
10000. 5.6198
Page 216
5.4 - Steam Functions Reference
StmSI_VsatP
Format
StmSI_VsatP(P)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 22119.8 kpa.
Returns
Computed saturated vapor specific volume in cc/g or Error digital state.
Sample Values
Pressure Volume
50. 3240.2
1000. 194.29
10000. 18.041
StmSI_PsatT
Format
StmSI_PsatT(T)
Arguments
T
Steam temperature in degree C. The valid range is 0.0 to 374.15 degree C.
Returns
Computed saturation pressure of the steam in kpa or Error digital state.
Sample Values
Temperature Pressure
50. 12.335
200. 1554.9
350. 16535.
Page 218
5.4 - Steam Functions Reference
StmSI_HsatT
Format
StmSI_HsatT(T)
Arguments
T
Steam temperature in degree C. The valid range is 0.0 to 374.15 degree C.
Returns
Computed specific enthalpy for saturated vapor in J/g or Error digital state.
Sample Values
Temperature Vapor Enthalpy
50. 2592.2
200. 2790.9
350. 2567.7
StmSI_SsatT
Format
StmSI_SsatT(T)
Arguments
T
Steam temperature in degree C. The valid range is 0.0 to 374.15 degree C.
Returns
Computed saturated vapor specific entropy in J/g/K or Error digital state.
Sample Values
Temperature Entropy
50. 8.0776
200. 6.4278
350. 5.2177
Page 220
5.4 - Steam Functions Reference
StmSI_VsatT
Format
StmSI_VsatT(T)
Arguments
T
Steam temperature in degree C. The valid range is 0.0 to 374.15 degree C
Returns
Computed saturated vapor specific volume in cc/g or Error digital state.
Sample Values
Temperature Volume
50. 12046.
200. 127.16
350. 8.7991
StmSI_VPT
Calculates the vapor specific volume as a function of pressure and temperature—all variables
expressed in SI units. Only use for superheated or dry saturated steam. An error of -1 (or
input out of range digital state) will be resulted for input temperature lower than the
saturation temperature for the input pressure. However, the function computes for the full
range of temperature for input pressure greater than the critical pressure.
Format
StmSI_VPT(P, T)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
T
Steam temperature in degree C. The valid range is 0.0 to 871.11 degree C.
Returns
Computed vapor specific volume in cc/g or Error digital state.
Sample Values
Pressure Temperature Volume
2500. 600. 159.21
5000. 600. 78.616
10000. 600. 38.320
40000. 600. 8.0884
Page 222
5.4 - Steam Functions Reference
StmSI_VPTL
Calculates the liquid specific volume as a function of pressure and temperature—all variables
expressed in SI units. Only use for compressed water. An error of -1(or input out of range
digital state) will be resulted for input temperature higher than the saturation temperature for
the input pressure. However, the function computes for the full range of temperature for input
pressure greater than the critical pressure.
Format
StmSI_VPTL(P, T)
Arguments
P
Pressure of the water in kpa. The valid range is 0.6108 to 110316.0 kpa.
T
Water temperature in degree C. The valid range is 0.0 to 871.11 degree C.
Returns
Computed liquid specific volume in cc/g or Error digital state.
Sample Values
Pressure Temperature Volume
2500. 100. 1.04245
5000. 100. 1.04116
10000. 100. 1.03861
40000. 100. 1.02438
StmSI_VPH
Calculates the vapor specific volume as a function of pressure and enthalpy—all variables
expressed in SI units. Use for both superheated or wet steam.
Format
StmSI_VPH(P, H)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
H
Specific enthalpy of the steam in J/g. The valid range is -2.326 to 4326.36 J/g.
Returns
Computed vapor specific volume in cc/g or Error digital state.
Sample Values
Pressure Enthalpy Volume State
2500. 3685.1 159.21 Superheated
5000. 3664.5 78.616 Superheated
10000. 3622.7 38.320 Superheated
40000. 3346.4 8.0884 Superheated
2500. 2617.0 72.04 90 % vapor
Note: The computed result may differ slightly from that computed using the
saturated liquid volume, saturated vapor volume and vapor fraction. The difference
increases with the moisture content of the steam.
Page 224
5.4 - Steam Functions Reference
StmSI_VPS
Calculates the vapor specific volume as a function of pressure and entropy—all variables
expressed in SI units. Use for both superheated or wet steam.
Format
StmSI_VPS(P, S)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
S
Specific entropy of the steam in J/g/K. The valid range is -0.41868 to 12.5604 J/g/K.
Returns
Computed vapor specific volume in cc/g or Error digital state.
Sample Values
Pressure Entropy Volume State
2500. 7.5956 159.21 Superheated
5000. 7.2578 78.616 Superheated
10000. 6.9013 38.320 Superheated
40000. 6.0135 8.0884 Superheated
2500. 5.8837 72.04 90 % vapor
Note: The computed result may differ slightly from that computed using the
saturated liquid volume, saturated vapor volume and vapor fraction. The difference
increases with the moisture content of the steam.
StmSI_HPT
Format
StmSI_HPT(P, T)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
T
Steam temperature in degree C. The valid range is 0.0 to 871.11 degree C.
Returns
Computed vapor specific enthalpy in J/g or Error digital state.
Sample Values
Pressure Temperature Enthalpy
2500. 600. 3685.1
5000. 600. 3664.5
10000. 600. 3622.7
40000. 600. 3346.4
Page 226
5.4 - Steam Functions Reference
StmSI_HPTL
Format
StmSI_HPTL(P, T)
Arguments
P
Pressure of the water in kpa. The valid range is 0.6108 to 110316.0 kpa.
T
Water temperature in degree C. The valid range is 0.0 to 871.11 degree C.
Returns
Computed liquid specific enthalpy in J/g or Error digital state.
Sample Values
Pressure Temperature Enthalpy
2500. 100. 420.86
5000. 100. 422.74
10000. 100. 426.50
40000. 100. 449.22
StmSI_HPS
Calculates the vapor specific enthalpy as a function of pressure and entropy—all variables
expressed in SI units. Use for both superheated or wet steam.
Format
StmSI_HPS(P, S)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
S
Specific entropy of the steam in J/g/K. The valid range is -0.41868 to 12.5604 J/g/K.
Returns
Computed vapor specific enthalpy in J/g or Error digital state.
Sample Values
Pressure Entropy Enthalpy State
2500. 7.5956 3685.1 Superheated
5000. 7.2578 3664.5 Superheated
10000. 6.9013 3622.7 Superheated
40000. 6.0135 3346.4 Superheated
2500. 5.8837 2617.0 90 % vapor
Note: Even if the input entropy is less than that of the saturated liquid, the function
still computes the enthalpy by extrapolation without setting an error state.
Page 228
5.4 - Steam Functions Reference
StmSI_SPT
Calculates the vapor specific entropy as a function of pressure and temperature—all variables
expressed in SI units. Only use for superheated or dry saturated steam. An error of -1 (or
input out of range digital state) will be resulted for input temperature lower than the
saturation temperature for the input pressure. However, the function computes for the full
range of temperature for input pressure greater than the critical pressure.
Format
StmSI_SPT(P, T)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
T
Steam temperature in degree C. The valid range is 0.0 to 871.11 degree C.
Returns
Computed vapor specific entropy in J/g/K or Error digital state.
Sample Values
Pressure Temperature Entropy
2500. 600. 7.5956
5000. 600. 7.2578
10000. 600. 6.9013
40000. 600. 6.0135
StmSI_SPTL
Calculates the liquid specific entropy as a function of pressure and temperature—all variables
expressed in SI units. Only use for compressed water. An error of -1 (or input out of range
digital state) will be resulted for input temperature higher than the saturation temperature for
the input pressure. However, the function computes for the full range of temperature for input
pressure greater than the critical pressure.
Format
StmSI_SPTL(P, T)
Arguments
P
Pressure of the water in kpa. The valid range is 0.6108 to 110316.0 kpa.
T
Water temperature in degree C. The valid range is 0.0 to 871.11 degree C.
Returns
Computed liquid specific entropy in J/g/K or Error digital state.
Sample Values
Pressure Temperature Entropy
2500. 100. 1.305
5000. 100. 1.30304
10000. 100. 1.29919
40000. 100. 1.27714
Page 230
5.4 - Steam Functions Reference
StmSI_SPH
Calculates the vapor specific entropy as a function of pressure and enthalpy—all variables
expressed in SI units. Use for both superheated or wet steam.
Format
StmSI_SPH(P, H)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
H
Computed vapor specific enthalpy in J/g. The valid range is -2.326 to 4326.36 J/g.
Returns
Computed vapor specific entropy in J/g/K or Error digital state.
Sample Values
Pressure Enthalpy Entropy State
2500. 3685.1 7.5956 Superheated
5000. 3664.5 7.2578 Superheated
10000. 3622.7 6.9013 Superheated
40000. 3346.4 6.0135 Superheated
2500. 2617.0 5.8837 90 % vapor
Note: Even if the input enthalpy is less than that of the saturated liquid, the function
still computes the entropy by extrapolation without setting an error state.
StmSI_TPH
Format
StmSI_TPH(P, H)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
H
Specific enthalpy of the steam in J/g. The valid range is -2.326 to 4326.36 J/g.
Returns
Computed steam temperature in degree C. or Error digital state.
Sample Values
Pressure Enthalpy Temperature State
2500. 3685.1 600. Superheated
5000. 3664.5 600. Superheated
10000. 3622.7 600. Superheated
40000. 3346.4 600. Superheated
2500. 2617.0 223.94 90 % vapor
Note: Even if the input enthalpy is less than that of the saturated liquid, the function
still returns the saturated temperature as the answer without setting an error state.
Page 232
5.4 - Steam Functions Reference
StmSI_TPS
Format
StmSI_TPS(P, S)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 110316.0 kpa.
S
Specific entropy of the steam in J/g/K. The valid range is -0.41868 to 12.5604 J/g/K.
Returns
Computed steam temperature in degree C. or Error digital state.
Sample Values
Pressure Entropy Temperature State
2500. 7.5956 600. Superheated
5000. 7.2578 600. Superheated
10000. 6.9013 600. Superheated
40000. 6.0135 600. Superheated
2500. 5.8837 223.94 90 % vapor
Note: Even if the input entropy is less than that of the saturated liquid, the function
still returns the saturated temperature as the answer without setting an error state.
StmSI_XPH
Calculates the steam quality (vapor fraction) as a function of pressure and enthalpy—all
variables expressed in SI units. Use only for wet steam.
Format
StmSI_XPH(P, H)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 22119.8 kpa.
H
Specific enthalpy of the steam in J/g. The valid range is -2.326 to 4326.36 J/g.
Returns
Computed steam quality (vapor fraction) or Error digital state.
Sample Values
Pressure Enthalpy Steam Quality
2500. 2617.0 0.9
5000. 2630.2 0.9
10000. 2595.8 0.9
Note: If the input enthalpy is greater than that of the saturated vapor, the function
returns 1.0 as vapor fraction. If the input enthalpy is less than that of the saturated
liquid, the function would compute negative vapor fraction without setting an error
state.
Page 234
5.4 - Steam Functions Reference
StmSI_XPS
Calculates the steam quality (vapor fraction) as a function of pressure and entropy—all
variables expressed in SI units. Use only for wet steam.
Format
StmSI_XPS(P, S)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 22119.8 kpa.
S
Specific entropy of the steam in J/g/K. The valid range is -0.41868 to 12.5604 J/g/K.
Returns
Computed steam quality (vapor fraction) or Error digital state.
Sample Values
Pressure Entropy Steam Quality
2500. 5.8837 0.9
5000. 5.6682 0.9
10000. 5.3939 0.9
Note: If the input entropy is greater than that of the saturated vapor, the function
returns 1.0 as vapor fraction. If the input entropy is less than that of the saturated
liquid, the function would compute negative vapor fraction without setting an error
state.
StmSI_HPX
Calculates the steam specific enthalpy as a function of pressure and quality (vapor fraction)—
all variables expressed in SI units. Use only for wet steam.
Format
StmSI_HPX(P, X)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 22119.8 kpa.
X
Steam quality (vapor fraction). Valid range is from 0.0 to 1.0.
Returns
Computed specific enthalpy of the steam in J/g or Error digital state.
Sample Values
Pressure Steam Quality Enthalpy
2500. 0.9 2617.0
5000. 0.9 2630.2
10000. 0.9 2595.8
Page 236
5.4 - Steam Functions Reference
StmSI_SPX
Calculates the steam specific entropy as a function of pressure and quality (vapor fraction)—
all variables expressed in SI units. Use only for wet steam.
Format
StmSI_SPX(P, X)
Arguments
P
Pressure of the steam in kpa. The valid range is 0.6108 to 22119.8 kpa.
X
Steam quality (vapor fraction). Valid range is from 0.0 to 1.0.
Returns
Computed specific entropy of the steam in J/g/K or Error digital state.
Sample Values
Pressure Steam Quality Entropy
2500. 0.9 5.8837
5000. 0.9 5.6682
10000. 0.9 5.3939
Most processes have repeatable time segments or stages. The PI Batch Subsystem maps
process or manufacturing events to slices of time and data, and stores these batch- and
process-based events hierarchically in the PI Data Archive as Batches, Unit Batches, or Sub
Batches. This capability enables powerful data and process analysis for both traditional and
non-traditional batch processes.
Many manufacturing companies find it useful to track their products in discrete batches rather
than as a time-continuous product. PI Batch can define and record sequences such as events
in discrete manufacturing, paper reels, steel coils, product or grade changes, turbine startups,
and lab runs. While industries such as chemicals and pharmaceuticals use PI Batch to track
and analyze batches, it is also widely used in non-batch applications to identify and track
process events. Along with the use of audit trail support, PI Batch and the PI System become
an integral component of a validated reporting environment in compliance with 21 CFR Part
11.
This chapter describes the functionality provided by the PI Batch Subsystem, from
configuration to interaction with the resulting batch data, and includes the following topics:
Section 6.1, PI Batch Overview, on page 239
Section 6.2, Installation, on page 241
Section 6.3, Configuration, on page 241
Section 6.4, Batch Data Information, on page 250
Section 6.5, Batch Subsystem Operation, on page 253
Section 6.6, Client Access to Batch Subsystem Batches, on page 254
Section 6.7, Complete Example, on page 254
Traditional batch applications are common in industries like chemical, food and beverage,
and pharmaceutical manufacturing. Batch processing has also been used in applications in
which a sequence of steps occurs, such as burner startup and shutdown, to determine whether
or not proper sequencing took place. Furthermore, batch processing has been used in
applications that are not typically considered pure batch processes to correlate process data
that has been generated during say an 8-hour shift or a 24-hour time period. Comparison of
various parameters during such shifts or time periods often leads to valuable insight about the
underlying process.
PI Batch is used in conjunction with its companion Client application, PI BatchView, which
allows you to search, select, trend, and compare events that have been collected by PI Batch
and stored in the PI System. Earlier versions of PI BatchView were based on the PI-API, and
more recent versions are based on the PI-SDK.
Batch activity is indexed on the following parameters:
• Time
• Unit
• Batch ID
• Product ID
Once the batch activity is recorded, specific batches or groups of batches can be searched and
retrieved. The batch search results may then be used to frame process data from the PI
Archive in the context of the selected batches.
6.1.1 The PI Batch Subsystem (BSS), PI Batch Database (PBD), and PI Batch
Generator (PIBaGen)
The PI Batch Subsystem (BSS) was introduced with PI Server 3.1. It provides batch
processing functionality: configuration, monitoring, and query processing. It continues to be
installed and supported, but it is no longer the only (or preferred) technology for batch
processing.
For information about the PI Batch Subsystem, read this chapter.
The PI Batch Database (BDB) was introduced with PI Server 3.3 and PI-SDK 1.1. It
provides enhanced batch information processing support.
For information about the PI Batch Database, refer to the PI-SDK User Manual.
The PI Batch Generator (PIBaGen) Interface was introduced with the PI Batch Database.
It is now included with PI Server Applications. It is a PI-SDK-based interface that reads
process unit configuration from the PI Module Database and writes into the PI Batch
Database. The interface monitors the PI Server for events that trigger the beginning of a batch
and then stores information about each batch, such as Batch ID and Product ID, into the PI
Data Archive.
For information about the PI Batch Generator, refer to the PI Batch Generator
(PIBaGen) User Manual.
The PI Batch Database and the PI Batch Generator are independent of the PI Batch
Subsystem. All three of these system components may be used in parallel.
For a comparison of the PI Batch Subsystem and PI Batch Database refer to PI
Batch Database Support of the PI Batch Subsystem. This document also explains
how to access BSS batches from the BDB, and vice versa.
To search, select, trend, and compare batches of interest, client products such as PI-
BatchView are available.
Page 240
6.2 - Installation
6.2 Installation
The PI Batch Subsystem is automatically installed on new installations or upgrades of the PI3
Server, but a valid license is required in order to use it. The pibatch.exe executable is located
in \PI\bin. The installation itself will not result in the creation of any units or batches, but the
installed piconfig script \PI\adm\pibatch.dif can be used to configure an example unit and
enable the creation of sample batches. The pibatch.dif script is discussed in more detail in
section 6.7.
The PI Batch Subsystem must started first, to configure any units or to create batches. Startup
will typically occur automatically either at boot time or when the PI Server startup script is
executed.
6.3 Configuration
All configuration for the PI Batch Subsystem must be performed with the command-line
utility piconfig. See chapter 11, The Piconfig Utility, in the PI Server System Management
Guide, for information about using the piconfig utility.
Attribute Description
UnitName This defines the unique unit name, which is the primary index of the
PIBAUNIT table. The name cannot include the ‘\’ character but can be
renamed.
NEWUnitName Used to rename an existing unit.
ActiveTag The PI tag that defines whether a batch is active or inactive on this unit.
Two different units cannot have the same batch activation tag.
ActiveType This attribute defines when a batch begins (becomes Active) or ends
(becomes Inactive) on a unit. The transition is a function of the data type
and value of the batch activation tag. The two possible types are Pulse
(default) and Step.
PULSE The Inactive / Active transition occurs according to the
following table. A change in value within the same status
range has no effect on the status of the unit.
ActiveTag Batch becomes Batch becomes Active
data type Inactive
Integer Value = 0 Value <> 0
Digital Value = first Value <> first digital state
digital state
Float -1 < Value < 1 Value <= -1 or Value >= 1
Page 242
6.3 - Configuration
Attribute Description
String Value = "" Value <> ""
STEP Units with this type are normally active: every time the
ActiveTag receives a new value, the current batch is
completed and a new batch is started. New batches will
cease being created for each new value when the ActiveTag
receives the Stop Value.
ActiveTag data type Stop Value
Integer Value = 0
Digital Value = first digital state
Float -1 < Value < 1
String Value = ""
BIDExpr This defines the expression consisting of PI Tags and text to generate a
batch identifier (BatchID) when a batch starts on a unit. See the section,
Rules for Defining BIDExpr and ProdExpr, for more information.
ProdExpr This defines the expression consisting of PI tags and text to generate a
product identifier (ProductID) when the batch starts on a unit. See the
section, Rules for Defining BIDExpr and ProdExpr, for more information.
EvalDelay Delay (default is zero), in seconds, to wait before evaluating BIDExpr and
ProdExpr after the batch starts. If the batch duration is shorter than the
evaluation delay, the BIDExpr and ProdExpr will be evaluated when the
batch ends. This attribute is useful if the BatchID and ProductID are not
defined until after the batch starts.
MergeConsecutive If the value of this attribute is non-zero (default is zero) and the
ActiveType is Pulse, consecutive batches with the same BatchID are
considered to be one batch. The first assigned ProductID is used for the
entire batch. This attribute is useful for batches that are halted
temporarily and then restarted before the actual batch completes.
Description A textual description of the unit.
DataAccess Similar to tag security, this security attribute controls access to the batch
data for the unit for the owner, group, and world. The format is the
following: "o:<access> g:<access> w:<access>" where the <access>
mask is either "rw" for read-write access, "w" for write-only access, "r" for
read-only access, or "" for no access. The default access string is "o:rw
g:r w:r".
DataGroup This security attribute indicates which group of PI users can access batch
data for the unit. The default data group is piadmin.
DataOwner This security attribute indicates which individual PI user owns the batch
data for the unit. The default data owner is piadmin.
UnitAccess Same as DataAccess, except this controls access to the configuration for
the unit. The default access string is also "o:rw g:r w:r".
UnitGroup This security attribute indicates which group of PI users can access the
configuration for the unit. The default unit group is piadmin.
UnitOwner This security attribute indicates which individual PI user owns the
configuration for the unit. The default unit owner is piadmin.
Note: The backslashes preceding the inner double quotes are needed; otherwise,
they would be misinterpreted to be the final double quote of the entire expression.
Such an expression combines the values of the PI tags R1:PRODA and R1:PRODB with
some additional text to generate a product name. Some example values of the PI tags and the
resulting ProductID (or BatchID) are:
R1:PRODA R1:PRODB ProductID
5 765.99 0005_00765-A
BLACK YELLOW BLAC_YELLO-A
ABC XYZ_X ABC _XYZ_X-A
12345 Shutdown ####_Digital
State Set-A
The following is a complete list of the syntax rules and limitations for specifying both
BIDExpr and ProdExpr expressions:
The entire expression must be enclosed in double quotes.
PI points must be enclosed in single quotes.
Static text strings must be enclosed in double quotes. Backslashes must precede the
double quotes surrounding text strings to prevent misinterpretation of the final double
quote for the entire expression.
A number following the field size indicator, '/', indicates the number of characters the
field will occupy. A value of 0 or an unspecified field width indicates that all
characters are required.
The values for integer tags are right-justified and zero-filled if the number of digits is
less than the field size. If the number of integer digits exceeds the field size, the field
is filled with '#'s.
The values for float tags are truncated and then converted to integers, which means
the field size rules for integers then apply.
The values for digital or string tags are left-justified and filled with trailing spaces if
the number of characters is less than the field size. If the number of characters
exceeds the field size, the text is truncated.
Page 244
6.3 - Configuration
If any tag has a bad status, the field is filled with '#'s.
Any leading or trailing blanks in the resulting BatchID or ProductID are truncated.
The resulting BatchID or ProductID should not contain any of the following
characters: * ? or \. These characters will interfere with wildcard searches.
Common Operations
The following sub-sections demonstrate the common tasks of creating, listing, renaming,
editing, and deleting units.
Create Units
Recall that the only attributes with default values are the following: ActiveType, EvalDelay,
MergeConsecutive, and the six security attributes (DataAccess, DataGroup, DataOwner,
UnitAccess, UnitGroup, UnitOwner). If the default values for these attributes are
acceptable, then these attributes do not have to be specified when creating new units. The
following piconfig commands will create the unit TestUnit using the default attribute values:
List Units
Use the following piconfig commands to list all the attributes for TestUnit:
* (Ls - ) PIconfig> @table pibaunit
* (Ls - PIBAUNIT) PIconfig> @mode list
* (Ls - PIBAUNIT) PIconfig> @ostr *
* (Ls - PIBAUNIT) PIconfig> @select unitname=TestUnit
* (Ls - PIBAUNIT) PIconfig> @ends
TestUnit,TestUnitTrigger,pulse,"TestBID",o:rw g:r w:r,piadmin,piadmin,
This is a test unit.,0,0,"TestPID",o:rw g:r w:r,piadmin,piadmin
Rename Units
Renaming units requires the use of the NEWUnitName attribute in edit mode. The following
piconfig commands rename TestUnit:
* (Ls - ) PIconfig> @table pibaunit
* (Ls - PIBAUNIT) PIconfig> @mode edit
* (Ed - PIBAUNIT) PIconfig> @istr unitname,newunitname
* (Ed - PIBAUNIT) PIconfig> TestUnit,TestUnit1
*> TestUnit,TestUnit1
Because a unit's name is not used to store the actual batch data, renaming a unit will be
wholly transparent to batch data searches and retrieval.
Edit Units
Any unit attribute except for UnitName can be edited directly using the attribute's name. The
following piconfig commands will edit the security attributes DataAccess and UnitAccess
for TestUnit:
* (Ls - ) PIconfig> @table pibaunit
* (Ls - PIBAUNIT) PIconfig> @mode edit
* (Ed - PIBAUNIT) PIconfig> @istr unitname,dataaccess,unitaccess
* (Ed - PIBAUNIT) PIconfig> TestUnit,"o:rw g:rw w:","o:rw g:rw w:"
*> TestUnit,"o:rw g:rw w:","o:rw g:rw w:"
Page 246
6.3 - Configuration
Editing a unit will also result in editing of the unique PI point (e.g. piba36) used to store the
unit's batch data in the archive. Examining the PI Server message log around the time of a
unit edit should yield a message similar to:
0 pipoints 27-Nov-05 23:17:22
>> Point Edited by User (1) piadmin, piba36, Point Id: 8406
Delete Units
OSIsoft does not recommend deleting units, especially those that have valid batch data.
Nevertheless, the following piconfig commands will delete TestUnit:
* (Ls - ) PIconfig> @table pibaunit
* (Ls - PIBAUNIT) PIconfig> @mode delete
* (Dl - PIBAUNIT) PIconfig> @istr unitname
* (Dl - PIBAUNIT) PIconfig> TestUnit
*> TestUnit
In case of user error, deleting a unit will not automatically result in the deletion of the unique
PI point used to store the unit's batch data in the Archive. Instead, the batch data storage point
will simply be renamed. Examining the PI Server Message Log around the time of a unit
deletion should yield a message similar to:
0 pipoints 27-Nov-05 23:30:04
>> Point Renamed by User (1) piadmin, New Tag piba36_del, Old Tag
piba36, PointId: 8406
To completely delete the unit and all of its batch data would require the second manual step
of deleting the renamed batch data storage point (e.g. piba36_del) for that particular unit.
Aliases in the PI Batch Subsystem provide the mechanism to enable the more natural
reference to an attribute's common name instead of the more obscure instrument name.
Attribute Description
Alias The alias name has two components: unit name and common name.
The syntax for an alias is the following: \\unit name\common name.
The unit name must correspond to an existing unit in the PIBAUNIT
table.
NEWAlias Used to rename an existing alias.
Tag The name of the PI point associated with the alias. The PI point must
already exist
Common Operations
The following sub-sections demonstrate the common tasks of creating, listing, renaming,
editing, and deleting aliases.
Create Aliases
The following piconfig commands will create three aliases on unit Reactor1, one for each of
the attributes level, temperature, and flow:
* (Ls - ) PIconfig> @table PIBAALIAS
* (Ls - PIBAALIAS) PIconfig> @mode create
* (Cr - PIBAALIAS) PIconfig> @istr alias,tag
* (Cr - PIBAALIAS) PIconfig> \\Reactor1\level,LIC:129732.PV
*> \\Reactor1\level,LIC:129732.PV
* (Cr - PIBAALIAS) PIconfig> \\Reactor1\temperature,TIC:135432.PV
*> \\Reactor1\temperature,TIC:135432.PV
* (Cr - PIBAALIAS) PIconfig> \\Reactor1\flow,FIC:245433.PV
Page 248
6.3 - Configuration
*> \\Reactor1\flow,FIC:245433.PV
List Aliases
Because aliases include the unit name, a wildcard (default: '*') is often used to select or list
specific aliases. The following piconfig commands list all aliases defined for Reactor1:
* (Ls - ) PIconfig> @table PIBAALIAS
* (Ls - PIBAALIAS) PIconfig> @mode list
* (Ls - PIBAALIAS) PIconfig> @ostr alias,tag
* (Ls - PIBAALIAS) PIconfig> @select alias=\\Reactor1\*
* (Ls - PIBAALIAS) PIconfig> @ends
\\Reactor1\flow,FIC:245433.PV
\\Reactor1\level,LIC:129732.PV
\\Reactor1\temperature,TIC:135432.PV
The wildcard can be used to list a variety of other alias combinations. For example, @select
alias=* will list all aliases for all units; @select alias=\\*\temperature will list all
aliases with a common name of temperature.
Rename Aliases
Renaming of aliases is performed in edit mode using the NEWAlias attribute. The following
piconfig commands rename the temperature alias of Reactor1:
* (Ls - ) PIconfig> @table PIBAALIAS
* (Ls - PIBAALIAS) PIconfig> @mode edit
* (Ed - PIBAALIAS) PIconfig> @istr alias,newalias
* (Ed - PIBAALIAS) PIconfig> \\Reactor1\temperature,\\Reactor1\CoreTe
mp
*> \\Reactor1\temperature,\\Reactor1\CoreTemp
Edit Aliases
Edit mode is also used when changing the corresponding PI point for an alias. The following
piconfig commands change the PI tag associated with the temperature alias of Reactor1:
* (Ls - ) PIconfig> @table PIBAALIAS
* (Ls - PIBAALIAS) PIconfig> @mode edit
* (Ed - PIBAALIAS) PIconfig> @istr alias,tag
* (Ed - PIBAALIAS) PIconfig> \\Reactor1\temperature,TIC:234531.PV
*> \\Reactor1\temperature,TIC:234531.PV
Delete Aliases
The following piconfig commands delete the temperature alias of Reactor1:
* (Ls - ) PIconfig> @table PIBAALIAS
* (Ls - PIBAALIAS) PIconfig> @mode delete
* (Dl - PIBAALIAS) PIconfig> @istr alias
* (Dl - PIBAALIAS) PIconfig> \\Reactor1\temperature
*> \\Reactor1\temperature
All batch data for all units is stored in the Data Archive. When a unit is created, it is assigned
a unique Archive point named pibaN, where N is the unit’s unique integer ID, for storing
batch data specific to that unit. Each completed batch consists of two events written to the
appropriate pibaN point: an event at the start time of the batch with a System Digital State of
ActiveBatch; and an event at the end time of the batch with the actual batch data stored as a
Blob object.
Attribute Definition
UnitName The name of the unit associated with a batch. In
searches, the wildcard search string for unit
names.
NEWUnitName This attribute is not supported.
BID The name or identifier of a batch. This is evaluated
when a batch starts (+ evaluation delay).
BIDsearch The wild card search string for BatchIDs.
Count The maximum number of batches to retrieve in a
search. If not specified, the default number of
batches returned is 50.
Page 250
6.4 - Batch Data Information
Attribute Definition
Handle The unique identifier for a single batch. The format
is the following: <uniqueID>-<StopTime in UTC>.
The unique ID is the same integer (N) used in the
name pibaN of the unit's Archive point.
ProdID The name or identifier of a batch's product. This is
evaluated when a batch starts (+ evaluation delay).
ProdIDsearch The wild card search string for ProductIDs.
SearchStart The start time of a search.
SearchStop The end time of a search.
StartStatus An integer indicating the status of a batch's start
time: 0 = Not Set; 1 = Unknown; 2 = OK.
StartTime The time a batch started.
StopStatus An integer indicating the status of a batch's end
time: 0 = Not Set; 1 = Unknown; 2 = OK.
StopTime The time a batch completed.
Create Batches
New batches may only be created for existing units, and the start and stop times are subject to
the following three conditions:
The start time must be before the stop time.
The time span of the batch must not overlap an existing batch on the same unit.
There must be a registered Archive that covers the time span of the batch.
BID and ProdID are optional but typically very useful attributes. A Handle should not be
specified, for it will be generated. The following piconfig commands will create a batch for
TestUnit2:
* (Ls - ) PIconfig> @table pibatch
* (Ls - PIBATCH) PIconfig> @mode create
* (Cr - PIBATCH) PIconfig> @istr unitname,bid,prodid,starttime,stoptime
* (Cr - PIBATCH) PIconfig> TestUnit2,"Batch-1","Prod-1","24-Dec-05
04:00","24-Dec-05 08:00"
*> TestUnit2,"Batch-1","Prod-1","24-Dec-05 04:00","24-Dec-05 08:00"
List Batches
Recall that the following five attributes can be specified as search input to narrow the list of
batches: UnitName, BIDSearch, ProdIDSearch, SearchStart, and SearchStop. A typical
search will specify at least UnitName, SearchStart, and SearchStop. The following
piconfig commands will list all batches for TestUnit2 since December 1, 2005:
* (Ls - ) PIconfig> @table pibatch
* (Ls - PIBATCH) PIconfig> @mode list
* (Ls - PIBATCH) PIconfig> @ostr unitname,bid,prodid,starttime,
stoptime,handle
* (Ls - PIBATCH) PIconfig> @ostr ...
* (Ls - PIBATCH) PIconfig> @istr unitname,searchstart,searchstop
* (Ls - PIBATCH) PIconfig> TestUnit2,1-dec-05,*
*> TestUnit2,1-dec-05,*
TestUnit2,Batch-1,Prod-1,24-Dec-05 04:00:00,24-Dec-05 08:00:00,35-
1135440000
TestUnit2,Batch-2,Prod-2,24-Dec-05 08:01:00,24-Dec-05 12:00:00,35-
1135454400
* End Repeat...
Note: The command @ostr … is required to force the output of multiple batches.
Without this command, only the first batch that matches the input criteria will be
output.
When listing batches, the Count attribute must also be taken into consideration. If Count is
not specified in the input structure, then a maximum of 50 batches will be output.
For user convenience, the installed piconfig script \PI\adm\pibalist.dif specifies the same
attributes in the input and output structures as those used in the above example, the typical
search.
Edit Batches
Any combination of the following four batch attributes may be edited: StartTime,
StopTime, BID, ProdID. Modification of StartTime or StopTime is subject to the same
three conditions identified in Create Batches, and if the time modification is valid, the
respective time status attribute will always be set to 2 = "OK".
In addition to the attributes that will be modified, the batch Handle must also be specified to
uniquely identify the target batch for modification. Because a Handle encapsulates
StopTime, modification of StopTime will render that batch Handle obsolete after the edit.
The following piconfig commands modify the BID and StopTime of the last December
batch for TestUnit2:
* (Ls - ) PIconfig> @table pibatch
* (Ls - PIBATCH) PIconfig> @mode edit
* (Ed - PIBATCH) PIconfig> @istr handle,bid,stoptime
* (Ed - PIBATCH) PIconfig> 35-1135454400,"Batch-2Mod","24-Dec-05
14:00:00"
*> 35-1135454400,"Batch-2Mod","24-Dec-05 14:00:00"
Page 252
6.5 - Batch Subsystem Operation
Delete Batches
As when editing batches, the Handle must be specified when deleting batches. After a delete,
the Handle will always be rendered obsolete. No other attributes need to be specified. The
following piconfig commands delete the last December batch for TestUnit2 (note the Handle
changed after modifying StopTime in the Edit Batches example):
* (Ls - ) PIconfig> @table PIBATCH
* (Ls - PIBATCH) PIconfig> @mode delete
* (Dl - PIBATCH) PIconfig> @istr handle
* (Dl - PIBATCH) PIconfig> 35-1135461600
*> 35-1135461600
The following sections describe the primary operating tasks of the Batch Subsystem.
Other than with piconfig, read-only programmatic access to the batches created by the Batch
Subsystem is available directly with the PI-API. Read-only programmatic access is also
available via the PI-SDK, but only if the units are first registered with the Batch Database;
this registration procedure is detailed in the document PI Batch Database Support of the PI
Batch Subsystem.
The only API-based client application is the PI BatchView add-in for Excel, but of course,
custom API applications can always be written. All other client applications such as
BatchView for PI ProcessBook or the stand-alone BatchView Quick Search are SDK-based
applications, and therefore require unit registration with the Batch Database. See
corresponding user guides for more information.
Installation of the Batch Subsystem does not result in the creation of any units or batches. The
installed piconfig script \PI\adm\pibatch.dif creates a sample unit and enable the automatic
creation of sample batches. Of course, the actual configuration and batch data is contrived,
but the example provides a complete functional overview of the Batch Subsystem.
Before executing the script, ensure that the Batch Subsystem and all other PI Server
subsystems are fully started. To execute the script, simply enter the following at a command
prompt after changing to the \PI\adm directory:
piconfig < pibatch.dif
The script first creates two digital sets to model BatchIDs and ProductIDs and two digital
tags, one assigned to each set, to be used in the BIDExpr and ProdExpr attributes of the
sample unit. These digital tags are configured to be serviced by the Random Simulator
Interface (executable name: random), a default interface distributed with all PI Servers, so
this interface also needs to be configured and started for the example to work properly.
The script then creates a single sample unit named Reactor1 using the default point
BA:Active.1 as the batch activation tag. If the default points were not created at PI Server
installation time, then they can be created manually by executing the following at a command
prompt after changing to the \PI\adm directory:
piconfig input defaultpt.dif input defaultpt.dat exit
BA:Active.1 is serviced by the Ramp Soak Simulator Interface (executable name: rmp_sk),
another default interface distributed with all PI Servers, so this interface also needs to be
configured and started for the example to work properly.
The script finishes with the creation of a few aliases–Temperature, Level, and Concentration–
using other default points–BA:Temp.1, BA:Level.1, and BA:Conc.1, respectively.
If the script executed without errors and all the simulator interfaces are running, a new batch
for Reactor1 should be created approximately every 81 minutes.
Page 254
Chapter 7. PI TOTALIZER SUBSYSTEM
Totalizer allows you to perform certain calculations on a point in the Snapshot, and to store
the results in another point. The process is called postprocessing. Postprocessing includes the
following types of summary calculation:
• Total
• Average
• Minimum
• Maximum
• Range
• Standard Deviation
• Median
Additionally, Totalizer permits the counting of update events for a point. The types of
counting allowed are as follows:
• All Events
• Event Equal To a value
• Event Not Equal To a value
• Event Greater Than a value
• Event Greater Than or Equal To a value
• Event Less Than a value
• Event Less Than or Equal To a value
• Event change from Greater Than or Equal To to Less Than
• Event change from Less Than to Greater Than or Equal To
The Totalizer is a dedicated subsystem, pitotal. This subsystem signs up for exceptions,
which means that it is notified when a new value is added to the Snapshot for any of the
points to be postprocessed. After postprocessing, values, for example, average, total, or time
in state, are sent back to the PI Snapshot.
Note: Since pitotal uses Snapshots of the data, postprocessing uses uncompressed
data. Its results are more accurate than those computed later from values in the
archive.
ExDev
ExMin
ExMax
Page 256
7.1 - Totalizer Subsystem Overview
The values are sent to the Snapshot if they pass the exception test defined by the ExDev,
ExMin and ExMax attributes. In Figure 7–2, 10 of the 28 values fail the exception test and
are not sent to the Snapshot. The Totalizer utilizes the 18 values that are left for the
evaluation. On the other hand, the Performance Equation Scheduler uses the compressed
values (if compression is on). Figure 7–2 shows the difference in the resultant time-weighted
calculation for the Totalizer and the Performance Equation Scheduler.
Region considered in
Time-Weighted calculation
using Compressed Values
Figure 7–2. Time Weighted Calculation for Totalizer and Performance Equation
The region considered for the calculation is the area under the curve created by connecting
the 18 values left from the exception test. On the other hand, the region considered by the
Performance Equation calculation would be the area under the curve that is created by
connecting the six points that are left after the compression test. In general, the difference in
accuracy between the two calculations is about 1 to 2.5 percent.
The Totalizer may also be more efficient in many cases, especially when the summary
interval is large. Consider a year-to-day calculation. If the calculation is implemented as a
performance equation, the Archive data from the beginning of the year to the current time
needs to be retrieved to carry out the calculation. On the other hand, if the calculation is
implemented as a Totalizer point, then only the new Snapshot event is needed to do the
calculation.
Totalizer is very flexible, offering a wide range of operating modes. The behavior of a
particular point is primarily determined by five multiple-choice parameters:
Not counting the behavior influences of the Rate Point Data Type and Step parameter, the
number of combinations of the five parameters is 12,000 (5 x 5 x 6 x 16 x 5). However, not
all of the combinations are allowed. For example, a point that is computing a total with a
TotalCloseMode option of Forever does not allow the ReportMode of PeriodEnd because
the totalization cannot stop at the end of the period. The combinations of the allowed cases
are described later in this chapter.
Page 258
7.2 - Totalizer ConfigurationOverview
Figure 7–3 shows a flow diagram for the steps that are involved in creating a Totalizer point.
TotalCloseMode
- Schedules the time for the
reset of the accumulation and
when the value is set to PI
Filter Expression Snapshot
- Filters out the values
sent to the accumulation
Function/
ReportMode
CalcMode
RateSampleMode - Determines
Source - Determines Totalizer
- Determines the manner in
Tag the type of Tag
the type of which the result
calculation that
sampling is sent to PI
is done for the
Snapshot
accumulation
Filtering
Each point may have one filter expression. This expression is evaluated each time that a new
update value is received for each tag referenced in the expression. The results are stored in
time order until the next rate point value is received.
Accumulation
The accumulation step takes the previous and current rate point values into account when
adding to the accumulators. If a filter is specified, the stored filter expression results are also
considered. The details of the accumulation depend on the specified functions. The available
functions are: total, average, minimum, maximum, range, standard deviation, count (of
digital states), and timer.
Accumulation Interval
The accumulation interval is the interval of time for which a postprocessing calculation
occurs. Totals are often generated for intervals specified by a period and an initial start time.
Alternatively, the interval may be defined by external events using a trigger expression in PE
form.
Output
The output of the results is usually reported at the end of the accumulation interval. The
output can also be estimated before the completion of the accumulation interval. A running
result is also available.
The points to which the Totalizer writes its postprocessed values must be of the Totalizer
Point Class. This class has both Base and Totalizer attributes. Table 7–2 lists the additional
attributes in the Totalizer Point Class attribute set. These Totalizer-specific parameters drive
the totalization process.
The data types for the five major attributes, RateSampleMode, TotalCloseMode,
ReportMode, Function, and CalcMode as well as the SourceTag, Options, and CompVal,
are strings and are not case-sensitive. The filter and event expressions use the Performance
Equation syntax. Period, Period2, Offset and Offset2 are relative timestamps while the rest
of the attributes are real numbers.
Page 260
7.3 - Totalizer Point Class Attributes
Page 262
7.3 - Totalizer Point Class Attributes
7.3.1 SourceTag
The SourceTag attribute specifies the rate point, which is the primary input for the
postprocessing. This rate point must already exist and must be specified when the Totalizer
point is configured. The rate point may be any numeric, digital, or string point types. The
value and timestamp used in the postprocessing calculation is taken when an update of the
rate point arrives.
7.3.2 RateSampleMode
The RateSampleMode attribute specifies when the individual values from the rate point will
be used in the calculation or will be added to the accumulation. The default option for the
RateSampleMode is Natural.
Natural (default)
Natural is the default and most common option. Figure 7–4 shows the update values of the
rate point. The values that are considered in the postprocessing calculation are the update
values that lie within the accumulation interval.
Accumulation
Interval
Depending on the other attributes such as the TotalCloseMode, ReportMode, Function, and
CalcMode, the calculation of the result may or may not involve the update values of the rate
point outside the accumulation interval. These features are discussed later in the chapter.
Scan1
Scan1 uses the attributes Period2 and Offset2 to sample the rate point at evenly spaced time
intervals. Values that lie within two updates of the rate point values are linearly interpolated.
Hence, Scan1 does not compute the completed results until the rate point after the
accumulation interval end time, as shown in Figure 7–5.
Accumulation
Interval
The values used in the calculation are the interpolated values at the timestamps set using
Period2 and Offset2. Also, note that the sample rate may or may not coincide with the
postprocessing period. For digital point counting, the digital state does not change until the
update event of the rate point is a different digital state. Hence, Scan1 will be similar to Scan2
in that the digital state at a particular scan of the rate point will be the last seen digital state of
the rate point.
Scan2
Scan2 is like Scan1 in that it also samples at evenly spaced time intervals using the attributes
Period2 and Offset2 except that sampled values are calculated from the last seen event. The
value is projected almost as though the Step option was set. Scan2 performs similarly to
Scan1 when counting digital states, as shown in Figure 7–6.
Page 264
7.3 - Totalizer Point Class Attributes
Accumulation
Interval
Event
Event uses the event expression specified in the EventExpr attribute to determine when to
sample the rate point. Sampling occurs when there is a change in the value of the event
expression, as shown in Figure 7–7.
Accumulation Interval
The values used in the calculation are linearly interpolated between values of the rate point
and timestamped at the time when the value of the event expression changes. Event performs
similarly to Scan1 in counting digital states.
7.3.3 TotalCloseMode
The option set in the TotalCloseMode attribute determines the accumulation interval. The
Totalizer functions accumulate data over the accumulation interval. The calculation is “closed
out” at the end of the accumulation interval and the “next event” occurs.
Note: “Closed out” means that the result is calculated and reported and the internal
state of the accumulation function is reset. The “next event” refers to either a value of
the rate point updating or an event from the event expression or the filter expression
for the Totalizer point being updated.
Clock (default)
In TotalCloseMode of Clock, the Totalizer runs and resets at regular time intervals. The
times are specified through two attributes, Period and Offset. Period is the length of each
accumulation interval. Offset specifies the start of the first interval. The accumulation begins
at the start of the day on which the Totalizer is started plus the amount of time given in the
Offset parameter. Period is a relative time of any length. Clock is the default setting for this
option.
The Period parameter may be specified as local time or UTC (Universal Coordinated Time).
Periods longer than one hour that have no specifier are assumed to be local time. This allows
totalization intervals to start at the same time every day even when the clocks are reset for
Daylight Savings Time.
The Offset is a relative timestamp that is less than the Period. Figure 7–8 shows an example
of the Clock option of the TotalCloseMode.
Accumulation
Interval Values of rate point
Event from
EventExpr
Event from
FilterExpr
In this example, although the accumulation ends, the actual close of the accumulation does
not occur until the rate point updates. This event can occur well after the end of the
accumulation interval. When the update event occurs, the calculated result is written to the
Archive with timestamps of the actual totalization interval.
Page 266
7.3 - Totalizer Point Class Attributes
For the RateSampleMode of Scan2, the close out of the accumulation occurs at the first
update event at or after the end of the period. In Natural, Scan1 and Event, the closeout of the
accumulation occurs only when the rate point value updates.
EventChange
This option connects the totalization period to external events. It requires a valid event
expression be defined in the EventExpr attribute. The current accumulation will end and
reset whenever the result of the event expression is different from that of the previous event
expression calculation.
If the expression includes PI tags referencing the Snapshot, it is evaluated on a natural
schedule. That is, it is recalculated whenever there is a new update for any of the tags.
Expressions that do not reference Snapshot values are evaluated at times specified by the
period and offset parameters but only when rate tag events beyond these times have been
received. PI time functions may be used in these expressions to establish many useful
intervals.
A naturally scheduled expression is only evaluated as each update is received for the real PI
tags in the expression. The times of these events are used in the evaluation of any time
functions in the expression. Tags that come from the same source (interface or remote PI
system) as that of the rate tag should be used to assure synchronization of these critical timing
events. The Option, CloseAtEvent may be used to force prompt closing of the Totalizer at the
period end time. Time-weighted totals will assume the rate tag to be constant at the last value
observed to the end of the period.
Expressions that contain no PI Snapshot references are evaluated at times specified by the
Period and Offset parameters. These calculations are only performed when new updates on
the rate tag are received. As each rate tag update arrives, its timestamp is compared with the
next time the expression is due for calculation. If the due time is prior to the event timestamp,
the expression is evaluated before the new event is fully processed.
Accumulation
Interval
Time at which
result sent to PI
Event from EventExpr SnapShot for Time at which
RateSampleMode result sent to PI
of Scan2 and Snapshot for
Event RateSampleMode
of Natural and
Scan1
As shown in Figure 7–9 for Natural and Scan1, the result of the accumulation will be delayed
and not be sent to PI Snapshot until an update for the rate point is observed. If the event
expression does not contain a point but only a time function, it will also be evaluated with the
RateSampleMode of Natural based on the rate point.
EventTrue
This option also requires a valid event expression to be defined in the EventExpr attribute. In
this case, as shown in Figure 7–10, an accumulation interval is started when the event
expression result is evaluated to be non-zero. Accumulation will continue until the event
expression is evaluated to give a zero result, at which point the Totalizer is closed out and
placed in a non-calculating state. The Totalizer point will be marked with the system status
condition “Good-Off” to indicate that no postprocessing data will be available for the
interval.
The times at which the event expression is evaluated is different depending on whether or not
a tag is specified in the event expression. See the description of the EventExpr attribute for
details about when the EventExpr is evaluated.
Interval
Accumulation Accumulation
Labeled as
Interval #1 Interval #2
Good-Off
Similar to EventChange, the time at which the results are sent to PI Snapshot for
RateSampleMode of Scan2 and Event is when the event expression is equal to zero and
closes out the accumulation. The time at which RateSampleMode of Natural and Scan1
closes out the accumulation is when an update from the rate point occurs.
NSampleMoving
The accumulation interval is defined as the time required to sample the rate point a specified
number of times. The actual time will be based upon the RateSampleMode and the filter
expression. The number of values used in the calculation for this TotalCloseMode option is
set in the MovingCount attribute. The NSampleMoving option only supports the
ReportMode option of Ramping.
Page 268
7.3 - Totalizer Point Class Attributes
Figure 7–11 shows two accumulation intervals with the MovingCount set to 3. Also, a filter
expression is used to limit the values of the RateSampleMode option of Natural used in the
accumulation.
Accumulation Interval #2
Accumulation Interval #1
The accumulation waits for the number of inputs defined by MovingCount and then
performs the calculation and sends the results to PI Snapshot. As a new sample arrives, the
value at the beginning of the accumulation is left out to incorporate the most recent value and
a new result is calculated and posted. In the above example, the values that are used do not
include the values excluded by the filter expression. For the RateSampleMode of Scan1,
Scan2, and Event, values that are included in the accumulation are interpolated from the
values of the rate point.
Figure 7–12 shows an example of RateSampleMode of Scan1 with a filter expression.
D
B E
C
Due to the configuration of the scan rate, the number of accumulations for the same number
of updates for the rate point doubles to four intervals. In the figure, the update values from the
rate points labeled as A and C are used to generate three interpolated values. Although the
update of the rate point C is within the time when the filter expression is true, it is used as a
reference point to generate interpolated values from update rate point values labeled as A and
C and also from C to E. Notice that the interpolated values (labeled as B and D) that occurred
when the filter expression was used, were excluded. Furthermore, in this example, the times
at which the results are sent to the Snapshot are at updates of the rate point.
NSampleBlock
The accumulation interval is defined as the time required to sample the rate point a specified
number of times. The actual time will be based upon the RateSampleMode and the filter
expression. The number of values used in the calculation for this TotalCloseMode option is
set in the MovingCount attribute. With NSampleBlock, the accumulation is in blocks of
events. The NSampleBlock option only supports the ReportMode option of PeriodEnd.
Figure 7–13 shows three accumulation intervals with the MovingCount set to 3. Also, a filter
expression is used to limit the values of the RateSampleMode option of Natural used in the
accumulation.
Page 270
7.3 - Totalizer Point Class Attributes
The accumulation waits for the number of inputs defined by MovingCount and then
performs the calculation and sends the results to PI Snapshot. In the example (Figure 7–13),
the values that are used do not include the values excluded by the filter expression.
Accumulation Interval #1 shows the first accumulation interval after the start of the Totalizer,
the accumulation interval starts at the time of the first event and closes at the time of the last
event. The next accumulation level starts after the end of the prior accumulation interval and
stops after three new events (which are not filtered) are processed. Notice that this second
accumulation interval and subsequent accumulation intervals will all start at one second after
the close of the prior interval.
TimeMoving
This option is similar to the previous case except the time for accumulation is specified
rather than the number of samples. The accumulation time is specified in the Period attribute.
As a value for accumulation is received, the Totalizer goes back a certain amount of time that
is specified by the Period parameter and checks to see if the Totalizer has started or that the
rate point has been created for postprocessing. If either of the conditions is not true, then the
point is entered into a circular queue. When conditions (start of Totalizer and point created
for rate point) are true, then the accumulation interval is set and a value for the beginning of
the period is interpolated between two update values of the rate point.
Figure 7–14 demonstrates the beginning of a TimeMoving accumulation. In this example, the
first accumulation interval does not begin until the fourth update of the rate point because the
fourth point is the first instance where the accumulation interval does not extend to the start
of the Totalizer.
Start of Totalizer
Accumulation
Interval
Filter Filter
The shaded region represents the area under the curve for which postprocessing for the
CalcMode option of TimeWeighted is calculated. This is discussed in CalcMode on page
277. In another example, the RateSampleMode is Scan2 whereby the value of the last update
of the rate point is used as 0the interpolated value.
At this update of rate points Time at which result
Accumulation Interval still sent to PI SnapShot
goes beyond start of Totalizer for Accumulation
Interval #2 is at
update of rate point
Accumulation
Start of Totalizer Interval #2
Accumulation
Interval #1
Since the interpolated values of the rate point depend only on a prior update of the rate point,
the scan rate of the filter expression is also important. In the figure above, the time at which
Page 272
7.3 - Totalizer Point Class Attributes
the results for accumulation interval #1 is at the natural scan rate of the filter expression and
does not need to be delayed to the time of the update of the rate point. For this example, if the
filter expression did not exist, then both the results from accumulation interval #1 and #2
would have been sent to the Snapshot at the update of the rate point. The start of the Totalizer
is when the Totalizer Subsystem begins. If the file, pilasttot_T.dat does not exist in the pi\dat
directory, the start of the Totalizer would be at the time when the Totalizer last started. If the
file does exist, then the start of the Totalizer is at the time specified in the pilasttot_T.dat. The
only valid option for the ReportMode attribute is Ramping.
Forever
In this mode, the Totalizer never resets. When restarted, it continues from the value found in
the resultant point. This option works for total and all of the count and timing functions.
Some external force may change the Totalizer point only if the Option point attribute is set to
Setable. In this event, the new value will be used as the base for the next Totalizer result. The
only valid option for ReportMode is Ramping. The only functions allowed are Total,
Maximum, Minimum and event counting functions.
7.3.4 ReportMode
The option set in the ReportMode attribute specifies the manner in which the Totalizer
results will be sent to the PI Snapshot. Table 7–3 lists the allowed combinations of
TotalCloseMode and ReportMode where ‘X’ denotes the allowable option.
EventChange X X X
EventTrue X X X
NSampleMoving X
NSampleBlock X
TimeMoving X
Forever X
PeriodEnd
No output is reported until the end of the accumulation period. At that time, the Totalizer
sends the calculated result twice by default. The value is sent once with a timestamp of the
start of the accumulation period plus one second, and again with a timestamp at the end of the
accumulation interval. The result on a trend display in PI ProcessBook is a horizontal line of
the result value through the period of the totalization. An Archive query for the result will
return the same value any time during the period. The Option parameter may be used to
change the default to write a value only at the beginning of the period (OneAtStart) or only at
the end of the period (OneAtEnd).
Ramping
The Ramping option result is a running result that is sent to PI Snapshot when an update
event occurs. Using the Function option Total with Ramping will result in a sawtooth trend
on a trend display that ramps up and then resets.
Running (default)
The Running option result is output to the PI Snapshot as each rate point event is received. It
is sent with a timestamp of one second into the current totalization period. If the Archive
compression specification CompMin is set to one second, the successive values will not be
recorded in the Archive, but will be available for display. Running is the default setting for
ReportMode.
RunEstimate
A new result is sent to the PI Snapshot as each rate point event is processed. The value is an
estimate of the result if the rate point were to hold steady at its current value. RunEstimate
can only be used for the Function option of Total.
RunEst2
A new result is sent to the PI Snapshot as each rate point event is processed. The value is an
estimate of the result if the rate point were to hold steady at the average observed so far in
this accumulation interval. RunEst2 can only be used for the Function option of Total.
7.3.5 Function
The combination of Function and CalcMode parameters defines the primary behavior of a
Totalizer point. The first seven Function options (Total, Average, Minimum, Maximum,
Range, StdDeviation, and Median) are intended for use with numerical rate points only. The
first two CalcMode options (TimeWeighted and EventWeighted) define the kind of
accumulation.
The remaining functions ("Events:" EventEQ, EventNE, … ) are for counting events and are
primarily intended for use with digital rate points. Besides the Function option of Events,
they compare the rate point value to the CompValue parameter, which is expected to be the
text of a digital state. They will also work with numeric points and a valid number in
CompValue. Each is a counter for a CalcMode of AllEvents or ChangeEvent. The result is a
time when the CalcMode is TimeTrue. Internally, the time is accumulated in seconds. The
result is multiplied by the Conversion parameter before being sent to the PI Snapshot.
Table 7–4 shows the allowed combinations of Function and CalcMode options where X
denotes the allowed combinations.
Page 274
7.3 - Totalizer Point Class Attributes
Minimum X X
Maximum X X
Range X X
StdDeviation X X
Median X
Events X X
EventEQ X X X
EventNE X X X
EventGE X X X
EventGT X X X
EventLE X X X
EventLT X X X
EventGE_LT X X X
EventLT_GE X X X
Total (default)
The result is the totalization of the rate point value. If CalcMode is EventWeighted, this is the
sum the values from the individual rate point value update events. TimeWeighted uses
trapezoidal integration to produce the total. Caution should be used in choosing the
RateSampleMode option. If the goal is for a total of the values of a rate point, the Natural
option should be used. The other RateSampleMode options will extrapolate values from
defined time points and may lead to incorrect totals.
Average
The result is the average of the rate point value. If the CalcMode is EventWeighted, the
average is the totaled individual update events and divided by the number of events. The
CalcMode option of TimeWeighted considers the time between events, dividing by the area
under the curve by the time interval.
Maximum or Minimum
The result is the maximum or minimum observed value of the input. If the CalcMode is
EventWeighted, the result will be one of the input values. If there is a filter expression active
and the CalcMode is TimeWeighted, the result may be an interpolated value corresponding to
the time when the filter changed state.
For TotalCloseModes of NSampleMoving and TimeMoving, a sorted list of all of the values
seen during the period is maintained.
Range
The result is the difference between the maximum and minimum observed values of the
input. If the CalcMode is EventWeighted, the result will be one of the input values. If there is
a filter expression active and the CalcMode is TimeWeighted, the result may be an
interpolated value corresponding to the time when the filter changed state.
For TotalCloseModes of NSampleMoving and TimeMoving a sorted list of all of the values
seen during the period is maintained.
StdDeviation
The result is the standard deviation of the observed data. Both time- and event-weighted
forms are available.
For TotalCloseModes of NsampleMoving, an array of intermediate results is kept.
StdDeviation is not supported for TotalCloseMode option of TimeMoving with CalcMode
option of EventWeighted.
Median
The Median value is the middle observed value of the input. If there is an even number of
values in the sample, an average of the center two is selected. Using Median with a short time
interval can be very effective as a filter for noise removal.
For TotalCloseModes of NSampleMoving and TimeMoving a sorted list of all of the values
seen during the period is maintained.
The following Function options are used for counting and timing operations. The allowed
CalcMode options are AllEvents, ChangeEvents, and TimeTrue.
Events
This Function option counts all event updates of the rate point that pass exception handling
and the filter expression. The allowed CalcMode options are AllEvents and ChangeEvents.
Caution should be used if the RateSampleMode option is not Natural. Using the other three
Page 276
7.3 - Totalizer Point Class Attributes
options of the RateSampleMode with Events will result in counting the interpolated values
as event updates.
EventXX
The set of Function options denoted as EventXX (EventEQ, EventNE, EventGE, EventGT,
EventLE, and EventLT) is used to count the number of update events that pass exception
handling. The filter expression or is used to find the time that the value of the rate point meets
the condition of the Function. As rate point events are received, they are compared to the
value in CompValue parameter to produce a true or false result.
For CalcMode of AllEvents, true events are simply counted. ChangeEvents will only count
those events that have values different than the immediately previous event. Consecutive
events with the same value will be skipped. For the TimeTrue mode, the true event starts a
timer and a false event stops it.
EventXX_XX
The set of Function options denoted as EventXX_XX (Event LT_GE and EventGE_LT) is
used as transition counters. They are used to count the number of times the update events
(that pass exception handling and the filter expression) pass through the value set in the
CompValue attribute or are used to find the time that the value of the rate point meets the
condition of the Function. As rate point events are received, they are compared to the value
in CompValue parameter to produce a true or false result.
For CalcMode of AllEvents, true events are simply counted. ChangeEvents will only count
those events that have values different than the immediately previous event. Repeat events
with the same value will be skipped. For the TimeTrue mode, the true event starts a timer and
a false event stops it.
7.3.6 CalcMode
The value set in the CalcMode parameter modifies the Function parameter. The first two
options (TimeWeighted and EventWeighted) can only be used with math functions while the
last three (AllEvents, EventChange, and TimeTrue) can only be used with counting functions.
TimeWeighted
The time between input values is (default)considered in totalization and average functions.
This is the normal option for accumulating flow signals into totals for the period. Figure 7–16
demonstrates a time-weighted total for both RateSampleMode options of Natural and Scan1.
Accumulation
Interval
Figure 7–16. TimeWeighted Total for Natural and Scan1 with Step=0
In both cases, the total will be similar. The area considered for totalization is the shaded
region. Furthermore, if the Step attribute of the rate point is 0, then that indicates that the
values between the update points are interpolated. If the value of the Step attribute is 1, then
the Scan1 RateSampleMode is overwritten and the totalization would be as if Scan2 was the
intended option. Figure 7–17 shows the plots for a totalization for the RateSampleMode
options of Natural and Scan2 with the Step option set at 1.
Addition area that
is considered for
Accumulation RateSampleMode
of Natural and
Interval
Rate point step =
1
Figure 7–17. Time-Weighted Total for Natural and Scan2 with Step=1
When the Step attribute is “on” (equal to 1) then the value of the rate point remains the same
until a new update value is seen. This is similar to Scan2. For the example in the previous
figure, the totalization for Scan2 is shown in the shaded area. This, however, is different than
the area for Natural scanning with Step equal to 1. For this specific example, the totalization
Page 278
7.3 - Totalizer Point Class Attributes
considers both the two shaded patterned areas as well as the shaded area for Scan2. Even if
Step = 0 for Scan2, the totalization would be the same.
EventWeighted
Here each rate point value is taken to be a discrete addition to the accumulated result. Time
is not considered. Each event has the same weight. In the first example shown in Figure 7–18,
the RateSample mode is Natural and the Function is Total.
Accumulation
Interval
XB
XA B
A
Total = XA+XB
In this case the accumulation interval contained two updates of the rate point labeled as A and
B. Therefore, the result is the summation of the values (XA and XB) of the rate points.
In another example shown in Figure 7–19 the RateSampleMode is Scan1 and the Function
is Average.
XD
XC
Accumulation
XE Interval
XB
C D
XA E
B
A
EventWeighted XA+ XB + XC + XD + XE
Average =
5
Scan rate based
on Period2 and
Offset2 attributes
The scan rate generated five interpolated values labeled as XA through XE, and the average
would be the sum of the values divided by the number of interpolated events. Use caution if
you want to use the Function option of Total with EventWeighted and the RateSampleMode
options of Scan1, Scan2, and Event. In the above example, since the events were interpolated,
the total from the interval would be the summation from XA through XE.
AllEvents
With the Function option of Events, the CalcMode option AllEvents counts all value
updates. For the rest of the event functions that use the CompValue attribute for comparison
with the update value, this CalcMode option counts all the events for which the comparison
is true. This means that events that repeat the same value will be counted.
In Figure 7–20, the digital states can be represented on a timeline by plotting the digital state
offsets for the two digital states “on” and “off.”
Accumulation
Interval
Digital State Offset
OFF OFF
ON ON
For the Function of Events, the count for the accumulation interval is 2. If the Function is
EventEQ and the CompValue is “on,” then the result is 1. For functions such as EventGT, the
comparison is made based on the digital state offset. Since “on” has a lower digital state
offset value than “off” for this example, using EventGT would result in counting the “off”
event that occurred within the accumulation interval.
In another example shown in Figure 7–21, the RateSampleMode is Scan1. The value of the
digital state at the time set by the scan rate is the digital state for the last seen update event.
Hence, using Scan1 or Scan2 would be similar.
Page 280
7.3 - Totalizer Point Class Attributes
Accumulation
Interval
The result of Function option Events is 5 and the result of EventEQ is 3 and the result of
EventGT is 2.
ChangeEvents
In the event class of functions, the count is only those updates that satisfy the condition and
that were real changes of value. Therefore, the count represents not the update events but the
changes of the update events. For the example shown in AllEvents where the
RateSampleMode could be either Scan1 or Scan2, the result of the function option Events is
2 and the result of EventGT is 1.
TimeTrue
This CalcMode option results in the duration of the conditions to be accumulated. Internally,
time is accumulated in seconds. The result is multiplied by the Conversion parameter before
being sent to the PI Snapshot. For the Function of EventEQ and CompValue of “on”,
TimeTrue will find the time within the accumulation interval that the digital state was “on”.
7.3.7 ZeroBias
The value of the rate point will be considered to be zero if less than this value.
7.3.8 Period
The Period attribute is used by the TotalCloseMode option of Clock to set the accumulation
interval. It accepts relative timestamps. For example, ‘+1h’, ‘+30m’, and ‘+1d’ will set the
accumulation interval to one hour, 30 minutes, and one day, respectively.
Periods longer than one hour are understood to be in local (wall clock) time. That is, for
periods that evenly divide into 24 hours, the totalization times will be the same from day to
day as the system changes to/from Daylight Savings Time (DST).
Optionally, the time interval may be specified to be in local (wall clock) or UTC (fixed
period) terms. This is done by appending a /local or /utc to the parameter. Actually, only the l
or c is needed.
For example, ‘+8h /local’ specifies 8 hour shifts instead of absolute 8 hour periods. This
means that for the 8-hour totalization period that spans the time change from Daylight to
Standard, the actual period length would be 9 hours. When the time changes from Standard to
Daylight, the actual period would be 7 hours.
7.3.9 Offset
The relative timestamp set in the Offset attribute is used by the TotalCloseMode option of
Clock to determine when to begin the initial accumulation. The Offset is a relative timestamp
that must be less than the relative timestamp set in the Period attribute. For example, if
Offset is ‘+12h’ and Period is ‘+1d’, the Totalizer will begin the accumulation calculation at
noon on the day that the Totalizer starts and will accumulate data for a period of 24 hours.
7.3.10 MovingCount
The value in MovingCount attribute is used by the TotalCloseMode option of
NSampleMoving and NSampleBlock to determine the number of samples for the accumulation
interval.
7.3.11 Period2
The Period2 attribute is used by the RateSampleMode options of Scan1 and Scan2 to set the
sampling rate. It accepts relative timestamps. For example, ‘+1m’, ‘+30s’, and ‘+ 1h’ will set
the accumulation interval to one minute, 30 seconds, and one hour, respectively. The Period2
attribute also accepts the optional /local and /utc flags.
7.3.12 Offset2
The relative timestamp set in Offset attribute is used by the RateSampleMode option of
Scan1 and Scan2 to determine when to start sampling. Offset2 is a relative timestamp that
must be less than the relative timestamp set in the Period2 attribute. The Totalizer will use
the beginning of the day for which the Totalizer is started as the reference point for when to
account for Offset2 and move in intervals set by Period2 and sample at the next appropriate
beginning of a period. For example, if Offset2 is ‘+10s’, Period2 is ‘+1m’, and the start of the
Totalizer is at noon, the first sample will be taken at noon plus 10 seconds and the next
sample will be taken at 12:01:10.
7.3.13 PctGood
PctGood is a number between 0 and 100 (in percent). If rate tag values are bad for a larger
fraction of the totalization period, the output of the Totalizer will be marked bad.
Percent good is calculated based on the amount of time that the rate tag has a bad status over
the totalization period for TimeWeighted totals and for the event counting functions (Events,
EventEQ, EventNE, EventGE, EventGT, EventLE, EventLT, EventGE_LT, EventLT_GE) with
a CalcMode of TimeTrue.
Page 282
7.3 - Totalizer Point Class Attributes
Percent good is calculated based on the number of events that have a bad status for
EventWeighted totals and for the event counting functions with a CalcMode of AllEvents and
ChangeEvents.
In the case of TimeWeighted totals, the Totalizer adjusts the total to account for the missing
data. This extrapolation takes the resultant good data and divides it by the fraction of time
that the data was good. For example, if the total of the good data is 100 and the percentage of
the data that was good for the time period is 80%, then the total that is reported is 125. To
turn off extrapolation, set PctGood to 0. By setting PctGood to 0, the total that is reported
from the previous example would be 100.
7.3.14 Conversion
Conversion is a number that multiplies the raw Totalizer result. It is used to convert the
units of the rate tag to the proper units for the totalization.
For TimeWeighted totals, the total is computed with the assumption that the rate tag is in
“units/day.” If the units of the rate tag are not in units/day, then the units of the rate tag must
be converted to units/day using Conversion. For example, if the units of the rate tag are in
kg/hr (kilograms per hour) and the desired total is in g (grams), then Conversion must be set
to 2400. That is, (1 kg/hr) (24 hr/day)(1000 g/kg) = (2400 g/day).
For EventWeighted totals Conversion can be used to convert the units of the rate tag to the
desired units of the total. For example, if the units of the rate tag is in kilograms and the
desired total is in grams, then Conversion should be set to 1000.
Here are some typical conversion factors for common units.
7.3.15 FilterExpr
This is a mathematical expression in PI Performance Equation syntax. The expression is
compiled and given an initial evaluation based on the current Snapshot values of tags
referenced. It is re-evaluated whenever an update is received for any of its tags.
Rate tag point values are excluded from totalization during intervals that the expression result
is zero. That is, rate tag values for periods when the filter expression result is zero are not
included in the total. This behavior is consistent with the sense of filter expressions in PI-API
and PI DataLink. For averages, the time is also excluded from the calculation.
For efficiency of evaluation, Archive access functions are not allowed in filter expressions.
Archive access functions include such functions as TagVal and TagAve.
The rate point is not filtered when the status of the filter expression is bad. The filter
expression is likely to be bad whenever some of the input points for the filter expression have
bad status.
Refer to Chapter 2, PI Performance Equation, for more information about the syntax of the
expressions.
Some examples of filter expressions are as follows:
'DigitalTag'= "ON"
'RateTag' > 50
7.3.16 EventExpr
This is a PE expression that defines event times used by EventChange and EventTrue for
the TotalCloseMode options. It also defines the times at which the rate point is scanned for
the RateSampleMode option of Event. The expression is naturally scheduled. That is, it will
be evaluated whenever a new value is received for any of its input values.
Event expressions are normally evaluated as new values are received for the tags they
reference. For TotalCloseMode of EventChange and EventTrue, an event expression that
references no Snapshot tags will be evaluated at times specified by the Period and Offset
parameters. Each time a rate tag value is received, if the event expression due time has
passed, the rate tag value is evaluated prior to processing the new update value.
Some examples of event expressions are as follows:
'R-2410_mode'
'DigitalTag' = "ON"
int( ('*' - '1-jan-2001')/(7 * '+24h') )
7.3.17 CompValue
The value set in the CompValue attribute is used for comparison in all the event counting
functions (e.g., EventGE, EventLE) except the Function option Events because Events counts
all update events and does not need a comparison value. The CompValue should match the
data type of the rate tag. It may be a digital state name, string, or a number.
7.3.18 Options
This field allows for entry of zero or more option words to select lesser-used functions.
InFromTotalizer
This option is set if the rate point is actually the integral of the flow signal to be totalized.
This is intended for use with the typical DCS accumulator block. The DCS can easily process
the flow at a very high sample rate. The updates to PI can be set for relatively large exception
deviation values with negligible loss of accuracy. These DCS blocks typically have a rollover
at some finite value. As that total is reached, the block output drops to the bottom of its range
and accumulation continues. The Totalizer observes this large value jump and calculates the
correct increment from the configured full-scale value of the rate point.
Page 284
7.3 - Totalizer Point Class Attributes
UnderIsBad
Consider values below the rate point zero level to be bad. If this option is not set, values are
considered valid. Negative values are set to zero or used if enabled by the NoClampZero
option.
NoClampZero
Do not clamp the output of the Totalizer to be greater than zero. Without this option, zero is
substituted for negative rate tag values.
CloseAtEvent
The close out of the accumulation interval is at the end of the period and the result of the
calculation is sent to the Snapshot. For time-weighted calculations, the value used at the end
of the period is the value of the last seen update of the rate point. Figure 7–22 shows an
example of a time-weighted total with Scan1 and the CloseAtEvent option.
Accumulation
Interval
Time at which
Time Weighted Total for result sent to PI
RateSampleMode of Natural with SnapShot
step attribute of rate point = 0 and
Option of CloseAtEvent
Scan rate based
on Period2 and
Offset2 attributes
Setable
The TotalCloseMode of Forever can be changed by some external force only when the
option field is set to Setable. In this case, the new value will be used as the base for the next
Totalizer result.
OneAtStart
The TotalCloseMode of PeriodEnd can be modified to only send a value only at the
beginning of the period (one second after the close of the last period) when the option field is
set to OneAtStart. The default behavior of PeriodEnd is to send a value to the beginning and
the end of the period.
OneAtEnd
The TotalCloseMode of PeriodEnd can be modified to only send a value at the end of the
period when the option field is set to OneAtEnd. The default behavior of PeriodEnd is to send
a value to the beginning and the end of the period.
UnderIsZero
Some external systems have limited ranges for measured values but are able to report that the
signal is below the available range. This option causes the Totalizer to use the rate tag zero
value in place of updates with UnderRange status.
OverIsTop
Some external systems have limited ranges for measured values but are able to report that the
signal is above the available range. This option causes the Totalizer to use the rate tag top of
span value in place of updates with OverRange status.
SourceStat
When the PctGood minimum is not attained, the Totalizer normally reports “bad total” as a
status. With this option, a bad status actually received from the source tag will be used
instead. This supplies some reason for the failure to someone looking only at the Totalizer
results.
LimitBack
When LimitBack is set, the number of totalization periods that will be reported between
source tag events is limited to twenty. This is a partial solution to the problem some systems
encounter when restarting after being down for some time. The Totalizer may attempt to
write results for all of the totalization periods for the period when the system was down.
Totalizer points can be created in the same manner as other point types except that Totalizer
point attributes includes the Totalizer attributes as well as the point attribute for the Base
point class.
Page 286
7.4 - Build Totalizer Points
7.4.2 PI TagConfigurator
The easiest way to build many Totalizer points is using the PI TagConfigurator tool. See the
OSIsoft support Web site to download this tool. An example is shown in Figure 7–23.
Note: under Export Tags of the PI SMT pull-down menu, the Point Class must be
Totalizer.
7.4.3 Piconfig
Alternatively, you can use the following script in the piconfig utility to create the same
Totalizer point:
@table pipoint
@ptclass totalizer
@mode create, t
@istru tag, pointsource, sourcetag, ratesamplemode, totalclosemode,
reportmode, function, calcmode
totnumtag, T, sinusoid, natural, clock, periodend, total, eventweighted
@ends
7.5.1 Startup
The pitotal program is started with the rest of the system. The program periodically writes
its internal status to the file PI\dat\pilasttot_T.dat. This file is also written during a normal
system shutdown. At startup, pitotal looks for this file. If it is not found, all Totalizer points
are initialized to start at the current time without consideration of any prior history.
If the pilasttot_T.dat file is found, it is read to obtain partial accumulation results to include
when restarting points. For the most part, all points with simple time-based scheduling will be
able to restart. If the accumulation interval that was in progress when the file was written has
expired, an attempt is made to close that total and a shutdown event will be written after it.
Otherwise, the accumulation is restarted with the assumption that no data points have been
lost. If any point appears to have shutdown events after the time of the pilasttot_T file, then
restart is canceled in favor of total cold start. Points that are event-scheduled have no basis to
know if restart is valid. Shutdown events are written and the point is cold-started.
Any point that has been reconfigured while pitotal was offline would be cold-started. Point
Database edits may result in a re-initialization of the point. This will occur when a significant
parameter change is made.
The Totalizer can nominally do all the operations that the PI for OpenVMS version could do
and more. Simple time-based points should port with no difficulty. However, the advanced
Totalizer algorithms depend on very specific behavior of underlying implementations that are
quite different. Any PI for OpenVMS points that use filter and event expressions will need
special attention.
The following are known differences:
The meaning of the filter expression result has been reversed to match the logic of the
API. Now, input values are ignored (filtered out) when the filter expression result is
zero.
Page 288
7.6 - PI for OpenVMS Upgrade Considerations
The Performance Equation syntax used in the event and filter expressions is different.
The largest difference is the absence of a formula library in PI Server. See Chapter 2,
PI Performance Equation, for further details.
New functions are available for counting and timing of events. Use of these functions
may enable the elimination of many event and filter expressions.
The use of PI for OpenVMS option of moving Totalization with event- and clock-
scheduling is not supported.
CalcMode EventWeighted
Moving Natural RateSampleMode Natural
TotalCloseMode NSampleMoving
ReportMode Ramping
CalcMode TimeWeighted
Clock Not Supported
Event Not Supported
Demonstration points for the Totalizer subsystem are available in the pi\adm directory in the
totalizerpts.dif file but are not automatically created when the system is installed. These
Totalizer demonstration points can be created by redirecting the file to the piconfig utility.
See Chapter 11, The Piconfig Utility, in the PI Server System Management Guide for
information about using the piconfig utility.
$ piconfig < totalizerpts.dif
Page 290
Chapter 8. PI ALARM SUBSYSTEM
The PI Alarm Subsystem (PI Alarm) provides the capability to establish alarms for PI
points. PI Alarm allows you to track, manage and acknowledge alarm conditions caused by
processes that exceed user-specified parameters.
PI Alarm can monitor many variables such as temperatures, volumes, flow rates, product
quality or raw material consumption. Alarms can be triggered by the duration of an event or
deviation from norm.
PI Alarm keeps a constant eye on process conditions. PI Alarm will assess the condition as
well as the priority of an event, as you define it. Depending on the longevity and/or severity
of the event, it can notify specific personnel. PI Alarm includes client functionality through
the PI-API to alert operators to selected alarms.
Data from PI Alarm are displayed in its companion client application, PI AlarmView. Alarm
conditions are historized together with an acknowledgement status. When Real-Time SQC
perceives an unacceptable deviation in the process, PI SQC Alarms alert the appropriate
personnel.
This chapter includes the following topics:
Section 8.1, Alarm Subsytem Overview, on page 292
Section 8.2, Alarm Point Configuration, on page 294
Section 8.3, Alarm State Sets, on page 308
Section 8.4, Alarm Groups, on page 312
Section 8.5, Build Alarm Points, on page 314
Section 8.6, Build Alarm Group Points, on page 315
Section 8.7, Override Default PointSource Values for Alarms, on page 316
Section 8.8, Build Alarm Digital State Sets, on page 317
Section 8.9, Program Operation, on page 319
Section 8.10, PI for OpenVMS Upgrade Consideration, on page 321
Section 8.11, Alarm State Set Encoding and Decoding, on page 321
A PI System often brings together information from several sources and can perform
calculations that are not easily done elsewhere. Some sites may have alarm philosophies that
enable them to take advantage of the PI System to provide alerts on these higher level
functions.
PI Alarm provides the basic server-side functions of an alarm system. The alarm package
includes the following features:
• Current and archived Alarm States.
• Alarm Groups to organize and manage alarms
• A simple alarm detection program for monitoring numeric, digital, and string
points.
• Alarm client functionality available through the PI-API to alert operators to
selected alarms.
The alarm package is organized into two categories.
The first part is the Alarm Point. Alarms are displayed and archived as digital
points. A monitoring program observes updates to numeric, digital, and string points
and then tests each for configured alarm conditions.
The second part is the Alarm Group. A set of alarm points can be organized into
Alarm Groups. Statistics such as the number of alarm points and the number of
unacknowledged alarms can be obtained for each Alarm Group. Groups can be
members of other groups to form alarm hierarchies.
Page 292
8.1 - Alarm Subsytem Overview
Source
Test1 Action1
point
Test2 Action2
Combiner
Logic
Test3 Action3
Alarm
point
Test4 Action4
The alarm point is naturally scheduled and signs up for updates of the source point. This
means that the alarm point is evaluated whenever the source point produces an exception. A
series of tests are done and an alarm is triggered if any of the tests are true. The digital state
of the alarm point is then set based on the combiner logic, which is discussed later in this
chapter.
Combiner Logic
Combiner logic refers to the manner in which the digital state of an alarm is set when a test or
multiple tests are true. If more than one test condition is true, the rule for which Alarm State
to set is that priorities have precedence. When two conditions of the same priority are true, it
is the first (in order of the tests) that is used to set the Alarm State. Further details of the logic
are given in the Action1, Action2, Action3, and Action4 attributes for alarm points.
Acknowledgment
In this release, acknowledgment is accomplished by allowing the client program to write
acknowledged digital states corresponding to the Alarm Digital States directly to the alarm
points. For example, an Alarm Digital State that represents a high value in the source tag can
only be acknowledged by the corresponding high acknowledged digital state. The alarm
program will over-write the client input in case of an error.
See Section 8.3, Alarm State Sets, for more information about Alarm Digital States. Future
releases will provide an interface for acknowledgement and other functions through the PI-
SDK.
An auto-acknowledge for the alarm point is also possible. An auto-acknowledged point will
continue to display the current alarm condition, but the display status will never be
unacknowledged. Further details on auto-acknowledgement can be found in the AutoAck
attribute for alarm points.
Alarm points have the point class of alarm. The point source is ‘@’ and the data type must
be digital.
Table 8–1 lists the attributes for the alarm point class.
Page 294
8.2 - Alarm Point Configuration
Note: While the actual point class has the parameters, Test5 and Action5, only four
Test/Action pairs are implemented.
8.2.1 SourceTag
The point set in the SourceTag attribute is the primary source used in the testing for alarm
conditions. The point must already exist and must be specified when the Alarm Point is
configured. The point may be numeric, digital or string point types.
EQ ( ref + 12 )
EQ ( ref – 14 )
An optional time parameter can also be used to delay the triggering of the alarm until the test
comparison is true for a given amount of time. The time parameter is a relative timestamp
that is added to the comparison. The time parameter consists of a plus sign, one or more
numbers, and a letter (s, m, h, or d). There may be no spaces between these elements.
EQ ( 12 ) +14m
EQ ( ‘tagname’ ) +11h
EQ ( ref + 70 ) +1h
EQ ( ON ) +1d
In the examples above, the first test triggers an alarm if the source tag is equal to 12 for over
14 minutes. The second test alarms when the source point is equal to the reference point
(referenced by tagname) for over 11 hours. The third test compares the source point with the
reference point plus 70 and if they are equal for over one hour then an alarm is triggered. In
the fourth test, an alarm triggers if the source point is ON for over one day.
All numeric point comparisons are performed using floating-point operations and all string
and digital state comparisons are performed using character operations. Comparisons of a
digital or string data type with a numeric data type returns an error at the time which the point
is compiled. Blob data types are not supported. Table 8–2 shows some examples of the
comparisons and whether an alarm will trigger.
Each of the four tests is evaluated in numeric order from Test1 through Test4 and each test is
associated with an “action” attribute numerically. For example, if the test set in Test1
becomes true, the associated “action” would be the one set in the Action1 attribute. In
general, if there is only one test that is used for the alarm point, it would be set in Test1 but
there is no rule governing the where to apply the test for the alarm point. Test1 could be left
unused and Test2, Test3, or Test4 may be used. In the case where all four attributes are
unused, the alarm point will default to the digital state that represents “no alarm” for that
Page 296
8.2 - Alarm Point Configuration
point. If more than one test is true, the digital state of the alarm is governed by the combiner
logic rules mentioned earlier in this chapter and detailed in the Action1, Action2, Action3,
and Action4 attributes section of this chapter.
Table 8–3 shows the available options for the comparison operators with their descriptions as
well as their viable argument data types. An X in the table denotes that the data type is
allowable.
LT Less Than X
EQ Equal To X X X
NE Not Equal To X X X
GT
The operator GT tests numeric constants as well as points that evaluate into numbers against
a numeric source point. An alarm is triggered if the value of the source point is greater than
the value set in the test. If a reference point is used, the tagname of the reference point is used
as the argument. If the keyword ref replaces the numeric constant as the argument and the
ReferenceTag attribute contains the tagname of the reference point, a numeric constant may
be added or subtract to the value of the reference point. A time parameter in the form of a
relative timestamp can delay the triggering of an alarm until the comparison is true for that
period of time.
GT ( 12 )
GT ( ‘tagname’ )
GT ( ref )
GT ( ref + 14 )
GT ( 70 ) +1h
LT
The operator LT tests numeric constants as well as points that evaluate into numbers against
a numeric source point. An alarm is triggered if the value of the source point is less than the
value set in the test. If a reference point is used, the tagname of the reference point is used as
the argument. If the keyword ref replaces the numeric constant as the argument and the
ReferenceTag attribute contains the tagname of the reference point, a numeric constant may
be added or subtract to the value of the reference point. A time parameter in the form of a
relative timestamp can delay the triggering of an alarm until the comparison is true for that
period of time.
LT ( 12 )
LT ( ‘tagname’ ) +14m
LT ( ref - 70 )
LT ( 11 ) +1h
EQ
The operator EQ tests can be performed with numeric constants, digital states, strings or a
reference to another point. An alarm is triggered if the value of the source point is equal to the
value set in the test. If a reference point is used, the tagname of the reference point is used as
the argument. If the keyword ref replaces the numeric constant as the argument and the
ReferenceTag attribute contains the tagname of the reference point, a numeric constant may
be added or subtract to the value of the reference point.
A time parameter in the form of a relative timestamp can delay the triggering of an alarm
until the comparison is true for that period of time.
EQ( 12.14 )
EQ ( OFF )
EQ ( ref )
EQ ( ref + 70 )
EQ ( “This is a string” ) +1h
NE
The operator NE tests can be performed with numeric constants, digital states, strings or a
reference to another point. An alarm is triggered if the value of the source point is not equal
to the value set in the test. If a reference point is used, the tagname of the reference point is
used as the argument. If the keyword ref replaces the numeric constant as the argument and
the ReferenceTag attribute contains the tagname of the reference point, a numeric constant
may be added or subtract to the value of the reference point. A time parameter in the form of
a relative timestamp can delay the triggering of an alarm until the comparison is true for that
period of time.
NE( 12 )
NE ( ON )
NE ( ‘tagname’ )
NE ( ref – 14.11 )
NE ( “This is a string” ) +70m
Page 298
8.2 - Alarm Point Configuration
StepGT
The operator StepGT tests numeric constants as well as points that evaluate into numbers
against a numeric source point. An alarm is triggered if the value of the source point changes
more than the value set in the test. If a reference point is used, the tagname of the reference
point is used as the argument. If the keyword ref replaces the numeric constant as the
argument and the ReferenceTag attribute contains the tagname of the reference point, a
numeric constant may be added or subtract to the value of the reference point. A time
parameter in the form of a relative timestamp can delay the triggering of an alarm until the
comparison is true for that period of time.
StepGT ( 12 )
StepGT ( ‘tagname’ ) +14m
StepGT ( ref - 70 )
StepGT ( 11 ) +1h
StepLT
The operator StepLT tests numeric constants as well as points that evaluate into numbers
against a numeric source point. An alarm is triggered if the value of the source point changes
less than the value set in the test. If a reference point is used, the tagname of the reference
point is used as the argument. If the keyword ref replaces the numeric constant as the
argument and the ReferenceTag attribute contains the tagname of the reference point, a
numeric constant may be added or subtract to the value of the reference point. A time
parameter in the form of a relative timestamp can delay the triggering of an alarm until the
comparison is true for that period of time.
StepLT ( 12 )
StepLT ( 'tagname' )
StepLT ( ref - 14 )
StepLT ( 70 ) +1h
RateGT
The operator RateGT tests numeric constants as well as points that evaluate into numbers
against a numeric source point. An alarm is triggered if the rate of change of the source point
is greater than the value set in the test. The rate of change is calculated by dividing the
difference between discrete average of two successive periods by the period. Figure 8–2
shows an example of the calculation of the rate of change.
6.5
Average = 6.5 6.0
6.0
diff = 1.5
5.0 Average = 5.0
2.5
In the example, the average of the first period is 6.5 units and the average of the second
period is 5.0 units. Hence the rate of change is 1.5 units per minute. The values used in the
calculation are those sent to PI Snapshot as exceptions. The comparison test is made after the
second period at the time of the arrival of the next source point Snapshot value. The default
period is 10 minutes. The period can be changed by setting a new period in the options
attribute.
If a reference point is used, the tagname of the reference point is used as the argument. If the
keyword ref replaces the numeric constant as the argument and the ReferenceTag attribute
contains the tagname of the reference point, a numeric constant may be added or subtract to
the value of the reference point. A time parameter in the form of a relative timestamp can
delay the triggering of an alarm until the comparison is true for that period of time.
RateGT ( 12.8 )
RateGT ( 'tagname' )
RateGT ( ref + 14 )
RateGT ( 70 ) +1h
RateLT
The operator RateLT tests numeric constants as well as points that evaluate into numbers
against a numeric source point. An alarm is triggered if the value of the source point is less
than the value set in the test. If a reference point is used, the tagname of the reference point is
used as the argument. If the keyword ref replaces the numeric constant as the argument and
the ReferenceTag attribute contains the tagname of the reference point, a numeric constant
may be added or subtract to the value of the reference point. A time parameter in the form of
a relative timestamp can delay the triggering of an alarm until the comparison is true for that
period of time. The default period is 10 minutes. The period can be changed by setting a new
period in the options attribute.
Page 300
8.2 - Alarm Point Configuration
RateLT ( 12.8 )
RateLT ( 'tagname' )
RateLT ( ref + 14 )
RateLT ( 70 ) +1h
Is_In
The operator Is_In tests digital states, strings, or points that evaluate into digital states or
strings against a digital state or string. In the comparison, all digital states are converted into
strings, and a string-to-string comparison is performed. The Is_In operator triggers an alarm
if the source point value is in the test value. For a reference point, the tagname of the
reference point is used as the argument. If the keyword, ref is used as the argument, the
ReferenceTag attribute contains the tagname of the reference point. A time parameter in the
form of a relative timestamp can delay the triggering of an alarm until the comparison is true
for that period of time.
Is_In ( "ON OFF" )
Is_In ( 'tagname' )
Is_In ( ref )
Is_In ( "This is a string" ) +1h
Not_In
The operator Not_In tests digital states, strings, or points that evaluate into digital states or
strings against a digital state or string. In the comparison, all digital states are converted into
strings and a string-to-string comparison is performed.
The Change operator triggers an alarm if the source point value is not in the test value. For a
reference point, the tagname of the reference point is used as the argument. If keyword ref is
used as the argument, the ReferenceTag attribute contains the tagname of the reference
point.
A time parameter in the form of a relative timestamp can delay the triggering of an alarm
until the comparison is true for that period of time.
Not_In ( "ON OFF" )
Not_In ( 'tagname' )
Not_In ( ref )
Not_In ( ON ) +1h
Includes
The operator Includes tests digital states, strings or points that evaluate into digital states or
strings against a digital state or string. In the comparison, all digital states are converted into
strings and a string to string comparison is performed. The Includes operator triggers an
alarm if the source point value includes the test value. For a reference point, the tagname of
the reference point is used as the argument. If keyword ref is used as the argument, the
ReferenceTag attribute contains the tagname of the reference point. A time parameter in the
form of a relative timestamp can delay the triggering of an alarm until the comparison is true
for that period of time.
Includes ( HI )
Includes ( 'tagname' )
Includes ( ref )
Includes ( "This is a string" ) +1h
Page 302
8.2 - Alarm Point Configuration
Change
The operator Change tests numeric values, digital states, strings or points that evaluate into
numeric values, digital states or strings. All numeric comparisons are done as floating point
operations and comparisons of all digital states are converted into strings and a string-to-
string comparison is performed. The Change operator triggers an alarm if the source point
value is different from the previous value. A time parameter in the form of a relative
timestamp can delay the triggering of an alarm until the comparison is true for that period of
time.
Change ( )
Change ( ) +1h
CondEQ
The operator CondEQ tests alarm point conditions against alarm points. An alarm will
trigger if an alarm of another alarm point is equal to the test value. For a reference point, the
tagname of the reference point is used as the argument. If keyword ref is used as the
argument, the ReferenceTag attribute contains the tagname of the reference point. A time
parameter in the form of a relative timestamp can delay the triggering of an alarm until the
comparison is true for that period of time. The argument is an alarm condition. In the
following examples, an alarm is triggered if the condition of the source alarm point is low,
the condition of the source alarm point is equal to the condition of the reference point (ref),
and the condition of the source point is high for over one hour, respectively.
CondEQ ( low )
CondEQ ( 'alarmtagname' )
CondEQ ( ref )
CondEQ ( high ) +1h
Table 8–7 show examples of the CondEQ operator using the sample Alarm Digital State Set
given in the Alarm State Sets section of this chapter. The digital state for a new alarm with
the condition of low is low << and the digital state for an acknowledged alarm with the
condition of low and an urgent priority is ** low.
For more information about Alarm Digital States, see Section 8.3, Alarm State Sets.
CondNE
The operator CondNE tests alarm point against an alarm point. An alarm will trigger if an
alarm of another alarm point is not equal to the test value. For a reference point, the tagname
of the reference point is used as the argument. If keyword ref is used as the argument, the
ReferenceTag attribute contains the tagname of the reference point. A time parameter in the
form of a relative timestamp can delay the triggering of an alarm until the comparison is true
for that period of time. The argument is an alarm condition. In the following examples, an
alarm is triggered if the condition of the source alarm point is not low, the condition of the
source alarm point is not equal to the condition of the reference point (ref), and the condition
of the source point is not high for over one hour, respectively.
CondNE ( low )
CondNE ( 'alarmtagname' )
CondNE ( ref )
CondNE ( high ) + 1h
IsUnack
IsUnack tests an alarm point against another alarm point. This operator has no arguments and
triggers an alarm if the source alarm point is unacknowledged.
In the following examples, an alarm is triggered if the source alarm point is unacknowledged
and goes unacknowledged for over one hour, respectively.
IsUnack ( )
IsUnack ( ) +1h
Page 304
8.2 - Alarm Point Configuration
In the above examples, the digital state that is set is for a new alarm with the attribute
AutoAck set to NO. Furthermore, it is also possible to have a priority level of 0, which is
shown as the last example in Table 8–8. In that case, only the alarm condition is returned
regardless of the acknowledgement status.
The second case is not limited to the Alarm Digital State Set and any digital state set may be
utilized. The second case only requires that the attribute contain a digital state (StateName)
that belongs to the digital state set of the alarm point.
The first two examples given in Table 8–9 use the Alarm Digital State Set from Table 8–15.
The last example used a default digital state set, Modes, with the digital states {Manual,
Auto, Cascade, Program, Prog-Auto}.
When more than one alarm is triggered simultaneously, the combiner logic determines the
digital state that is set by using the following rules:
• Priorities have precedence.
• When two conditions of the same priority are true, it is the first (in order of the
tests) that is used to set the Alarm State.
Table 8–10 gives examples of which “action” will be taken when more than one “action”
attribute is triggered. In these examples, it is assumed that all four tests were done and the
“actions” that were left blank are the result of alarms that were not triggered.
In the first combiner logic example, all the priorities are the same; hence Action1 is set
because it is the first test that is true. In the second example, even though Action4 and
Action1 are both true, Action1 is used because it has a higher priority. The last example
demonstrates the second syntax where priority is not used; hence Action1 is set because it is
the first test that is true. Refer to Alarm State Sets on page 308 for more information about the
digital state that is set.
8.2.4 ExDesc
The tagname of the Alarm Group for the alarm point is set in the ExDesc. An alarm point
must belong to an Alarm Group and the Alarm Group must be created before the creation of
the alarm point. Refer to Alarm Groups on page 312 for additional information.
8.2.5 DigitalSet
The DigitalSet attribute specifies the name of the Alarm State Set that is to be associated
with the tag. An alarm point is required to have a digital set and the digital set must be
created before the creation of the alarm point. See Section 8.3, Alarm State Sets, for more
information about Alarm Digital States.
8.2.6 ReferenceTag
The tagname defined in the ReferenceTag attribute is used in the Test1, Test2, Test3, and
Test4 attributes as a reference point to trigger alarms. In the case where a reference is used,
the argument in the test is the keyword ref. In this case, the ReferenceTag attribute must be
the tagname of the desired reference point.
8.2.7 AutoAck
The two options that can be set for the AutoAck attribute are yes or no. The default is yes. If
the value in AutoAck attribute is yes then an alarm is automatically acknowledged. For a
three-acknowledgment status configuration in the Alarm State Set, the new and
unacknowledged missed statuses shown in Table 8–12 would never be assigned to an alarm
point value.
Page 306
8.2 - Alarm Point Configuration
8.2.8 DeadBand
The DeadBand attribute modifies the Test1, Test2, Test3, and Test4 attributes of GT and
LT. The DeadBand is a threshold, within the alarm limit, that the rate point must pass after
an alarm is triggered before the point is considered not to be in alarm. The default DeadBand
is 0.
Deadband
Lower Alarm Limit
8.2.9 Options
The option attribute is used to modify the period associated with the RateGT and RateLT
operators in the Test1, Test2, Test3, and Test4 attributes.
Syntax: RTime = timestamp
The following examples set the period to 1 hour, 5 minutes, and 30 seconds respectively.
RTime = +1h
Rtime = +5m
Rtime = +30s
8.2.10 ControlTag
The tagname defined in the ControlTag attribute is used in the combiner logic to disable
alarms. The tagname specified by the ControlTag attribute must refer to a numeric (any float
or integer) or digital point type. Any other point type will result in an Error state for the
alarm point. In the case where a control tag is used, the alarm can be taken out of service by
setting the value of the control tag to zero for numeric tags or the 0th state for digital tags.
Below is an example of using the ControlTag to disable an alarm when net generation drops
below a predetermined value. This could easily be applied to all alarms on a unit. Assume
that U2:NetGen.PV is the net generation on our example unit.
Configure a PE point, a digital point, with 2 states: Not Running and Running. Be sure that
Not Running is first digital state in the set. Set the point to be naturally scheduled, based on
our net generation value. The ExDesc of the PE will look similar to:
event=U2:NetGen.PV, if('U2:NetGen.PV' > 5) THEN "Running" ELSE "Not
Running"
If there are only 2 states in this digital set, and Not Running is the first one, the following
ExDesc will do the same thing.
event=U2:NetGen.PV, 'U2:NetGen.PV' > 5
Finally, enter the tagname of this PE as the ControlTag of any alarms that should be disabled
when net generation falls below 5.
8.2.11 ControlAlg
Reserved attribute for future implementation.
An Alarm State Set is a Digital State Set constructed such that condition, acknowledgement,
and priority codes are all encoded in the digital states.
8.3.1 Condition
The condition of an alarm describes the manner in which an alarm is manifested. Table 8–11
shows some sample descriptions of the types of alarm conditions that may be implemented.
Page 308
8.3 - Alarm State Sets
Acknowledgment Description
Status
New An alarm has been triggered and is unacknowledged.
Acknowledged The triggered alarm is acknowledged.
Unacknowledged The unacknowledged alarm was missed because the
Missed source point is no longer in alarm.
8.3.3 Priority
The priority describes the level of importance given to the triggered alarm or the severity
associated with the triggered alarm. Table 8–13 is an Alarm Digital State Set with a single
priority and three acknowledgement statuses.
In this scheme, the acknowledgement statuses are represented by symbols. New alarms are
denoted by the symbol “<<” at the end of the alarm conditions, while acknowledged alarms
are just denoted as the alarm conditions itself. Alarms that are missed because the source
point has gone out of an alarm condition are denoted by an underscore followed by an “x”
(“_x”) after the alarm condition.
For the case where more severity is placed on certain types of alarms as opposed to others,
the priority level can be expanded to multiple levels. Table 8–14 shows an example of a
three-priority system with their respective meanings.
The three priorities are classified from the most severe (priority level 3) to the least severe
(priority level 1) as Most Urgent, Important, and Alert and their respective symbols which
is denoted in front of the alarm condition are “**”, “_*”, and “__” respectively. Table 8–15
shows the same Alarm Digital State Set with the additional priorities.
Page 310
8.3 - Alarm State Sets
The only default Alarm State Set that is installed is the Pialarm33 State Set. Four sample
Alarm State Sets are also included in a piconfig script (two for use with numeric source tags
and two for digital). These sample Alarm State Sets are provided in Section 8.3, Alarm State
Sets. For each type, one set is simple, only showing alarm condition, and the other complete,
showing priority, condition, and acknowledge status. The sample Alarm State Sets for
numeric source points are displayed in Table 8–13 and Table 8–14. A second set of Alarm
State Sets for digital or string source points are provided in Table 8–16 and Table 8–17.
Table 8–16. Example Digital Alarm State Set with One Priority
Each site using PI Alarms needs to examine its needs for alarm display sets and establish
local standards. While state sets can be added or changed, some changes will require
significant re-configuration of client programs. This can be minimized by planning.
As with all Digital State Sets, each of the digital state strings in the tables corresponds to a
digital state code. The manner in which the Alarm State Sets mentioned above are changed
into digital states is explained in Section 8.11, Alarm State Set Encoding and Decoding.
An Alarm Group is a collection of alarm points that are grouped together using a common
group name. Furthermore, Alarm Groups may also contain other Alarm Groups, to create an
alarm hierarchy. Each alarm point is assigned to a single Alarm Group. The Alarm Group
organization should match the operational structure of the plant. This hierarchy forms the
basis for alarm system control and reporting functions.
Each Alarm Group is represented in the PI system by one or more points. A single point is
required to provide the name for the group referred to by alarm points within it. The Alarm
Group point can receive values that represent statistics about the alarms in the group.
Additional points allow the alarm subsystem to report group statistics (number of alarms,
number of unacknowledged alarms, etc.). These additional statistical points are optional.
Page 312
8.4 - Alarm Groups
The GroupName parameter defines the name of the group. The PointFunc parameter
contains the options to be set for the group. Statistics of the Alarm Group are described in the
PointFunc table (Table 8–18). The Arg parameter is a modifier to the PointFunc parameter.
Available statistics include the number of alarms at each priority and the highest priority of
the currently active alarms in the group. Groups can be arranged on a hierarchy.
PointFunc Description
GroupID Setting PointFunc to GroupID defines the Alarm Group. The optional Arg
parameter is the name of the group’s parent group in the hierarchy (if it exists)
UnAck Displays total number of unacknowledged alarms within a group or priority.
The Arg parameter defines the priority for the unacknowledged alarms.
InAlarm Displays total number of points in alarm within a group or priority. The Arg
parameter defines the priority of the alarms.
In that case, the statistics at the parent level include the points in the groups below. Groups
can be arranged to any depth. There is nothing preventing both points and groups from being
assigned to the same group. Table 8–19 shows an example Alarm Group hierarchy with two
subgroups.
This example Alarm Group contains the point AlarmTop that defines the top of the alarm
hierarchy. AlarmTop and Tot_Unack give the statistics of the total number of alarms points
that are in alarm and the total number of unacknowledged alarms in the alarm hierarchy that
are in the alarm hierarchy. AlarmGrp1 and AlarmGrp2 are the two Alarm Groups within the
hierarchy.
AlarmGrp1_Unack_1 and AlarmGrp1_InAlarm_1 are the statistics of the number of
unacknowledged alarms in Alarm Group AlarmGrp1 with priority 1 and the number of alarm
points in AlarmGrp1 that are in alarm with priority 1, respectively.
AlarmGrp2_InAlarm_0 and AlarmGrp2_Unack are the number of alarm points in an
Alarm State with priority 0 in AlarmGrp2, and the statistics of the total number of
unacknowledged alarms in AlarmGrp2, respectively. Using the modifier Arg of ‘UnAck’
with the priority 0 will always return 0 because conditions are always considered
acknowledged.
Alarm points are created in the same manner as other points except that the Alarm must be of
alarm point class, which includes Base attributes. The point type must be digital and the
PointSource must be ‘@’.
To override the PointSource default values, see Override Default PointSource Values for
Alarms, page 316.
8.5.1 PI TagConfigurator
You can easily create alarm points with the PI TagConfigurator tool. See the OSIsoft
Technical Support Web site to download this tool.
Page 314
8.6 - Build Alarm Group Points
8.5.2 Piconfig
Alternatively, you can use piconfig to create an alarm point:
@table pipoint
@ptclass alarm
@mode create, t
@istru tag, pointsource, sourcetag, exdesc, pointtype, digitalset,
test1, action1
alarmtag1, @, sinusoid, alarmgrp1, digital, pialarm33, lt (20), lolo 2
@ends
Alarm Group points are created in the same manner as other points. The point type must be
numeric and the PointSource must be G.
To override the PointSource default values, see Override Default PointSource Values for
Alarms, page 316.
8.6.1 PI TagConfigurator
Alarm Group points can be created using the PI Tag Configurator utility, which you can
obtain from the OSIsoft support Web site.
8.6.2 Piconfig
Alternatively, you can use the piconfig utility to create the same Alarm Group point.
@table pipoint
@ptclass base
@mode create, t
@istru tag, pointsource, exdesc, pointtype
alarmgrp1, G, “alarmgrp1 GroupID”, Int32
@ends
You can override the default PointSource values by setting particular values in the Windows
Registry. Under the Registry key, SYSTEM/CurrentControlSet/Services/pialarm, the
string values AlarmPS, GroupPS, and SqcPS will be present if used.
For example, in Figure 8–6, the RegEdit screen has been reset with the PointSource for
Alarm points set to A, the PointSource for group points to S, and the PointSource for sqc
alarmpoints to C. Changes take effect only when the pialarm service is restarted.
Page 316
8.8 - Build Alarm Digital State Sets
For UNIX systems, the command line that starts the Alarm Subsystem may contain optional
arguments to override the default point sources. For the same settings as in the Windows
example above, include the following options in the command line: -ps=A, -gps=S, and -
qps=C.
Alarm Digital State Sets are similar to all digital state sets in that each digital state string must
correspond to a digital state code. The Alarm State Set is special because there is a specific
structure that is required for this type of digital state set. The following piconfig script is an
example that shows how to build a simple Alarm Digital State Set with three
acknowledgement statuses, three priorities, and two conditions - low and high.
@table PIDS
@mode create,t
@istyp delim,
@istru set,
@istru oldcode ,state
@istru ...,
pialm33,
1, ----
2, __ Low ^^
3, _* Low ^^
4, ** Low ^^
5, __ Low <<
6, _* Low <<
7, ** Low <<
8, __ Low _x
9, _* Low _x
10, ** Low _x
11, __ High ^^
12, _* High ^^
13, ** High ^^
14, __ High <<
15, _* High <<
16, ** High <<
17, __ High _x
18, _* High _x
19, ** High _x
20, LOW
21, HIGH
22, 3 3
@ends,
In the above script, the Alarm State Set is named pialm33. There are 22 digital states. The
first digital state is the state of no alarm. In this script, the no alarm status is represented by
the symbol “----”.
1, ----
If the desired representation for no alarm is “No Alarm,” this line in the script would be:
1, No Alarm
The last digital state (22nd) corresponds to the number of acknowledgment statuses and the
number of priorities that exist for the Alarm State Set. In this example, it is three for both. For
only one priority, the line would read as follows:
22, 3 1
The Alarm State Set is created in a manner similar to having three nested loops, where the
outer loop is the condition, the middle loop is the acknowledgement status, and the innermost
loop is the priority. So for each condition, the innermost loop sets the priorities from least
severe to most severe, which are represented here by the symbols “__”, “_*”, “**”.
2, __ Low ^^
3, _* Low ^^
4, ** Low ^^
The middle loop then sets the acknowledgement statuses in the order of acknowledged alarm
(“ ^^“), new alarm (“<<”) and unacknowledged alarm missed (“_x”).
2, __ Low ^^
3, _* Low ^^
4, ** Low ^^
5, __ Low <<
6, _* Low <<
7, ** Low <<
8, __ Low _x
9, _* Low _x
10, ** Low _x
Page 318
8.9 - Program Operation
The outer loop finally loops around the conditions. Hence each condition has 3
acknowledgement statuses and 3 priorities, and thus 9 digital states each. Since the first
digital state code is the no alarm condition, digital state codes 2 though 19 are used for the
Alarm States. At the end of the Alarm States are the condition names themselves.
20, LOW
21, HIGH
As mentioned earlier, the last digital state code is used to tell the alarm program how many
acknowledgement statuses and priorities are in the Alarm State Set.
22, 3 3
Further details on encoding and decoding Alarm Digital States is provided in Alarm State Set
Encoding and Decoding, page 321.
8.9.1 Startup
The Alarm Subsystem program is started with the rest of the system. The location of the
program, pialarm.exe for Windows and pialarm for UNIX, is in the pi\bin directory. All rate
calculations are reset when the PI System or the Alarm Subsystem is restarted.
The example above is edited from the Kamyr display, from the PIDemo example included in
PIProcessBook. It shows the alarm point values next to the values of the source tag as well as
a trend display of the statistics of the alarms for the unit (Unit5). The chart on the bottom left
corner displays the statistics of the alarms for the four other units as well as the current unit.
Page 320
8.10 - PI for OpenVMS Upgrade Considerations
The PI Server Alarm subsystem is capable of having all the alarms of the PI for OpenVMS
version and more.
The following are known differences:
The method of alarm messaging is not supported on the server side. The Alarm Client
program will allow for the viewing of alarms and Alarm Groups as well as
messaging. This feature will be available in the future.
A log of the alarms is not available. The history of the alarm is contained in the alarm
points themselves.
Acknowledgement of the alarm is accomplished by selecting the auto-
acknowledgement feature or writing an acknowledged digital state to the PI system
through the PI-API.
Due to the manner in which the Alarm State Set is structured, conversion from the digital
state code or offset to the condition, acknowledgement status, and priority is not as
straightforward as it may seem.
There is a distinction between the manner in which Digital State Sets are created and the
digital state code (offset) that is returned from a client program. For example, the following is
part of the piconfig script to create an Alarm Digital State Set as explained in Section 8.8,
Build Alarm Digital State Sets.
@table PIDS,
@mode create,t
@istyp delim,
@istru set,
@istru oldcode ,state
@istru ...,
pialm33,
1, ----
2, __ Low ^^
3, _* Low ^^
4, ** Low ^^
5, __ Low <<
etc…
In the script, the digital states are numbered starting at 1. On the contrary, the offset, which is
returned from a client program returns the digital state offset in which the number begins at 0.
Therefore, for encoding and decoding, the digital state code is the digital state offset. Hence
the offset for the digital state shown for ** Low ^^ in the script is 3 and not 4.
In order for client applications to convert from digital state codes to the condition,
acknowledgement status, and priority, and vice versa, the following algorithms should be
applied. See section 8.8, Build Alarm Digital State Sets for more information.
Page 322
8.11 - Alarm State Set Encoding and Decoding
P = 2 (Important)
P = 3 (Most Urgent)
P equal to 0 results in the alarm condition. The number of states per condition Pa1 is given
by multiplying the number of acknowledgeable statuses by the max numeric priority level:
Pa1 = Nack * MxP
For example, if the two conditions in the Alarm State Set are high and low, then MaxC is
equal to 2. The number of states in the Alarm State Set is Nsts.
Nsts = Pa1 * MaxC + MaxC
The digital state code, code, is then given by the following equation.
code = Pa1 * ( C - 1 ) + Mxp * A + P
Offset AlarmSet
0 .
1 Lolo
2 Low
3 High
4 Hihi
5 Rate
6 Change
7 Dig1
Offset AlarmSet
8 Dig2
9 Lolo <<
10 Low <<
11 High <<
12 Hihi <<
13 Rate <<
14 Change <<
15 Dig1 <<
16 Dig2 <<
17 Lolo _x
18 Low _x
19 High _x
20 Hihi _x
21 Rate _x
22 Change _x
23 Dig1 _x
24 Dig2 _x
25 LOLO
26 LOW
27 HIGH
28 HIHI
29 RATE
30 CHANGE
31 DIG1
32 DIG2
33 31
Offset AlarmSet
0 .
1 __ Lolo
2 _* Lolo
Page 324
8.11 - Alarm State Set Encoding and Decoding
Offset AlarmSet
3 ** Lolo
4 __ Lolo <<
5 _* Lolo <<
6 ** Lolo <<
7 __ Lolo _x
8 _* Lolo _x
9 ** Lolo _x
10 __ Low
11 _* Low
12 ** Low
13 __ Low <<
14 _* Low <<
15 ** Low <<
16 __ Low _x
17 _* Low _x
18 ** Low _x
19 __ High
20 _* High
21 ** High
22 __ High <<
23 _* High <<
24 ** High <<
25 __ High _x
26 _* High _x
27 ** High _x
28 __ Hihi
29 _* Hihi
30 ** Hihi
31 __ Hihi <<
32 _* Hihi <<
33 ** Hihi <<
34 __ Hihi _x
35 _* Hihi _x
Offset AlarmSet
36 ** Hihi _x
37 __ Rate
38 _* Rate
39 ** Rate
40 __ Rate <<
41 _* Rate <<
42 ** Rate <<
43 __ Rate _x
44 _* Rate _x
45 ** Rate _x
46 __ Step
47 _* Step
48 ** Step
49 __ Step <<
50 _* Step <<
51 ** Step <<
52 __ Step _x
53 _* Step _x
54 ** Step _x
55 __ Change
56 _* Change
57 ** Change
58 __ Change <<
59 _* Change <<
60 ** Change <<
61 __ Change _x
62 _* Change _x
63 ** Change _x
64 __ Dig1
65 _* Dig1
66 ** Dig1
67 __ Dig1 <<
68 _* Dig1 <<
Page 326
8.11 - Alarm State Set Encoding and Decoding
Offset AlarmSet
69 ** Dig1 <<
70 __ Dig1 _x
71 _* Dig1 _x
72 ** Dig1 _x
73 __ Dig2
74 _* Dig2
75 ** Dig2
76 __ Dig2 <<
77 _* Dig2 <<
78 ** Dig2 <<
79 __ Dig2 _x
80 _* Dig2 _x
81 ** Dig2 _x
82 LOLO
83 LOW
84 HIHI
85 HIGH
86 RATE
87 STEP
88 CHANGE
89 DIG1
90 DIG2
91 3 36
Offset AlarmSet
0 .
1 Move
2 Fail
3 OFF
4 Over
Offset AlarmSet
5 Under
6 Change
7 Dig6
8 Dig7
9 Move <<
10 Fail <<
11 OFF <<
12 Over <<
13 Under <<
14 Change <<
15 Dig7 <<
16 Dig8 <<
17 Move _x
18 Fail _x
19 OFF _x
20 Over _x
21 Under _x
22 Change _x
23 Dig7 _x
24 Dig8 _x
25 MOVE
26 FAIL
27 OFF
28 OVER
29 UNDER
30 CHANGE
31 DIG7
32 DIG8
33 31
Page 328
8.11 - Alarm State Set Encoding and Decoding
Offset AlarmSet
0 .
1 __ Move
2 _* Move
3 ** Move
4 __ Move <<
5 _* Move <<
6 ** Move <<
7 __ Move _x
8 _* Move _x
9 ** Move _x
10 __ Fail
11 _* Fail
12 ** Fail
13 __ Fail <<
14 _* Fail <<
15 ** Fail <<
16 __ Fail _x
17 _* Fail _x
18 ** Fail _x
19 __ OFF
20 _* OFF
21 ** OFF
22 __ OFF <<
23 _* OFF <<
24 ** OFF <<
25 __ OFF _x
26 _* OFF _x
27 ** OFF _x
28 __ Over
29 _* Over
30 ** Over
Offset AlarmSet
31 __ Over <<
32 _* Over <<
33 ** Over <<
34 __ Over _x
35 _* Over _x
36 ** Over _x
37 __ Under
38 _* Under
39 ** Under
40 __ Under <<
41 _* Under <<
42 ** Under <<
43 __ Under _x
44 _* Under _x
45 ** Under _x
46 __ Change
47 _* Change
48 ** Change
49 __ Change <<
50 _* Change <<
51 ** Change <<
52 __ Change _x
53 _* Change _x
54 ** Change _x
55 __ Dig7
56 _* Dig7
57 ** Dig7
58 __ Dig7 <<
59 _* Dig7 <<
60 ** Dig7 <<
61 __ Dig7 _x
62 _* Dig7 _x
63 ** Dig7 _x
Page 330
8.11 - Alarm State Set Encoding and Decoding
Offset AlarmSet
64 __ Dig8
65 _* Dig8
66 ** Dig8
67 __ Dig8 <<
68 _* Dig8 <<
69 ** Dig8 <<
70 __ Dig8 _x
71 _* Dig8 _x
72 ** Dig8 _x
73 MOVE
74 FAIL
75 OFF
76 OVER
77 UNDER
78 CHANGE
79 DIG7
80 DIG8
81 33
Statistical Quality Control (SQC) is the use of numerical methods to monitor the
characteristics of a process, making sure they remain within pre-determined boundaries.
The PI Real-Time SQC (PI SQC) component allows you to apply Western Electric Pattern
Tests to all process or laboratory data collected by the PI System. PI SQC continually reviews
any SQC tests in the PI System. It stores test results, and a record of SQC control limits back
into your PI System. The results are available for viewing and analysis via PI ProcessBook
and the PI SQC Add-In.
PI SQC is a part of PI Alarm, which provides continual evaluation of SQC pattern tests and
the management of alarms generated from them. When an unacceptable deviation from test
norm occurs, PI SQC notifies the PI SQC Alarm Manager.
The chapter includes an overview of SQC fundamentals, an understanding of how PI SQC
works, an explanation of how to configure the PI points on which PI SQC functionality
depends, and instructions on how to install PI SQC.
The following topics are included:
Section 9.1, Introduction to Statistical Quality Control , on page 334
Section 9.2, Case Study for PI Real-Time SQC, on page 334
Section 9.3, Real-Time SQC Definitions, on page 335
Section 9.4, Tests for Unnatural Patterns, on page 337
Section 9.5, PI Real-Time SQC, on page 340
Section 9.6, Pattern Tests, on page 341
Section 9.7, SQC Alarm Priority and Precedence, on page 342
Section 9.8, Create a New SQC Alarm, on page 343
Section 9.9, Start and Run the PI Alarm Subsystem, on page 343
Section 9.10, Associated Point Configuration, on page 347
Section 9.11, PI SQC Alarm Point Configuration, on page 351
Section 9.12, PI Real-Time SQC Chart Types, on page 359
Section 9.13, Default SQC Alarm Digital States, on page 360
Section 9.14, Log Messages, on page 363
The following books, on the subject of Statistical Quality Control (SQC), were used in
developing this chapter, and may be helpful in developing your implementation of PI SQC.
Wheeler, Donald J., Advanced Topics in Statistical Process Control: The Power of
Shewart's Charts, 1995, SPC Press, Knoxville
Statistical Quality Control Handbook, 2nd Edition, 1958, Western Electric Company
The following example illustrates how PI SQC can be used and helpful in a typical setting.
Tip: If you are not familiar with the principals and practices of Real-Time SQC, read
Section 9.1, Introduction to Statistical Quality Control before you read this
application example.
Page 334
9.3 - Real-Time SQC Definitions and Terminology
Assume that we want to set up an SQC Alarm that will evaluate data entered for a lab test.
We’ve already established a PI point for the manual entry of laboratory results, and we have
been entering data for some time.
Recently, we decided to apply SQC to this laboratory measurement. We used PI ProcessBook
and the SQC Add-In for ProcessBook to construct an ad-hoc SQC chart of individuals for the
measurement. By investigating data collected when the process was running within norms,
we established control limits for the chart. We entered those numeric values into the control
parameters tab for that chart. We decided to apply only the 1 of 1, Outside 3 Sigma limit to
this chart.
The ad-hoc chart served us well for a couple of months; it gave us enough information to
make process improvements. After observing the post-process improvement data for some
time, we recalculated control limits for this lab measurement and found that we could tighten
the chart control limits. Since we decided to keep a history of our control limits over time, we
created PI points into which we entered both the old and the newly calculated control limits.
We then set the control parameters for the chart to get limits from the new PI tags.
After using this chart for a while, we decided that we wanted to alert the operator when the
chart showed that a pattern test failure had occurred, so that action could be taken before we
produced off-spec product. It wasn’t practical for the operator to keep the ad-hoc SQC chart
displayed in the monitor all the time, so we decided to implement an SQC Alarm in PI.
We configured an SQC alarm point to use the same lab value as the ad-hoc chart, the same
control limit tags and to evaluate the same pattern test (Individual Measurements). Now the
SQC calculations happen on the PI Server whenever the lab tester enters a new value. The
operator sees an indication on the PI ProcessBook display if the calculation results in an
alarm condition. The operator can take corrective action and acknowledge the alarm. If the
process is in an upset condition, the operator can suspend the evaluation of the alarm by
clicking on a button on the PI ProcessBook display - and later turn the alarm evaluation back
on when the process returns to normal.
If process engineers review the SQC control limits and enter new SQC control limits lab
measurement, the PI SQC Alarm processor senses the change and begins using the new limits
for the SQC Alarm.
The following SQC terms and phrases are used in this chapter.
Statistical Quality Control – The use of numerical methods to help keep the
characteristics of a process within boundaries.
• Statistical – drawing conclusions from numbers
• Quality – the characteristics or properties of the process
• Control – keeping something within boundaries
Process – A process is a set of conditions or causes that work together to produce a
result. In an industrial setting a process can be a single control loop, a unit operation, a
Example
The following example illustrates the above definitions.
Page 336
9.4 - Tests for Unnatural Patterns
Over the last couple of decades there has been an active water-sampling program in the San
Francisco Bay. The graph below depicts the salinity data collected since 1989 at a single
monitoring station at a depth of 1 meter:
C h a r t o f S F B a y S a lin it y S t a 3 3
35
30
25
20
S a lin
15
10
6
8
1
6
6
/2
/1
/1
/2
/1
/1
/1
/1
/1
/1
/1
/2
/1
/2
0
3
2
1
D a t e & T im e
In Figure 9–1, the process is a particular locale in San Francisco Bay. Measurements of
salinity were taken over time at that location. It is clear from the plot that the measurements
fluctuate. In order to learn whether the fluctuations are natural or unnatural we need to be
able to test for unnatural patterns and evaluate the data against those tests.
Statistical quality control can be defined as: defining tests and evaluating data (sets of
measurements) against those tests to determine if data exhibit unnatural patterns.
Historically, Shewart's classic Control Chart test involved testing the samples plotted on the
Control Chart against 3 sigma limits. Over time, people applying SQC instituted additional
tests that sought to check the samples for the presence of unnatural patterns. Over the years a
number of such tests have been established. The basic set of pattern tests is known as the
Western Electric set.
Zone A (OutsideControl)
Zone B (OutsideTwoSigma)
Zone C (OutsideOneSigma)
Value
Instability
There are four tests for instability. These are the most important of the pattern tests:
1. Any single point that falls outside the 3-sigma limit fails this test.
2. Two out of three successive points fall in Zone A or beyond on one side of the center
line.
Page 338
9.4 - Tests for Unnatural Patterns
3. Four out of five successive points fall into Zone B or beyond on one side of the
center line.
Figure 9–6. Eight Successive Points Fall on One Side of the Center Line (Instability)
Stratification
Samples whose up and down variations are very small in relation to the centerline are termed
stratified. Stratification exists when 15 or more consecutive points fall within Zone C on
either side of the centerline.
Mixtures
The mixture pattern is one in which points fall near the limits and not near the centerline. The
test for mixture is eight consecutive points on both sides of the centerline where no point is
within Zone C. At least one crossing of the center line must occur.
Figure 9–8. Eight Points on Both Sides of Center with None in Zone C (Mixture)
Trends
Trends are indicated by a series of points that are either monotonically increasing or
decreasing.
SQC Alarm processing is a critical part of implementing Real-Time SQC. The continual
evaluation of SQC pattern tests and the management of alarms generated from them are the
responsibility of the PI Real-Time SQC product.
Creation and maintenance of SQC Alarms is most easily performed using the PI SQC Alarm
Manager application, which includes its own user guide. The PI point that implements PI
SQC Alarm functionality is called an SQC Alarm. See Section 9.11, PI SQC Alarm Point
Configuration for a detailed discussion of configuration options for an SQC Alarm.
Page 340
9.6 - Pattern Tests
Each PI SQC Alarm has one or more pattern tests defined. A pattern test is in Alarm status if
some maximum number ‘X’ out of a total number ‘Y’ of consecutive samples meets the test
condition (for example, if 2 of 3 samples are outside two standard deviations from the
centerline). The standard Western Electric Pattern Tests are supported:
Outside Control – This test counts the number of samples outside the control limit
on one side of the center line.
Outside Two Sigma – This test evaluates the sample against a limit drawn 2/3 of the
way between the center line and the control limit. Do not confuse sigma in this usage
with the standard deviation of the sample (that interpretation would only be true if, as
classically defined, SQC control limits are set to 3 times the standard deviation of
process measurements; but the control limits could be set to other values depending
on process needs).
Outside One Sigma – This test evaluates the sample against a limit drawn 1/3 of the
way between the center line and the control limit. Do not confuse sigma in this usage
with the standard deviation of the sample.
One Side of CL – This test counts how many samples are on one side of the center
line.
Stratification – This test counts the number of samples that fall within the upper and
lower One Sigma limits on both sides of the center line.
Mixture – This test counts the number of samples that fall outside the upper and the
lower One Sigma limits on both sides of the center line.
Trend – This test counts the number of samples which are monotonically increasing
or decreasing.
The SQC Alarm processor uses the concepts of alarm priority and test precedence established
in the PI Alarm Subsystem. A brief explanation appears below.
9.7.1 Priority
SQC Alarms embody the same concept of priority that is described in Chapter 8, PI Alarm
Subsystem. Higher priority indicates a more immediate operator concern. For example,
consider an alarm system designed with four priorities 0, 1, 2, and 3. A priority of 0 might
indicate an alert for which no action is required, while a priority of 3 indicates a severe alarm
requiring an immediate response.
Each SQC Alarm can be configured to have a priority which applies to all of the alarm's
pattern tests. Selecting a priority may prove useful for incorporating SQC Alarms into Alarm
Groups for the general management of alarms. For more information, see Section 8.6, Build
Alarm Group Points.
9.7.2 Precedence
The seven pattern tests that may be executed with PI SQC have a fixed order of precedence,
as listed below.
Page 342
9.8 - Create a New SQC Alarm
An SQC alarm point can be configured to test for any combination of these patterns. In such a
point, if more than one pattern test is in alarm status, the highest precedence test will be the
one reported in the SQC alarm point.
Caution: If you perform these steps out of order, an SQC Alarm may be placed in
the Error state.
1. Start the PI Alarm Subsystem. The first time the subsystem runs, it creates the new
point class used for SQC Alarms, and the Digital State Tables used for controlling
SQC Alarm execution and reporting.
2. Create the Associated Points on the PI Server. You can use the Excel Workbooks that
are included in the distribution as templates.
3. Enter initial values for control limit points and enter Normal for the ResetTag and
the TestStatusTag (if used).
4. Create the SQC alarm point. You can use the Excel Workbooks included in the
distribution as a template.
Source Data
This is the process data source to be monitored. The SourceTag attribute is read and the SQC
Alarm signs up for notification of new data events for the source point.
Control Limits
The UCL, CL, and LCL Tag attributes are read, and the SQC Alarm signs up for notification
of data events on those points.
Page 344
9.9 - Start and Run the PI Alarm Subsystem
TestStatusTag
The TestStatusTag attribute is read, and if it is a valid PI point, the SQC Alarm uses it for
detailed pattern test reporting.
Pattern Tests
Each SQC Alarm contains seven pattern tests. Each pattern test is initialized by reading its
configuration text.
Event Sign Up
The SQC Alarm also signs up for data events on the SQC alarm points so it will know about
attempts to acknowledge alarms. The current value of the ResetTag is read and used to
preserve the execution state of the SQC Alarm.
An SQC Alarm can be set up to clear when the subsystem restarts. If the ClearOnStart
attribute is set to True then the alarm is cleared, and alarm calculations are started anew. If
the ClearOnStart attribute is set to False then data are retrieved from PI to the pattern test
buffer, the prior state of the SQC Alarm is retrieved from PI, and alarm calculations are
restarted.
highest precedence test in alarm is written to the SQC alarm point. The timestamp of the SQC
Alarm will be the same as the source data event time.
If the optional TestStatusTag is configured, then a value corresponding to all tests in alarm
will be written to the TestStatusTag with the same timestamp as the SQC Alarm event. The
TestStatusTag also includes an indication of the side of the center line of the most recent
source data event.
SQC Alarm processing is a Real-Time function; alarms are evaluated whenever new data for
source points arrive. If PI Archive data are edited, or data are inserted into the Archive before
the most recent Snapshot event (out of order data), then the SQC Alarm processor ignores
that data.
Page 346
9.10 - Associated Point Configuration
An SQC Alarm requires the existence or creation of several PI points in addition to the SQC
alarm point. Also, the user has the option to create several additional PI points that could be
used by user-written programs to further enhance SQC Alarm reporting. All of these points
are described in the following topics, along with the requirements for configuring these
points.
Note: When defining a new SQC Alarm, it is important that all of the required,
associated PI points are created before the SQC alarm point is created.
In the following section, the function of each of the required PI points is described in detail.
Note: For the associated points it is usually desirable to archive every value that is
input for that point. Thus, exception reporting and compression are typically turned
off for all associated points.
SourceTag
The SourceTag contains the values from which the SQC Alarm pattern tests are evaluated.
This is also the value that would be charted if the user were generating a graphic SQC Chart.
It is possible to use the same SourceTag for multiple SQC Alarms.
The SQC Alarm’s SourceTag can be any PI point. Typically the SourceTag point will be a
manually entered value for a chart of individuals, or a PI Totalizer Point for aggregated
sampled data. For example, the sampled data could be an average of a fixed number of
manually entered values or a time-weighted average of an analog measurement from a DCS.
The pointtype of the SourceTag should be a numeric data type, typically a floating point
number such as a float32 or float64.
To ensure that archive events for alarms and source tag archive events are in sync, the
SourceTag must have compression turned off.
Note: If compression on the source tag is not turned off, then alarms will be
calculated based on Snapshot events that may later be ‘compressed out.' This may
lead to confusion since alarms might be generated that are not associated with
archived source-data events.
TestStatusTag
The TestStatusTag can be used by customer-written programs in situations where
knowledge of all pattern tests in alarm is needed (for example, in the dynamic creation of
operator action guidelines). A TestStatusTag can only apply to one SQC Alarm.
The TestStatusTag is a point with pointtype int32, whose value is set by the Alarm
Subsystem. The value indicates all of the pattern tests currently in alarm by assigning each of
the pattern tests a bit within the 32-bit word. Whenever a pattern test is in alarm, its bit is set.
If a test is not evaluated, its bit is always zero. After the bits are set for all pattern tests in
alarm, the sign of the TestStatusTag is set to indicate whether the corresponding value of the
SourceTag was above or below the center line for the event triggering the alarm. If the value
of the SourceTag was equal to the center line, the TestStatusTag is positive.
Page 348
9.10 - Associated Point Configuration
The Alarm Subsystem assigns the values given in Table 9–3 to the TestStatusTag based on
the individual SQC pattern-test alarms.
For values of the SourceTag below the centerline, the TestStatusTag will be negative;
however, care must be taken when analyzing the individual bits of the TestStatusTag. Before
analyzing the bits of a negative TestStatusTag, the TestStatusTag should first be multiplied
by -1 to remove the sign. Then the individual bits may be readily analyzed. For example, if
the OneSideofCL alarm has been set because the values of the SourceTag are below the
centerline, the TestStatusTag will first be assigned a value of 8 and then multiplied by -1 to
arrive at -8. When viewed as a group of bits that are set, -8 is represented as
11111111111111111111111111111000, not -100.
ResetTag
The ResetTag is used by client programs to control the execution of pattern tests on an SQC
Alarm. The PI Alarm Subsystem looks for updates to the value of the ResetTag and
implements the desired actions. The allowed values of the ResetTag are listed in Table 9–5.
The same ResetTag PI point can be used for multiple SQC Alarm calculations if desired.
The PointType of the ResetTag must be Digital and the DigitalSet attribute should be set to
pialarmcontrol, which is the Digital State Set where the reset values are stored. This Digital
State Set is created automatically when the subsystem starts up for the first time.
Page 350
9.11 - PI SQC Alarm Point Configuration
The pointtype of the control limit points should be set to a numeric data type, such as a
float32 or float64.
These tags are used for display and for calculation of the process capability (Cpk) by version
1.1 or greater of the PI SQC Add-In for ProcessBook. If the attributes are blank, then the
specification limits will not be displayed and the Cpk will not be calculated.
While specification limits are not used in SQC Alarm calculations, users may wish to
establish regular PI Alarms based on the values of the SourceTag relative to the specification
points.
ProductTag
ProductTag is an optional PI point used to designate the current product for which the SQC
Alarm is being calculated. User-written programs might use this point's value to
programmatically adjust the control and specification limits based on the product or grade of
material being manufactured.
CommentTag
CommentTag is an optional PI point for storing comments associated with the SQC Alarm.
Information regarding conditions in the plant environment at certain times may be stored in
this tag. User-written programs may be used to enter and retrieve these comments for use in
process improvements based on attributing SQC Alarms to causes such as the technique
known as Pareto analysis.
The PI SQC Alarm Point is the central storage point for all the information needed to
implement a PI SQC Alarm. Configuration information of a SQC alarm point includes all of
the attributes needed to define the PI SQC Alarm’s behavior as well as the associated points
that are referenced by the SQC Alarm.
The following topics describe how to manually configure the PI SQC alarm point. OSI
recommends the use of the PI SQC Alarm Manager application for the creation and
maintenance of SQC Alarms.
Later, you will find discussion of how to configure associated points, both required and
optional, that are used to define a SQC Alarm.
deleting SQC Alarm tags. Sample Excel workbooks for use with PI TagConfigurator are
included in the distribution media. The instructions in the workbooks step through the
creation of associated points, setting initial values for the associated points, creating the
sample aggregation point (for SQC Alarms other than for a chart of Individuals), and the
creation of the SQC alarm point itself.
Note: When specifying attribute values ‘Yes’, ‘Y’, ‘True’, ‘T’, ‘On’ and ‘1’ all have
equivalent meaning and may be used interchangeably. The strings are case
insensitive. The same is true of ‘No’, ‘N’, ‘False’, ’F’, ’Off’ and ‘0’.
Page 352
9.11 - PI SQC Alarm Point Configuration
Pattern Test Definitions (if left blank, the pattern test will not be performed)
OutsideControl x of y [<blank>, above, Within y number of samples, x are outside
or below] of control limits. Options: specify above or
below to apply test only above or below the
center line.
OutsideTwoSigma x of y [<blank>, above, Within y number of samples, x are outside
or below] the "Two Sigma" limit. Options: specify
above or below to report alarms for this test
only above or below the center line.
OutsideOneSigma x of y [<blank>, above, Within y number of samples, x are outside
or below] the "One Sigma" limit. Options: specify
above or below to report alarms for this test
only above or below the center line.
OneSideofCL x of y [<blank>, above, Within y number of samples, x are on one
or below] side of the center line. Options: specify
above or below to report alarms for this test
only above or below the center line.
Stratification x of y Within y number of samples, x are within
the "One Sigma" limit.
Mixture x of y Within y number of samples, x are not
within the "One Sigma" limit.
Trend x x consecutive values trend either up or
down.
Associated-Point TagName Definitions
SourceTag TagName for PI point on which the Alarm
Calculations will be performed
Ptclass
This must be set to SQC_Alarm.
PointType
This must be set to digital. The SQC alarm point contains a digital state representing the
value of the highest precedence alarm currently set.
Digitalset
This must be set to pisqcalarm, which contains SQC Alarm States. The digital states in the
pisqcalarm Digital State Set are described in "Default SQC Alarm Digital States," page 360.
PointSource
The PointSource identifies points as SQC alarm points. The default PointSource for SQC
Alarms is Q, although this can be configured to a different string as described in the topic,
Determine the PointSource, in section 9.9.1.
Scan
Scan is used to determine when SQC Alarms are calculated. SQC Alarms are not calculated
when Scan = Off. When Scan is changed from Off to On while the SQC Alarms are running,
the ClearOnStart attribute (described below) determines the SQC Alarm's startup behavior.
Compressing
Compression defaults to On (i.e., 1) for all PI points, but Compressing should be set to
OFF (i.e., 0) to ensure archiving of all SQC Alarms.
Page 354
9.11 - PI SQC Alarm Point Configuration
Behavior Controls
AutoAck
AutoAck is used for automatic acknowledgement of alarms. It defaults to Yes.
If AutoAck = No, the SQCAlarmPriority needs to be set to a nonzero value in order to use
acknowledgements.
ChartType
ChartType is an indicator used by the PI SQC Add-In to PI ProcessBook. The ChartType
attribute indicates the type of SQC chart for which the SQC Alarms are being calculated.
Valid values are listed in Table 9–7.
Note: This attribute is not used by the PI Server in its SQC calculations. The SQC
Alarm Point’s SourceTag will determine whether this is a chart of individuals, an x-
bar chart, etc. The default value is 0. See page 359 for a description of how to set up
SQC Alarms for the various chart types.
Value ChartType
0 Chart type is unspecified (default)
1 Individuals
2 X-Bar
3 Moving Average
4 Exponentially-Weighted Moving Average (EWMA)
5 Standard Deviation
6 Moving Standard Deviation
7 Range
8 Moving Range
ClearOnStart
ClearOnStart=Yes is used to clear any active alarm and start alarm calculations afresh on
startup or after a change to the alarm point’s attributes. No means to start the alarm
calculations using retrieved archive values of SourceTag and to restore the SQC Alarm’s
prior state. If not specified on point creation, ClearOnStart defaults to No.
ClearOnLimitChange
ClearOnLimitChange=Yes means clear any active alarm and start alarm calculations afresh
when any control limit tag (UCLTag, CLTag, LCLTag) changes. No means continue
evaluating alarms using new limit values. If not specified on point creation, ClearOnStart
defaults to Yes.
Note: If set to Yes, changing more than one limit tag may result in one reset for each
limit that is changed. This can be avoided by first setting the ResetTag to Clear,
changing the control limits, and then setting the ResetTag to Normal.
PIProductLimits
<Included in Point class and reserved for future use>
WaitOnLimitChange
<Included in Point class and reserved for future use>
ExDesc
ExDesc specifies an Alarm Group that this SQC Alarm belongs to. SQC Alarms may be
added to existing PI Alarm Groups.
Alarm Priority
SQCAlarmPriority
SQCAlarmPriority is an integer value that sets the priority of the SQC Alarm. Defaults to 0.
This affects how the SQC Alarm will be reported with respect to other alarms and SQC
Alarms on your system. For a discussion of alarm priorities and precedence, see page 342.
In addition to setting AutoAck = No, SQCAlarmPriority must be set to a nonzero value in
order to use acknowledgements.
Page 356
9.11 - PI SQC Alarm Point Configuration
OutsideControl
This pattern test fails (sets an alarm) when x of y values of the SourceTag are outside of
control limits. A value of the SourceTag is outside the control limits when
SourceTag > UCL or SourceTag < LCL.
The above or below options can be used with this pattern test to restrict pattern alarm
reporting to one side of the center line. The Western Electric SQC Handbook recommends 1
of 1 for this pattern test.
OutsideTwoSigma
This pattern test fails (sets an alarm) when x of y values of the SourceTag are outside the
"TwoSigma" limit. A value of the SourceTag is outside the "TwoSigma" limit when
SourceTag > (2/3 * (UCL-CL) + CL) or SourceTag < (CL - 2/3 * (CL-LCL)).
The above or below options can be used with this pattern test to restrict pattern alarm
reporting to one side of the center line. The Western Electric SQC Handbook recommends 2
of 3 for this pattern test.
OutsideOneSigma
This pattern test fails (sets an alarm) when x of y values of the SourceTag are outside the
"OneSigma" limit. A value of the SourceTag is outside the "OneSigma" limit when
SourceTag > (1/3 * (UCL-CL) + CL) or SourceTag < (CL - 1/3 * (CL-LCL)).
The above or below options can be used with this pattern test to restrict pattern alarm
reporting to one side of the center line. The Western Electric SQC Handbook recommends 4
of 5 for this pattern test.
OneSideofCL
This pattern test fails (sets an alarm) when x of y values of the SourceTag are on one side of
the center line. The above or below options can be used with this pattern test to restrict
pattern alarm reporting to one side of the center line. The Western Electric SQC Handbook
recommends 8 of 8 for this pattern test.
Stratification
This pattern test fails (sets an alarm) when x of y values of the SourceTag are within the
"OneSigma" limit. A value of the SourceTag is within the "OneSigma" limit when
(CL - 1/3 * (UCL-CL)) > SourceTag > (CL + 1/3 * (CL-LCL)).
The Western Electric SQC Handbook recommends 15 of 15 for this pattern test.
Mixture
This pattern test fails (sets an alarm) when x of y values of the SourceTag are found on both
sides of the centerline and none of these values falls within "OneSigma." Each of the x values
must satisfy one of the following two conditions
SourceTag > (CL + 1/3 * (UCL-CL)) or SourceTag < (CL - 1/3 * (CL-LCL));
and among the x values, both of these conditions must be met at least once.
The Western Electric SQC Handbook recommends 8 of 8 for this pattern test.
Trend
This pattern test fails (sets an alarm) when x consecutive values of the SourceTag trend either
up or down.
The Western Electric SQC Handbook recommends 8 for this pattern test.
SourceTag
Tagname for PI point containing the source data on which the SQC Alarm calculations will
be performed.
TestStatusTag
(Optional) Tagname for PI point to which SQC Alarm system writes value indicating which
tests are in alarm. When this attribute is left blank (the default) the TestStatusTag is not used.
When a TestStatusTag is used, the TestStatusTag point must be unique in each SQC Alarm
definition.
Page 358
9.12 - PI Real-Time SQC Chart Types
UCLTag
Tagname for Upper Control Limit. The same UCLTag can be used in more than one SQC
Alarm definition.
CLTag
Tagname for Center Line. The same CLTag can be used in more than one SQC Alarm
definition.
LCLTag
Tagname for Lower Control Limit. The same LCLTag can be used in more than one SQC
Alarm definition.
ResetTag
Tagname for PI point governing the SQC Alarm calculation's execution and reset. The same
ResetTag can be used in more than one SQC Alarm definition.
ProductTag
Reserved for future use
CommentTag
(Optional) Tagname for a PI point to store comments associated with the SQC Alarm. Leave
this tag attribute blank (default) if you do not wish to store comments in a PI point.
The type of control chart for which an SQC Alarm is established depends solely on the SQC
Alarm’s SourceTag. The SourceTag can be any PI point type; creating subgroups of
measurements for use in SQC is generally done using a combination of totalizer and
performance equation points.
9.12.4 EWMA
The SourceTag for the EWMA (Exponentially Weighted Moving Average) SQC Alarm is a
Performance Equation which watches for events on the raw data tag and whose equation
syntax is (note that <xxx> indicates that you need to substitute a value or string):
‘<RawDataTag>’ +
if badval (‘<me>’) then
<Lambda> * PrevVal(<’RawDataTag>’) else
<Lambda> * PrevVal(‘<me>’)
Lambda is the weighting factor whose magnitude you must determine. You should substitute
the name of the Performance Equation tag that you are creating for <me> in the example
above.
The default digital state set (pisqcalarm) for SQC Alarms is automatically installed during
the first startup of the PI Alarm Subsystem. Another Digital State Set can be created for
custom use. The Digital State Set must contain the same seven pattern tests in the same order
as below. You may alter the number of acknowledgement states or priorities or change the
text displayed when a pattern test fails in your custom set. See Create a New SQC Alarm for
details on constructing Alarm Digital State Sets.
The zeroeth state contains the No Alarm digital state. The last digital state (71st in this case),
records the number of priorities and acknowledgement states in the digital state set.
Offset AlarmSet
0 .
1 __ Trend
2 _* Trend
3 ** Trend
4 __ Trend <<
5 _* Trend <<
Page 360
9.13 - Default SQC Alarm Digital States
Offset AlarmSet
6 ** Trend <<
7 __ Trend _x
8 _* Trend _x
9 ** Trend _x
10 __ Mixture
11 _* Mixture
12 ** Mixture
13 __ Mixture <<
14 _* Mixture <<
15 ** Mixture <<
16 __ Mixture _x
17 _* Mixture _x
18 ** Mixture _x
19 __ Stratification
20 _* Stratification
21 ** Stratification
22 __ Stratification <<
23 _* Stratification <<
24 ** Stratification <<
25 __ Stratification _x
26 _* Stratification _x
27 ** Stratification _x
28 __ OneSideofCL
29 _* OneSideofCL
30 ** OneSideofCL
31 __ OneSideofCL <<
32 _* OneSideofCL <<
33 ** OneSideofCL <<
34 __ OneSideofCL _x
35 _* OneSideofCL _x
36 ** OneSideofCL _x
37 __ OutsideTwoSigma
38 _* OutsideTwoSigma
Offset AlarmSet
39 ** OutsideTwoSigma
40 __ OutsideTwoSigma <<
41 _* OutsideTwoSigma <<
42 ** OutsideTwoSigma <<
43 __ OutsideTwoSigma _x
44 _* OutsideTwoSigma _x
45 ** OutsideTwoSigma _x
46 __ OutsideOneSigma
47 _* OutsideOneSigma
48 ** OutsideOneSigma
49 __ OutsideOneSigma <<
50 _* OutsideOneSigma <<
51 ** OutsideOneSigma <<
52 __ OutsideOneSigma _x
53 _* OutsideOneSigma _x
54 ** OutsideOneSigma _x
55 __ OutsideControl
56 _* OutsideControl
57 ** OutsideControl
58 __ OutsideControl <<
59 _* OutsideControl <<
60 ** OutsideControl <<
61 __ OutsideControl _x
62 _* OutsideControl _x
63 ** OutsideControl _x
64 Trend
65 Mixture
66 Stratification
67 OneSideofCL
68 OutsideTwoSigma
69 OutsideOneSigma
70 OutsideControl
71 33
Page 362
9.14 - Log Messages
Errors in configuration of SQC alarm points and errors encountered in the operation of the
subsystem are written to the PI System Message Log. The following section explains how to
view those error messages using the PIGetMsg utility. The error messages are listed along
with hints on how to correct the error condition.
Message Explanation
Created the state set The subsystem created one of the digital state sets it needs
to function. Only seen if the state set does not exist at the
time of subsystem startup.
SQC alarm point class OK The subsystem created the SQC Alarm pointclass. Only
seen if the pointclass does not exist when the subsystem
starts up. The subsystem successfully created the
pointclass.
Adding SQC Alarm <SQC A new SQC alarm point has been created on the PI Server
Alarm Point> and it is being picked up by the subsystem.
Previously deleted SQC Alarm The SQC Alarm was previously established. PI point was
<SQC Alarm Point> is being deleted and then re-created. Now it is being picked up by
added again. the subsystem.
Editing SQC Alarm <SQC Alarm The SQC alarm point has been edited and the subsystem is
Point> picking up the changes.
An existing PI point is being The PI point's PointSource was edited to the one used by
changed to an SQC Alarm the subsystem for SQC Alarms and is being picked up by
<SQC Alarm Point> the subsystem.
PointSource edit, deleting alarm The PI point's PointSource was edited to one not used by
<SQC Alarm Point> the subsystem, and the subsystem will no longer process
the point.
PI Point Deleted, deleting alarm The PI point was deleted so the subsystem will no longer
<SQC Alarm Point> process it.
Message Explanation
<SQC Alarm Point> Scan set to The SQC Alarm's Scan attribute was set to 'OFF', so the
off subsystem will no longer process it.
<SQC Alarm Point> Scan-off at The subsystem tried to establish the SQC Alarm, but the
initialization – not added point's scan attribute is set to 'OFF'. If this is not what you
want, edit the point using PI SMT and change the scan
attribute to 'ON'.
<SQC Alarm Point> Scan-on ... SQC alarm point was edited and the Scan parameter was
re-initializing. changed from 'OFF' to 'ON'. The Alarm is being put back on
line.
Error Messages
Table 9–11 lists messages that indicate that a serious error has occurred at some point in the
running of PI Real-Time SQC or in the initialization of a Real-Time SQC Alarm.
Message Explanation
Failed to create SQC alarm The subsystem had trouble creating the pointclass. Possible
point class ... retrying solution to problem: Open a command window and change
directory to the pi\adm directory. Then issue the command
net stop pialarm. After the services are stopped,
enter the command net start pialarm. Now look in the
message log for the message ‘SQC alarm point class
created’.
<SQC Alarm Point> failed to The digital set specified for the SQC Alarm is not valid.
setup digital set Check to see that you have used a valid digital state set and
that it conforms to the requirements as listed in this chapter.
<SQC Alarm Point> being Subsystem can't get attributes for point during an attempt to
edited but unable to retrieve edit the SQC Alarm.
attributes
<SQC Alarm Point> is wrong The SQC Alarm was not created as a digital point. Change
point type for alarm point the SQC alarm point's pointtype to digital.
<SQC Alarm Point> failed to Unable to retrieve the SQC Alarm's SourceTag attribute.
get sourcetag attribute.Status-
<SQC Alarm Point> update For some reason the subsystem was not able to sign up for
signup for <_sourcetag > data events on the tag.
failed
<SQC Alarm Point> sourcetag The SourceTag was not a recognized type, change the
<_sourcetag> pointtype is not SourceTag pointtype.
valid
<SQC Alarm Point> failed to Unable to retrieve the TestStatusTag attribute.
get teststatustag attribute
<SQC Alarm Point> failed to Unable to get the SQCAlarmPriority attribute.
get SQCAlarmPriority attribute
Page 364
9.14 - Log Messages
Message Explanation
<SQC Alarm Point> update Unable to sign up for data events on the SQC alarm point
signup for <SQC Alarm Point>
failed
<SQC Alarm Point> Status of The current value of the ResetTag for the SQC Alarm is not
< ResetTag > is bad at start NORMAL, HOLD or CLEAR. Enter an initial value of
NORMAL for the reset tag.
<SQC Alarm Point> Status of One or more limit points for this SQC Alarm has a bad
one or more Limits is bad at status (includes 'Pt Created', 'Shutdown', etc). Enter initial
start values for all three limit tags.
<SQC Alarm Point> One or One or more of the pattern test attributes was not properly
more pattern tests failed to defined. Check to see that all pattern tests are properly
initialize configured according to this chapter.
Email Support
Email support is available 24 hours a day, 7 days a week. Send technical support
inquiries, including the problem description and message logs, to:
[email protected]. Technical Support will respond to your inquiry within 24
hours.
Knowledge Center
The Knowledge Center provides a searchable library of documentation and technical
data, as well as a special collection of resources for system managers. For these options,
click Knowledge Center in the Technical Support Web site.
• The Search feature allows you to search Support Solutions, Bulletins, Support
Pages, Known Issues, Enhancements, and Documentation (including User
Manuals, Release Notes, and White Papers).
• System Manager Resources include tools and instructions that help you
manage: Archive sizing, Backup scripts, Daily Health Check, Daylight Saving
Time configuration, PI Server security, PI System sizing and configuration, PI
Trusts for Interface Nodes, and more.
Page 368
INDEX OF TOPICS
Page 370
Associated Points, 348 Recalculator Subsystem
Atn Subsystem, 34
function in PEs, 80 Bod
Atn2 function in PEs, 84
function in PEs, 81 Bom
Attributes, 63 function in PEs, 85
exdesc character limits, 14 Bonm
PE Subsystem, 11 function in PEs, 86
setting for PEs, 11 Calc Failed message, 59
Totalizer, 260 CalcMode, 261
AutoAck, 346, 355 AllEvents, 280
Alarms, 306 ChangeEvents, 281
Average EventWeighted, 279
Totalizer, 275 TimeTrue, 281
Avg TimeWeighted, 277
function in PEs, 82 Totalizer, 277
Badval Calculated expressions
function in PEs, 83 character limits, 13, 14
Basis time Calculated Points, 6
Recalculator Subsystem, 20 about, 6
Batch Subsystem adding scan classes, 10
Alias Table, 248 calculation expressions, 13
Batch Deletes, 253 creating, 7
Batch Edits, 252 exDesc attribute, 13, 14
configuration, 241 finding scan classes, 10
Operation, 253 finding the PointSource, 8
Pibaunit name table, 253 location3 attribute, 12
Batch tags in Data Archive, 250 location4 attribute, 12
BATCHACTIVETYPE, 242 PointSource attribute, 12
BATCHEXPR, 243 scan attribute, 14
BATCHID scan class offset, 9
Defining, 244 scan class period, 9
Defining for Web Processes, scan class, UTC time flag, 9
245 scan classes, 9
definition of, 241 scheduling, 11
Evaluation, 253 scheduling problems, 17
Behavior Controls setting scan classes, 12
PI SQC, 355 shutdown attribute, 14
BID switching calculations on or
Batch Subsystem, 250 off, 14
Blob tips for creating, 16
Data types, 296 Calculated tags
Page 372
Curve Dynamic Functions
function in PEs, 92 Recalculator Subsystem
CYCLETIME tag, 245 Subsystem, 33
Data types Dynamic Response, 64
checking, in PEs, 59 Encoding and Decoding
inconsistent, in PEs, 18 Alarm State Set, 321
DataLink, 6 Engineering units, Steam Tables,
185
Day
Enthalpy
function in PEs, 93
as independent variable, 188
DaySec
Entropy
function in PEs, 94
as independent variable, 188
DeadBand
EQ
Alarms, 307
Alarms, 298
Default
Error Messages
point source for alarm group
points, 313 Alarm, 320
Delay PI SQC, 363
function in PEs, 95 Totalizer, 288
Delete Errors
an Alias, 249 Checking, 58
Demonstration Points in PEs, 16, 59
Alarm, 321 EvalDelay
Totalizer, 290 Batch Subsystem, 243, 253
Dependent Point Event
Recalculator Subsystem, 20 Totalizer, 276
Digital Base Set, 327 Event expression
Digital Set, 354 Totalizer, 267
Alarms, 306 Event RateSampleMode
Digital State Set Totalizer, 265
SQC custom, 360 Event Scheduling
SQC default, 360 for PEs, 11
Digital States Recalculator Subsystem, 23
numbers and strings as, 51 EventChange TotalCloseMode
Steam Tables, 186 Totalizer, 267
Digstate EventCount
function in PEs, 96 function in PEs, 98
DigText EventExpression
function in PEs, 97 Totalizer, 284
Disjunction Operators, 53 EventTag, 12
Documentation EventTrue TotalCloseMode
conventions, v Totalizer, 268
for interfaces, vi EventWeighted
Page 374
Alarm Groups, 313 Left
Hour function in PEs, 116
function in PEs, 109 Len
If-then-else expressions, 53 function in PEs, 117
If-then-else operator, 57 Limits
Impulse on characters in PEs, 13, 14
function in PEs, 110 List
in ( ) operator, 53 aliases
in .. operator, 53 Batch Subsystem, 249
InAlarm location1 attribute
Alarm Group, 313 Recalculator Subsystem, 23
Includes location3 attribute
Alarms, 302 for PEs, 12
Inclusion Operators, 53 PEs, 11
Independent Variables, 187, 188 location4 attribute
InFromTotalizer for PEs, 10, 12
Totalizer, 284 Log
Instability tests, 338 function in PEs, 118
InStr Log10
function in PEs, 111 function in PEs, 119
InstrumentTag, 12 Lower Control Limit tag, 359
Int Lower Specification Limit tag, 359
function in PEs, 112 LSLTag, 347, 350
Interfaces LT
downloading documentation Alarms, 298
for, vi LTrim
PE Subsystem, 6 function in PEs, 120
Intervals between PE calculations, Max
11
function in PEs, 121
Inversion
Maximum
Recalculator Subsystem, 21
Totalizer, 276
Is_In
Median
Alarms, 301
function in PEs, 122
IsDST
MedianFilt
function in PEs, 113
function in PEs, 123
IsSet
Mid
function in PEs, 114
function in PEs, 124
IsUnack
Min
Alarms, 304
function in PEs, 125
LCase
Minimum
function in PEs, 115
Totalizer, 276
LCLTag, 347, 350
Page 376
test algorithm, 357 about, 6
OutsideOneSigma executable, 6
test algorithm, 357 overloading, 17
OutsideTwoSigma skipped calculations, 17
test algorithm, 357 starting and stopping, 7
OverIsTop Performance Equations
Totalizer, 286 about calculated points, 6
Overloading PE Subsystem, 17 adding scan classes, 10
Parameters Built-in functions table, 62, 65
tagnames as, 48 calculation expressions, 13
Totalizer, 258 changing the PointSource, 8
Pareto analysis character limits, 13, 14
comment tag, 351 creating, 7
Parsetime errors in, 16
function in PEs, 132 examples, 14
Recalculator Subsystem, 31 exDesc attribute, 13, 14
Pattern finding scan classes, 10
natural, 334, 336 finding the PointSource, 8
unnatural, 334, 336 How they're used, 6
Pattern tests inconsistent data types, 18
additional options for, 342 location3 attribute, 12
as used in PI Real Time SQC location4 attribute, 12
definitions, 341 number operands, 47
configuration of, 356 operands, 46
definition of, 336 Operators, 52
evaluation of, 345 Parentheses, 58
initializing, 345 Pipetest Utility, 59
precedence, 342 PointSource attribute, 12
order of, 342 scan attribute, 14
Western Electric, 337 scan class offset, 9
zones, 337 scan class period, 9
Pattern types, 338 scan class,UTC time flag, 9
instability, 338 scan classes, 9
mixture, 340 Scheduler, 5, 7
stratification, 339 scheduling, 11
trend, 340 scheduling problems, 17
PctGood setting attributes, 11
PEs, 133 setting scan classes, 12
Totalizer, 282 shutdown attribute, 14
PE Operators. See Operators string operands, 48
PE Subsystem switching calculations on or
off, 14
Page 378
PI SMT, 347, 351 in Totalizer, 266
PI SQC Subsystem Point Class
Multiple resets SQC, 352
how to avoid, 346 Point Configuration
Running the subsystem, 345 Alarms, 294
Sample Grouping, 336 Recalculator Subsystem, 34
Zones, 337 Totalizer Points, 258
PI System Point restart
shut down event-scheduled points, 288
impact on SQC, 346 PointFunc
PI System Management Tools, 347, Alarm Group, 313
351 Points
PI TagConfigurator, 347, 351 creating PEs, 7
Alarm Group Points, 315 naming, 48
Building Totalizer Points, 287 PointSource, 354
Piconfig alarm group points, 313
Building Totalizer Points, 287 configuring for PEs, 8
PIGetMsg utility, 363 determining, 344
Pilasttotal_T.dat, 288 how to set default, 344
pipeschd file overriding defaults, 316
adding scan classes, 10 PEs, changing, 8
changing the point source, 8 PointSource attribute
finding scan classes, 10 for PEs, 8, 11, 12
PointSource, 8 PointType, 354
scan classes, 9 Poly
pipeschd.bat, 8 function in PEs, 134
pipeschd.exe, 6 Postprocessing, 255
pipeschd.sh, 8 Prefix Operators, 53, 56
Pipetest Utility, 59 Pressure
Pisqcalarm digital set, 354 as independent variable, 187
PItotal, 256 PrevEvent
Program, 288 function in PEs, 135
Point PrevVal
dependent PE points, 21 function in PEs, 136
Point Attributes Priorities
RateSampleMode Alarms, 292, 309
in Totalizer, 263 Priority
ReportMode PI SQC, 342
in Totalizer, 273 Process
SourceTag definition of, 335
in Totalizer, 263 Process capability, 351
TotalCloseMode
Page 380
Alarms, 306 definition, 9
Registry offset, 9
Recalculator Subsystem, 40 period, 9
Relational Operators, 52 scheduling problems, 17
Relative time UTC time flag, 9
expressions, 49 Scan Flag
Relative Timestamp Response to, 288
Recalculator Subsystem, 20 Scan1 RateSampleMode
ReportMode, 261 Totalizer, 263
PeriodEnd, 273 Scan2 RateSampleMode
Point Attribute Totalizer, 264
in Totalizer, 273 Scheduling
Ramping, 274 clock, for PEs, 11
RunEst2, 274 event, for PEs, 11
RunEstimate, 274 Totalizer, 259
Running, 274 Scheduling PEs, 11
Totalizer, 273 problems, 17
ResetTag, 347, 350 SDK, 6
digitalset, 350 SearchStart
functions of, 345 Batch Subsystem, 251
initializing, 344 Second
pointtype, 350 function in PEs, 142
Right Sequencing PEs, 17
function in PEs, 139 Server Application
Round PE Syntax and Functions
function in PEs, 140 Reference, 2
RTrim Performance Equations
Calculator, 1
function in PEs, 141
Performance Equations
RunEst2 ReportMode
Scheduler, 1, 5
Totalizer, 274
PI Alarm Subsystem, 3
RunEstimate ReportMode
PI Batch Subsystem, 2
Totalizer, 274
PI Totalizer Subsystem, 2
Running ReportMode
Real-Time SQC, 3
Totalizer, 274
Recalculator, 19, 20
Sample Grouping
Steam Tables, Syntax and
PI SQC, 336 Functions Reference, 2
Scan attribute, 354 Totalizer, 255
checking on subsystem startup, Server Applications
344
Overview, 1
for PEs, 14
Setable
Recalculator Subsystem, 23
Totalizer, 285
Scan class
Page 382
creation of, 344 StmEng_HsatT, 195
SQCAlarmPriority, 356 StmEng_PsatT, 194
Sqr StmEng_SPH, 207
function in PEs, 146 StmEng_SPT, 205
SquareRoot, 12 StmEng_SPTL, 206
SStDev StmEng_SPX, 213
function in PEs, 147 StmEng_SsatP, 192
Start StmEng_SsatT, 196
Alarm, 319 StmEng_TPH, 208
Recalculator Subsystem, 36 StmEng_TPS, 209
Totalizer, 288 StmEng_TsatP, 190
Startup StmEng_VPH, 200
of alarm subsystem, 344 StmEng_VPS, 201
StateNo StmEng_VPT, 198
function in PEs, 148 StmEng_VPTL, 199
States StmEng_VsatP, 193
numbers and strings as, 51 StmEng_VsatT, 197
Statistical Quality Control StmEng_XPH, 210
definition of, 335 StmEng_XPS, 211
introduction to, 334 StmSI_HPS, 228
reference sources, 334 StmSI_HPT, 226
StdDeviation StmSI_HPTL, 227
Totalizer, 276 StmSI_HPX, 236
StDev StmSI_HsatP, 215
function in PEs, 149 StmSI_HsatT, 219
Steam Functions StmSI_PsatT, 218
Reference, 2, 190 StmSI_SPH, 231
valid range, 187 StmSI_SPT, 229
Step attribute StmSI_SPTL, 230
Recalculator Subsystem, 23 StmSI_SPX, 237
Recalculator Subsystem:, 25 StmSI_SsatP, 216
STEP tag, 245 StmSI_SsatT, 220
StepGT StmSI_TPH, 232
Alarms, 299 StmSI_TPS, 233
StepLT StmSI_TsatP, 214
Alarms, 299 StmSI_VPH, 224
StmEng_HPS, 204 StmSI_VPS, 225
StmEng_HPT, 202 StmSI_VPT, 222
StmEng_HPTL, 203 StmSI_VPTL, 223
StmEng_HPX, 212 StmSI_VsatP, 217
StmEng_HsatP, 191 StmSI_VsatT, 221
Page 384
Temperature setting for PEs, 12
as independent variable, 187 TimeTrue
Test1 point attribute Totalizer, 281
in Alarms, 295 TimeWeighted
Testing alarms, 293 Totalizer, 277
TestStatusTag, 347, 348 Timing Functions
initializing, 345 Totalizer, 276
pointtype, 348 Tips for creating PEs, 16
use of, 346 Total
values, 349 function in PEs, 178
Text Totalizer, 275
function in PEs, 171 TotalCloseMode, 260, 266
Three Priority Alarm Set, 324, 329 Clock, 266
Time expression or tagname?, 48 EventChange, 267
Time expressions EventTrue, 268
absolute time, 50 Forever, 273
and strings, 50 NSampleBlock, 270
Arithmetic operations on, 54 NSampleMoving, 268
as PE operands, 49 TimeMoving, 271
combined time, 49 Totalizer, 266
relative time, 49 Totalization of Digital Tag
tips, 50 Example
Time Functions Performance Equations, 14
Extract from Timestamp, 32 Totalizer Subsystem
Recalculator Subsystem, 31 Building Totalizer Points, 286
TimeEq CalcMode, 277
function in PEs, 172 Compatibility with PI for
OpenVMS, 289
TimeGE
CompValue, 284
function in PEs, 173
Configuration, 258
TimeGT
Conversion, 283
function in PEs, 174
Demonstration Points, 290
TimeLE
Error Messages, 288
function in PEs, 175
EventExpression, 284
TimeLT
Filter Expression, 283
function in PEs, 176
InFromTotalizer, 284
TimeMoving TotalCloseMode
MovingCount, 282
Totalizer, 271
new features, 289
TimeNE
Offset, 282
function in PEs, 177
Offset2, 282
Timestamps
Options field, 284
modifying through
Recalculator, 31 OverIsTop, 286
Page 386
PINet and PIonPINet User Guide
PI3 Server 3.4.370
PINet and PIonPINet 2.6
Worldwide Offices
OSIsoft, Inc. is the owner of the following trademarks and registered trademarks: PI System, PI ProcessBook,
Sequencia, Sigmafine, gRecipe, sRecipe, and RLINK. All terms mentioned in this book that are known to be
trademarks or service marks have been appropriately capitalized. Any trademark that appears in this book that
is not owned by OSIsoft, Inc. is the property of its owner and use herein in no way indicates an endorsement,
recommendation, or warranty of such party's products or any affiliation with such party of any kind.
Restricted Rights Legend
Use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii)
of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013
Copyright Notice
Unpublished -- rights reserved under the copyright laws of the United States
PREFACE – USING THIS GUIDE
The PINet and PIonPINet User Guide is part of the OSIsoft PI Server Documentation Set. It
explains how to install and use the PINet and PIonPINet packages that provide distributed
process data acquisition for OpenVMS. PINet and PIonPINet allow parts of a PI for
OpenVMS display system to run transparently on a PINet node.
You can download the most recent version of the PI Server Documentation Set from the
OSIsoft Technical Support Web site (http://techsupport.osisoft.com).
The PI Server Documentation Set includes the following user guides.
Title Subject
PI Server Reference Guide A comprehensive reference guide for the PI Server, including
details on databases and data flow, including exception and
compression.
Auditing the PI Server A guide to maintaining a good audit trail of your process data in the
PI Server.
PINet and PIonPINet User A guide to PINet/OpenVMS and PIonPINet packages (PI-PN)
Guide which allow parts of a PI for OpenVMS display system to run
transparently on a PINet node.
The following table provides a summary of key PI2 Server publications. You can download
the latest versions of these and other publications from the OSIsoft Technical Support
Website, http://techsupport.osisoft.com, or http://training.osisoft.com.
The PI Guide Contents
Mastering PI2, Volume I - Volume 1 covers core PI2 Server subsystems. It describes PI data
Server Reference flows, the Data Archive, Event Queue, and Event Manager. It
provides instructions for building points and setting up interfaces,
interface nodes, and status monitoring. It describes utilities and
management tools for the system manager, and their use in
troubleshooting.
Mastering PI2, Volume II - Volume 2 covers Customizing PI2. It includes information for
Server Applications systems managers and users who primarily use terminals to
access the PI2 Server. Topics include: the PI2 menu system, user
accounts and permissions, printing, alarm message routing, and
the Event Logger.
PI2 VMS Manual, Volume 1 Volume 1 covers the Data Archive, Data Trending, Graphics
Package, Performance Equations, Event Logger, Manual Input,
Analysis, Real-Time SQC, Alarms, Profile Display, PC Download,
and the Interactive Report Writer.
PI2 VMS Manual, Volume 2 Volume 2 provides an in depth look at the various Toolkit functions
available with PI2.
PI2 VMS Manual, Volume 3 Volume 3 provides an Addendum for Release 2.0 of the PI2
Toolkit.
PI2 Installation & Upgrade PI2 server applications user reference guide. Tutorial for using
Handbook Trends, Unit Summaries, New Graphics package, Performance
Equations and Formula Library.
See section 6.5, PIonPINet/VMS Operation, for additional PI2 documentation references.
Related Documentation
OSIsoft provides a variety of documentation to help you use and understand the PI Server,
interfaces and client tools. Each interface has its own manual, and each client tool has its own
online help and/or user guide.
PI Server System Managers should read the UniInt End User Manual, which describes the
OSIsoft Universal Interface (UniInt). Many PI interfaces are based upon UniInt, and this
guide can provide a deeper understanding of interface design.
Page iv
Preface – Using this Guide
The PI Server provides two sets of powerful tools that allow system administrators and users
to perform system administration tasks and data queries.
The PI Server includes many command-line tools, such as pidiag and piartool. The
PI Server Documentation Set provides extensive instruction for performing PI Server
administrative tasks using command-line tools.
The PI System Management Tools (SMT) is an easy-to-use application that hosts a
variety of different plug-ins, which provide all the basic tools you need to manage a
PI System. You access this set of tools through a single host application. This host
application is sometimes referred to as the SMT Host, but it is more commonly called
the System Management Tools or SMT.
You can download the latest version of SMT from the Technical Support Web site:
http://techsupport.osisoft.com
In addition to extensive online help that explains how to use all of the features in the SMT,
the SMT includes the Introduction to PI System Management user guide.
Monospace Consolas monospace is used for: To list current Snapshot information every 5 seconds,
type: CODE examples use the piartool -ss command. For example:
"Consolas" COMMANDS to be typed on the
font command line (optionally with
arguments or switches)
System INPUT or OUTPUT such
as excerpts from log files and other
data displayed in ASCII text
Bold consolas is used in the
context of a paragraph
Light Blue - Links to URL / Web sites, and email http://www.osisoft.com/procedures.aspx
Underlined addresses [email protected]
Page vi
QUICK TABLE OF CONTENTS
Page x
Table of Contents
1.1 Overview
PINet/VMS provides support for distributed applications to the PI System. Such distributed
applications are generally data acquisition instrument interface programs written originally
for the PI2.x System.
PINet/VMS serves two major functions:
It allows users who are currently using the PI2.x System to migrate to a PI 3 Server
System.
It provides users of PI Server with an expanded list of available data acquisition
instrument interface programs.
The PIonPINet package (PI-PN) allows parts of a PI2.x for OpenVMS display and menu
system to run transparently on a PINet node. This allows distribution of computer load
associated with user terminals and X-Window sessions. It allows users familiar with the
display system and certain optional server applications to continue using them when
migrating the PI Home Node from OpenVMS to PI3 Server. Distributing the display system
may also provide more autonomy for management of users and change in a distributed
environment.
PIonPINet displays use a client/server protocol to retrieve snapshot and archive data from the
PI Home Node. Important information such as point attributes are cached on each node to
improve performance.
Note: Unless otherwise noted, in this guide, "PI Server" generally refers to the PI 3
Server.
PI Home Node
Snapshot
Archives
Groups
Users
Optional Modules
DCS / PLC
Databases
The primary function of a PINet/VMS node is to support data acquisition interface programs.
As such, programs on the PINet/VMS node can read the following data:
Point Attributes (Tag, Descriptor, Zero, Span, etc.)
Long Tagnames
Snapshot
Archive
Engineering Unit Strings
Digital State Strings
Page 2
1.1 – Overview
The node with the PI System is called the PI Home Node. There can be several PINet
satellite nodes connected to a PI Home Node. PINet/VMS keeps its own local version of the
Point Database and Snapshot Subsystem file. However, point creation must still be performed
on the PI Server System (PI Home) Node.
PINet/VMS connects to the PI Home Node to retrieve archive data, engineering unit strings,
and digital state strings. PINet/VMS also connects to the PI Home Node when it processes
snapshot data for storage into the PI Server.
Time Synchronization
The PINet/VMS node may adjust its system time to match that of the PI Home Node. See the
discussion about PINetSync in section 3.1.10, for more information.
Data Buffering
The PINet/VMS node can buffer data for times when PI is not running on the Home Node or
when the network is down. The PINet/VMS node can be restarted even if PI is not running on
the Home Node.
However, some interface programs require that the PINet/VMS node be connected to the PI
Home Node when the interface is started. (Consult the individual documentation sets for each
of your interfaces to PI for more information.)
The following illustration shows the features and infrastructure of a PINet node.
The data source (an interface) sends exception reports to the PINet SnapShot using a
function, PutSnapShot. PutSnapShot places a data set consisting of a Value, Status and
Time Stamp into a memory image called SnapShot. Simultaneously the data set is placed into
the event queue for forwarding to the PI Server Home Node and into the PI Event Manager.
The event queue is monitored by a process called ExceptServ, whose job is to send data sets
to the PI Server and receive confirmations of successful transfers. If the network or PI Server
are offline, the ExceptServ process retries until successful. During times when the network
or PI Server are offline, the Event Queue buffers the data sets to protect against loss. A
process called QManager monitors the event queue. The QManager makes the value, Event
Queue, a virtual queue. It makes sure that no data are lost when the PI Home Node is not
available because of backup or maintenance.
Page 4
1.1 – Overview
PI3 and PI Clients (PI ProcessBook, PI DataLink, PI API) make it easy to have a distributed
PI3 system with many servers concurrently accessed by clients for data retrieval.
PINet only connects to one PI server at a time. The PINet is custom built for the PI3 server it
runs against.
Platforms
PINet/VMS runs only on VAX or ALPHA computers from Digital Equipment Corporation.
OpenVMS
The VAX or ALPHA machine must be running the OpenVMS operating system, version 6.1,
6.2, 7.1 or later. You must be running OpenVMS version 6.1, 6.2, 7.1 or greater. OpenVMS
7.0 is not supported.
TCP/IP Software
One of the following TCP/IP software products is required on the VAX or ALPHA.
DEC TCP/IP Services for OpenVMS (commonly called UCX), v 2.0b or higher
Process Software TCPWare version 3.1 or higher
Process Systems (formerly TGV/Cisco) MultiNet, v3.2 or higher for VAX, v3.4 or
higher for ALPHA
Attachmate (formerly Wollongong) PathWay, runtime release 1.1 or higher
PI2.x on OpenVMS
PINet/VMS Systems older than version 2.0.9 must first be upgraded to 2.0.9 before they can
be further upgraded to PINet/VMS 2.12 or later. Note that the PINet software for a node
connecting to a PI Server system is specially compiled for this purpose. The PINet software
which was compiled for connection to PI for OpenVMS servers should not be used with PI
version 3.1 or later servers.
OSIsoft has developed a spreadsheet model that can assist in planning for PI disk and
memory requirements, including VAX, AXP, for PINet, and PIonPINet. Contact your
OSIsoft Salesperson for a copy or download the spreadsheet from OSIsoft Technical
Support’s web site at:
http://techsupport.osisoft.com/support_smr_systemsizing.aspx
Page 8
2.3 – Memory and Disk Estimates for VAX/VMS
Memory Requirements
Feature Memory Requirements
Point Attributes: 125 bytes/ultimate Tag
Archive tables: 6144 bytes/max. # archive files on PI Home Node
Other PINet tables: ~50000.00 bytes
Allow at least 1.5 megabytes memory for VMS system usage. If your VAX is a member of a
cluster, add an additional 1.5 megabytes for each VAX in the cluster. A minimum of 16
megabytes of memory is required. OSIsoft recommends that 25% spare memory be present.
For some interfaces when data is collected on the PINet Satellite node, add 1.3 megabytes or
more of memory to allow for databases or shareable images, such as:
• Allen Bradley PLC (0.6 MB)
• Fisher CHIP (1.3 MB)
• Foxboro FCG (1.3 MB)
• Foxboro AIS (1.3 MB)
• Honeywell CM50S (7.5 MB)
• Rosemount RMTHost (1.3 MB)
• Taylor MOD 300 (1.3 MB)
• Westinghouse WDPF (1.3 MB)
• Yokogawa Centap (1.3 MB)
Manuals for the DCS vendor-supplied software contain information for planning for your
system's memory and disk requirements.
Disk Requirements
Feature Disk Requirements
Point Database file: 512 bytes/ultimate Tag
Other data files: ~50000 bytes
Other PINet files: 35 to 40 megabytes
VMS disk requirements Swap file: 10 megabytes
consisting of: Pagefile: 40-50 megabytes
Vendor interface files: 10 megabytes maximum
When collecting PI Home Node data, vendor interfaces requiring disk space are:
Allen-Bradley PLC (1.3 MB)
Fisher CHIP (6.5 MB)
Foxboro FCG (2.75 MB)
Honeywell TDC3000 (18 MB)
Rosemount RMTHost (8 MB)
At runtime, the PI System uses PINetBuild. We require that you leave PINetBuild on your
PINet and PIonPINet nodes. PINetBuild is required for startup as well as any upgrade or
technical support of your system.
Note: These are rough estimates. Requirements are very dependent on system
configuration and what other applications (relational databases as an example) are
running.
Our estimate for VMS disk requirements includes VMS, DECNet End-Node, typical TCP/IP,
C, FORTRAN, DECWindows as well as swap and page files for one to four users.
VMS System Disk Requirements
VMS ( 5.x+): 120 megabytes. Includes:
Swap file: 10 megabytes (20000 pages).
Pagefile: 50-100 megabytes (100000-200000 pages).
Feature Disk Requirements
Vendor interface 10 megabytes nominal
files:
For fewer than three users you may be able to reduce pagefiles to 25 megabytes (50000
pages). For three to four users you may find that a 30-megabyte (70000 pages) pagefile is
enough.
Page 10
2.4 – PINet/VMS Installation
The ALPHA is a 64-bit machine, so everything will be 2 or more times as large. Data
structures on ALPHA are forced into 64-bit words and in many cases must be page-aligned.
If you are running PINet on DEC ALPHA platforms running OpenVMS you can estimate
your memory and disk requirements as follows:
Requirements for DEC AXP/VMS
Memory Use the sections above to estimate your memory needs as though your system was
running under VAX/VMS. Multiply the result by 2.5 to get your AXP/VMS PIonPINet
memory requirement.
Disk Multiply the VAX/VMS requirement for program file disk space by 2.5 to get the AXP
PINet disk size. Multiply the data and configuration file requirement from VAX/VMS by
4 to get your AXP/VMS PINet disk requirement.
Before you start, be sure to perform all of the following preparation steps.
Refer to the HP/Compaq Guide To Open VMS Software Installation for complete
information on the VMSinstal command procedure.
PINet/VMS Machine
Back up your VMS system disk.
Security
A PITrust must be defined for the PINet or PIonPINet node. Refer to the PI Server System
Management Guide for instructions regarding PITrust creation.
Create a PITrust for each of your PINet and PI API/SDK nodes to use. The PITrust permits
those nodes to write data to PI without having to log in.
The PINet or PIonPINet node’s PITrust must be defined prior to installation or upgrade of
PINet or PIonPINet.
The Proxy database of PI3.2 has been replaced with a Trust table in PI3.3. During upgrades
from PI3.2 to PI3.3, the PIProxy table is automatically converted to a new PITrust table.
Proxies and Trusts are similar to the model for network security used by PI2.
UCX
$ ucx set host “PITHREE” /addr=123.145.167.21
TCPWare
Edit the TCPWARE:Hosts. file.
MultiNet
Edit the MultiNet:Hosts.Local file. After editing, run the following commands:
$ multinet host_table compile
$ @multinet:install_databases
PathWay
Edit the TWG$ETC:Hosts. file.
Shutdown and restart.
Page 12
2.4 – PINet/VMS Installation
… where a page is 512 bytes for VAX systems. (A page may be known as pagelets on
AXP).
If your system does not have enough pagefile capacity, consult your VMS installation
and upgrade documentation.
Note: If your VMS system does not have a CD drive, insert the CD into a PC
running Windows 95 or greater. Copy the PINet installation kit files to a
temporary directory on your VMS system using either FTP or WRQ Reflection 4,
in binary transfer mode.
The VMSInstal dialogue will guide you. In the OpenVMS installation procedure,
brackets are used to indicate default answers. For example,
* Do you want to continue? [YES]
12. Press the < RETURN > key to indicate YES.
VMSInstal checks that these SysGen parameters are set greater than or equal to the
following values:
MAXBUF 20480
GBLSECTIONS 256
LNMPHASHTBL 512
LNMSHASHTBL 512
The values for the SysGen parameters GBLPAGES and VIRTUALPAGECNT and
PQL_DPGFLQUOTA are calculated at installation time.
If any of these parameters are inadequate, VMSInstal revises the data file
Sys$System:ModParams.dat. With your consent, VMSInstal runs AUTOGEN with
NOREBOOT NOFEEDBACK. VMSInstal prompts you to reboot your system and
restart the installation procedure.
Page 14
2.4 – PINet/VMS Installation
Note: If you have Honeywell CM50 software installed and plan to load the
TDC3000 interface, the SysGen parameters GBLPAGES, VIRTUALPAGECNT
and the System account quota PAGEFLQUO may need to be substantially
larger than the procedure calculates. If you have more that one computer
gateway (CG), or many lists, add 4,500 pages plus 200 pages for each list to the
GBLPAGES calculation. VIRTUALPAGECNT and PGFLQUO will need to be at
least 100,000. Also, if you plan to use the TDC3000 interface, you should set
your PageFile.Sys file to be within the range of 75000-120000 for VAX, and
100000-200000 for AXP. You may resize the pagefile via the
Sys$Update:Swapfiles.com file.
13. You are asked (i) whether PINet/VMS will communicate to the PI Home Node via
TCP/IP and (ii) whether the PI Home Node runs on Windows or UNIX (versus
running on VMS).
Answer YES to both of these questions. The following file is edited to reflect your
answers:
PINet:PINetNames.com
PINet 2.2 and later permit the size of the PINet node's Point Database size to be
changed easily to match the license limit of the PI Server Home Node. On upgrade,
the PINet node's Point Database size is checked, if there is a change in Point
Database size, a message will be written to the screen.
Point Database size change requires a complete synchronization of the databases
copied to the PINet node. This can take up to 45 minutes or so. In rare cases there is a
problem with this synchronization processing; refer to section 3.4.4, Rebuilding the
Point Database for the procedure to complete the synchronization (to manually
rebuild the Point Database.)
14. If you are using your own option file that specifies PISub/Lib explicitly, you may
want OSIsoft to build PISub.olb during this upgrade.
This is a deprecated feature – installations of PINet 2.3 and later will not present this
question during the VMSInstal dialog.
Note: For PI version 2.0.x, 2.1.x and 2.2, the former PISub library is split into two
libraries: PISubShr.olb and PISubNoShr.olb. If you have not written any PI Toolkit
applications and do not have any third party PI software, this modification is
transparent. If you are using PILink:PITKLib.opt (or any OSIsoft-supplied link option
file) when linking your applications, your applications will link normally. Therefore,
PISub.olb is NOT needed.
PISub.olb requires approximately 20000 blocks in addition to 20000 blocks used for
temporary files.
If there is enough disk space to support a copy of PISub.olb, you will be prompted as
follows:
Do you want PISub.olb built? [NO]
If there is insufficient disk space, you will be warned to modify your option files.
You will also be given the option to continue the upgrade as follows:
Do you want to continue? [YES]
If you choose to continue the upgrade, the PI System will upgrade normally.
However, it is likely that any applications linked in the procedure
PINet:SiteSpecificLink.com with special link option files will fail. At some point, you
will need to modify your special link option files.
Replace the line:
PILink:PISub/Lib
with the two lines:
PILink:PISubNoShr/Lib
PILink:PISubShr/Lib
A better option is to change the link command procedures to use PILink:PITkLib.opt.
15. Re-link any programs you have written which use PI subroutines such as interfaces or
other custom programs. VMSInstal will automatically perform the commands in
PINet:SiteSpecificLink.com.
16. Check PINet:SiteStart.com and PINet:SiteStop.com. These command files should
contain the site-specific startup and shutdown commands for your system. These are
mostly interface programs and user-written programs based on the PI Toolkit.
Note: If your VMS system does not have a CD drive, insert the CD into a PC
running Windows 95 or greater. Copy the PINet installation kit files to a
temporary directory on your VMS system using either FTP or WRQ Reflection 4,
in binary transfer mode.
Page 16
2.4 – PINet/VMS Installation
MAXBUF 20480
GBLSECTIONS 256
LNMPHASHTBL 512
LNMSHASHTBL 512
The values for the SysGen parameters GBLPAGES and VIRTUALPAGECNT and
PQL_DPGFLQUOTA are dependent on each particular VAX/ALPHA. Thus, these
values are calculated at installation time.
Special Notes:
If you have Honeywell CM50 software installed and plan to load the TDC3000
Also, if you plan to use the TDC3000 interface, you should set your
PageFile.Sys file to be within the range of 75000-120000 for VAX, and 100000-
200000 for AXP. You may resize the pagefile by executing the VMS command:
@Sys$Update:Swapfiles.com
If any of these SysGen parameters are inadequate, VMSInstal revises the data file
Sys$System:ModParams.dat. With your consent, VMSInstal runs AUTOGEN with
NOREBOOT NOFEEDBACK. The VMSInstal procedure prompts you to reboot
your system and restart the procedure.
8. You are prompted for disk device names for the new PINet/OpenVMS directories.
9. You are also asked (i) whether PINet/OpenVMS will communicate to the PI Home
Node via TCP/IP and (ii) whether the PI Home Node runs on Windows or UNIX
(versus running on VMS).
Answer YES to both of these questions. The PINet:PINetNames.com file is edited to
reflect your answers.
10. With your consent, VMSInstal edits the Sys$Manager: files SyStartup_V5.com
(VMS 5.x) or SyStartup_VMS.com (VMS 6.x) and Sys$Manager:SyShutDwn.com to
automatically start up and shut down PINet/OpenVMS.
11. The installation procedure restores files from CD and links the PINet/OpenVMS
System. Depending on the capabilities of the machine, this may take 60 minutes or
more.
It is 23-APR-2005 at 09:45.
* Are you satisfied with the backup of your system disk [YES]?
* Where will the distribution volumes be mounted: DKA300:[PISAVESET.LOQUAT26]
Enter the products to be processed from the first distribution volume set.
* Products: pinet026
* Enter installation options you wish to use (none):
Page 18
2.5 – Typical PINet Upgrade
PINET V2.6
* Are you satisfied with the backup of your PINET directories [YES]?
PINet UPGRADE:
>>> This procedure purges the PINet directory as it goes to <<<
>>> save disk space. <<<
Linking shareable images...
Linking PINet Node programs...
Copying files...
Linking Interfaces...
PINetInstall completed
To install products across the network using VMSInstal, there must be a default proxy
account on the serving host so that the destination node can access the installation kits. This is
because the VMSInstal utility cannot accept user name and password in the command
statement.
Set up a default proxy as follows:
LYCHEE::DISK$PIDISK:[PITAPE]>set default sys$system:
LYCHEE::SYS$SYSROOT:[SYSEXE]>run authorize
UAF> sho /proxy
_remote user: *
Username: SYSTEM
Password:
Welcome to VAX/VMS V5.5
Directory LYCHEE::DKB0:[PITAPE]
PINET020.A;1 PINET020.B;1
Total of 2 files.
It is 4-AUG-1994 at 18:45.
* Are you satisfied with the backup of your system disk [YES]?
Page 20
2.7 – Post VMSInstal Steps
PINET V2.0
Page 22
2.7 – Post VMSInstal Steps
In PINet 2.6 and later, you can use a system wide option to disable the Snapshot future time
check. You can modify this setting in the command file setSkipPITimeChk.com in the PINet
directory. You can modify and run the command file at anytime to change the time check
setting.
Note: you can use the PINet to PINet option with PI3.x Server, only.
For new installation of PINet, you will be prompted for the PINet-to-PINet option. You do
not have to do anything for the PINet master, that is, the PINet node directly connected to the
PI Server Home Node. You should enable the PINet-to-PINet option for the PINet slave and
specific the PINet master as the Home Node. The PINetTransport can be either DECNET or
TCP/IP to talk to the PINet master.
For upgrading an existing PINet node, the installation procedure automatically adds the
PINettoPINet logical name to your system andset the logical to 0. If you want to change an
existing PINet node to become a PINet slave, you have to modify manually the
pinetnames.com (or pionpinetnames.com for PIonPINet nodes) to change the HOMENODE
name to point to the PINet master. PIHomePort should be changed to 545 and PINettoPINet
should be changed to 1.
3.1.2 Directories
There are two pertinent directories on the PINet/VMS node, PINet and PINetBuild. These are
system logical names that usually translate to global directories, [PINet] and [PINetBuild].
The logical names PISysExe, PISysMgr, and PISysDat are translated into the [PINet]
directory. The PIBuild and PILink logical names are resolved into the [PINetBuild] directory.
3.1.3 Startup
and ShutdownPINet:PINetStart.com and PINet:PINetStop.com are the startup and shutdown
command files. Place these files in the OpenVMS-system specific startup
(Sys$Manager:SyStartup_VMS.com) and shutdown (Sys$Manager:SyShutdwn.com) routine,
respectively. Thus, PINet/VMS is started or stopped whenever the VAX/ALPHA is started or
stopped.
When PINet/VMS is first installed – and first started – the Home Node PI System must be
running. At installation and first startup, the PINetSync subsystem rebuilds the complete
Point Database information stored on the PINet node. Do not interrupt this process.
Subsequently, you can start the PINet/VMS System when the home PI System is not running.
Note that some interface programs require that the PINet/VMS node be connected to the
PIHome Node when the interface is started.
The startup command file executes PINet:PINetNames.com. This command file defines the
logical names for directories and files of the PINet/VMS system. In addition, this file
contains a symbol for the TCP/IP node name of the PI Home Node.
The startup command file also installs the PITables, PISubShr, PICRTShare, and PIElShare
shareable images. The startup command file starts the batch job that creates a new version of
the PINet/VMS log file at a specified time every night. The PINet/VMS log file,
PIMessLog.txt, is in the directory PINet.
Other log files (PINet subsystem and interface programs) can be found in the PINet directory
with names like: *.out, *.log, and *.txt.
PINetStart.com and PINetStop.com are generic procedures that should not be edited. Put site
specific instructions such as interface start and stop commands in PINet:SiteStart.com and
PINet:SiteStop.com.
Page 26
3.1 – PINet/VMS Operation
I/OMonitor
The program PINet:IOMonitor.exe displays the value of the counters for every Tag in
PINet:IORates.dat. It then displays the rates in events per second at the user specified update
interval (5 seconds is good interval to use).
$ run PINet:IOMonitor.exe
Scan period (secs): 5
SYTDC001 9889 events
SYSNPPINET 21672 events
SYEVMPINET 168 events
Rates in events/second
(use control-C to stop program):
SYTDC001 SYSNPPINET SYEVMPINET
5.40 29.80 1.81
Snap
The program PINet:Snap runs as a DCL command. Type:
$ set command PINet:Snap
QWatch
The program PINet:QWatch.exe shows the status of the Snapshot Event Queue on the
PINet/VMS node. The Event Queue and its QManager subsystem compose the data
buffering mechanism on a PINet satellite node. For QWatch, a scan period of 5 seconds is
suitable. Use <CTRL-C> to exit the program.
$ run PINet:QWatch.exe
Scan period in secs [0]: 5
EVMDump
The program PINet:EVMDump.exe lists the processes that have signed up for exceptions
(events from the Event Manager).
$ run PINet:EVMDump.exe
Page 28
3.1 – PINet/VMS Operation
PINetVerify
The command file PINet:PINetVerify.com shows the overall status of the PINet/VMS node.
Run this utility as a first step in debugging PINet/VMS problems.
$ @pinet:pinetverify
Along with a display of some status information, it displays warnings:
• If some of the necessary PINet/VMS processes are not running
• If the PI Home Node is unavailable
• If the PINet/VMS protocol version of the Home Node is incompatible
WildL
The program PINet:WildL.exe searches for Tags based on a Tagname specification. An
asterisk is a wildcard character in the Tagname search.
WildL.exe displays its results in three columns. The first column is the PointID, the second
column is the short Tagname (at most 10 characters), and the third column is a regular
Tagname. The short Tagname is necessary for backward compatibility with PI2.x Systems.
For example, to search for Tags beginning with the letter T:
$ run PINet:wildl.exe
Mask: t*
PointID NAME 5/5 points found/remain
11 TAG NUM~11 TAG NUMBER 1
18 TAG1234~18 TAG1234567890
19 TAG1234~19 TAG1234567891
21 THIS IS~21 THIS IS ANOTHER LONG TAGNAME
20 THIS_IS~20 THIS_IS_A_VERY_LONG_TAGNAME
ListAtt
The program, PINet:ListAtt.exe can be used to look at most of the classic point class
attributes for a Tag whose name is known.
The attributes displayed are those commonly used by instrument interfaces which run on
OpenVMS PINet nodes and are useful in troubleshooting and monitoring data collection
operation.
This may also be useful for comparing the configuration as stored on the PINet node with the
configuration of the Tag on the PI Server.
$ run pinet:listatt
Enter Tagname: sinusoidu
PointType :R Precision :F
Zero : 0.0000000E+00 Span : 100.0000
Typic.Val : 50.00000 EngUnits : 2
Pt Source :R
Location : 0 -2 0 1 0
Filtr code: 0 SquareRoot: 0
Archiving : 1 Compresing: 1 Scan : 1
Total Code: 0 Conv. fact: 1.000000
Exc. Specs: 1.000000 % 0 0
Comp.Specs: 2.000000 % 0 28800
Creator : 1 Create Date: 20-May-1997 14:45
Changer : 1 Change Date: 26-Jan-1999 19:12
Enter Tagname:
Interface Programs
I/ORates Tags for interface programs that run on a PINet/VMS node should be entered in the
PINet:IORates.dat file. For example,
* IORate Tags
SYTDC001,1
Page 30
3.1 – PINet/VMS Operation
Interfaces may use I/O counter numbers 1-34 and 51-200. Consult each interface’s specific
documentation on where to place the I/O counter number in the interface’s startup command
line.
In the above example, remember to create the SYTDC001 Tag on the PI Home Node.
Note: The Tagnames SYSNPPINET and SYEVMPINET are arbitrary. You may
create these Tags and name them anything you wish. In fact, if you have more than
one PINet/VMS node, you will need to create two sets of Tags. These may be
SYSNPNET1 and SYEVMNET1 together with SYSNPNET2 and SYEVMNET2.
Tag Creation
You may use the following piconfig commands to create I/O Rate Tags. The fields in the
second line below represent Tagname, descriptor, engineering units, pointtype, zero, span,
typicalvalue, step, and pointsource.
@input defaultpt.dif
sysnppinet,snapshot rate for
PINet,events/min,float16,0.0,3000.0,500.0,0,L
@exit
An I/O Rate Tagname may not contain more than ten (10) characters (use short Tagname).
3.1.9 Shutdown
PINet/VMS Node
EventsWhen the PINet/VMS System is shut down, points can be set to a status of Shutdown.
The PINet/VMS node should only add shutdown events for Tags for which it collects data.
Modify PINet:ShutdownEvents.com and PINet:CheckForCrash.com to add shutdown events
for these Tags. At the end of each of these files is a line that executes the program
PI Home Node
On the PI Home Node, modify the Shutdown attribute for Tags that are collected on
PINet/VMS nodes. The PI System on the Home Node can be shut down and restarted without
stopping data collection by distributed interface programs running on the PINet/VMS node.
Thus, the PI Home Node should NOT write shutdown events for Tags whose data are
collected on PINet/VMS nodes.
PI Server uses the PI\dat\shutdown.dat file instead of the PISysDat:IORates.dat file. PI
Server allows individual configuration of shutdown events on a Tag by Tag basis, using the
Shutdown point attribute. Normally the Shutdown attribute should be set to 0 (off) for all
points not collected by interfaces on the PI Home Node.
Chapter 1, Starting and Stopping PI in the PI Server System Management Guide, explains
how to configure shutdown events.
Page 32
3.1 – PINet/VMS Operation
ExceptServ
Data acquisition interface programs put events into the Event Queue with either
pisn_sendexceptions or pisn_putsnapshot (PI2.x Toolkit routines PISendExceptions or
PutSnapshot). The exception report server process, ExceptServ, retrieves events from the
event queue and sends them to the PI Home Node. The PINetMgr process on the Home
Node puts the events into the Snapshot and Archive.
Because PI Server implements point-by-point security, the pisn_sendexceptions or
pisn_putsnapshot routines may not return an error, yet data are not sent to the archive. Check
PINet:PIMessLog.txt to make sure that the ExceptServ program did not encounter any errors
in sending data to the PI Home Node.
QManager
This process, QManager, maintains the virtual event queue. It saves events to disk when the
memory portion of the event queue fills up. It moves the events from disk to memory when
the memory portion of the queue has enough free space.
SaveSnapshot
The SaveSnapshot process writes the local copy of the Snapshot value for each Tag to a file.
PINetSync
The PINetSync process maintains on the PINet/VMS node an accurate copy of the PI Home
Node’s point database. This process also synchronizes the time with the PI Home Node.
By default, the PINet/VMS node sets its system time to match that of the PI Home Node. It
compares its system time to that of the Home Node every hour. The PINet/VMS node time is
updated if it is different from the Home Node time by more than 10 seconds. The PINetSync
process performs this check and writes a message to PINet:PIMessLog.txt whenever it
changes the VMS time.
If you wish to change the default behavior of PINetSync, refer to the instructions in the
PINet:PINetSync1.com file.
PIEVManager
The PIEVManager process maintains queues of exception reports for programs that sign up
for them. This process retrieves exception reports from the PI Home Node if necessary.
EVMCheck
The EVMcheck process periodically checks that each list of points established with the
PIEVManager has an associated parent process. If not, EVMcheck deletes the orphaned list.
IORates
The IORates process periodically checks for updates to counters written by interfaces. The
IORates process provides 10 minute averages which are placed in Tags specified by file
PISysDat:IORates.dat established by the interfaces for reporting their status.
Network Communications
The PINet/VMS System talks to the PI Home System via transparent TCP/IP socket calls.
The format of the messages passed between the nodes is referred to as the PINet/VMS
protocol. According to this protocol, the processes on the PINet/VMS node send commands.
The PINetMgr process on the Home Node replies to these commands.
PI3 server nodes have automatically follow the DST / Standard time management rules that
their operating system is configured to follow. However, PINet nodes do not have such a
utility. How should the fall and spring time changes be handled on PINet nodes?
In the USA (and other parts of the world), PINet nodes talking to PI3 Home Nodes should
submit a batch job to run at 01:55:00 AM before the change that does the following:
@PINet:Stop PINetSync
wait 00:05:00 ! wait 5 minutes
set time=01:00:00.0 (for fall change)
- OR -
set time=03:00:00 (for spring change)
set time (set time with no parameters synchronizes the VMS clock
with the CMOS clock on the processor board of the OpenVMS systems)
wait 00:05:00 ! wait 5 minutes
@PINet:PINetSync
Note: use line 3 or 4 only.
The rationale behind this procedure is discussed below:
We could rely on the time synchronization feature of PINetSync to set the time on the PINet
node.
However, since PINetSync only checks the Home Node time at a user-specified frequency
(default once per hour), it is possible to have the time wrong for a period up to the time sync
frequency (e.g. one hour as in the case of the default setting). Hence, we recommend using a
batch job to set time directly to avoid losing data (specially in the case of the PI3 Home
Node. For PI2 Home Node where data may be discarded anyway, it is not as critical though it
will prevent unnecessary error messages from putsnapshot).
Also, we recommend stopping the PINetSync procedure before the time sync so that we will
not run into the case of two separate processes trying to set time and get into each other's
way. For example, if the PINetSync procedure already set the PINet system time back before
the batch job is activated, the batch job may get activated in the wrong time. Or if the user
Page 34
3.3 – PINet Backup Scripts
had specified ramping method for time change in the PINetSync startup parameters, the time
change may take a long time to accomplish.
Note: If you are running any scan-based OSIsoft interfaces on your PINet node, it
would also be wise to stop and restart all your interfaces right after you change the
PINet node's time. Most interfaces keep track of their scan times in terms of PINet
time. If you set the time back, the interfaces will go another whole hour before
running another scan. This is not a problem for interfaces collecting data via
exception instead of during predefined scan times. This problem only appears during
the fall DST change.
If your interface takes an extremely long time to start up, you might be better off to just let it
run without stopping and restarting it, but this should be a very rare case.
not possible. What we can do is try to identify key files and users - backing up these objects
on a frequent basis such as daily or several times per week.
Page 36
3.3 – PINet Backup Scripts
$ ! PINetBackBatch.com
$ ! OSIsoft Software, Inc.
$ ! Chuck Thompson
$ !
$ ! Command file to back up PINet System.
$ !
$ ! Several items may need to be customized in this file.
$ ! Check the name of the tape drive device name ("TAPE = ") below.
$ !
$Backup:
$ !
$ ! Backup to tape
$ !
$ Tape = "MUA0"
$ Allocate 'Tape'
$ Initialize 'Tape' "Arc1"
$ Mount/Foreign/NoAssist 'Tape'
$ If .not. $Severity then goto ErrBranch
$ !
$ ! We do not want to backup the file "eventq.dat" - this file
$ ! could poison the system if restored in the future.
$ !
$ ! For VMS Version 5.x
$ !
$ Backup /Record /NoVerify /Log /Ignore=(Interlock,Label) -
PI$Disk:[PI*...]*.* /Exclude=EventQ.dat -
'Tape':PINet.bck
$ !
$ ! An alternate backup scheme... Get whole disk where PINet lives.
$ ! Note: It is assumed that the PI$Disk logical name references the
$ ! name of an actual disk device, not a concealled logical name.
$ !
$ ! backup /record /noverify /log /ignore=(interlock,label) /image -
$ ! PI$Disk: /exclude=eventq.dat -
$ ! 'tape':PINet.bck
$ !
$ Dismount/Unload 'Tape'
$ Deallocate 'Tape'
$ !
$End:
$ !
$ ! Write message to PI message log
$ !
$ WriteMessLog :== $PISysExe:WriteMessLog
$ WriteMessLog "PINet directory backed up to tape"
$ Exit
$ !
$ !
$ErrBranch:
$ !
$ Write Sys$Output "Mount error: Severity and Status are"
$ Write Sys$Output $Severity,$Status
$ !
$ ! end of file
Page 38
3.3 – PINet Backup Scripts
3.4 Troubleshooting
Page 40
3.4 – Troubleshooting
Take a look at the PINet System Message Log (PINet:PIMessLog.txt and other logs named
like, *.out, *.log, *.txt). The PINet/VMS processes or interfaces may put useful information
in the log files.
PINetTransport
The PINetTransport logical name must be TCP/IP.
1. To confirm, run the following from DCL:
$ show logical PINetTransport
"PINETTRANSPORT" = "TCPIP" (LNM$SYSTEM_TABLE)
2. If necessary, edit the appropriate line in PINet:PINetNames.com:
$ Define/System/NoLog PINetTransport TCPIP
3. Execute PINet:PINetNames.com; stop PINet.
4. Re-link the entire PINet system:
$ set default PINetBuild:
$ @pinetinstall.com
5. Restart PINet/VMS.
PIHomeNode
The PIHomeNode logical name must contain the name of the machine running PI Server.
To confirm, run the following from DCL:
$ show logical PIHomeNode
" "PIHOMENODE" = "PI3"PIServer"::"0=PIServer""
The above shows that the PIHomeNode is a machine called “PI3”. If necessary, edit
the appropriate line in PINet:PINetNames.com. In this example, the name should be
changed to “PITHREE”.
$ HomeNode := PITHREE
Execute PINet:PINetNames.com. See Rebuilding the Point Database later in this chapter.
Restart PINet/VMS.
PIHomePort
The PIHomePort logical name must match the PI server port number. By default this number
is 5450.
To confirm, run the following from DCL:
$ show logical PINetTransport
"PIHOMEPORT" = "5450" (LNM$SYSTEM_TABLE)
UCX - VAX
$ Define/System/Exec/NoLog PIVAXCOMMLib sys$library:ucx$ipc.olb
$ Define/System/Exec/NoLog PIVAXCOMMShr pinet:vaxcommdumlib.exe
UCX - ALPHA
$ Define/System/Exec/NoLog PIVAXCOMMLib pinet:vaxcommdumlib.olb
$ Define/System/Exec/NoLog PIVAXCOMMShr pinet:vaxcommdumlib.exe
Page 42
3.4 – Troubleshooting
Note: The following is only valid if the network transport doesn’t change.
A rename on the PI3 version 3.3 and earlier server does not trigger a ptupdate for processes
signing up for Point Database change. (This has been fixed in PI versions 3.3 SR1 and later.)
Note that if the user is changing any other point attribute, a point update will be triggered.
The problem is only for rename. In the case of pinet, pinetsync on the PINet rely on the
point database signup on the PI3 server to process a point database change. If the PI3 server
does not notify pinet about the rename, PINet will not go get the new point record to process
the point change. PI3 3.3 SR1 addressed this issue.
Another problem can be that updates to other point attributes are missed. PI3 version 3.3
manual says “If a PINet node is connected to the PI Server, the default MaxUpdateQueue
value is too small. It should be increased to at least the point count of the PI3. This value
ensures that all point updates requested by PINet can be queued on the PI Server if a system
manager performs an edit operation on every point.”
Here is a script that can be used to apply the PITimeout table change suggested by the
manual. Clip the lines below, save as a text file, maxupdatequeue.txt. Alter the setting (10000
shown below) to match your Tag count. (Tip: It is better to increase this to match your
Licensed Tag Count.)
@mode edit,t
@istr name,value
maxupdatequeue,10000
@ends
then use piconfig to apply the change:
piconfig < maxupdatequeue.txt > maxupdatequeue.out
and check the output log to confirm the change.
A Tag rename operation is not transparent to many applications. Especially those applications
that support PE expressions using embedded Tagnames.
Most applications map Tagnames to PointID numbers at startup, thus the application
continues to run during a name change event. Some applications (like PI ProcessBook)
persist the PointID cache so it can then resolve a Tagname change on the next startup.
Unfortunately, PI Batch in 3.2 does not. (Even the data set PI calculation expression part of
ProcessBook does not.)
The Client-Server architecture for any application (WEB, PI, Fileservers…) makes the issue
of concordance and links very difficult. Renaming a Tag is much like renaming a Windows
directory that is shared. OSIsoft module database technology includes an aliasing feature as a
possible centralized solution for issues like name concordance.
In the meantime, it is important as an administrator to carefully implement Tagname changes:
1. Publish a Tagname change log (especially to Excel/Datalink users)
Date, old name, new name, ptid, recno, comment
2. Check for references within the PI Server modules and Tag attributes
Batch PIBAUNIT table: ACTIVETAG, BIDEXPR, PRODEXPR
Interface Tags (including PIPESCHD): EXDESC
Totalizer: FILTERSTR, EVENTSTR
3. Update SMT configuration worksheets
SOURCETAG and SRCPTID are maintained by PI, so rename is
automatically supported but saved SMT worksheets need to be re-
imported.
What PINet for PI3 uses as a PointID is actually the archive system’s RecNo from the PI3
server. (This is true for all PINet for PI3 nodes starting with PINet version 2.2.)
Why the difference? PINet for PI3’s databases and structures are all hard-coded to compiled-
in limits set by OSIsoft. The number of points that a PINet node’s local point database can
“see” is limited to your licensed point count of your PI3 server. On the PI3 server, Point IDs
are assigned in 1,2,3…N order. As points are deleted and new points created, PointID
numbers are never reused. Thus after quite a few point deletion/creation cycles, it’s possible
that your PI3 system will have PointID numbers larger than your licensed point count. If that
happens, your PointID numbers will exceed the range PINet can see. (PointID limitation only
effects PINet versions 2.1.1 and 2.1.2. PINet 2.1.0 and earlier versions did not support PI3
server.)
However the archive subsystem’s RecNo ID number ranges from 1 to N where N is the peak
number of concurrent Tags your system has had. PI3 reuses RecNo’s as points are deleted and
new points are created. RecNo ID numbers should always be within the range of the
databases and structures of your PINet for PI3 node(s).
If you license more points for your PI3 server, you may need to upgrade your PINet for PI3
node(s) at the same time.
Page 46
4.4 – PINet – Migration by Upgrade or New Install
In any case you will have to upgrade or make a new install of PINet to get a version that has
databases built and structured for PI3. (The database sizes and structures are different for a
PINet node compiled for a PI2 system versus a PI3.)
Note that every PINet is custom compiled for each PI Server. It is improbable that PINet
install kits for any two PI Servers will be identical. Be sure to use the proper install kit for
PINet with your PI Server.
A consequence of upgrading will be that the system manager will have to re-link all their
custom programs that are PI related (linked to PI shareable, or using Tag data, or using PI
subroutine libraries).
With the PI2 to PI3 pre-migration survey came a command file that can “sniff” all the
mounted disks of a VMS system to find files linked to PI. The command file is called Find-
PI-Related.com.
Note: Upgrading a PINet compiled for a PI2 server with an install kit for a PINet
compiled for a PI3 server will result in databases that are inconsistent. You will have
to manually rebuild the databases using the procedure documented in Rebuilding the
Point Database on page 42. If you are changing the network transport, there are
additional changes you will have to manually edit into several files. Therefore it is
strongly advised to do a new installation, as this avoids ALL of these issues.
For the migration, it is often easier and faster to just do a new installation of PINet. The
VMSinstal kit for PI, on a new install, takes care of lots of changes that have to be made to
change things like protocol, PI Home Node, addresses, and ports. On an upgrade, the PI
VMSinstal kit does not check or set these parameters for you.
There are only about six files worth preserving from the old PINet – it is pretty quick to just
edit the new PINet installation files as needed by comparing to listings from the old PINet
installation. The six files are:
sitestart.com
sitestop.com
checkforcrash.com
shutdownevents.com
iorates.dat
and the interface startup file, for example, TDC.com from the Honeywell CM50s
interface.
To do a new install on your PINet node for migration, try these steps as preparation for the
PINet installation:
1. Restart PINet
2. Check to see that all PINet processes and PI related processes are stopped
3. Rename the PINet and PINetBuild directories
PI2 has a feature for PINet called PINet to PINet. This feature was added starting with PINet
version 2.1.2. PINet can also act as a PIServer for PINet and PI-API nodes. PIServer and
PINet to PINet can be good solutions in situations including:
PINet or API nodes are overrunning the PI3 Update Manager. (Use both PINet to
PINet and PIServer features.)
API nodes either have weak buffering capability or cannot support buffering at all,
i.e., Windows 9x or some of the imbedded PI-API platforms. (Use PIServer feature.)
Need to support nodes that can only use DECNet networking with a PI3 Server. (Use
PIServer feature.)
PINet to PINet is not implemented very often. Modern Windows servers and newer PI3
versions have vastly improved performance and capabilities that pretty much reduce or
eliminate the need for PINet to PINet. Settings exposed in the PI3 PITimeout Table and
settings at the PI-API node to fine-tune API-Buffering have combined to solve most needs for
PINet to PINet.
Discussion
PINet to PINet is an option that can be selected during PINet installation. The PINet
VMSinstal kit prompts for this option. PINet to PINet would be selected for the slave nodes
only, not the PINet node that is acting as the PI Server. (See the diagram below – Refer to
nodes 1 and 2 as the PINet slaves.)
PINet to PINet should only be used to create a PINet slave node when the server is PI3 and
there are problems with PI3 Update Manager overruns.
Probably all PINet nodes (2.1.0 or later) can implement PIServer features. (Depends on disk,
memory, and processor capability.) Starting with PINet 2.1.2, the PINet VMSinstal kit places
PIServer programs on the PINet node for any network protocols found. To enable the
PIServer listener and set up PI security, follow instructions in section 4.6, Troubleshooting
PINet Connections and in the pinetbuild:PIServer.txt file. PINet versions 2.1.0, 2.1.1 can
have manually implemented PIServer support by following directions in a Tech Note /
Answerbook.
Here are some benefits to using a PINet node as the server for other PINet nodes and PI-API
nodes.
Page 48
4.5 – PINet to PINet and PINet as a PI Server Node
Windows and UNIX machines and poorer performance of PI3. The issue was that the
PINet nodes represented a large demand on the PI3 Update Manager and as a result, the
Update Manager could be overrun or lose updates. The Event Manager for PINet was
more robust in some ways as compared to the Update Manager, so the work-around was
to turn a PINet node in to the “server” for all the interface nodes including PINet, PI-API.
(PINet nodes 1 and 2 in the illustration below are slaves of a PINet node acting as the
PIServer node.)
Errors such as -999 and -994 in this case are similar to -10401 and like errors.
File protection problems on the PI Server can be a problem. The TCP/IP software and the
PIServer software are candidates. For PI, check the protections of some files. PISysExe:*.exe
should have all files set for (s:rwe, o:rwe, g:rwe, w:rwe) and PISysExe:*.com files should all
be (s:rwe, o:rwe, g:re, w:re). There are many different file protections for files in the
PISysDat directory. However, PIServer.dat needs to be (s:rwe, o:rwe, g:rwe, w:rwe).
The host file and related TCP/IP parts need world access.
With legacy UCX or DEC TCP/IP, it is possible that the PIServer service is incorrectly
defined or is disabled.
Page 50
4.7 – Starting PINet on OpenVMS 6.1 and Later
The startup of the OpenVMS operating system has several execution threads. The startup of
PINet occurs in a different thread than the X-Window subsystem. PINet has some routines
which depend on X-Windows (Motif or DECWindows).
If PINet doesn’t start up automatically when you reboot OpenVMS, and if you can easily
start PINet from the command line, it’s possible that the OpenVMS startup process is
attempting to start PINet before X-Windows is operational.
A workaround for this problem is to start PINet from the system batch queue processor, after
a delay.
Change the startup command you placed in Sys$Manager:SyStartup_VMS.com from:
$ @dua0:[pinet]pinetstart
To:
$ submit /user=system /after=”+00:05:00” /log=dua0:[PINet] -
dua0:[pinet]pinetstart
Substitute the appropriate disk drive name for dua0.
OSIsoft has developed a spreadsheet model that can assist in planning for PI disk and
memory requirements, including VAX, AXP, for PINet, and PIonPINet. Contact your
OSIsoft sales person for a copy.
function is in progress, is 1.5 to 3 megabytes. Each DEC Window user should have 2 to 4
megabytes of memory to support their server processes.
Allow .25 to .5 megabytes of memory for VMS Only Users (not logged into PI) concurrently
logged into the system (i.e. system users, mail, programmers).
Allow at least 1.5 megabytes memory for VMS system usage. If your VAX is a member of a
cluster, add an additional 1.5 megabytes for each other VAX in the cluster.
When data is collected on the PIonPINet node for some interfaces, add 1.3 megabytes of
memory for databases or shareable images such as:
• Allen Bradley PLC (0.6 MB)
• Fisher CHIP (1.3 MB)
• Foxboro FCG (1.3 MB)
• Honeywell CM50S (7.5 MB)
• Rosemount RMTHOST (1.3 MB)
• Taylor MOD 300 (1.3 MB)
• Westinghouse WDPF (1.3 MB)
• Yokogawa Centap (1.3 MB)
Manuals for the DCS vendor-supplied software contain information for planning your system
memory and disk requirements.
Note: These are rough estimates. Requirements are very dependent on system
configuration and what other applications (relational databases as an example) are
running.
Our estimate for VMS disk requirements includes VMS, DECNet End-Node, typical TCP/IP,
C, FORTRAN, DECWindows as well as swap and pagefiles for 8 to 16 users.
Page 54
5.1 – System Requirements
Note: For fewer than 3 users you may be able to reduce pagefiles to 25 megabytes
(50000 pages). For 3 to 4 users you may find that a 30-megabyte (70000 pages)
pagefile is enough.
At runtime, the PI System uses PINetBuild. We require that you leave PINetBuild on your
PIonPINet system. PINetBuild is required for startup as well as any upgrade or technical
support of your system.
Page 56
5.2 – Installing PIonPINet/VMS
Note: Substitute the name of your device for cd-device. You will be prompted to
confirm new installation or upgrade.
2. Memory and disk requirements for PIonPINet are slightly different than those for
PINet. Confirm that the virtual memory of VMS is adequate to begin the installation.
5.2.3 Startup
The file PISysMgr:PIonPINetStart.com starts PIonPINet/VMS. You should put the following
in your OpenVMS startup command file, Sys$Manager:SyStartup_VMS.com in order to start
PIonPINet/VMS when OpenVMS starts up:
$ @dka0:[PINet]pionpinetstart.com
Substitute the name of your disk for dka0. Site specific PI startup commands are still placed
in PISysMgr:SiteStart.com. Site-Specific PI startup commands would include the start
commands for optional PI components such as interfaces, reports, custom programs.
5.2.4 Shutdown
The file PISysMgr:PIonPINetStop.com stops PIonPINet/VMS. You may wish to put the
following in your Sys$Manager:SysShutdwn.com command file in order to stop
PIonPINet/VMS when OpenVMS shuts down:
$ @pisysmgr:pionpinetstop.com
Site-specific shutdown commands for interfaces, reports, custom programs are still placed in
PISysMgr:SiteStop.com.
PIonPINet allows running PI2.x applications on a PINet node. Since PINet TCP/IP can run
against a PI3.x System, applications that cannot be migrated can still be run. PIonPINet also
supports PI Toolkit-based applications. PIonPINet is a separately licensed product – contact
OSIsoft sales for more information.
Note: Displays that present Engineering Units, Point Sources and Digital State
strings show data from a local default database that is installed with PIonPINet/VMS.
They are not updated with information from the PI Server Home Node. Digital state
strings used in other displays are translated by the Home Node and should be
correct.
Configuration and editing for these items and all archiving is only performed on the PI Home
Node. A process called PINetSync maintains a local copy of the Point Database and
synchronizes the local VMS system time with that of the PI Home Node.
PINet nodes use the PI3 server Record number attribute (RecNo) rather then the PointID.
This is due to PINet architecture, which is based on a fixed size point database. The RecNo is
always below the point count, whereas the PointID grows monotonically.
Optional components from the PI Home Node are enabled for the PIonPINet Satellite node if
licensed. Specifically, PIonPINet/VMS supports the following PI2.x modules:
PINet/VMS - Includes support for interfaces, PI Toolkit programming, PI API
programming. PIonPINet is a superset of the PINet/VMS product. Thus there is no
need to separately install PINet on a PIonPINet node.
PI TR, Data Trending - Including four types of Trends: Horizontal, Vertical,
Composite, and Overview. Both types of Unit Summaries are supported: short and
long.
Page 60
6.3 – Unsupported Modules
PI GP, Graphics Package - The graphics package generates rather large drawing
files (PIGP*.dat). You may wish to examine your disk requirements before
implementing this package. Display files can range in size from several hundred
kilobytes to several megabytes in size. Also, user quotas will need to be considered,
particularly PGFLQUO.
PI AN, Analysis Package - The analysis package is supported on PIonPINet nodes.
No extra configuration is necessary.
PI IR, Interactive Report Builder - There are no special requirements for this
package.
PI RW, Report Writer - Since additional files are necessary to run the report writer,
you may wish to create a special PIReports directory. This provides a concise
repository for source files (*.rdf), compiled files (*.rpi, *.rpo), and reports (*.txt).
PI DL, PC Download Package - Since additional files are optionally created for this
package, you may wish to create a special PIDownload directory. This provides a
concise repository for source files (*.txt) and output files (*.prn).
PI PD, Profile Displays - There are no special requirements for this package.
Note that client products such as PI ProcessBook, PI DataLink, PI SQCView, and PI Profile
generally replace the functionality of the above modules.
If the PI Home Node is PI for Windows or UNIX, PIonPINet/VMS should only be
considered a migration tool for current PI for OpenVMS users.
If the PI Home Node is PI2.x on Open VMS, then PIonPINet provides support for terminal
based users on a satellite node. This frees up resources and computing power on the PI Home
Node. This can also provide a rich, distributed environment for PI Systems needing to
provide some limited functionality during network or PI Home Node outages. PIonPINet also
can provide a powerful distributed environment give a local system manager autonomous
control over local user accounts, privileges, display library and menu systems.
The following utilities are not supported when the Home Node is a PI3.x Server:
List Digital States
List Engineering Units
List Point Source
These utilities present data, based on the architecture of PI2.x for OpenVMS. They are
incompatible with the PI3.x Server architecture.
The PI API maintains compatibility (relative to these tables) with all servers. All point editing
operations, including changes to Digital-States, Engineering Units and Point Source must be
performed on the PI Home Node.
Directories
There are three directories on a PIonPINet/VMS system:
• PINet
• PINetBuild
• PISysDat
The command file PIonPINetNames.com maps PI logical names to the above directories.
Page 62
6.5 – PIonPINet/VMS Operation
Running PI Displays
To look at PI for OpenVMS displays, log into the PI menu. Execute the following:
@pisysexe:pi
Consult the PI for OpenVMS documentation set for information on the particular PI2.x
server application programs that interest you.
The following sections of the PI for OpenVMS Manual apply to PIonPINet:
PI TR, Data Trending
PI GP, Graphics Package
PI AN, Analysis Package
PI IR, Interactive Report Builder
PI RW, Report Writer
PI DL, PC Download Package
PI PD, Profile Displays
The PI DA, Data Archive section of the PI for OpenVMS Manual set includes chapters on
Getting Started, Display System, and Appendices. These chapters also apply to PIonPINet
(Logging in, Using Standard Displays, User Accounts, Menu System, Privileges.)
The PI Guide is also a very useful reference for navigating the PI menu, using trends and
graphics. The PI Guide also explains concepts such as PI time (absolute and relative). Refer
to the PI System Manager’s Course Notes book for explanation of PINet operation as a data
acquisition node and for troubleshooting tips.
Registered users of OSIsoft Technical Support may download all referenced documentation
from the OSIsoft Technical Support web site: http://techsupport.osisoft.com.
The PI Programming ToolKit and PI API are documented in their respective manuals.
Full details of the bug fixes and enhancements can be found in the software release notes for
PI for OpenVMS version 2.6. These release notes are available on the OSIsoft Web site and
can also be found in the PINetBuild directory of PINet interface nodes running PI2.6. Look
for a file called V2.6.
PINet Version 2.6 is released with many bug fixes and enhanced features primarily affecting
interfaces and PINet interface nodes. Bug fixes and workarounds through April, 2005 are
included in this release.
Full details of the bug fixes and enhancements can be found in the software release notes for
PINet for OpenVMS version 2.5. These release notes are available on the OSIsoft Web site
and can also be found in the PINetBuild directory of servers running PI2.5. Look for a file
called V2.5.
PINet Version 2.5 is released with many bug fixes and enhanced features primarily affecting
interfaces and PINet nodes. Bug fixes and workarounds up to about 17-Feb-04 are included in
this release.
Page 66
Appendix A: PINet and PIonPINet Revision History
$! setSnapChkRange.com
$!
$! command file to allow use to specify option to do range check in snapshot
$! for type R points. Default is no range checking.
$! To specify range checking, set the argument to 1.
$!
$ rgch :== $pisysexe:setSnapChkRange
$! set to no range checking in snapshot. Change 0 to 1 to do range check
$ rgch 1
The example shown above enables range checking. Changes made to this command file are
persistent because this command file is executed with each restart of PINet.
PINet version 2.4.1 is primarily a release supporting interfaces that have been revised or
newly written. Several infrastructure changes benefiting interfaces are also included in this
release. (e.g. new UniInt version used for linking interfaces.)
Full details of the bug fixes and enhancements can be found in the software release notes for
PI for OpenVMS version 2.4. These release notes are available on the OSIsoft web site and
can also be found in the PINetBuild directory of servers running PI2.4 - look for a file called
"V2.4".
Problems with several PI utilities and subsystems have been resolved. Refer to the software
release notes for more details on PINet UNIInt. UNIInt is an interface shell developed by
OSIsoft to standardize behavior of interfaces. Enhancements made to UNIInt will benefit all
interfaces using UNIInt. The version of UNIInt will be output to the log file as the interfaces
start up. The PI release notes for version 2.3 can be found in the file, PINetBuild:V 2.3.
Page 68
Appendix A: PINet and PIonPINet Revision History
Point Database: A new utility, PINet:Find-PI Related.com can be used to identify custom
and 3rd party PI Related programs which were not automatically relinked by the upgrade to
PI. PI Related programs are linked to PI libraries and shareable images. If not relinked, PI
Related programs will not run properly after PI has been upgraded.
PINet Enhancement: The scheme to create the short Tagnames on PINet talking to a PI3
Home Node was changed in PINet 2.3. Tagnames equal to or shorter than 10 characters on
the PI3 Home Node will now retain their Tagnames on the PINet node instead of having
mangled Tagnames created.
During an upgrade, the PINet VMSinstal procedure will automatically rebuild the local
copies of the Point Database, Event Queue, and Snapshot files. To avoid lost data, system
managers should not upgrade PINet nodes at a time when the PINet node has a backlog of
unprocessed data in the event queue.
Problems with several PI utilities and subsystems have been resolved. Refer to the software
release notes for more details on the following items:
EVMCheck has been enhanced to accept a user-specified timeout setting when
checking for inactive processes.
ConvertVAXSnapshot utility, which runs as part of a conversion from VAX to AXP
(ALPHA)processor, no longer has problems for Point Databases larger than 64000
points.
ConvertPIPoint utility, which automatically runs on upgrade to increase the Point
Database size, no longer crashes or corrupts records.
The archive call, ArcInterpValFilter now correctly handles “bad data” in the filter
expression.
PI2.2 and later versions provide two command files (SaveAllDisp.com and
RestoreAllDisp.com) to automate the saving and restoring of displays. The upgrade procedure
copies these command procedures to PISysEXE and gives the user a chance to quit the
upgrade procedure to run the SaveAllDisp.com procedure before continuing with the upgrade.
For reports, simply delete the *.rpi files. Next time the report is run (Use
PISysExe:DoReport.com to run the reports), the report writer will recompile the reports
which generates new RPI files.
A number of problems affecting PI Server nodes have been corrected. Excessive reconnection
problems for PINet nodes running UCX have been corrected. PI Event Manager update
problems for points not collected locally have been corrected. The update rates are now more
frequent so that events will not accumulate on the PI Home Node. On VAX, OSIsoft is now
using DECC version 4.0 (previously OSIsoft was using only VAXC).
At the PINet nodes there is a new option, SetSnapChkRange, for setting range checking for
new data coming into the snapshot. The default behavior is range checking off. With range
checking off, snapshot values are allowed to exceed the range defined by the point's zero and
span attributes. With range checking on, any new snapshot value that exceeds the point's zero
and span will automatically be replaced with a status value of UnderRange or OverRange as
appropriate. PIServer support is now placed on all PINet and PIonPINet nodes. This is
primarily to support PI SMT/Health Check.
PI Server has been updated to support System Management Tools (PI SMT). PI SMT
includes Health Check, a Windows-based GUI client for monitoring the PI System operation.
PI SMT also includes Tag Configurator for building/changing points via an Excel97 add-in.
Other tools are planned for the future. After installing or upgrading PINet 2.1.2, PI SMT may
Page 70
Appendix A: PINet and PIonPINet Revision History
be installed from the PI3.x CD, or may be downloaded from the OSIsoft Web site,
http://www.osisoft.com. Refer to PI Server System Management Guide, Chapter 2, “System
Management Tools (PI SMT), ” and the PINet version 2.1.2 software release notes for more
information.
PIBuild:PIserver.txt permits the network service for PI to be defined using a command
procedure instead of just an executable image. Users should change to the new service
definition - this is not automatic. The instructions are also found in a file
PINetBuild:PIServer.txt on the PINet server node. The advantages of the change are lower
usage of system memory, more complete logging of system errors and ability to read the
PINet:MTPPIServer.log file while the process is still running.
PINet to PINet
Instead of connecting a VMS PINet node directly to a PI Server, the PINet node can connect
to another PINet node that is connected to the PI Server. This capability is introduced in
version 2.1.2. This feature is useful for PI Server system with a lot of VMS PINet nodes. By
grouping the PINet nodes, you can reduce the number of direct connections on the PI Server
and distribute the some of the network load over several machines. Note that the PINet to
PINet option is strictly used with PI Server.
For new installation of PINet, you will be prompted for the PINet-to-PINet option. You do
not have to do anything for the PINet master, that is, the PINet node directly connected to the
PI Server Home Node. You should enable the PINet-to-PINet option for the PINet slave and
specific the PINet master as the Home Node. The PINetTransport can be either DECNET or
TCP/IP to talk to the PINet master.
For upgrading an existing PINet node, the installation procedure automatically adds the
PINettoPINet logical name to your system and set the logical to 0. If you want to change an
existing PINet node to become a PINet slave, you have to modify manually the
pinetnames.com (or pionpinetnames.com for PIonPINet Nodes) to change the HOMENODE
name to point at the PINet master. PIHomePort should be changed to 545 and PINettoPINet
should be changed to 1.
Upgrading Hint
If you want to implement PINet-to-PINet for existing PINet nodes, it may be easier to remove
the PINet installation and perform a new installation. The same may also be the case if you
are migrating a PINet node from a PI2.1.x or PI2.2.x Home Node as part of a PI2 to PI 3
Server migration.
Save your interface startup files before removing the old PINet installation. Re-install PINet
per the instructions in this chapter. Restore the interface startup files before restarting PINet.
Check the interface startup file configurations against the latest documentation for your
interface to PI.
Programming Issues
See the PI Server Reference Manual, Appendix D for a discussion of PI API and PI Toolkit
functions that behave differently when called against a PI3.x Server versus a PI2.x System for
VMS. In addition, the following functions now connect to the PI Home Node in order to
return the specified parameters.
GetDigState
pipt_digstate
Page 72
TECHNICAL SUPPORT AND RESOURCES
Email Support
Email support is available 24 hours a day, 7 days a week. Send technical support
inquiries, including the problem description and message logs, to:
[email protected]. Technical Support will respond to your inquiry within 24
hours.
Knowledge Center
The Knowledge Center provides a searchable library of documentation and technical
data, as well as a special collection of resources for system managers. For these options,
click Knowledge Center in the Technical Support Web site.
• The Search feature allows you to search Support Solutions, Bulletins, Support
Pages, Known Issues, Enhancements, and Documentation (including User
Manuals, Release Notes, and White Papers).
• System Manager Resources include tools and instructions that help you
manage: Archive sizing, Backup scripts, Daily Health Check, Daylight Saving
Time configuration, PI Server security, PI System sizing and configuration, PI
Trusts for Interface Nodes, and more.
Page 74
Technical Support and Resources
PINet and PIonPINet require special consideration for support and upgrades. Please follow
these instructions.
Upgrades
To request an upgrade, provide PINet and operating system version, and platform
information to Technical Support. Follow PI2 upgrade request instructions on the
Technical Support web site: choose Contact Us > Obtaining Upgrades.
Page 78
Index of Topics
Page 80
Index of Topics
OpenVMS/X-Windows, PINet/OpenVMS, 7
51 VersionRequirements
PINet/OpenVMS, 29, 40 PINet/OpenVMS, 7
PINetTransport, 41 View
PINetVerify, 40 Error Messages
Point Database, 42 PINet, 26
Snap, 40 Message Log
UCX PINet errors, 26
TCP/IP software, 7, 12, 42, 56 VMS
UniInt, iv, 65, 67 Disk Space
Upgrade Requirements, 10
from PI for OpenVMS, 13 Migration from VAX to AXP,
PINet, 47 8, 62
VMS, 57 Upgrading, 57
Utility VMSInstal
Utilities, PINet/OpenVMS, 27 PINet, 11
Vendor’s TCP/IP communications WildL
library, 42 PINet, 29
Version Requirements X-Windows, 1
PI Server, 7 PINet Startup problem, 51
Page 82