Upload
haxuyen
View
236
Download
1
Embed Size (px)
Citation preview
Copyright © 2008 OSIsoft, Inc
Version 4.6
Using PI DataLink and Processbook
The Visuals
Copyright © 2008 OSIsoft, Inc
Introductions
Instructor Students
Tell us about your PI System What is your role with PI? What skills do you need to learn?
2
Copyright © 2008 OSIsoft, Inc
Course Overview
Length: 1 day Interactive course:
Theory 50% Exercises and examples 50%
3
Copyright © 2008 OSIsoft, Inc
Objectives
Understand the fundamentals of PI technology Learn to access data in the PI server Become familiar with the use of PI Datalink
and Processbook
Please ask questions as they arise!
4
Copyright © 2008 OSIsoft, Inc
Course Content
Introduction to PI Common Dialog Windows PI Tags Data Flow PI Time Format PI Processbook PI Datalink
5
Copyright © 2008 OSIsoft, Inc
1.0 Introduction to PI
Copyright © 2010 OSIsoft, LLC
1.0 PI Basics
7
Copyright © 2010 OSIsoft, LLC
1.1 What is a PI System?
Copyright © 2008 OSIsoft, Inc
The PI System 2010
9
PI System 2010
Virtualization
High availability
Windows integrated security
Real-time Interfaces
PI Server
PI Asset Framework PI Archives
PI Notifications PI AnalyticsPE Totalizer PI ACE
64-bit product
IT DataIT MONITOR
Custom DataAPIs / SDKs
Relational Data OLEDB / ODBC SQL SERVER /
ORACLE
Web ServicesSOA / EXTERNAL DATA
LEGACY APPS
Real-Time DataDCS / PLC / SCADA / OPC
HISTORIANS / INTERFACES
Copyright © 2008 OSIsoft, Inc
Basic Parts
10
Interface Node
PI Server
`
Client PC
Data Source
Copyright © 2008 OSIsoft, Inc
Architecture of a Typical PI System
11
Copyright © 2010 OSIsoft, LLC
1.2 PI Tags
12
Copyright © 2008 OSIsoft, Inc
What is a PI Tag?
It is a unique storage point for data in the PI system. It is simply a single point of measurement.
13
Examples A flow rate from a flowmeter A controller’s mode of operation The batch number of a product Text comments from an operator The results of a totalizer or calculation
Copyright © 2008 OSIsoft, Inc
PI Tag Attributes – Display
Tag name: unique name of the PI point Descriptor: PI tag description EngUnits: Engineering units PointType: type of variable stored Zero, Span and Typical value: minimum, range
and typical values Point source: allows grouping of PI tags by data
interface (DCS,PLC, or other sources)
14
Copyright © 2010 OSIsoft, Inc.
Data Flow
Copyright © 2008 OSIsoft, Inc
Data Tests
Every value can go through 2 data screeningtests before being archived:
Exception Test “Send only significant changes in data to the
server”
Compression Test“Store only data needed to reliably represent
process behavior”
16
Copyright © 2008 OSIsoft, Inc 17
Data Flow
Data acquisition node
PI server
Copyright © 2010 OSIsoft, Inc.
New Event Processing
PI Interface
ExceptionReport
PISnapSS
Snapshot
DataCompression
Event Queue
file(s)
Shared MemoryPIArchSS
Archive Cache
Primary Archive
Online Archives
Archive
18
Copyright © 2010 OSIsoft, Inc.
Exception Filtering
Copyright © 2010 OSIsoft, Inc.
PI Interface
ExceptionReport
New Event Processing
PISnapSS
Snapshot
DataCompression
Event Queue
file(s)
Shared MemoryPIArchSS
Archive Cache
Primary Archive
Online Archives
Archive
1
Copyright © 2010 OSIsoft, Inc.21
Exception Test (Interface Level)
Exception test:ExcMax (time)
+ ExcDev
- ExcDevCurrent Snapshot
• New values outside the box violate the exception test• The exception test is performed by the interface• When a value violates the exception test, this value
and the previous one are sent to the PI server
Copyright © 2010 OSIsoft, Inc.22
Exception Test
When a value violates this test, that value and the previous value are reported.
Why? To have a better representation of the actual tag behavior
Snapshot value
+/- Excdev
Trend if previous value is not sent
Previous value
Trend if previous value is sent
Tem
pera
ture
Time
passes the exception test
Copyright © 2010 OSIsoft, Inc.23
Raw Data - Example
Raw values scanned on the data source. Without Exception and Compression tests, these
would all be archived
Time
Tem
pera
ture
Copyright © 2010 OSIsoft, Inc.24
Exception Test - Example
Time
Tem
pera
ture
P
E
P
P
P
E
E
E
EE
E E
E E
E: Exception P: Previous
E
Copyright © 2010 OSIsoft, Inc.25
Exception Test - Results
Time
Tem
pera
ture
Successive values sent to the PI Server.When a value is sent, it becomes the new snapshot.
Copyright © 2010 OSIsoft, Inc.
Turning Off Exception?
Behavior of ExcDev = 0, ExcMax = 0, is that Exception Test is turned off: All values are sent to PI; This will increase the traffic between the data
collection node and the server.
26
Copyright © 2010 OSIsoft, Inc.
PI Exception Test - Example
Scan = 1m, ExcDev = 1, ExcMax = 10m
27
DCS Value Exception Current Snapshot12:00 50.0 Yes 12:00 50.0
12:01 50.3 No 12:00 50.012:02 51.1 Yes 12:02 51.1 … … No 12:02 51.1
12:12 51.4 Yes 12:12 51.4
Copyright © 2010 OSIsoft, Inc.
PI Server Snapshot and Data Compression
Copyright © 2010 OSIsoft, Inc.
New Event Processing
PI Interface
ExceptionReport
PISnapSS
Snapshot
DataCompression
Event Queue
file(s)
Shared MemoryPIArchSS
Archive Cache
Primary Archive
Online Archives
Archive
2
Copyright © 2010 OSIsoft, Inc.30
Snapshot
The snapshot contains the most recent value, for each tag in the PI server
Copyright © 2010 OSIsoft, Inc.
New Event Processing
PI Interface
ExceptionReport
PISnapSS
Snapshot
DataCompression
Event Queue
file(s)
Shared MemoryPIArchSS
Archive Cache
Primary Archive
Online Archives
Archive
2
Copyright © 2010 OSIsoft, Inc.32
Compression Test (PI Server)
Compression test:
Last archived value
• If a value between the last archive event and the current snapshot is outside the box, the current snapshot violates the compression test. In this case, the value previous to the current snapshot will be archived.
• The compression test is done by the PI server• Compression can be turned off with the Compressing attribute
+ Compdev
- Compdev
Currentsnapshot
< Compmax (s)
Copyright © 2010 OSIsoft, Inc.33
Compression Test – Example
Time
Tem
pera
ture
A: Archived Value
A A
A
AA
A
A
The compression algorithm is performed on new snapshots to determine which data is kept in the PI archives
Copyright © 2010 OSIsoft, Inc.34
Compression Results
Time
Tem
pera
ture
When the user requests a tag-time for which the value is interpolated, the difference can be no greater than
±compdev
Values kept in the PI archives
Copyright © 2010 OSIsoft, Inc.
Compression ResultsRaw values scanned.
35
After Exception.
Time
Tem
pera
ture
Copyright © 2010 OSIsoft, Inc.
New Event Processing
PI Interface
ExceptionReport
PISnapSS
Snapshot
DataCompression
Event Queue
file(s)
Shared MemoryPIArchSS
Archive Cache
Primary Archive
Online Archives
Archive
3a
3b
Copyright © 2010 OSIsoft, Inc.
Turning Off Compression?
Behavior of Compression: Compressing set to Off: all exceptions are archived
(no compression); Better Compressing set to On, CompDev set to 0:
successive identical values (or values aligning perfectly) are not archived. This is much more efficient.
It is appropriate to turn off data compression for laboratory, manually entered, totalized, and other tags where each event is significant in itself
37
Copyright © 2010 OSIsoft, Inc.38
Data Compression – How Much Data?
This highly variable data cannot be compressed by PI. Everyvalue is a pivot point for the compression algorithm. Allvalues are archived.
This data appears highly compressible. Probably only three or four of these values would be stored in the archive.
Copyright © 2010 OSIsoft, Inc.39
Data Flow
The exception and compression specifications should be adjusted to achieve efficient archive storage without losing significant data
Disk space and Performance vs Data accuracy
Copyright © 2010 OSIsoft, Inc.40
Exception and Compression Attributes
Each PI Tag can be individually configured for its exception reporting and compression
Exception ReportingAttributes
CompressionAttributes
ExcDev or ExcDevPercent
ExcMax ExcMin
CompDev or CompDevPercent
CompMaxCompMinCompressing
Copyright © 2010 OSIsoft, Inc.41
Set Appropriate Zero & Span
Be careful when defining Zero and Span attributes because: ExcDevPercent and CompDevPercent attributes are
automatically adjusted according to Span; The accuracy and range of Float16 values are set by
the Zero and Span; Zero and Span are used by many functions in PI
ProcessBook.
Copyright © 2010 OSIsoft, Inc.
Step Attribute
The Step attribute affects both display and compression:
Instead of using the usual compression algorithm, a second exception test is applied using the CompDev value.
42
Copyright © 2010 OSIsoft, Inc.43
Exception and Compression Defaults
ExcDevPercent = 1 (% of span) ExcMax = 600 (10 minutes) CompDevPercent = 2 (% of span) CompMax = 28800 (8 hours) Zero = 0 Span = 100
Copyright © 2010 OSIsoft, Inc.
Recommendations
Set the compression deviation to the minimum change that is measurable by the instrument.
Set the exception deviation to ½ of the compression deviation.
These are starting point recommendations.
44
Copyright © 2008 OSIsoft, Inc
1.3 PI Time Format
Copyright © 2008 OSIsoft, Inc
PI Time Format
Absolute (a specific point in time) * : (NOW) t : 00:00:00 on the current day (TODAY) 18-feb-05 16:00:00
Relative (time is offset from another time) +8h : + 8 hours
Combined t+8h : today + 8 hours
46
Copyright © 2008 OSIsoft, Inc
Absolute Time
dd-mmm-yy HH:mm:ss.00000dd Daymmm Month (Jan, Feb, Mar, Apr, May, …)yy YearHH Hours in 24 hour formatmm Minutesss Seconds00000 Milliseconds
Example:
18-feb-05 10:43:29.323
47
Copyright © 2008 OSIsoft, Inc
Absolute Time
dd-mmm-yy HH:mm:ss
"Date" fields default to the current date"Time" fields default to 00.
Expression Meaning25 00:00:00 on the 25th of the current month25-Aug-03 00:00:00 on that date8: 08:00:00 on the current date25 8 08:00:00 on the 25th of the current month21:30:01.02 9:30:01.0200 PM on the current date
48
Copyright © 2008 OSIsoft, Inc
Absolute Time – Other Formats
Symbol Meaning* Current timet 00:00:00 on the current day (TODAY)y 00:00:00 on the previous day
(YESTERDAY) Monday, Tuesday, Wednesday, Thursday, Friday, Saturday. Sunday
00:00:00 on the most recent of that day of the week
Absolute time formats
49
Copyright © 2008 OSIsoft, Inc
Relative Time
Syntax Meaning+2d + two days-1.5h - One hour and a half+32m + 32 minutes-15 s - 15 seconds
Number of: Hours (h) Minutes (m) Seconds (s)
Leading sign (+ or -) is required. No default time unit: must specify d, h, m, s, w, mo, or y Can use fractions only for Hours, Minutes and Seconds
+2.5h, -0.5m Relative time is most often part of a Combined time
Years (y) Months (mo)
Weeks (w) Days (d)
50
Copyright © 2008 OSIsoft, Inc
Combined Formats
Syntax Meaning*-8h 8 hours agoT-7d 00:00:00, 7 days agoY+11h Yesterday at 11:00:00 AMMonday + 14.5h 02:30:00 PM on the most recent Monday
Uses both an absolute and a relative time The absolute part of the time can be *, T, Y, or a day of
the week
51
Copyright © 2008 OSIsoft, Inc
Directed Exercise
PI Time Express the following timestamps using the absolute time
format: Tuesday-2d 1 6: y+8h *-30m
Express the following times in valid PI timestamps: Today at 6:00 AM The 4th of the current month at 16:00 12 hours ago
52
Copyright © 2008 OSIsoft, Inc
What are the two filtering tests that each event that is read on the data source can go through before being archived in the PI Server?
Which of the following are invalid PI times? a. 4 6 d. y-1y b. 22 22: e. *-Monday c. t-1.5d f. 09-Jun-06 22:45:35.0943
Group Recap Question (optional)
53
Copyright © 2008 OSIsoft, Inc
2.0 Common Dialog Windows
Copyright © 2008 OSIsoft, Inc
PI Connection Manager Viewing Connection Information
Use the check boxes to connect / disconnect from the available PI servers
Connection settings
Connection information
55
Copyright © 2008 OSIsoft, Inc
PI Connection Manager Editing Connection Settings
The connection settings can de edited
Click the Save button to apply the changes
To change the default PI server, select Tools > Options
56
Copyright © 2008 OSIsoft, Inc
PI Connection Manager Adding a New Connection
To add a new PI server connection, select Server > Add Server
Network Path: either PI Server IP address or Hostname Default User Name: PI user used to connect Password: password if PI user is password protected Confirm: validates the connection at creation time Connection Type: PI 3 or PI 2 server Port Number: 5450 for a PI 3 Server or 545 for a PI 2 Server
57
Copyright © 2008 OSIsoft, Inc
PI Connection ManagerChanging Passwords
A PI user can change is own password from the PI Connection Manager Select Tools > Change Password
58
Copyright © 2008 OSIsoft, Inc
Directed Exercise
Connecting to PI:• Learn about connecting to PI with the PI SDK• Discover the IP address and computer name of your
PI Server
59
Copyright © 2008 OSIsoft, Inc
Tag Search Window – Basic Search
60
Start searching according to the
criteria
Display the attributes/values for selected
tags
Tag search results
Look for a specific value/status/attrib
ute
Look for a specific point
type/class/source
Tag name mask
Select PI Server(s) to
search through
Validate selectio
n
Copyright © 2008 OSIsoft, Inc
Tag Search StrategiesTag Search using wildcards:
Use * to replace any number of charactersExample: flow* = flow_meter1, flow_meter2, flow_meter3
Use ? to replace one character Example: tank?_level = tankA_level, tankB_level
Note 1: Search criteria are not case sensitiveNote 2: Search criteria can be combined
Example: Look for Tag Mask = flow* and Point Source = o
61
Copyright © 2008 OSIsoft, Inc
Tag Search Window – Advanced Search
62
SQL-like query based on user-defined conditions
1- Define condition2- Click 'Add'…3- Click 'Search
Copyright © 2008 OSIsoft, Inc
Tag Search Window – Alias Search
63
Search through aliases in the PI ModuleDB (described later)
Copyright © 2008 OSIsoft, Inc
Tag Information Windows
64
Pt. Attr... Pt. Values...
Copyright © 2008 OSIsoft, Inc
Directed Exercise – Searching for tags
Tag Mask: BA*
Tag Mask: *158*Descriptor: *end*
Advanced Search:PIpoint.Span > 100 AND PIpoint.CompDevPercent > 1
Save this search as a favorite.
65
Copyright © 2008 OSIsoft, Inc
What information needs to be specified when creating a new connection to a PI server?
What are the two wildcard characters available in a tag search?
Group Recap Question (optional)
66
Copyright © 2008 OSIsoft, Inc
4.0 PI Processbook
Copyright © 2008 OSIsoft, Inc
5.0 PI DataLink
Copyright © 2008 OSIsoft, Inc
Objectives Learn how to effectively use PI DataLink in MS Excel Be able to retrieve current and archived values Be able to retrieve sampled values from the archive Learn how to retrieve calculated values Learn how to retrieve PI expressions values Learn how to filter the results Learn how to use the trend element
PI DataLink
69
Copyright © 2008 OSIsoft, Inc
What is PI DataLink ?
PI DataLink is an OSIsoft Add-In for Microsoft Excel (and Lotus 1-2-3)
This Add-In lets you import data from the PI System into a spreadsheet for further analysis
70
Copyright © 2008 OSIsoft, Inc
PI DataLink Menu
71
1 2 3 4 5 6 7 8
1. Functions that retrieve a single value2. Functions that retrieve series of values3. Functions that retrieve calculated values4. Trend display tool, Tag search and connections5. Alternate tag identification methods6. Module Database related methods7. Settings and help8. Notification search
Copyright © 2008 OSIsoft, Inc
PI DataLink Menu with Excel 2003
72
Functions that retrieve a single value
Functions that retrieve series of values
Functions that retrieve calculated values
Function to retrieve notifications
Tag search, connections, settings and help
Alternate tag identification methods
Trend display tool
Copyright © 2008 OSIsoft, Inc
PI DataLink Settings1. Determines how tags selected in the Tag Search
dialog window are copied on the spreadsheet: Columns or Rows
2. Determines if the PI server's name is copied automatically in PI DataLink dialog boxes
3. Determines which time zone PI DataLink interprets time from (PI server vs client station)
4. Option to Display #N/A instead of blanks when there are more cells than data to fill them
5. Option to ignore locale settings on the operating system when parsing timestamps
6. Determines the number format for PI DataLink results
7. Determines the date/time format for PI DataLink results
12
45
7
6
3
73
Copyright © 2008 OSIsoft, Inc
DataLink Settings
74
1
2
4
3
Copyright © 2008 OSIsoft, Inc
Help on functions
Hovering the mouse over a specific function make the description appears below the ribbon.
To get help from the documentation, click on the function icon and press F1 on the keyboard.
75
Copyright © 2008 OSIsoft, Inc
Preset functions
76
• Every function in the ribbon with a triangle pointing downward gives you preset functions
• These preset functions have the time related fields already filled for you or location of data
• Click on the desired options to use them
Copyright © 2008 OSIsoft, Inc
Current Value
Function: PICurrVal Retrieves the current value for a tag
Arguments1. PI Server name or cell reference2. Tag name or cell reference(s) to a list
of tags3. Output Cell4. Display the timestamp
77
1
2
3
4
Copyright © 2008 OSIsoft, Inc
Archive ValueFunction: PIArcVal Retrieves a single value from the PI archive
for a specified time stamp
Arguments1. Tag or Expression data retrieval2. PI Server name or cell reference3. Tag name or cell reference(s) to a list of tags4. Time when to retrieve the data5. How data are retrieved6. Output Cell7. Display the timestamp
78
1
2
3
4
5
6
7
Copyright © 2008 OSIsoft, Inc
Archive Value
Retrieval Mode Retrieves a value from the PI archive for a specified
time only if an archived value exists at that time
79
Copyright © 2008 OSIsoft, Inc
Interpolated Values
00.5
11.5
22.5
33.5
0 1 2 3 4 5Time
Valu
es
80
Copyright © 2008 OSIsoft, Inc
Tag Attributes
81
1
2
3
4
Function: PITagAtt Retrieves an attribute associated with a tag
Arguments1. PI Server name or cell reference2. Tag name or cell reference(s) to a list of tags3. Attribute4. Output Cell
Copyright © 2008 OSIsoft, Inc
Update a Spreadsheet Pressing F9 key does
Recalculates Excel dynamic time functions Recalculates Current Value function Recalculates other PI DataLink functions based on these functions
Pressing CTRL+SHIFT+ALT+F9 simultaneously does Everything that F9 does Recalculates other PI DataLink functions based on relative PI time
(i.e. ‘Monday', '*', '*-3h')
Best practice to build your spreadsheet Use references to cells for the Tag Name, Start Time and End Time Use references to cells containing dynamic Excel time functions
82
=NOW() and =TODAY()
=PICURRVAL()
Copyright © 2008 OSIsoft, Inc
Refreshing Your Queries
83
Copyright © 2008 OSIsoft, Inc
Dynamic Time Functions in Excel
Function: =TODAY() Returns today’s date at 00:00:00
Example: =Today() – 1signifies yesterday at 00:00:00
Function: =NOW() Returns the current time and date
Example: =Now() - 3/24signifies 3 hours ago
84
Copyright © 2008 OSIsoft, Inc
Directed Exercise
1. Open the PI and Excel time.xls spreadsheet located on the CD
2. Fill the table converting the desired times with PI and Excel time abbreviations
85
Copyright © 2008 OSIsoft, Inc
Exercise DL1
Objective: Learn to extract a single value from a PI Database using the following functions:
Current value function Archive value function Tag attributes function
86
Activity Report
Copyright © 2008 OSIsoft, Inc
Archived vs. Sampled Values Archived:
Values stored in the PI archive
Sampled: Values evenly spaced in time. These values are interpolated from the archived values.
87
Copyright © 2008 OSIsoft, Inc
Compressed data (start time/end time)
Function: PICompDat Retrieves compressed data from the archive based on a start time
and an end time
Arguments1. Search for a time range2. PI Server name or cell reference3. Tag name or cell reference(s) to a list of tags4. Date/Time to begin extraction to Date/Time to end; data can be
returned in reverse order5. Filter6. Show or hide the filtered data zone7. How to treat data at the beginning and end of the time range8. Output Cell9. Display count, timestamps, quality bits and annotations10. Vertical or horizontal result
88
1
2
3
4
567
89
10
Copyright © 2008 OSIsoft, Inc
Calculation Boundary Types
Inside (B,C,D) Outside (A,B,C,D,E) Interpolated (F,B,C,D,G)
B
C
D
E
Start Time
End Time
A
F (interpolation) G (interpolation)
89
Copyright © 2008 OSIsoft, Inc
Sampled DataFunction: PISampDat Retrieves evenly spaced interpolated values
from the archive
Arguments1. Tag or Expression data retrieval2. PI Server name or cell reference3. Tag name or cell reference(s) to a list of tags4. Date/Time to begin interpolation with evenly time space
data and Date/Time to end5. Filter6. Show or hide the filtered data zone7. Output Cell8. Display timestamps9. Vertical or horizontal result
90
1
2
3
4
56
789
Copyright © 2008 OSIsoft, Inc
Resize the array
If the array has not been resized to show all values, the last row of data will contain this message:
• Resize to show all values
91
Copyright © 2008 OSIsoft, Inc
To Edit an Array
Three options are available:1. Manually:
1. Select the new cell range for the array2. Press F23. Press CTRL+SHIFT+ENTER simultaneously
2. Via the dialog window:1. Right-click on a cell in the array2. Select the name of the function in the contextual menu3. Do the modifications in the dialog window4. Click on OK
3. For functions that need to be resized:1. Right-click on a cell in the array2. Select the Recalculate (Resize) PIDL formula option
92
Copyright © 2008 OSIsoft, Inc
How to Resize an Array
93
Copyright © 2008 OSIsoft, Inc
Array Values
Use this PI DataLink setting to output #N/A in the cells of a PI DataLink array not containing any data
94
Copyright © 2008 OSIsoft, Inc
Compressed Data (start time/number)
Function: PINCompDat Retrieves compressed data from the archive based on a start
time and a number of values to be returned
Arguments1. Search for a number of value2. PI Server name or cell reference3. Tag name or cell reference(s) to a list of tags4. Date/Time to begin extraction to Date/Time with a number of
values; data can be returned in reverse order5. Filter6. Show or hide the filtered data zone7. How to treat data at the beginning and end of the time range8. Output Cell9. Display timestamps, quality bits and annotations10. Vertical or horizontal result
95
1
2
3
4
567
89
10
Copyright © 2008 OSIsoft, Inc
Quality Flags Some applications allow reading or writing of additional
information such as the quality or the status of a specific value (questionable, substituted)
These bits can be shown in a separate column, beside the value itself
Consult interface-specific documentation to determine if they support this functionality
The PI Server allows addition of annotations on archived values
This information can be shown with the show annotations option
They will be in another column beside the other(s)
96
Copyright © 2008 OSIsoft, Inc
"IF" Function in Excel
Syntax:=IF(Logical_test, value_if_true, value_if_false)
97
Copyright © 2008 OSIsoft, Inc
Conditional formatting in Excel 2007
New conditional formatting of Excel gives great look and a comprehensive perspective to your report
Useful to compare values extracted from PI
98
Copyright © 2008 OSIsoft, Inc
Exercise DL2
Objective: Learn to retrieve process data using the Compressed Data function
99
Operational Start Up
Copyright © 2008 OSIsoft, Inc
Timed DataFunction: PITimeDat
Retrieves sampled data synchronized with an array of time values
Arguments1. Tag or Expression data retrieval2. PI Server name or cell reference3. Tag name or cell reference(s) to a list of tags4. Time when to retrieve the data; it must use reference
cells only5. How data are retrieved6. Output Cell
100
1
2
3
4
5
6
Copyright © 2008 OSIsoft, Inc
Calculated DataFunction: PICalcDat
Retrieves a calculated value for a given tag, in a specified time interval. Calculations allowed are: total, minimum, maximum, standard deviation, range, count, average and mean
Arguments1. Tag or Expression data retrieval2. PI Server name or cell reference3. Tag name or cell reference(s) to
a list of tags4. Date/Time to begin calculation to
Date/Time to end
101
1
2
3
4
Copyright © 2008 OSIsoft, Inc
Calculated DataArguments…
5. Sub-interval calculation6. Filter7. Conversion Factor8. Type of calculation9. Weighting10. How expression is evaluated11. Sampling frequency12. Minimum % of good value needed13. Output Cell14. Display time, minimum or maximum
timestamp inside the interval15. Display % of good value16. Vertical or horizontal result
102
5
6
7
8
9
10
11
12
13
14
1516
Copyright © 2008 OSIsoft, Inc
The Three Rules of Performance Equations
Numbers and operators are written as is. Tag names and timestamps are written in
single quotes: 'CDT158' Strings are written in double quotes:
"This is a string"
103
Copyright © 2008 OSIsoft, Inc
Performance Equation Functions
104
Copyright © 2008 OSIsoft, Inc
What is a Conversion Factor?
Used with PI DataLink, in the Calculated Data function
A multiplier used to change a number from one unit of measure to anothero Ex: 1000 g/kg, 2.54 cm/inch, 24 hours/day, 1440 minutes/day
When using the Total function in Calculated Data, it is used to correct PI’s assumption that the data is in units per day
Is equal to 1.0 when source data is in units/day
105
Copyright © 2008 OSIsoft, Inc
Conversion FactorsIt is important to supply the correct conversion factor when calculating TOTALS with PI because PI assumes the engineering units of a rate tag is units per day.
106
Example: For a flow measured in m³/h, a conversion factor of 24 must be supplied to convert between the engineering units of the rate tag and the units/day assumption of PI.
Rate tag Assumption of Conversionengineering units the PI Server Factor
Units / day Units / day 1Units / hour Units / day 24Units / minute Units / day 1440Units / second Units / day 86400
Copyright © 2008 OSIsoft, Inc
Computing Totals
0
1
3
5
7
0 1 2 3 4 5 6 7 8 9 10 11
Time (m)
Flow (GPM)
Normal total = (3 gpm x 3m) + (5 gpm x 2m) + (1 gpm x 3m) = 22 gallons
PI assumes this measurement to
be units/day
PI total = ((3 gallons per day x 3m x 1day/1440m) + (5 gallons per day x 2m x 1day/1440m) + (1 gallon per day x 3m x 1day/1440m)) *
1440m/1d = 22 gallons
The total computed by PI must be multiplied by a factor of 1440
Copyright © 2008 OSIsoft, Inc
Exercise DL3
Objective: Learn to extract multiple calculated values from a PI Database using the Calculated Data function
108
Daily Production
Copyright © 2008 OSIsoft, Inc
Filtered Sampled DataFunction: PISampFilDat
Retrieves a series of evenly spaced interpolated values that satisfy a filter condition
Arguments1. Filter expression using the Performance Equation
syntaxIn this example, the filter is written to remove all values
from tag <tagname> which are lesser or equal than 120
2. Show or hide the filtered data zone
109
1
2
Copyright © 2008 OSIsoft, Inc
Filtered Compressed DataFunction: PICompFilDat or PINCompFilDat
Retrieves compressed data based on a start time and an end time or an initial date/time and a number of values to be returned which also satisfy a filter condition
Arguments1. Search for a time range or for a number of value2. Filter expression using the Performance Equation
syntaxIn this example, the filter is written to remove all values
from tag <another tagname> which are not equal to the digital state ON
3. Show or hide the filtered data zone
110
23
1
Copyright © 2008 OSIsoft, Inc
Exercise DL4
Objective: Learn to apply filters to select the values to extract from a PI Database using the following function Sampled Data
111
Off-Specification Production
Copyright © 2008 OSIsoft, Inc
Expression CalculationFunction: PIExpDat
Retrieves data from calculations on tag expressions (via the Sampled Data dialog box)
Arguments1. PI Server name or cell reference2. Expression to evaluate following the Performance
Equation syntax
112
2
1
Copyright © 2008 OSIsoft, Inc
Other Expression Calculation MethodsExpression calculations can also be performed
For one specific time in the past (Archive Value dialog box) For a specific list of timestamps (Timed Data dialog box) To obtain statistics or totals on an expression (Advanced Calculated
Data dialog box)
113
Copyright © 2008 OSIsoft, Inc
PI Calculated Data vs. PI Expression
114
Copyright © 2008 OSIsoft, Inc
PI Calculated Data vs. PI Expression
PI Expression
PI Calculated Data
time**-7d
max maxmax max maxmax max1day 1day1day 1day 1day1day 1day
time
8h 8h8h 8h 8h8h 8h
1day 1day1day 1day 1day1day 1day
max maxmax max maxmax max
If the time interval in the PI expression was changed to 1 day, it means forTagMax(‘sinusoid’, ‘*-1d’, ‘*’) function, the results of both expressions will be identical.
115
Copyright © 2008 OSIsoft, Inc
Exercise DL5
Objectives: Learn to carry out a calculation for the current value of an expression;
Use MS Excel’s Conditional Formatting to make your PI Data Link reports more useful.
116
Expression Calculation
Copyright © 2008 OSIsoft, Inc
Exercise DL6 (Optional)
Objectives: Learn to apply complex filters to extract archived
values Learn to synchronize data extraction Learn to extract maximum value of a time range
using Calculated data function Use MS Excel’s Conditional Formatting to make
your PI DataLink report easy to use
117
Quality Control Report
Copyright © 2008 OSIsoft, Inc
Advanced Calculated Data Returns a single
calculated value or evenly spaced calculated values from the PI data archive
Advanced features: Filtering Expression sampling
options Event-weighted or time-
weighted calculations Definition of a minimum
percent of good values
118
Copyright © 2008 OSIsoft, Inc
Expression Sampling Modes - Example
Event-weighted average between 11 PM and 12 AM for tag CDT158 with a filter expression like(‘BA:CONC.1’ + ‘BA:TEMP.1’ > 30)
119
Copyright © 2008 OSIsoft, Inc
CDT158BA:CONC.1BA:TEMP.1Advanced Calculated Result
11/01/2008 23:00:00 12/01/2008 00:00:00
Expression Sampling Modes – Point Compressed
Evaluates the filter expression at the timestamp of any compressed value of the source point
120
Filter Expression is ‘BA:CONC.1’ + ‘BA:TEMP.1’ > 30
75.4575.32
17.21 23.128.97
35.5444.76
61.1263.25 64.75
67.25
Copyright © 2008 OSIsoft, Inc
CDT158BA:CONC.1BA:TEMP.1Advanced Calculated Result
11/01/2008 23:00:00 12/01/2008 00:00:00
Expression Sampling Modes – Expression Compressed
Evaluates the filter expression at the timestamp of any compressed values of any tags in the filter expression
121
Filter Expression is ‘BA:CONC.1’ + ‘BA:TEMP.1’ > 30
61.21
17.8614.65
17.54
33.7646.89
54.79
Copyright © 2008 OSIsoft, Inc
CDT158BA:CONC.1BA:TEMP.1Advanced Calculated Result
11/01/2008 23:00:00 12/01/2008 00:00:00
Expression Sampling Modes – Interpolated
Evaluates the filter expression at evenly spaced sampling intervals
122
Filter Expression is ‘BA:CONC.1’ + ‘BA:TEMP.1’ > 30
73.98
26.21
29.56
50.3462.97
Copyright © 2008 OSIsoft, Inc
Questions
124