Skip navigation
All Places > All Things PI - Ask, Discuss, Connect > Blog > 2015 > April
2015

I’ve seen a lots of questions regarding URL from notifications to Coresight and decided to write a blog post regarding the topic.

During my test’s I found two main ways of doing this, but I have to say I prefer the built-in “Web Link” feature in notifications.

The second option is to specify the URL in an attribute and add the attribute value to the notification message. This works if you don’t have any spaces in your server or database name but that wasn’t the case in my environment so this is how it turned out:

How it’s done

First of all, I’ve created a ProcessBook ERD display, as you may be familiar with there is possibilities to manipulate the element of interest in Coresight by specifying it in the URL by “?CurrentElement=\\SERVER\DATABASE\PathToElement\”. (If you don’t want to use a ProcessBook ERD display, just use “?Asset=\\SERVER\DATABASE\PathToElement\”)

 

First, publish your ProcessBook display to Coresight.

Then you’ll need to navigate to that display in order to get the correct url.

Copy the URL and start configuring the notification.

On your right hand side click “Add->Web Link->Other”

Display name: Open in Coresight

Link address: http://complete/url/to/coresight/display example “https://democor/coresight/#/PBDisplays/55/”

 

Then add a parameter.
For ProcessBook display the parameter name is “CurrentElement”
For Coresight display the parameter name is “asset”
The value is simply the Target (path)

Just click OK and drag the link into the notification message

 

Verification


 

 

Using these kinds of URL parameters in notifications could also open up possibilities to specify the start and end time for Coresight (parameters: StartTime=*-1h&EndTime=*). You could for example use start time of the notification or create an analysis that writes a start-end time to an attribute before sending the e-mail.

A customer stopped by the PI ProcessBook pod on Wednesday asking how to grab just the M/DD part of a timestamp from a Value symbol with VBA. Here's a quick example when you have a value symbol on your display called Value1.

 

Sub Test()

 

Debug.Print showMonthAndDayOnly(Value1)

 

End Sub

 

'takes a value symbol and returns M/DD string for the timestamp

Function showMonthAndDayOnly(valueSymbol As Value) As String

 

Dim vValue As Variant

Dim vTime As Variant

Dim vStatus As Variant

 

vValue = valueSymbol.GetValue(vTime, vStatus)

 

Dim sDate As String

Dim i As Integer

 

'finds location of 2nd "/" in the timestamp's date

i = InStr(1, vTime, "/")

i = InStr(i + 1, vTime, "/")

 

showMonthAndDayOnly = Mid(vTime, 1, i - 1)

 

End Function

We have made our PI Developer Technologies more easily available. Anyone with an account on the Tech Support website or PI Square is now able to download the PI AF SDK, PI Web API, the PI OPC DA and HDA Servers, and all products in the PI SQL Framework (PI OLEDB Provider, PI OLEDB Enterprise, PI JDBC Driver and PI ODBC Driver). We are doing this to make it easier for you to build applications that leverage PI System data. See this blog post for details.

Filter Blog

By date: By tag: