YetAnotherForum
Welcome Guest Search | Active Topics | Log In | Register

Accessing calculation tag names Options · View
Lopton
#1 Posted : Tuesday, February 15, 2011 1:39:38 AM
Rank: Newbie
Groups: Member

Joined: 2/15/2011
Posts: 4
Location: Los Angeles, CA
Hi all,
I am interested in using PI Proccessbook to track for overloading on transformer banks. What I have done is create a PI calculation which retrieves the maximum value from a group of 5 transformers and displays that value. Unfortunately it just displays the value, but I also need to know which transformer is high. Is there any way to get the tag name of the highest value to show up, I have tried everything, including VBA that I can think of?


For Example:
Transformer 1 = 4MW
Transformer 2 = 2MW
Transformer 3 = 3MW
Transformer 4 = 5MW
Transformer 5 = 9MW

PI Calc = MAX ( Transformer 1, Transforme 2, Transforme 3, Transforme 4, Transforme 5)


PI Calc = 9MW <--- which is great, but I would like to know which transformer is highest

-Matt

Sponsor  
 

OSIsoft vCampus is a subscription-based, online offering that consists of providing everything people need to develop applications on the PI System.
We invite you to take a "tour" of the OSIsoft Virtual Campus - also feel free to consult the FAQ  or contact OSIsoft vCampus for more details.
milesUK
#2 Posted : Tuesday, February 15, 2011 12:35:44 PM
Rank: Advanced Member
Groups: Member

Joined: 5/28/2009
Posts: 75
Location: Cheshire, UK
Hi Matt,

Are you limited to ProcessBook? I would tackle such calculations within Excel using the formula =PICurrVal(tag, 1,"pi server") which will return the latest value in PI and the time it occurred.

You could then determine the MAX and lookup the time it occurred using INDEX() & MATCH() for example.

regards,

Miles



MilesUK
ProcessBook v3.0.15.3
RJK Solutions
#3 Posted : Thursday, February 17, 2011 10:57:36 AM
Rank: Administration

Groups: Administration

Joined: 6/20/2008
Posts: 617
Location: Cheshire, United Kingdom.
As Miles indicated, there is no direct way of doing this via performance equations.
In ProcessBook you could add a few extra datasets to indicate which is the maximum and then use some VBA to get the name, for example...

Dataset: MAX_TRANSFORMER
MAX ('Transformer 1', 'Transformer 2', 'Transformer 3', 'Transformer 4', 'Transformer 5')

What you could then do is have 5 datasets that equal 1 if the value matches the max() value, then you can multistate the text on your ProcessBook display.

Dataset: TRANSFORMER1_ISMAX
if 'Transformer 1' = MAX ('Transformer 1', 'Transformer 2', 'Transformer 3', 'Transformer 4', 'Transformer 5') then 1 else 0

...

Dataset: TRANSFORMER5_ISMAX
if 'Transformer 5' = MAX ('Transformer 1', 'Transformer 2', 'Transformer 3', 'Transformer 4', 'Transformer 5') then 1 else 0

Then say you have 5 value symbols on your display showing Transformer 1 to 5, multistate each in turn so that if it is 1 then colour is Red and all other states are black. Assign 3 states, 0->0.9999 Black, 0.9999->1 Red, >1 Black.

Finally, if the visual aid from the multistates wasn't enough you could run some VBA:
Code:

Dim sMaximum As String: sMaximum = ""

Dim MState As MultiState
Set MState = Transformer1.GetMultiState()
If MState.CurrentState = 1 Then
    ' Maximum
    sMaximum = sMaximum & Transformer1.GetTagName(1) & ","
End If

'...

Set MState = Transformer5.GetMultiState()
If MState.CurrentState = 1 Then
    ' Maximum
    sMaximum = sMaximum & Transformer5.GetTagName(1) & ","
End If

Debug.Print sMaximum


As you can see, some effort for something so simple. If might be an idea to have such datasets as performance equation tags running on the PI server, especially if you are going to be doing this for batches of transformers then processbook is just visualising, and not calculating.

Hope this helps...
Principal Consultant
Real-Time Data Management @ Wipro Technologies
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.