|
|
Rank: Member Groups: Member
Joined: 4/8/2011 Posts: 16 Location: Denmark
|
Hi All
I have this PI expression in PI-processbook
if 'Tag01' > 0 AND 'Tag02' > 0 then 'Tag03' else 0
1) But I don't want the else 0 - I want to have it get the last value where the expression was fulfilled
Have tried
if 'Tag01' > 0 AND 'Tag02' > 0 then 'Tag03' else ('Tag01' > 0 AND 'Tag02' > 0 then 'Tag03')-1
How do I do that?
2) And furthermore
What of I want it to not show the value at all if the expression is not fulfilled - have tried:
if 'Tag01' > 0 AND 'Tag02' > 0 then 'Tag03' else Nothing
Hope Anyone can help and maybe guide me to a place where PI expressions possibility is written with example - the Processbook guide wasn't to much help :(
|
|
|
|
|
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.
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
use NoOutput() and the end of your expression
if 'Tag01' > 0 AND 'Tag02' > 0 then 'Tag03' else NoOutput()
|
|
|
Rank: Member Groups: Member
Joined: 4/8/2011 Posts: 16 Location: Denmark
|
Thx  Then I only need the code for the last true value 
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
You don't need to get the last value, the only thing NoOuput() does is to NOT send a new value to the snapshot, meaning your last event will still be applicable.
|
|
|
Rank: Member Groups: Member
Joined: 4/8/2011 Posts: 16 Location: Denmark
|
But can it be done? 
|
|
|
Rank: Advanced Member
 Groups: Member
Joined: 4/7/2011 Posts: 137 Location: KZN, South Africa
|
mogwai
Ofcourse it can be done, try the following. Create a new dataset calculation and use the floowing in the expression
If 'sinusoid'>80 then 'sinusoid' else NoOutput()
Change the in calculation interval to 1min, on the same display just add a normal 'sinusoid' value, trend both these values and also look at the "current value", depending on what your sinusoid value is you will notice that the dataset value is "keeping" the last unfiltered value.
|
|
|
Rank: Member Groups: Member
Joined: 4/8/2011 Posts: 16 Location: Denmark
|
Thx  Solved!
|
|
|
Rank: Newbie Groups: Member
Joined: 12/7/2011 Posts: 5
|
hi i dont understand can you explain me more. i need the code for understand thanks
|
|
|
|
Guest
|