Tip:
Highlight text to annotate it
X
Section 4.2. Digital
State Sets. Now,
when you are working with Digital Tags, you are working with a
tag that's, in fact, stored as an integer, but
we display the data as text.
Any guesses as to why we do this?
Well, it is, it's really simple. It's a lot cheaper, in terms of resources,
to store things as integers than to store them as, as strings
of text. So, if you can build yourself a little
lookup table to point yourself to the text
and then store this as, as a,
an integer, it just, just takes a lot less space. It's a lot faster for
retrieval, etc. The PointType here is going to be
a Digital. Here's an example of a Digital
Tag. If we take a look at the Tag
CDM158, here are the different values. Now,
in fact, these are a finite set of values, and there's
only five in this case. And, and,
in point of fact, we are not storing these as these words here. We are
storing this as a number, 0 through 4.
So, that's what a Digital is, and it's not just
on-off, open-close. It can be any number of
Digital States and those Digital State Sets.
So, these Digital Tags -- they do have an associated Digital Set.
We use the attribute called
DigitalSet to associate a tag with a Digital
Set Name. And that Digital Set
obviously has to exist prior to the creation of the Digital
Tag that uses that Set. So here's some
examples of some Digital State Sets. Here's a
MySet which has five states.
And, and these five states are Manual through Failed.
So, in fact, if we were to look at this internally,
this would be represented in the Archive as zero, one,
two, three, four -- like that. Now, here's a real
straightforward one: MySet2. Zero for On,
one for Off. Actually, it's more typically the other way around --
zero for Off, one for On. But as you can
see, if you need that, you can create another set that would define
it that way. Here's a third set: MySet3.
This would be zero, one, and two.
Now, you may notice
that sometimes -- let me go back here --
sometimes Digital Tags are going to have
a, a ki... -- or require, I should
say, a kind of a, a dummy
Digital State at the beginning, because sometimes we are not getting zero,
one, two, three, four. We are actually getting one, two, three, four, five
from the data source.
So, in that case, what you end up having to create --
let me go back here again -- you end up having to create a Digital
State Set with a kind of a dummy in the first, in the first
instance. So this might be, be just a, a
dash and then we start Manual, Auto, Cascade, etc.,
like that. Also,
you should know that Digital State Sets -- they are
case insensitive, but they are case preserving.
So, whatever case you enter when you
first create that, that Digital State,
that's the case that you are going to be stuck with for quite a while, so...
Now, there are some ways to fix that through piconfig, but,
... it's a kind of an odd combination. It's case preserving but
case insensitive. So, for example, if you
look at a Digital State
such as Program,
if we had first done that as a lowercase p
then -- actually, we are going to preserve that and
we would have to go in and use piconfig
with some some special
scripts that we have documented elsewhere, to
change the case of that if we want to later on. So, it's a very
minor point, but it's something to keep in mind.
Now, I am going to take a look at the Digital State
Database from within the PI
System Management Tools. So, if you go with -- in Points,
and Digital States, this is where you will see the different States that we ship with the
system. For example, the one we were just looking at, Modes --
you know, here are those States, zero through
four.
Now, there's a very interesting Digital State Set
called System. And, System is
where we keep all those things that are -- well,
that are used by the System. So, for example, a
little earlier today, we saw something called Point
Created. It was a Digital State called Point Created.
And, if I can remember correctly, that is somewhere down here.
Yeah, Point Created is just
a Digital State in the, the Sample
Digital State Set -- or excuse me, in the System Digital State
Set. Yeah, there it is, right there.
I am sorry. I clicked on that and it went back to the
beginning here. Let me find that again. Yeah, here it is, right here,
this Point Created. So, Point Created is simply an
item within that Digital State Set called
System. Now that's something, obviously, we suggest that you do not
edit. That's the System Digital State Set.