Now let's return back to our Mixing
Tank example and this right here. If you recall
I configured this to just demonstrate
the power of this Substitution, and if
there's a Tag Name that has that same Name then --
the same Name as the Element that it's currently
referring to, or the current context is --
then we'll, we'll go ahead and retrieve that PI Tag. But, there's
another Option here and that is to do a Tag Creation
with your New Element, so you can actually
specify that, if there is no Tag
that has that Attribute we will go ahead and -- or has that Name,
we will go ahead and create that. So let me show you
an example of that. For this
let me just show you what happens if we create a brand new
Attribute here, and we'll do this over in the,
in the Storage Tank Template. So in the Storage Tank
Template I'm going to add a brand new Attribute here called Concentration.
So it's called Concentration,
and we'll make this a PI Point Reference.
And look at what happens when you specify
PI Point and you're not going to hard-code this with a
specific Tag Name, which is typically, you
know, you don't normally in a Template want to hard-code anything.
As you can see, it, the Default is to do this Element Attribute.
And, if I couple that with this Tag
Creation, what this means is that this will
actually create those Tags with those Names.
So, the Tag Name will be the Name of the Element,
followed by the Name of the Attribute. So this is going to be a Tag
called, you know, Elements.
Contra...err concentration, because that's the name of my Attribute here.
And, of course, the Name of the Element will be just
wherever I happen to create this, whatever the Element Name is.
Storage Tank 3, for example, is what I'm about to
create. So, we're going to create a Tag, Storage Tank 3.concentration
Okay.
And, this Tag can have as many Attributes
as you need. So, and the Attributes
can be configured the way you need, I should say. So,
I'll go ahead and configure the Attribute to,
I think I'll just generate a random tag here. This should work
on your system just fine. I'll change this to a classic,
Float32, and down with the,
here, in the Point Source, I'm
going to change that to an r.
And in location code 2,
4 and 5 I'm just going to add
3, 1 & 1, just like that. So, I, I,
I know just from experience that's going to generate a Random Tag for me
using our Random Interface.
And so, what we've done now is we've defined,
you know, this is what's going to happen when the Tag Creation takes
place. We will create a Tag that is a classic Point
Class, a float 32 of the Point Type, and then these
specific Attributes.
Okay, let's go ahead and check that in and then
exploit this, see how we can make it work. For this, so
I, I've done this in the Storage Tank Template. I added this New
Attribute called Concentration. I'll go over into my
List of Storage Tanks and let's do this.
Let's create a brand new Production Line
and then I'll add a New Storage Tank under that. So, let's do a New
Child Element. This is simply going to be called
Production Line. I, for the Production Line 3 I don't
want any Template associated with that.
This is just more or less for navigation purposes.
Production Line
3, and
there are no Attributes of that particular Production Line just like there were
no Attributes for these other two. It's more or less a, just a,
a label here. I'll go ahead and check that in. And now,
you know, the, the, the point of creating that
was so that I could create a New Storage
Tank. This is going to be Storage Tank 3. It's going to
be using the Storage Tank Template, the one that I just
edited. So we should see that New Attribute.
, let me go ahead and give it a Name.
Storage Tank 03, or just
3.
And, take a look at this. It is now
specifying that there is a New Attribute
called Concentration, and the Concentration is
going to be making use of this Tag here. Now, you can't
see it because it's kind of got a carriage return in
there, but it's Storage Tank 3. Concentration.
That's the Name of the Tag. Now,
nothing's going to happen at the point. If I were to go out and do a
Tag Search, for example, I will not see
that this Tag -- this Tag does not exist yet.
I just switched over to a different Server here. This is my PI Server.
And, I'll just do a real quick Tag Search.
, if we take a look at that -- what would we call it? It's called
Storage Tank 3.
If I do a Search for it - there is no such thing.
There is no such Tag as Storage Tank 3
Concentration. That's because we haven't
done this last step yet, and this
is a step that you can do at a
High Level or at the actual Attribute itself.
If you do a right mouse-click, there's an Option here called Create or
Update PI Point. It's the equivalent of doing
the, it's a, the Create Config. Method for those of you who
are programmers who might be doing this programatically. See, after
you've configured this, and after you've created the Element,
you still have to instruct AF
to create that PI Point. Again, that's not a
big issue for folks that are, if you're doing this in the thousands,
that's not a big issue
either programatically or using the User Interface, because one of the
things you can do is you can go to the Top of the Hierarchy and
specify to Create or Update the Reference,
and then, everything organized underneath that will be
created or updated. So,
you know, this has not yet been created. When I go here,
or here, either one, I'll do a right
mouse-click, Create or Update Reference.
Okay, and this tells us that it, this tell us it apparently
worked, it just echoes what things were
processed. Let's see if this actually has worked
for us. I'll go ahead and check this back in. , take
a look at my Concentration. Now we actually have a Value
there. That's the effect of the Random Interface.
It's actually running and generating random numbers. And I
can also verify this by going out here and
let's take a look for this very same Search.
Now, the Search is giving me results:
Storage Tank 3. Concentration.
So, we created that Tag. It's current Value is 50.
And that was, that was an example
of using AF to
automatically create it. And, it's automatically creating that
Tag based on the --
what you've done in this definition
here. Again, the definition was Element
Name. Attribute Name. Now, there's one more
way I can make use of this Substitution Syntax,
the percent sign, and that is you can actually
use Substitution within the context of
the Tag Creation, and, and the
Attributes of that Tag. So, for example,
I would like to put in the
Extended Descriptor -- that's right here. I would like
to put in the Extended Descriptor some of the information
from this, the Element that we're currently
creating this in. So, let me
do this. I, I'm, I'm in my Attribute
Template here, my Element Template here, and
I'm going to go ahead and add a Reference to --
let's go with the Element Name, and then we'll also
reference, how about one of the Attributes like the Serial
Number? And, what you'll see is when you,
when it's time to do this, you'll actually see a list
of all of those things that are available to make
reference to. These are all of the Attribute Values.
These are some of the Related Attribute Values. These are
Parent, Child, Sibling, etc. And,
and then the fundamentals: the Element
Name, the Attribute Name, etc. So, I'm going to go with
the, let's go with the Element Name.
I'm going to put in a -- lets, how about a underscore?
And then I'll put the
Attribute that we called Serial Number.
So, that was under Attribute Values.
And, this was called,
here it is, Installation Date Serial Number. This is one
of the, if you remember, this is one of the, the
Attributes that we created earlier on. So,
that now is defined that using the
Substitution, we're going to substitute that as the
Extended Descriptor. One thing to point out is do you notice the
little @ symbol that's being used here. The @ symbol is our
indicator within this Substitution that
what's being, what follows, is an Attribute.
Okay. So, that's actually substituting the
Attributes Value. So, let's go ahead
and acknowledge that. I'll check this
in. And, I'll test this the same way I
tested the other one. Let's go ahead and create a New Production Area.
This is going to be Production Line 4.
No
Templates. Not going to be based on any Template.
[typing]
Okay. And within that I'll create a
New Child Element. That Child Element
is going to be the Storage Tank 4, so we'll base this on the
Storage Tank Template. Actually, let me make sure everything's checked
in before we do this. I'll do
a New, Child Element, Storage
Tank Template. This is the one we're going to use here. This is
going to be called Storage Tank 4, and
if we take a look at this, we should see that the
Tag that we're going to be creating here -- , here's the Tag --
has not yet been created,
but, as you can see over here in the
Configuration here, we are describing --
you see we've already Substituted the, in the
Extended Descriptor, the Name of the Element, Storage Tank
followed by the underscore, followed
by the, that's the Serial Number, so
it's kind of hard to see here with the word-wrap, but that's Storage Tank
4_Serial Number.
If you recall, even if you check this in, this is not going to be created,
this Tag will not be created, until you
do a right click on here and choose that you're
going to Create or Update this PI Point.
There we go.
And, the big finish to this would be, well, this should start soon getting
data, but I can just verify it by going to by PI
Server. Just do a quick Tag Search.
Let's search for all the,
all the -- this was
Storage Tank, I believe.
, there we go. Here's our Storage Tank 3
and 4. Let's see if we have any Values now. This
is still Point Created so we don't have any Values for that yet, but that's just --
it can take up to two minutes for the Interface to get started
on generating Random Data.
And I forgot
to show you the most important thing. When we retrieve
that, take a look at its Attributes. There's Storage
Tank 4, and look at its
Extended Descriptor. Here's our Extended
Descriptor: Storage Tank 4_Serial
Number. And, again,
all of this can be done programatically as well, using
the AFSDK. So, if you're interested in doing a large-
scale project that requires this, that's an option for you.
There we go. Now we're starting to get
Data. Okay, well, that's it. That's about
it for this new feature. Let me wrap up one last thing.
If you recall, when we had this, when I demonstrated
that feature of doing the Substitution
in which the, we were looking at a,
doing a lookup that was making Reference to
the Parent, now we've got an Option
in the Storage Tanks to support a
Production Goal for Production Line
3 and 4. So, just to make this complete,
see, we don't have -- we, we have a Lookup
for 1 and 2. For 3 and 4 we're
not retrieving anything because I have not updated that
Table to reflect what's in Storage -- what the Production
Goals for Storage Tank, or for Production Line 3 and 4 are.
So, maybe this is belaboring the obvious,
but, here's, here's our big finish.
If I go into my Production Goals -- let me go ahead
and add two more Production Lines.
[typing]
I'll go ahead and check this in, and
let's see if we've gotten any results.
, here's my Production Goal
for Production Line 3 and Production
Line 4. So, those Production Goals are now -- the
Lookup is working properly because I've updated that Table.