Skip navigation
All Places > PI Developers Club > Blog
1 2 3 Previous Next

PI Developers Club

564 posts

OSIsoft is excited to present a brand new utility called the AF Transformer.

 

Quick links to downloads:

Installation kit

User Guide

Reference Guide

Release notes

 

The AF Transformer can take one or more source AF structures, reshape those structures and then write them to another AF destination.  This can be useful when you have one or more AF reference structures containing enough meta data to be able to shape into other AF structures that benefit other users and use cases in an organization.  We have found many organizations desire different AF structures for different purposes.

 

Example transformation where a new parent element is created from an attribute:

DevClub blog no.1.png

 

One use case that comes up regularly is for transforming the AF structures built by PI Connectors.  The source AF structures built by PI Connectors can serve as a useful model for the PI Admin and controls engineer to confirm that the right data is being collected because the AF structure looks exactly like the data source's meta data.  However, the shape of data coming from data sources often does not fit perfectly the way an organization or end user desire to consume the data.  Hence, the AF Transformer can help.

 

You may have seen this at the London UC where we showed a few examples during this talk.  Forward to about 14 minutes in and the next 10 minutes cover the basics of what problem this tool helps you solve and then gives a few demos.  Feel free to watch when you have a few minutes. Additionally, we will follow this blog with some more detailed examples for you to learn from.  There are plenty of examples (including source AF databases to transform) installed with the utility.

 

We'd like the community of developers, partners, and customers alike to share their questions, their successes and maybe a few examples of what they create in the Developers Club community.  Stay tuned for more content from us and in the meanwhile, we look forward to your questions, comments, suggestions, and successes!

A Sneak Peek into the PI Vision 4 Extensibility Model

 

March 9, 2018

9:00 AM (PT)/12:00 PM (ET)/6:00 PM (ES)

 

Register now!

 

In this webinar you will be introduced to the new extensibility model coming in PI Vision 4 and we will walk through the creation of a custom symbol using OSIsoft's new developer seed project for PI Vision 4. There will be an opportunity to ask questions at the end. This webinar is initially intended to be a companion to the Visualization Virtual Hackathon 2018 webinar, but will give all viewers a sneak peek at PI Vision 4 and the new extensibility model.

 

We will cover:

 

  • PI Vision 4
  • PI Vision 4 developer seed project
  • Creating a new symbol for PI Vision 4
  • Q&A

 

The audience will have a chance to ask questions directly to the organizers of the event.

 

Speakers:

  • John Sintilas, Principal Software Developer, OSIsoft
  • Marcos Vainer Loeff, Sr. Technology Enablement Engineer, OSIsoft

 

We'd love to hear your comments and questions here in the comments or in the PI Developers Club forum!

Asset Analytics Native Integration with MATLAB

 

March 21, 2018

9:00 AM (PT)/12:00 PM (ET)/6:00 PM (ES)

 

Click Here to Register Now!

 

In this PI Developers Club webinar, we offer a sneak preview of the AF 2018 release with the highly anticipated feature of native integration between Asset Analytics and MATLAB!  Panelists include Stephen Kwan, AF Product Manager, along with technical representatives from MathWorks, Tim Choo and Sachin Nikumbh, both on the MATLAB Production Server team.  Data scientists, developers, system integrators, or anyone interested in analytics is encouraged to attend and ask questions.

 

UPDATE: If you clicked the above link before Feb 14 at 2 PM US Pacific time, your registration may not have gone through.  If you have not received a confirmation email, please register again.

 

Speakers:

  • Stephen Kwan, AF Product Manager
  • Tim Choo, MathWorks, Product Manager for MATLAB Production Server
  • Sachin Nikumbh, MathWorks, Engineering Manager for MATLAB Production Server
  • Hosted by Rick Davin, Sr. Technology Enablement Engineer

 

We'd love to hear your comments and questions here in the comments or in the PI Developers Club forum!

Visualization Virtual Hackathon 2018

 

February 15, 2018

9:00 AM (PT)/12:00 PM (ET)/6:00 PM (ES)

 

Register now!

 

Learn, innovate, compete, and win big at OSIsoft's second Visualization Virtual Hackathon! If you are a PI System developer, architect, designer, or data professional this event is for you. In this webinar we will be announcing our second Visualization Virtual Hackathon. We will explain the flow of the event:

 

  • Agenda
  • Goals of the Hackathon
  • Registration
  • Rules
  • Resources and Documentation available
  • Judging criteria
  • Size of teams
  • Project submission
  • Prizes
  • Winners announcement

 

The audience will have a chance to ask questions directly to the organizers of the event.

 

Speakers:

  • John Sintilas, Principal Software Developer, OSIsoft
  • Marcos Vainer Loeff, Sr. Technology Enablement Engineer, OSIsoft

 

We'd love to hear your comments and questions here in the comments or in the PI Developers Club forum!

I am happy to announce that the client libraries below were updated using the new PI Web API swagger specification (2017 R2). All the new methods from PI Web API 2017 R2 are available for you to use on the client side! The X-Requested-With header was also added to work with CSRF defences.

 

 

If you have questions, please don't hesitate to ask!

Web ID 2.0 Specification

 

These tables will help you encode and decode a PI Web API 2.0 Web ID so that you can both compose and deconstruct a Web ID yourself.   Visit How to Optimize your Applications for Web ID 2.0 to learn how the encoding works and how you can use Web ID to optimize your web application with PI Web API.

 

Web ID 2.0 first became available in PI Web API 2017 R2 (1.10 and later).   You can check your installed version by browsing to your PI Web API System endpoint  {yourwebapiserver}/piwebapi/system .

 

AFAnalysis

The Web ID for an AFAnalysis consists of the following data:

Full Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘F’

1

None

Version

‘1’

1

None

Marker

“Xs”

2

None

System ID

analysis.PISystem.ID

22

Urlencoded Guid

Analysis ID

analysis.ID

22

Urlencoded Guid

Name Payload

analysis.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

var

Urlencoded UTF8 String

 

ID Only Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘I’

1

None

Version

‘1’

1

None

Marker

“Xs”

2

None

System ID

analysis.PISystem.ID

22

Urlencoded Guid

Analysis ID

analysis.ID

22

Urlencoded Guid

 

Path Only Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘P’

1

None

Version

‘1’

1

None

Marker

“Xs”

2

None

Name Payload

analysis.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

var

Urlencoded UTF8 String

 

Local ID Only Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘L’

1

None

Version

‘1’

1

None

Marker

“Xs”

2

None

Analysis ID

analysis.ID

22

Urlencoded Guid

 

Default ID Only Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘D’

1

None

Version

‘1’

1

None

Marker

“Xs”

2

None

Analysis ID

analysis.ID

22

Urlencoded Guid

 

 

AFCategory for Analysis

The Web ID for an AFCategory, whose Identity is CategoryAnalysis, consists of the following data:

Full Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘F’

1

None

Version

‘1’

1

None

Marker

“XC”

2

None

System ID

category.PISystem.ID

22

Urlencoded Guid

Analysis Template

ID

category.ID

22

Urlencoded Guid

Name Payloadcategory.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘I’

1

None

Version

‘1’

1

None

Marker

“XC”

2

None

System ID

category.PISystem.ID

22

Urlencoded Guid

Analysis Template

ID

category.ID

22

Urlencoded Guid

 

Path Only Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘P’

1

None

Version

‘1’

1

None

Marker

“XC”

2

None

Name Payload

category.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

var

Urlencoded UTF8 String

 

Local ID Only Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘L’

1

None

Version

‘1’

1

None

Marker

“XC”

2

None

Analysis Template

ID

category.ID

22

Urlencoded Guid

 

Default ID Only Type

Field Name

Value

Encoded Width

Encoding Method

Type

‘D’

1

None

Version

‘1’

1

None

Marker

“XC”

2

None

Analysis Template

ID

category.ID

22

Urlencoded Guid

 

 

AFAnalysisTemplate

The Web ID for an AFAnalysisTemplate consists of the following data:

 

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“XT”2None
System ID

template.PISystem.ID

22Urlencoded Guid
Analysis TemplateID

template.ID

