There are a lot of uses for PI
Performance Equations, but one of the truly nice uses is
the ability to build Active Points or Trigger Tags.
I am going to go into my SMT, System Management Tools,
and click on Performance Equations.
And I want to show you a couple different examples of Triggers.
The first example is going to simply be
where a Tag Level or a Tag Value
goes over a, a certain set
value. In this case, I am going to use a Temperature
Tag and th...I want to, I want to define my, my Batch Start
when the Temperature goes over an
ambient temperature. Let's say the ambient temperature is 80 degrees.
So, I am going to just call this
Trigger1. And the --
it's actually going to be an integer is the result of the,
of the equation, so, I will call this an
Int16. And, the Point Source is
already filled out. My Point Source is already pointing to my Performance
Equation Engine, so that's all set. I
can click on the Equation Tag here, and my equation
is simply going to be: CDT158
is greater than 80.
That's a Temperature Tag. Now, if I hit the Evaluate
Button here, I am going to get an error because I
need to pay attention to the, to the
specific Performance Equation
Syntaxes, and the Syntaxes,
if you need a really quick rule to remember, is
Tag Name and Timestamp in single quotes,
Strings in double quotes. And you can see here that I clearly have
a Tag Name, so I can put single quotes around it,
click Evaluate, and you can see that
this does Evaluate to True. This, this Expression
is True. If it were currently False,
let's say over 800, then it would Evaluate
to zero. So, I have an Expression
that I have created to
validate to, to tell me
whether this tag is over a certain level. Now, the
only other thing we need to really pay attention to here
is the Scheduling. Do I want a Schedule based on a clock?
And this would be the Scan Classes that are
part of the, part of the Performance Equation Interface.
Or, do I want to do Event-based Scheduling?
And what I think I will do is I will base the Event
on that tag itself: so,
CDT158. I could have typed it in but I am just
showing you that you can do a Tag Search here. And, then I
can choose to either -- when the time when the avail...
Expression is evaluated or the timestamp of the triggering
Event. So, I want to timestamp my Performance
Equation when I Evaluate the Expression.
And you will notice that if you use Event-based Scheduling,
it does put that in the Event Tag field
in your Equation Tab. So, I have got the scheduling
I wanted to use. Every time CDT158 gets a
value, I am going to Evaluate this Expression.
And, if it's greater than 80, then I want my Batch
to start. And, and it works out very well that
it's going to report a zero or a one, True or False.
Remember, we talked earlier about the
Compression and Exception. In this case,
I do not want, I do not want
to miss any of my, any of my
threshold events, so I am going to set my
Deviation to zero for Exception
and Compression because I want to make sure I
keep all of the results from my Ex, Ex,
Expression and Equation Tag. So I will save this,
and now this tag can be used
to generate certain values,
generate certain values for my triggers.
I would like to look at the previous example
that we used, but throw a little bit more complexity
into it 'cause I think that'll reflect more
real-life situations. Let's say I want to
compare my CDT158 Tag to my
ambient temperature of 80 degrees, but I want to make
sure that that temperature's been exceeded for
more than two minutes, because
I do not want little spikes in the ambient temperature
to start a new Batch. So, I am
going to make sure that that value is greater
than that for more than two minutes before
I start my Batch. So, I am going to go in
and create a Performance Equation Tag. I am going to call this
Trigger2. Oops.
And, what I need to --
it's going to be an integer again -- and what
I need to do is create an Equation using my Performance
Equation Engine, and if I
look in the
Program Files, PIPC,
and Help Folder, what I will find is a folder
called PEReference, PEReference.chm.
That's the Help File to the Performance Equation
Syntax. And, if I open that up,
what I will find is a complete reference
to all the Performance Equation Functions and their
Syntaxes and Operators, all described here in detail.
I want to use the Time Greater Than
Function, and I want to see,
or detect, when that Tag is Greater Than that certain value.
So, I am going to, I am going to do a little copying here. I am
going to copy the format of the Syntax out of the Performance
Equation Manual, and I am going to paste it
into the Equation Field. Now I have gotta do some
alterations here. I have to change the Tag Name to
'CDT185.' Keep --
pay close attention that I did use single quotes.
Remember, it's single quotes for Tag Names and
Timestamps. So, my Start Time
is going to be
'*-2m.' That's going to go back two
minutes every time I do the calculation.
And my End Time is going to be a,
a Now symbol, an *, and the
Value is going to be 80. So, I am
comparing the Tag Name over the last two
minutes -- whenever I evaluate this, I am going back two minutes.
I am comparing it and finding out how many seconds
the Value was over 80. And if I
Evaluate it, you will see that it returns a number of seconds. So,
I need to further adjust
this Equation to make my Result
either a zero or one, 'cause I want this to be a Trigger. I
do not want to have to have something else Evaluate whether,
you know, 120 is a good number, or whether 92 is a good number.
So, I am going to change my Expression. I am going to add a little
bit to it, and I am going to say, If
this Expression -- and I will but parentheses around the whole
Expression -- if that Expression is
Greater Than 120,
Then we have a value of one,
Else we have a value of zero.
I could have also used, Else no output. But,
I am going to use Else zero. I am going to Evaluate that, and I can see
that I do have a zero here. So,
the Expression --
it's, it's not greater than 120.
It's -- well, there's a little bit of a, a -- there's a little
bit of a problem there because it will never be greater than 120,
'cause I am going back 120 seconds and it's reporting the value in
seconds. So, why do not we say -- if I want to do
this, this correctly -- why do not we say 119?
And that will Evaluate properly. That, that way, when
we exceed 119 seconds,
we will report a value of one, Else zero.
And, of course, we have the same scheduling
aspects that we want. We can either do it based on Clock
or Event, and we want to make sure that we adjust
our Exception and Compression statistics
to be appropriate for our Trigger Tag. So, there's
an example of something a little bit more complex.
Also notice that when I,
when I review this tag, it's -- puts the Equation in the
Extended Descriptor Field. You can build these
tags, you can build these tags with PointBuilder.
You just have remember that, instead
of having the Equation Tab, what you get
is you get the Extended Descriptor Field,
and you have to put the Expression in the Descrep...Extended Descriptor Field
instead of using the Equation Tab. It's nice to
use the Performance Equation Builder because you get the
Equation Tab with the Evaluate Button, and you can
see if you have made any sort of mistake or not.