22Urlencoded Guid
Name Payload

template.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“XT”2None
System ID

template.PISystem.ID

22Urlencoded Guid
Analysis TemplateID

template.ID

22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“XT”2None
Name Payload

template.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“XT”2None
Analysis TemplateID

template.ID

22Urlencoded Guid
  1. 5.   Default ID Only Type
Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“XT”2None
Analysis TemplateIDtemplate.ID22Urlencoded Guid

 

AFAnalysisRule

The Web ID for an AFAnalysisRule consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“XR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
System IDanalysisRule.PISystem.ID22Urlencoded Guid
Owner IDanalysisRule.Analysis.ID or analysisRule.AnalysisTemplate.ID22Urlencoded Guid
Analysis Rule IDanalysisRule.ID22Urlencoded Guid
Name PayloadanalysisRule.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“XR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
System IDanalysisRule.PISystem.ID22Urlencoded Guid
Owner IDanalysisRule.Analysis.ID or analysisRule.AnalysisTemplate.ID22Urlencoded Guid
Analysis Rule IDanalysisRule.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“XR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
Name PayloadanalysisRule.GetPath(AFEncodeType.Name,null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“XR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
Owner IDanalysisRule.Analysis.ID oranalysisRule.AnalysisTemplate.ID22Urlencoded Guid
Analysis Rule IDanalysisRule.ID22Urlencoded Guid

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“XR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
Owner IDanalysisRule.Analysis.ID oranalysisRule.AnalysisTemplate.ID22Urlencoded Guid
Analysis Rule IDanalysisRule.ID22Urlencoded Guid

 

AFPlugIn for Analysis Rule

The Web ID for an AFPlugIn, whose Identity is PlugInAnalysisRule, consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“XP”2None
System IDanalysisRulePlugIn.PISystem.ID22Urlencoded Guid
Event Frame IDanalysisRulePlugIn.ID22Urlencoded Guid
Name PayloadanalysisRulePlugIn.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“XP”2None
System IDanalysisRulePlugIn.PISystem.ID22Urlencoded Guid
Event Frame IDanalysisRulePlugIn.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“XP”2None
Name PayloadanalysisRulePlugIn.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“XP”2None
Event Frame IDanalysisRulePlugIn.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“XP”2None
Event Frame IDanalysisRulePlugIn.ID22Urlencoded Guid

 

AFAttribute

The Web ID for an AFAttribute consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“Ab”2None
Base ElementMarker‘E’ if attr.Element is AFElement‘F’ if attr.Element is AFEventFrame‘N’ if attr.Element is AFNotification1None
System IDattr.PISystem.ID22Urlencoded Guid
Element IDattr.Element.ID22Urlencoded Guid
Attribute IDattr.ID22Urlencoded Guid
Name Payloadattr.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“Ab”2None
Base ElementMarker‘E’ if attr.Element is AFElement‘F’ if attr.Element is AFEventFrame‘N’ if attr.Element is AFNotification1None
System IDattr.PISystem.ID22Urlencoded Guid
Element IDattr.Element.ID22Urlencoded Guid
Attribute IDattr.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“Ab”2None
Base ElementMarker‘E’ if attr.Element is AFElement‘F’ if attr.Element is AFEventFrame‘N’ if attr.Element is AFNotification1None
Name Payloadattr.GetPath(AFEncodeType.Name,null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“Ab”2None
Base ElementMarker‘E’ if attr.Element is AFElement‘F’ if attr.Element is AFEventFrame‘N’ if attr.Element is AFNotification1None
Element IDattr.Element.ID22Urlencoded Guid
Attribute IDattr.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“Ab”2None
Base ElementMarker‘E’ if attr.Element is AFElement‘F’ if attr.Element is AFEventFrame‘N’ if attr.Element is AFNotification1None
Element IDattr.Element.ID22Urlencoded Guid
Attribute IDattr.ID22Urlencoded Guid

 

AFCategory for Attribute

The Web ID for an AFCategory, whose Identity is CategoryAttribute, consists of the following data: 

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“AC”2None
System IDcategory.PISystem.ID22Urlencoded Guid
Category IDcategory.ID22Urlencoded Guid
Name Payloadcategory.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“AC”2None
System IDcategory.PISystem.ID22Urlencoded Guid
Category IDcategory.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“AC”2None
Name Payloadcategory.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“AC”2None
Category IDcategory.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“AC”2None
Category IDcategory.ID22Urlencoded Guid

 

AFAttributeTemplate

The Web ID for an AFAttributeTemplate consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“AT”2None
ElementTemplate Marker‘E’Preserved here for legacy purposes1None
System IDattrTempl.PISystem.ID22Urlencoded Guid
ElementTemplate IDattrTempl.ElementTemplate.ID22Urlencoded Guid
AttributeTemplate IDattrTempl.ID22Urlencoded Guid
Name PayloadattrTempl.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“AT”2None
ElementTemplate Marker‘E’Preserved here for legacy purposes1None
System IDattrTempl.PISystem.ID22Urlencoded Guid
ElementTemplate IDattrTempl.ElementTemplate.ID22Urlencoded Guid
AttributeTemplate IDattrTempl.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“AT”2None
ElementTemplate Marker‘E’Preserved here for legacy purposes1None
Name Payload

attrTempl.GetPath(AFEncodeType.Name,null)

.Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“AT”2None
ElementTemplate Marker‘E’Preserved here for legacy purposes1None
ElementTemplate IDattrTempl.ElementTemplate.ID22Urlencoded Guid
AttributeTemplate IDattrTempl.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“AT”2None
ElementTemplate Marker‘E’Preserved here for legacy purposes1None
ElementTemplate IDattrTempl.ElementTemplate.ID22Urlencoded Guid
AttributeTemplate IDattrTempl.ID22Urlencoded Guid

 

AFDatabase

The Web ID for an AFDatabase consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“RD”2None
System IDdatabase.PISystem.ID22Urlencoded Guid
Database IDdatabase.ID22Urlencoded Guid
Name Payloaddatabase.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“RD”2None
System IDdatabase.PISystem.ID22Urlencoded Guid
Database IDdatabase.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“RD”2None
Name Payloaddatabase.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“RD”2None
Database IDdatabase.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“RD”2None
Database IDdatabase.ID22Urlencoded Guid

 
AFElement

The Web ID for an AFElement consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“Em”2None
System IDelement.PISystem.ID22Urlencoded Guid
Element IDelement.ID22Urlencoded Guid
Name Payloadelement.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“Em”2None
System IDelement.PISystem.ID22Urlencoded Guid
Element IDelement.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“Em”2None
Name Payloadelement.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“Em”2None
Element IDelement.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“Em”2None
Element IDelement.ID22Urlencoded Guid

 

AFCategory for Element

The Web ID for an AFCategory, whose Identity is CategoryElement, consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“EC”2None
System IDcategory.PISystem.ID22Urlencoded Guid
Category IDcategory.ID22Urlencoded Guid
Name Payloadcategory.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“EC”2None
System IDcategory.PISystem.ID22Urlencoded Guid
Category IDcategory.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“EC”2None
Name Payloadcategory.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“EC”2None
Category IDcategory.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“EC”2None
Category IDcategory.ID22Urlencoded Guid

 

AFElementTemplate

The Web ID for an AFElementTemplate consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“ET”2None
System IDtemplate.PISystem.ID22Urlencoded Guid
ElementTemplate IDtemplate.ID22Urlencoded Guid
Name Payloadtemplate.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 
   ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“ET”2None
System IDtemplate.PISystem.ID22Urlencoded Guid
ElementTemplate IDtemplate.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“ET”2None
Name Payloadtemplate.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“ET”2None
ElementTemplate IDtemplate.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“ET”2None
ElementTemplate IDtemplate.ID22Urlencoded Guid

 

AFEnumerationSet

The Web ID for an AFEnumerationSet consists of the following data:

Full Type

Field NameValueEncodedWidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“MS”2None
Source Marker‘R’ if enumerationSet.PISystem != null‘D’ if enumerationSet.PIServer != null1None
Server IDenumerationSet.PISystem.ID (if AF)enumerationSet.PIServer.ID (if PI)22Urlencoded Guid
EnumerationSet IDenumerationSet.ID22Urlencoded Guid
Name PayloadenumerationSet.GetPath(AFEncodeType.Name,null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

 

ID Only Type

Field NameValueEncodedWidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“MS”2None
Source Marker‘R’ if enumerationSet.PISystem != null‘D’ if enumerationSet.PIServer != null1None
Server IDenumerationSet.PISystem.ID (if AF)enumerationSet.PIServer.ID (if PI)22Urlencoded Guid
EnumerationSet IDenumerationSet.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncodedWidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“MS”2None
Source Marker‘R’ if enumerationSet.PISystem != null‘D’ if enumerationSet.PIServer != null1None
Name PayloadenumerationSet.GetPath(AFEncodeType.Name,null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

 

Local ID Only Type

Field NameValueEncodedWidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“MS”2None
Source Marker‘R’ if enumerationSet.PISystem != null‘D’ if enumerationSet.PIServer != null1None
EnumerationSet IDenumerationSet.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncodedWidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“MS”2None
Source Marker‘R’ if enumerationSet.PISystem != null‘D’ if enumerationSet.PIServer != null1None
EnumerationSet ID
  1. enumerationSet.ID
22Urlencoded Guid

 

 

AFEnumerationValue

The Web ID for an AFEnumerationValue consists of the following data: 
Full Type

Field NameValueEncodedWidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“MV”2None
Source Marker‘R’ if val.EnumerationSet.PISystem != null‘D’ if val.EnumerationSet.PIServer != null1None
Server IDval.EnumerationSet.PISystem.ID (if AF)val.EnumerationSet.PIServer.ID (if PI)22Urlencoded Guid
EnumerationSet IDval.EnumerationSet.ID22Urlencoded Guid
EnumerationValue IDval.ID22Urlencoded Guid
Name Payload(val.EnumerationSet.GetPath(AFEncodeType.Name, null).Substring(2) + '\\' + val.Name) .ToUpperInvariant()varUrlencoded UTF8String

 

ID Only Type

Field NameValueEncodedWidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“MV”2None
Source Marker‘R’ if val.EnumerationSet.PISystem != null‘D’ if val.EnumerationSet.PIServer != null1None
Server IDval.EnumerationSet.PISystem.ID (if AF)val.EnumerationSet.PIServer.ID (if PI)22Urlencoded Guid
EnumerationSet IDval.EnumerationSet.ID22Urlencoded Guid
EnumerationValue IDval.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncodedWidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“MV”2None
Source Marker‘R’ if val.EnumerationSet.PISystem != null‘D’ if val.EnumerationSet.PIServer != null1None
Name Payload

(val.EnumerationSet.GetPath(AFEncodeType.Name,null)

.Substring(2) + '\\' + val.Name) .ToUpperInvariant()

varUrlencoded UTF8String

 

Local ID Only Type

Field NameValueEncodedWidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“MV”2None
Source Marker‘R’ if val.EnumerationSet.PISystem != null‘D’ if val.EnumerationSet.PIServer != null1None
EnumerationSet IDval.EnumerationSet.ID22Urlencoded Guid
EnumerationValue IDval.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncodedWidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“MV”2None
Source Marker‘R’ if val.EnumerationSet.PISystem != null‘D’ if val.EnumerationSet.PIServer != null1None
EnumerationSet IDval.EnumerationSet.ID22Urlencoded Guid
EnumerationValue IDval.ID22Urlencoded Guid

 

 

AFEventFrame

The Web ID for an AFEventFrame consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“Fm”2None
System IDeventFrame.PISystem.ID22Urlencoded Guid
Event Frame IDeventFrame.ID22Urlencoded Guid
Name PayloadeventFrame.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“Fm”2None
System IDeventFrame.PISystem.ID22Urlencoded Guid
Event Frame IDeventFrame.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“Fm”2None
Name PayloadeventFrame.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“Fm”2None
Event Frame IDeventFrame.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“Fm”2None
Event Frame IDeventFrame.ID22Urlencoded Guid

 

 

AFNotification

The Web ID for an AFNotification consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“Nf”2None
System IDnotification.PISystem.ID22Urlencoded Guid
Element IDnotification.ID22Urlencoded Guid
Name Payloadnotification.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“Nf”2None
System IDnotification.PISystem.ID22Urlencoded Guid
Element IDnotification.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“Nf”2None
Name Payloadnotification.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“Nf”2None
Element IDnotification.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“Nf”2None
Element IDnotification.ID22Urlencoded Guid

 

 

AFNotificationTemplate

The Web ID for an AFNotificationTemplate consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“NT”2None
System IDtemplate.PISystem.ID22Urlencoded Guid
ElementTemplate IDtemplate.ID22Urlencoded Guid
Name Payloadtemplate.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“NT”2None
System IDtemplate.PISystem.ID22Urlencoded Guid
ElementTemplate IDtemplate.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“NT”2None
Name Payloadtemplate.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“NT”2None
ElementTemplate IDtemplate.ID22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“NT”2None
ElementTemplate IDtemplate.ID22Urlencoded Guid

 
AFTimeRule

The Web ID for an AFTimeRule consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“TR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
System IDtimeRule.PISystem.ID22Urlencoded Guid
Owner IDtimeRule.Analysis.ID or timeRule.AnalysisTemplate.ID22Urlencoded Guid
Time Rule IDtimeRule.ID22Urlencoded Guid
Name PayloadtimeRule.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“TR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
System IDtimeRule.PISystem.ID22Urlencoded Guid
Owner IDtimeRule.Analysis.ID or timeRule.AnalysisTemplate.ID22Urlencoded Guid
Time Rule IDtimeRule.ID22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“TR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
Name Payload

timeRule.GetPath(AFEncodeType.Name,null)

.Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“TR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
Owner IDtimeRule.Analysis.ID ortimeRule.AnalysisTemplate.ID22Urlencoded Guid
Time Rule IDtimeRule.ID22Urlencoded Guid

    

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“TR”2None
Owner Marker‘X’ if rule’s owner is AFAnalysis‘T’ if rule’s owner is AFAnalysisTemplate1None
Owner IDtimeRule.Analysis.ID ortimeRule.AnalysisTemplate.ID22Urlencoded Guid
Time Rule IDtimeRule.ID22Urlencoded Guid

 

 

AFPlugIn for Time Rule

The Web ID for an AFPlugIn, whose Identity is PlugInTimeRule, consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“TP”2None
System IDtimeRulePlugIn.PISystem.ID22Urlencoded Guid
Event Frame IDtimeRulePlugIn.ID22Urlencoded Guid
Name PayloadtimeRulePlugIn.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“TP”2None
System IDtimeRulePlugIn.PISystem.ID22Urlencoded Guid
Event Frame IDtimeRulePlugIn.ID22Urlencoded Guid

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“TP”2None
Name PayloadtimeRulePlugIn.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“TP”2None
Event Frame IDtimeRulePlugIn.ID22Urlencoded Guid

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“TP”2None
Event Frame IDtimeRulePlugIn.ID22Urlencoded Guid

 

 

AFSecurityIdentity

The Web ID for an AFSecurityIdentity consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“SI”2None
System IDsecurityIdentity.PISystem.ID22Urlencoded Guid
Security IdentityIDsecurityIdentity.ID22Urlencoded Guid
Name PayloadsecurityIdentity.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“SI”2None
System IDsecurityIdentity.PISystem.ID22Urlencoded Guid
Security IdentityIDsecurityIdentity.ID22Urlencoded Guid

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“SI”2None
Name PayloadsecurityIdentity.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“SI”2None
Security IdentityIDsecurityIdentity.ID22Urlencoded Guid

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“SI”2None
Security IdentityIDsecurityIdentity.ID22Urlencoded Guid

 

 

AFSecurityMapping

The Web ID for an AFSecurityMapping consists of the following data.

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“SM”2None
System IDsecurityMapping.PISystem.ID22Urlencoded Guid
SecurityMapping IDsecurityMapping.ID22Urlencoded Guid
Name PayloadsecurityMapping.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“SM”2None
System IDsecurityMapping.PISystem.ID22Urlencoded Guid
SecurityMapping IDsecurityMapping.ID22Urlencoded Guid

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“SM”2None
Name PayloadsecurityMapping.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8String

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“SM”2None
SecurityMapping IDsecurityMapping.ID22Urlencoded Guid

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“SM”2None
SecurityMapping IDsecurityMapping.ID22Urlencoded Guid

 
AFTable

The Web ID for an AFTable consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“Bl”2None
System IDtable.PISystem.ID22Urlencoded Guid
Table IDtable.ID22Urlencoded Guid
Name Payloadtable.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 Strin

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“Bl”2None
System IDtable.PISystem.ID22Urlencoded Guid
Table ID

table.ID

22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“Bl”2None
Name Payload

table.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“Bl”2None
Table ID

table.ID

22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“Bl”2None
Table ID

table.ID

22Urlencoded Guid

 

 

AFCategory for Table

The Web ID for an AFCategory, whose Identity is CategoryTable, consists of the following data:

 

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“BC”2None
System ID

category.PISystem.ID

22Urlencoded Guid
Category ID

category.ID

22Urlencoded Guid
Name Payload

category.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“BC”2None
System ID

category.PISystem.ID

22Urlencoded Guid
Category ID

category.ID

22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“BC”2None
Name Payload

category.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“BC”2None
Category ID

category.ID

22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“BC”2None
Category ID

category.ID

22Urlencoded Guid

 

 

PIPoint

The Web ID for a PI Point consists of the following data:

 

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“DP”2None
Server ID

point.Server.ID

22Urlencoded Guid
Point ID

point.ID

6Urlencoded Int32
Name Payload

point.GetPath().Substring(2)

.ToUpperInvariant()
varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“DP”2None
Server ID

point.Server.ID

22Urlencoded Guid
Point ID

point.ID

6Urlencoded Int32

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“DP”2None
Name Payload

point.GetPath().Substring(2)

.ToUpperInvariant()
varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“DP”2None
Point ID

point.ID

6Urlencoded Int32

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“DP”2None
Point ID

point.ID

6Urlencoded Int32

 

 

PIServer

The Web ID for a PI Server consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“DS”2None
Server ID

server.ID

22Urlencoded Guid
Server Name

server.Name.ToUpperInvariant()

varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“DS”2None
Server ID

server.ID

22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“DS”2None
Server Name

server.Name.ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“DS”2None

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“DS”2None

 

 

PISystem

The Web ID for a PISystem consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“RS”2None
System ID

piSystem.ID

22Urlencoded Guid
Name Payload

piSystem.GetPath(AFEncodeType.Name,

null).Substring(2).ToUpperInvariant()
varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“RS”2None
System ID

piSystem.ID

22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“RS”2None
Name Payload

piSystem.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“RS”2None

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“RS”2None

 

 

UOM

The Web ID for a UOM consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“Ut”2None
System ID

uom.PISystem.ID

22Urlencoded Guid
UOM ID

uom.ID

22Urlencoded Guid
Name Payload

uom.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“Ut”2None
System ID

uom.PISystem.ID

22Urlencoded Guid
UOM ID

uom.ID

22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“Ut”2None
Name Payload

uom.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“Ut”2None
UOM ID

uom.ID

22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“Ut”2None
UOM ID

uom.ID

22Urlencoded Guid

 
UOMClass

The Web ID for a UOMClass consists of the following data:

Full Type

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker“UC”2None
System ID

uomClass.PISystem.ID

22Urlencoded Guid
UOM ID

uomClass.ID

22Urlencoded Guid
Name Payload

uomClass.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘I’1None
Version‘1’1None
Marker“UC”2None
System ID

uomClass.PISystem.ID

22Urlencoded Guid
UOM ID

uomClass.ID

22Urlencoded Guid

 

Path Only Type

Field NameValueEncoded WidthEncoding Method
Type‘P’1None
Version‘1’1None
Marker“UC”2None
Name Payload

uomClass.GetPath(AFEncodeType.Name, null).Substring(2).ToUpperInvariant()

varUrlencoded UTF8 String

 

Local ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘L’1None
Version‘1’1None
Marker“UC”2None
UOM ID

uomClass.ID

22Urlencoded Guid

 

Default ID Only Type

Field NameValueEncoded WidthEncoding Method
Type‘D’1None
Version‘1’1None
Marker“UC”2None
UOM ID

uomClass.ID

22

Urlencoded Guid

(If you're looking for the PI object encodings spec, visit this post)

 

Supported Versions

Web ID 2.0 first became available in PI Web API 2017 R2 (1.10 and later).   You can check your installed version by browsing to your PI Web API System endpoint  {yourwebapiserver}/piwebapi/system .

Video: Everything you wanted to know about WebID 2.0

 

What is Web ID?

Web ID is a fail-safe mechanism for retrieving artifcats from PI and AF servers while remaining safe for use in URLs. WebID URLs are resilient to changes of an object’s name or ID, which means you can store them and use them in your apps.

 

PI Web API uses Web ID as the main access mechanism to explore the objects in the PI system landscape.

 

If you already know the structure of your AF hierarchy, you can compose Web ID addresses yourself, sparing you the expense of consulting the query and search endpoints in PI Web API to determine what those Web IDs are.

 

How can I use Web ID to enhance my application?

With Web ID you can build direct links to storage areas in the PI System and cache those in your own application.   This is helpful for scenarios where you have a large number of objects to trade with PI Web API and you already know how the objects are modeled in the PI System.   They are also critical to efficient operations such as Batch requests where you need to perform a large amount of operations at once.

 

With Web ID you can also save on network bandwidth and transfer rates by composing shorter Web IDs where necessary, if server contexts aren’t expressly needed.

 

The Basics - How a Web ID is composed

A Web ID is a smart code that is comprised of several compound strings. The first four characters of a WebID determine how the remainder of the string is comprised and what object is being referenced.

 

Diagram of how a Web ID is composed

 

In the example here, a full version of a Web ID is being used to encode the ID of an AF Element.

 

The components of the Web ID in this instance are:

AF Element (Web ID Type: Full)

 

Field NameValueEncoded WidthEncoding Method
Type‘F’1None
Version‘1’1None
Marker‘Em’2None
System IDelement.PISystem.ID22Urlencoded Guid
Element IDelement.ID22Urlencoded Guid
Name Payloadelement.GetPath(AFEncodeType. Name, null).Substring(2).ToUpperInvariant()varUrlencoded UTF8 String

(Visit here for the full listing of supported object types and their encodings)

 

Web ID Types

The following Web ID types can be used to reduce the length of ID that you use to cache. You can request WebID types by adding ?webIDType={type} to any URL request in PI Web API, or posting any type of Web ID you wish to the PI Web API server. PI Web API will automatically figure out what type of Web ID you sent based on the formatting markers inside the ID.

 

Here are some examples:

Web ID TypeSampleElements Omitted
Full (default)F1EmDqD5loBNH0erqeqJodtALAh_fRZ2eH5xGWZgAVXQKgBgUkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQx
?webIDType=IDOnlyI1EmDqD5loBNH0erqeqJodtALAh_fRZ2eH5xGWZgAVXQKgBgPath
?webIDType=PathOnlyP1EmUkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQxServer ID, Object ID
?webIDType=LocalIDOnlyL1Emh_fRZ2eH5xGWZgAVXQKgBgServer ID, Path
?webIDType=DefaultIDOnlyD1Emh_fRZ2eH5xGWZgAVXQKgBgServer ID, Path

Let’s decompose in code

The following code sample demonstrates how a full Web ID is parsed.

Example C# - Decomposing Web ID values

  using System;
  using System.Text;

  class WebIDExample
  {

  internal static string Encode(byte[] value)
  {
 string encoded = System.Convert.ToBase64String(value);
 return encoded.TrimEnd(new char[] { '=' }).Replace('+', '-').Replace('/', '_');
  }

  internal static string Encode(Guid value)
  {
 byte[] bytes = value.ToByteArray();
 return Encode(bytes);
  }

  internal static byte[] Decode(string value)
  {
 //Base 64 strings are in multiples of 4 bytes long.
 //This restores the = sign padding and changes the Uri-safe chars with the Base64 requirement
 StringBuilder decodestring = new StringBuilder(value.Replace('-','+').Replace('_','/'));
 int padneeded = value.Length % 4;
 for (int i = 0; i < padneeded; i++)
 {
 decodestring.Append('=');
 }

 byte[] bytes = System.Convert.FromBase64String(decodestring.ToString());
 return bytes;
  }

  internal static string DecodeString(string value)
  {
 return Encoding.UTF8.GetString(Decode(value));
  }

  internal static Guid DecodeGUID(string value)
  {
 byte[] guid = Decode(value);
 return new Guid(guid);
  }

  public static void Main()
  {

 // Given a Web ID of F1EmDqD5loBNH0erqeqJodtALAh_fRZ2eH5xGWZgAVXQKgBgUkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQx,
 // let's decode the component parts.

 // F Full 1 Version Em AF Element RXhhbXBsZVN0cmluZw== Server
 // ID (GUID), string must be padded to decode
 // h/fRZ2eH5xGWZgAVXQKgBg== AF Object ID (GUID), change the _
 // to a / before decoding UkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQx
 // Name (RESTUNIT\SAWYER\ELEMENT1)

 // Note: The decoded GUIDs are returned as a series of UTF8 bytechars, which are then
 // convertible into a GUID by printing the hex value of each byte.

 // Encode/decode basic string parts used in WebID
 Console.WriteLine("The F value of the WebID = Full");
 Console.WriteLine($"The value of RXhhbXBsZVN0cmluZw is {DecodeString("RXhhbXBsZVN0cmluZw")}");
 Console.WriteLine($"The value of DqD5loBNH0erqeqJodtALA is {DecodeGUID("DqD5loBNH0erqeqJodtALA").ToString()}");
 Console.WriteLine($"The value of h_fRZ2eH5xGWZgAVXQKgBg is {DecodeGUID("h_fRZ2eH5xGWZgAVXQKgBg").ToString()}");
 Console.WriteLine($"The value of UkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQx is {DecodeString("UkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQx").ToString()}");

  }

  }

 

Example JS - Decomposing Web ID values

//var btoa = require('btoa');
//var atob = require('atob');

function DecodeString(strDecode) {
  var decodestring = strDecode.replace('-', '+').replace('_', '/');
  var padneeded = decodestring.length % 4;
  for (var i = 0; i < padneeded; i++) {
  decodestring += '=';
  }

  return (atob(decodestring)).toString('utf8');;
}

function Base64ToArrayBuffer(base64) {
  var binary_string = atob(base64);
  var len = binary_string.length;
  var bytes = new Uint8Array(len);
  for (var i = 0; i < len; i++) {
  bytes[i] = binary_string.charCodeAt(i);
  }
  return bytes.buffer;
}

function DecodeGUID(strDecode) {
  var bytes = Base64ToArrayBuffer(strDecode);
  var uncodedbytes = new Uint8Array(bytes);

  var guidstr = "";

  for (var i = 3; i >= 0; i--) {
  if (uncodedbytes[i] < 17) {
  guidstr += "0" + uncodedbytes[i].toString(16);
  } else {
  guidstr += uncodedbytes[i].toString(16);
  }
  }
  guidstr += "-";
  if (uncodedbytes[5] < 17) {
  guidstr += "0" + uncodedbytes[5].toString(16);
  } else {
  guidstr += uncodedbytes[5].toString(16);
  }
  if (uncodedbytes[4] < 17) {
  guidstr += "0" + uncodedbytes[4].toString(16);
  } else {
  guidstr += uncodedbytes[4].toString(16);
  }
  guidstr += "-";
  if (uncodedbytes[7] < 17) {
  guidstr += "0" + uncodedbytes[7].toString(16);
  } else {
  guidstr += uncodedbytes[7].toString(16);
  }
  if (uncodedbytes[6] < 17) {
  guidstr += "0" + uncodedbytes[6].toString(16);
  } else {
  guidstr += uncodedbytes[6].toString(16);
  }
  guidstr += "-";
  if (uncodedbytes[8] < 17) {
  guidstr += "0" + uncodedbytes[8].toString(16);
  } else {
  guidstr += uncodedbytes[8].toString(16);
  }
  if (uncodedbytes[9] < 17) {
  guidstr += "0" + uncodedbytes[9].toString(16);
  } else {
  guidstr += uncodedbytes[9].toString(16);
  }
  guidstr += "-";
  for (i = 10; i < 16; i++) {
  if (uncodedbytes[i] < 17) {
  guidstr += "0" + uncodedbytes[i].toString(16);
  } else {
  guidstr += uncodedbytes[i].toString(16);
  }
  }

  return guidstr;
}


function ParseExample() {
  console.log("Taking the Full Web ID of " +
  "F1EmDqD5loBNH0erqeqJodtALAh_fRZ2eH5xGWZgAVXQKgBgUkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQx\n");
  console.log("Let's break this into its constituent parts: ");
  console.log("F1 Full Web ID, Version 1");
  console.log("Em This is an AF Element");
  console.log("DqD5loBNH0erqeqJodtALA -> " + DecodeGUID("DqD5loBNH0erqeqJodtALA") + " Server ID");
  console.log("h_fRZ2eH5xGWZgAVXQKgBg -> " + DecodeGUID("h_fRZ2eH5xGWZgAVXQKgBg") + " AF Object ID");
  console.log("UkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQx -> " + DecodeString("UkVTVFVOSVRcU0FXWUVSXEVMRU1FTlQx"));
}


ParseExample();

 

How the encoding works

 

Encoded fields are constructed mostly in two ways:

Encoded Strings (Base64)

UTF-8 strings designating names are encoded in Base64 . However, they do not include the padding characters required to decode them. This means you will need to follow this pattern:

  • Determine length of string
  • If the modulo of the string’s length is not evenly divisible by 4, then pad the string with equal signs ‘=’ until it is evenly divisible by four.
  • Once decoded into a binary array, convert the binary array to UTF-8 characters.

 

Encoded GUID/UUID (Base64)

How a GUID is composed

Universally Unique Identifiers (UUIDs) are 128-bit numbers that are used to uniquely identify any type of object as well as guarantee with an extremely high level of probability that randomly-generated numbers will not collide.

 

Web ID contains unqiue object identifiers that point to servers and resources in PI Asset Framework. Usually this will be a Server ID that identifies the AF Server where an Asset Framework object is based then GUID/UUID of an AF object itself; like an element, attribute, batch frame or template, etc.

 

Note about byte order - PI Web API uses Microsoft-formatted GUID numbers. Because they are expressed in Base64 strings, they will be 22 characters in length. In other environments such as Javascript or Java, UUIDs may be expressed with different byte orders.

 

Given a GUID expressed as DqD5loBNH0erqeqJodtALA, you must expand this string to DqD5loBNH0erqeqJodtALA== so that it is 24 characters long. Converting the individual bytes to hexadecimal notation and placing the bytes in the correct order should yield 96f9a00e-4d80-471f-aba9-ea89a1db402c as the server GUID.

 

 

 

 

For the full listing of supported PI object types and their Web ID encodings, visit here.

ray

Next Generation PI SQL Processing

Posted by ray Employee Jan 10, 2018

We have been working on a new SQL query processing engine we call the Real-Time Query Processor (RTQP). The RTQP Engine has several important goals. First and foremost, we plan to improve performance and scalability of your SQL queries. We understand that some queries involving large PI System databases and large amounts of time series data could be improved. Secondly, we are taking the opportunity to simplify the design of the tables that support SQL queries. Our goal is to simplify our design so that fewer table joins are required to perform your most common tasks.

 

The OSIsoft PI SQL Team is proud to announce the availability of the second Community Technology (CTP2) release of the Real-Time Query Processor (RTQP)! There was a CTP1 which was shared with a few early adopters; we thank them for their feedback. To install CTP2, you need a new OLEDB provider called PI SQL Client OLEDB. This provider communicates with the PI SQL Data Access Server (RTQP Engine) which performs the SQL query processing. You can download the PI SQL Client OLEDB, documentation and release notes from the Technical Support Download Center. The required PI SQL Data Access Server (RTQP Engine) is an optional component in the PI AF Services 2017 R2 install kit.

 

Our new table designs are not compatible with PI OLEDB Enterprise. We hope you will be motivated to migrate but we will continue to support PI OLEDB Enterprise and PI OLEDB Provider indefinitely so we don’t break your working configurations. They can be installed in parallel.

 

We welcome feedback! Please contact us at BetaOLEDB@osisoft.com instead of calling Technical Support. Or, you can post comments here.

ray

PI Web API 2017 R2 is released!

Posted by ray Employee Dec 29, 2017

I am pleased to announce the release of PI Web API 2017 R2, our suite of REST services for interacting with the PI System. The PI Web API is a member of the Developer Technologies suite of products. Click to see our Technical Support Product Release Bulletin which in turn will direct you to the right pages in our Download Center. We have stopped shipping the dedicated PI Web API install kit. Instead, PI Web API is part of PI AF Services 2017 R2.

 

There are many enhancements and bug fixes in this release. I encourage you to read the Release Notes to learn about what we did. Improving performance is Job #1! You'll find many work items that were directed at improving speeds of data retrieval and search. I wanted to mention two features:

 

WebId 2.0: we have received many comments about our WebId concept which are unique identifiers to just about everything you reference through PI Web API. While accurate, they can get to be a bit big. To address this, we have introduced WebId 2.0. We now have different types of WebId that vary in length and precision. It is even possible to create WebIds yourself if you already have access to AF SDK object ids. Let me know if this is interesting to you.

 

Channels: we have received a lot of positive feedback about our websocket "Channel" implementation. One of your biggest problems, it seems, is that you can't be completely sure if the channel is healthy if you have not received data updates for a while. For technical reasons, we are unable to implement the web socket standard RFC6455 "Ping" and "Pong" features to ascertain health. What we have done instead is allow you to request a periodic "heartbeat" response which consists of an empty message if there are no data values to send.

 

I hope you can upgrade to PI Web API 2017 R2 soon. Let me know what you think!

I am pleased to announce the release of several products in the PI SQL family which are members of the Developer Technologies suite of products:

All of these products provide access to PI System data through SQL queries. Click on these product names to see the Technical Support Product Release Announcements which in turn will direct you to the right pages in the Technical Support Download Center. There are just too many enhancements and bug fixes to list them all here. Congratulations to the OSIsoft PI SQL development team on these releases!

Introduction

 

This is an R package that integrates the PI System with R through PI Web API. It was built with the PI Web API 2017 Swagger definition. With this package, you can retrieve PI data without having to generate the URL for each request.

 

You can visit the GitHub repository of this library here.

 

Requirements

 

  • R 3.4+

 

Installation

 

This R package is not available on CRAN. You should download it directly from this GitHub repository by using the devtools R package. If you don't have it installed, please use the command below:

 

install.packages("devtools")

 

Then, load the library and install the PI Web API R package with the install_github method:

 

library(devtools)
install_github("osimloeff/PI-Web-API-Client-R")

 

If the installation is successful, the command below will load the package:

 

library(piwebapi)

 

If you want to uninstall this package, use the command below:

 

remove.packages("piwebapi")

 

 

Documentation

 

All the methods and classes from this R package are described on its documentation, which can be opened by typing on the R console:

 

help(package="piwebapi") 

 

Examples

 

Please refer to the following examples to understand how to use this library:

 

Create an intance of the piwebapi top level object.

 

Basic Authentication

 

useKerberos <- FALSE
username <- "myusername"
password <- "mypassword"
validateSSL <- TRUE
debug <- TRUE
piWebApiService <- piwebapi$new("https://webserver/piwebapi", useKerberos, username, password, validateSSL, debug)

 

Kerberos Authentication

 

useKerberos <- TRUE
username <- NULL
password <- NULL
validateSSL <- TRUE
debug <- TRUE
piWebApiService <- piwebapi$new("https://webserver/piwebapi", useKerberos, username, password, validateSSL, debug)

 

 

If you want to use basic authentication instead of Kerberos, set useKerberos to FALSE. If you are having issues with your SSL certificate and you want to ignore this error, set validateSSL to FALSE. If you want to receive a log about each HTTP request, set debug to TRUE.

 

 

Retrieve data from the main PI Web API endpoint

 

response1 = piWebApiService$home$get()

 

Get the PI Data Archive WebId

response2 = piWebApiService$dataServer$getByPath("\\\\piservername", "WebId")

 

Get current values in bulk using the StreamSet/GetValuesAdHoc

 

 

response3a = piWebApiService$point$getByPath("\\\\JUPITER001\\sinusoidu")
response3b = piWebApiService$point$getByPath("\\\\JUPITER001\\cdt158")
response3c = piWebApiService$point$getByPath("\\\\JUPITER001\\sinusoid")
webIds <- c(response3a$WebId, response3b$WebId, response3c$WebId)
response3d = piWebApiService$streamSet$getValuesAdHoc(webIds)

 

Retrieving PI data to an R data frame

 

 

response4a <- piWebApiService$data$getRecordedValues(path = "pi:\\\\PISRV1\\sinusoid", startTime = "y-200d", endTime = "t")
response4b <- piWebApiService$data$getRecordedValues(path = "pi:\\\\PISRV1\\sinusoid", startTime = "y-200d", endTime = "t", selectedFields = "items.value;items.timestamp")
response4c <- piWebApiService$data$getRecordedValues(path = "af:\\\\PISRV1\\UCDavisBuildings\\Buildings\\Buildings\\Academic Surge Building\\Electricity|Demand", startTime = "y-200d", endTime = "t")


response5a <- piWebApiService$data$getInterpolatedValues(path = "pi:\\\\PISRV1\\sinusoid", startTime = "y-2d", endTime = "t", interval = "1h")
response5b <- piWebApiService$data$getInterpolatedValues(path = "pi:\\\\PISRV1\\sinusoid", startTime = "y-2d", endTime = "t", interval = "1h", selectedFields = "items.value;items.timestamp")
response5c <- piWebApiService$data$getInterpolatedValues(path = "af:\\\\PISRV1\\UCDavisBuildings\\Buildings\\Buildings\\Academic Surge Building\\Electricity|Demand", startTime = "y-2d", endTime = "t", interval = "1h")


response6a <- piWebApiService$data$getPlotValues(path = "pi:\\\\PISRV1\\sinusoid", startTime = "y-2d", endTime = "t", intervals = 30)
response6b <- piWebApiService$data$getPlotValues(path = "pi:\\\\PISRV1\\sinusoid", startTime = "y-2d", endTime = "t", intervals = 30, selectedFields = "items.value;items.timestamp")
response6c <- piWebApiService$data$getPlotValues(path = "af:\\\\PISRV1\\UCDavisBuildings\\Buildings\\Buildings\\Academic Surge Building\\Electricity|Demand", startTime = "y-2d", endTime = "t", intervals = 30)


response7a <- piWebApiService$data$getMultipleRecordedValues(paths = paths, startTime = "y-200d", endTime = "t")
response7b <- piWebApiService$data$getMultipleRecordedValues(paths = paths, startTime = "y-200d", endTime = "t", selectedFields = "items.items.value;items.items.timestamp")


response8a <- piWebApiService$data$getMultipleInterpolatedValues(paths = paths, startTime = "y-200d", endTime = "t", interval = "1h")
response8b <- piWebApiService$data$getMultipleInterpolatedValues(paths = paths, startTime = "y-200d", endTime = "t", interval = "1h", selectedFields = "items.items.value;items.items.timestamp")


response9a <- piWebApiService$data$getMultiplePlotValues(paths = paths, startTime = "y-200d", endTime = "t", intervals = 30)
response9b <- piWebApiService$data$getMultiplePlotValues(paths = paths, startTime = "y-200d", endTime = "t", intervals = 30, selectedFields = "items.items.value;items.items.timestamp")

 

 

The path from the methods above should start with "pi:" (if your stream is a PI Point) or "af:" (if your stream is an AF attribute).

 

Create a PI Point

 

newPoint <- PIPoint(NULL, NULL, "SINUSOIDR", NULL, "12 Hour Sine Wave", "classic", "Float32", NULL, NULL, NULL, NULL, NULL)
response10 = piWebApiService$dataServer$createPoint("s0TJVKOA0Ws0KihcA8rM1GogUElGSVRORVNTLVNSVjI", newPoint)
Send values in bulk using the StreamSet/UpdateValuesAdHoc


timedValue1 <- PITimedValue(timestamp = "2017-04-26T17:40:54Z", value = 30)
timedValue2 <- PITimedValue(timestamp = "2017-04-27T17:40:54Z", value = 31)
timedValue3 <- PITimedValue(timestamp = "2017-04-26T17:40:54Z", value = 32)
timedValue4 <- PITimedValue(timestamp = "2017-04-27T17:40:54Z", value = 33)
t1 <- list(timedValue1, timedValue2)
t2 <- list(timedValue3, timedValue4)
s1 <- PIStreamValues(webId = webIds[1], items = t1);
s2 <- PIStreamValues(webId = webIds[2], items = t2);
values <- list(s1, s2)
response11 <- piWebApiService$streamSet$updateValuesAdHoc(values, "BufferIfPossible", "Replace");
Update the description from a PI Point


createdPoint <- piWebApiService$point$getByPath("\\\\PIFITNESS-SRV2\\SINUSOIDR")
updatePoint <- PIPoint()
updatePoint$Descriptor <- "12 Hour Sine Wave for R"
response12 <- piWebApiService$point$update(createdPoint$WebId, updatePoint)

 

Delete a PI Point

 

response13 <- piWebApiService$point$delete(createdPoint$WebId)

 

Using PI Batch to increase performance

 

getSinReq <- list(Method = "GET", Resource = "https://cross-platform-lab-uc2017.osisoft.com/piwebapi/points?path=\\\\pifitness-srv2\\sinusoid")
getCdtReq <- list(Method = "GET", Resource = "https://cross-platform-lab-uc2017.osisoft.com/piwebapi/points?path=\\\\pifitness-srv2\\cdt158")
getData <- list(Method = "GET", Resource = "https://cross-platform-lab-uc2017.osisoft.com/piwebapi/streamsets/value?webid={0}&webid={1}")
getData$Parameters <- c("$.sinu.Content.WebId", "$.cdt.Content.WebId")
getData$ParentIds <- c("sinu", "cdt")
batch <- list(sinu = getSinReq, cdt = getCdtReq, data = getData);
response14 <- piWebApiService$batch$execute(batch)
content(response11)

 

 

Create a SecurityEntry on an element

 

allowRight <- array(1:2)
allowRight[1] = "Read"
allowRight[2] = "ReadData"
denyRights <- array(1:3)
denyRights[1] = "Write"
denyRights[2] = "Execute"
denyRights[3] = "Admin"
securityEntry <- PISecurityEntry(securityIdentityName = "SwaggerIdentity", allowRights = as.list(allowRight), denyRights = as.list(denyRights))
response15 <- piWebApiService$element$createSecurityEntry(elementWebId, securityEntry, TRUE);

 

Get a SecurityEntry of an element

 

response16 <- piWebApiService$element$getSecurityEntries(elementWebId)

 

Update a SecurityEntry of an element

 

allowRight <- array(1)
allowRight[1] = "Read"
denyRights <- array(1:4)
denyRights[1] = "Write"
denyRights[2] = "Execute"
denyRights[3] = "Admin"
denyRights[4] = "ReadData"
securityEntry <- PISecurityEntry(allowRights = allowRight, denyRights = denyRights)
response17 <- piWebApiService$element$updateSecurityEntry("SwaggerIdentity", elementWebId, securityEntry, TRUE)

 

 

Final Remarks

 

We hope that data scientists will be able to integrate the PI System with R easier using this R package since it can return R data frame objects.

 

Please share your comments and suggestions below!

Introduction

 

Today we release our first version of the PI Web API client library for Python . The purpose of using this library is to make it easier the integration of a Python application with the PI System through PI Web API. This library is a client RESTful web service. All server methods from PI Web API 2017 are available on the library. As a result, you don't need to generate the URL in order to make an HTTP request. The library will generate for you automatically!

 

You can visit the GitHub repository of this library here.

 

Requirements

 

  • Python 2.7 or Python 3.4+

 

Installation

 

Before we start, it is good to mention that we don't recommend using this library with Anaconda. Try to use a clean Python instance instead.

 

pip install

 

If the python package is hosted on Github, you can install directly from Github

 

pip install git+https://github.com/osimloeff/PI-Web-API-Client-Python.git

 

You may need to run pip with root permission: sudo pip install git+https://github.com/osimloeff/PI-Web-API-Client-Python.git. If you are using Windows, remember to open the command prompt running as administrator. You must have Git installed on your machine.

 

Then import the package:

 

import osisoft.pidevclub.piwebapi 

 

Setuptools

 

Install via Setuptools.

 

python setup.py install --user

 

(or sudo python setup.py install to install the package for all users)

 

 

Then import the package:

import osisoft.pidevclub.piwebapi

 

 

This library was tested using PyCharm 2017.1.5.

 

 

Documentation

 

All classes and methods are described on the DOCUMENTATION.

 

Examples

 

Please check the test_main.py from this repository. Below there are also code snippets written in Python for you to get started using this library:

 

Create an instance of the PI Web API top level object.

 

    from osisoft.pidevclub.piwebapi.pi_web_api_client import PIWebApiClient
    client = PIWebApiClient("https://test.osisoft.com/piwebapi", False, "username", "password", True)  

 

Only Basic Authentication is available in this version. Therefore, the variable useKerberos should always be False. Do not forget to set the username and password accordingly.

 

Retrieving PI data to an Python pandas data frame

 

    df1 = client.data.get_recorded_values("pi:\\\\JUPITER001\\cdt158", None, None, "*-9d", None, None, None, None, "*-10d", None)df4 = client.data.get_multiple_recorded_values(["pi:\\JUPITER001\sinusoid", "pi:\\JUPITER001\sinusoidu", "pi:\\JUPITER001\cdt158"],None, "*", None, None, None, None, "*-1d", None)
    df2 = client.data.get_interpolated_values("pi:\\JUPITER001\\sinusoidu",None, "*", None, None, "2h", None, "*-1d", None)
    df3 = client.data.get_plot_values("pi:\\\\JUPITER001\\sinusoidu", None, "*", 10, None, "*-3d", None)
    df4 = client.data.get_recorded_values("pi:\\\\PISRV1\\sinusoid", None, None, "*", None, None, None, "items.value;items.timestamp", "*-1d", None)
    df5 = client.data.get_recorded_values("pi:\\\\PISRV1\\sinusoid", None, None, "*", None, None, None, "items.good;items.questionable;items.substituted", "*-1d", None)
    
    dfs1 = client.data.get_multiple_recorded_values(["pi:\\\\JUPITER001\\sinusoid", "pi:\\\\JUPITER001\\sinusoidu", "pi:\\\\JUPITER001\\cdt158", "af:\\\\JUPITER001\\Vitens\\Vitens\\Friesland province\\01 Production sites\\Production Site Noordbergum\\Distribution\\Quality|pH"],None, "*", None, None, None, None, "*-1d", None)
    dfs2 = client.data.get_multiple_interpolated_values(["pi:\\\\JUPITER001\\sinusoid", "pi:\\\\JUPITER001\\sinusoidu", "pi:\\\\JUPITER001\\cdt158", "af:\\\\JUPITER001\\Vitens\\Vitens\\Friesland province\\01 Production sites\\Production Site Noordbergum\\Distribution\\Quality|pH"], "*", None, None, "1d", None, "*-5d", None)
    dfs3 = client.data.get_multiple_plot_values(["pi:\\\\JUPITER001\\sinusoid", "pi:\\\\JUPITER001\\sinusoidu", "pi:\\\\JUPITER001\\cdt158", "af:\\\\JUPITER001\\Vitens\\Vitens\\Friesland province\\01 Production sites\\Production Site Noordbergum\\Distribution\\Quality|pH"], "*", 10, None, "*-1d", None)
    dfs4 = client.data.get_multiple_recorded_values(paths, None, "*", None, None, None, "items.items.value;items.items.timestamp", "*-1d", None)
    dfs5 = client.data.get_multiple_interpolated_values(paths, "*", None, None, "1h", "items.items.value;items.items.timestamp", "*-5d", None)

 

 

The path from the methods above should start with "pi:" (if your stream is a PI Point) or "af:" (if your stream is an AF attribute).

 

Get the PI Data Archive WebId

 

    dataServer = client.dataServer.get_by_path("\\\\JUPITER001", None);

 

Create a new PI Point

 

    newPoint = PIPoint()
    newPoint.name  = "SINUSOID_TEST"
    newPoint.descriptor = "Test PI Point for Python PI Web API Client"
    newPoint.point_class = "classic"
    newPoint.point_type = "float32"
    newPoint.future = False
    res = client.dataServer.create_point_with_http_info(dataServer.web_id, newPoint);    

 

Get PI Points WebIds

 

 

    point1 = client.point.get_by_path("\\\\JUPITER001\\sinusoid", None)
    point2 = client.point.get_by_path("\\\\JUPITER001\\cdt158", None)
    point3 = client.point.get_by_path("\\\\JUPITER001\\sinusoidu", None)

 

 

Get recorded values in bulk using the StreamSet/GetRecordedAdHoc

 

 

    webIds = list()
    webIds.append(point1.web_id);
    webIds.append(point2.web_id);
    webIds.append(point3.web_id);
    piItemsStreamValues = client.streamSet.get_recorded_ad_hoc(webIds, None, "*", None, True, 1000, None, "*-3d", None);

   

Send values in bulk using the StreamSet/UpdateValuesAdHoc

 

 

    streamValuesItems = PIItemsStreamValues()
    streamValue1 = PIStreamValues()
    streamValue2 = PIStreamValues()
    streamValue3 = PIStreamValues()

    value1 = PITimedValue()
    value2 = PITimedValue()
    value3 = PITimedValue()
    value4 = PITimedValue()
    value5 = PITimedValue()
    value6 = PITimedValue()

    value1.value = 2
    value1.timestamp = ("*-1d")
    value2.value = 3
    value2.timestamp = ("*-2d")
    value3.value = 4
    value3.timestamp = ("*-1d")
    value4.value = 5
    value4.timestamp = ("*-2d")
    value5.value = 6
    value5.timestamp = ("*-1d")
    value6.value = 7
    value6.timestamp = ("*-2d")


    streamValue1.web_id = point1.web_id
    streamValue2.web_id = point2.web_id
    streamValue3.web_id = point3.web_id


    values1 = list()
    values1.append(value1)
    values1.append(value2)
    streamValue1.items = values1


    values2 = list()
    values2.append(value3)
    values2.append(value4)
    streamValue2.items = values2


    values3 = list()
    values3.append(value5)
    values3.append(value6)
    streamValue3.items = values3


    streamValues = list()
    streamValues.append(streamValue1)
    streamValues.append(streamValue2)
    streamValues.append(streamValue3)
    response = client.streamSet.update_values_ad_hoc_with_http_info(streamValues, None, None)

 

 

Get an element and an attribute by path

 

    element = client.element.get_by_path("\\\\JUPITER001\\Universities\\UC Davis", None)
    attribute = client.attribute.get_by_path("\\\\JUPITER001\\Universities\\UC Davis\\Buildings|Campus Average EUI", "Name")

 

Final Remarks

 

It has never been easier to integrate the PI System with Python. By writing just some lines of code, it is very easy to retrieve PI data into Python through PI Web API.

 

Please share your comments and suggestions below!

Hello PI Geeks!

 

We are planning our next Hackathon at PI World 2018 where we expect tens of esteemed PI professionals, industry experts, and data scientists to compete. You can have your business challenge be the topic of the event which means there will be a whole group of engineers who will compete to add value to your business by solving one of your challenges.

 

We have been hosting several successful hackathons over the past few years (2017 SF, 2017 London, 2016 SF, 2016 Berlin, 2015 SF). In 2016, for example, the topic of the Programming Hackathon was Innovation Around Smart Cities. Data was sponsored by the San Diego International Airport and made available to our hackers. The executives from the airport were really happy with the final results of the hackathon mainly because:

 

  • They were inspired by the new creative apps and business models developed by our hackers, which could add a lot of value to their business.
  • They learned new ways to gain insight into the data they already had in their PI System.
  • They were able to detect where they could be more efficient in their industrial processes.

 

While starting to organize the PI World SF Hackathon 2018 we are looking to find our data sponsor. This is where you come in! We are seeking for a  customer who may be willing to share their data with us for the event. A good data sponsor typically has the following qualifications:

 

  • Owns a PI System with AF already in place
  • Has a few data-oriented high level business challenges or aspirations
  • Has at least tens of assets and many hundreds of data streams in place
  • Has at least 1 year of historical data
  • Has sampling rate of at least several samples a minute on the majority of the tags
  • Is willing to share their data with us – We are willing to consider an anonymized/obfuscated version of the dataset as well

 

In case you are interested becoming the new data sponsor for the Programming Hackathon, please don’t hesitate to contact me by e-mail (mloeff@osisoft.com).

Overview

The ability to subscribe to PI point updates through data pipes is a convenient feature which helps in both understanding and troubleshooting data flow. PIEventsNovo is a console application that can be used to sign up for data pipe (snapshot/archive/timeseries) events and additionally provides useful data access features.

 

Scenarios where this tool might be useful

-     Set up data pipe subscription for pi events (including timeseries and future data)

-     Fetching current (end-of-stream) values

-     Fetching archive values over a particular time range

-     Generating interpolated and plot values based on sample duration and pixels in trend

-     Summary calculations (Event and Time weighted) over a time range

-     Update/Annotate pi events specifying write mode (replace,insert, no compression etc) and buffer option

-     Upload values to a tag from a csv file

-     Delete recorded values over a time range

 

Note: most output formats are comma separated making it convenient to redirect the console output to csv/txt files for further investigation.

 

 

Sample outputs

 

Sign up for snapshot and archive events

 

TimeSeries data

 

Current Values

 

Archive Values

 

Summary (Event Weighted)

 

Update (with no compression and buffer event)

 

Upload data to a pi point from csv file (with mode and buffer options)

 

Source Code and Technical Documentation

GitHub - ThyagOSI/pieventsnovo: Application to mimic the some of the functionalities of pievents.exe. Uses AF SDK to han…

 

Minimum Requirements

.NET Framework 4.5.2

OSIsoft.AFSDK 4.0.0.0 Version 2.8.5.7759

 

Trivia

During your interactions with our technical support team you might have come across a certain 'pievents' application (inspiration for the current name and functionalities) which performs snapshot and archive data pipe subscription. However, this is not distributed or available for download and it lacks support for relatively modern features like TimeSeries and Future Data.

 

Feedback

If you find issues, or would incorporate a new feature in this utility, please feel free to post your comments.

I am pleased and excited to let you know that we will soon roll out two significant enhancements and a series of minor improvements to PI Developers Club:

  • If you are not a member yet but are interested in trying out PI DevClub member features you will be able to start a trial subscription right form the website. The goal is to let any interested person a chance to try and see how much value PI DevClub membership offers without having to pay upfront. The trial period is designed to last 45 days; at that point the subscriber will have the choice to renew and become a regular member. To be eligible two conditions need to be met: i) the individual cannot have been a member for the past two years; ii) the individual cannot have regular vouchers available to her/him to use and become a regular subscriber.
  • If you are a member already you will be able to unconsume (release) your voucher as a self-service feature; today you need to email us to do so. We believe this move gives more control to our subscribers on how to use their subscriptions.
  • Across the board we will be improving the user experience when it comes to purchase, renewal, and managing subscriptions.

 

We are planning to roll out these features over the coming weeks. Stay tuned!

Filter Blog

By date: By tag: