In this video,
I'm going to show you how to connect to an OPC
server and browse for data using the PI OPC Client Tool. So right now we are at the point
where we have installed the PI Interface for OPC DA,
but we haven't configured any instance of the interface yet.
And before we configure anything, we want to make sure that our PI
Interface is going to be able to connect to the OPC server and
access data on the OPC server. We also want to make sure that
that data is currently good. And finally, we
might want to choose which data we are going to be collecting using the PI
Interface. So we can do all of this using the PI
OPC Client Tool which is a tool that is installed when you install
the PI Interface for OPC DA. So let me
start up that application.
One thing to note here is if your OPC
Server is installed on a different computer,
you are going to need to run the PI OPC Client Tool,
using an account that has the proper DCOM permissions to access that OPC server.
As a general rule, you always want to
start the PI OPC Client Tool, using the account
that is eventually going to be used to run the PI
Interface for OPC DA's service.
So let me show you how to do that. First, let's bring up the start
menu and search for the PI OPC
Client Tool. So here instead of clicking on it, we are going to
right click on it. And then depending
on your local policies, you might have the
option run as different user. This is what you are going to want to
select. However, it's possible that this hasn't been
enabled, so what you can do is first
pin the application to the task bar. So I'm going
to show you the second way.
Once it is pinned to the task bar, what you
can do is hold down the shift key and then
right click on the application. And then you'll
have the option, run as different
user.
So my account is a
local account,
and once I put in the password, the application
starts up under that account.
So the PI OPC Client Tool is actually fairly
similar to the PI Interface for OPC DA, in a
sense that it's also an OPC client. So its
primary function is to connect to an OPC Server and access data on
it. But the difference is it comes with this
graphical user interface. Meaning that the user can
actually browse the OPC Server and see the
data updating in real-time. So this is not only useful when you are
first configuring the PI Interface, it's actually fairly
useful if you ever need to troubleshoot it. Let's say your
PI Interface for OPC DA has stopped collecting
data. You can use the PI OPC Client Tool to make sure that there is
nothing wrong with your OPC server.
Alright, so the first thing we are going to want to do is
connect to the node that is hosted our OPC Server. And as
you can see here on the top left corner, the
default node that we are going to connect to is the
localhost. So if your OPC Server is not
local, you are going to need to change this. So you can do
this by clicking on the elipses up
here. That's going to allow you to browse your network
for the OPC Server node.
If you know the IP address or the hostname of your node,
you can actually type it into this field here.
Since my OPC Server is local, I'm going to leave this as
default. Next, I'm going to click on
the connect to node button which is here.
This is going to populate
the OPC Server's field which is located here.
So this lists all the OPC
Servers that the PI OPC Client was able to find on
the node. Next, I can choose
which OPC Server I want to connect to and press on
the connect to OPC Server button.
This is going to populate the
server status field which is located down here. So this basically
confirms that we were able to successfully
able to connect to our OPC Server. You can also see
the server current state which is running.
This is what you want to see if your OPC Server is
healthy. So it's possible that you weren't able to
connect to your OPC Server. This could mean a couple of
things. It can mean the OPC Server is not
running or is not available on the network. And it
can also mean that the OPC Server is
running, but you just don't have access to it using the
PI OPC Client Tool.
OK, so we have connected to our
OPC Server, next we are going to want to browse for data.
So before we do that, we have to create a
group. So you might be asking, what is a
group? It's sort of something that exists
with the OPC DA standard. It's essentially
how OPC clients organize the data
that they are asking or requesting from the OPC Server.
So on the PI system,
we organize data by tags. For OPC DA,
these are organized by items. And again, an OPC client
needs to organize these items
under groups. So to create our group, we are going to have to
press on the add a group button which is up here.
And so this brings up the add group
dialogue, and we see that we have a lot of options. But since we are
primarily using the PI OPC Client Tool
to validate the data on the OPC Server, these don't really
matter too much for us. So I'm going to hit create.
Next, we are going to
want to add items to our group. So we are going
to do that using the browse OPC
Server button which is located here.
And this is going to open up the add item dialogue.
So we see our OPC Server listed, but we don't
see any items yet. And the reason for this is that
we need to browse the OPC Server
using the browse options that are up
here.
So typically OPC Servers organize
their items under a hierarchy. And so the
easiest way to list that hierarchy is to simply
press the list button which is located here.
This is going to load
the entire hierarchy under the OPC
Server. And it's going to allow you to drill down the
hierarchy and when you select a branch in the hierarchy, you are
going to be able to see all the items under that branch
listed on the right over here.
So it's possible that your OPC
Server actually has a very large hierarchy.
So listing your hierarchy this way would take a pretty long
time. So I'm going to show you another way you could do
this. But first, I'm going to clear the
hierarchy using the clear button located
here.
So let's say you have a really big hierarchy
and you don't want to list the entire thing at once. You
can actually select the manual option which is located here.
This is going to allow you to
simply load the very first level of the
hierarchy. So as you can see, we only
have the very first level. If I want to drill
down, I'm going to have to select my branch and hit
the list button again.
So again, this is helpful if your OPC
Server has a very large hierarchy and you don't want to
load the entire thing at once.
OK, so now I'm going to show you a 3rd option.
Sometimes OPC Servers don't have
their items listed under a hierarchy at all.
In that case, you need to use the flat option which is here.
This is basically going to list all of
the items for an OPC
Server on the right without having them organized at all.
So I'm going to clear this
again and list my hierarchy how I did with the first
method. Now I want to add items.
What I need to do is
select an item and this is going to populate
the item's properties
window which is down here.
And the most important property is the
item ID. This is the unique identifier
of the item on the OPC Server. And this is
what the OPC client needs in order to
request the correct data from the OPC
Server. So I'm going to want to hit the add button to
add this item to my group.
Obviously this would take pretty long
if you wanted to add several items. So you can
add items in bulk using these buttons. Select
all and add selected.
So I'm just going to select a couple of other items,
and hit add selected.
Alright, so
one last thing. It's possible that your
OPC Server doesn't support browsing it all, which means
when you try to find your items, you aren't going to be able to find anything.
So it's still possible to use the
OPC Client Tool to confirm that your data is
valid even if you aren't able to browse. So I'm going to show you
how to do that. First I'm going to clear
everything that's in this dialogue. So all you
need to know in order to add an
item to a group is the item ID.
So as long as you know
that, you can type it in.
And then you
can add any tag name that you want, it doesn't really
matter. And then again, you hit the
add button. So as you can see, I
was able to add this item without being able to
browse the OPC Server.
Alright, so if you are satisfied with
your items in your group,
all you have to do is hit OK at the bottom.
So now we have
connected to our OPC Server, we have created our group
and we've added items to our group. But we still aren't
getting any data. And that's because we haven't told
the OPC client how to ask for data
from the OPC Server. So there are a couple of different
ways that we can request the data. For simplicity
sake, we are simply going to use the poll
method which is using this button
up here. This is going to request the
data from the OPC Server every
second. So this brings up the polling
group dialogue and we can now see that we have
values, quality and time-stamps
for all of our items. So what
are we making sure of? Well we want to make sure
that the value is good and makes sense for the
data that we are requesting, that the
time-stamp is current. But there is also this 3rd
column here, quality.
This is again a property that comes with the
OPC DA standard. It's essentially how the OPC
Server tells the OPC client if the
data that it's sending is any good. So we want to make sure that the
quality of our data is good.
So that's basically it. We've
confirmed that we have good quality data using our
PI OPC Client Tool. There is just one last thing
I'd like to show you and that's the fact that you don't
actually need the PI OPC Client Tool to do this. You can
actually use any OPC client to confirm that your
data is good. So oftentimes, when vendors
sell OPC Servers, it will come with an
OPC client that you can use.
I'm going to show you a different client that comes with the PI
Interface for OPC DA.
And that's the PI OPC tool.
This is actually the predecessor
of the PI OPC Client Tool. So as you can see, it
doesn't have as nice of a graphical user interface, but it
essentially does the same thing. So I'm quickly going to go over the same
steps that I did with the PI OPC Client Tool in
the PI OPC tool.
So as you'll remember, our first step is to
connect to our node.
Once again, the default node is the localhost.
So if I simply go to the drop down menu for the server name, I'm going to
see the servers that are installed locally.
Alright, the next step as you'll remember is
to add a group. So I simply need
to create
group name and hit create.
Next I'm going to want to browse the OPC
Server. So if I hit list
server tags, I will get the hierarchy. And then
I can drill down the hierarchy and
find the item that I want to
look at. If I double click on the item, I will get the tag
properties.
Once again, we have the item ID here.
So I simply need to press add to group.
And I now have that
item in my group. Finally, I
need to tell the OPC client how to access
data from the OPC Server.
So I'm just going to hit refresh, and
now I see that I have a good
value, good time-stamp and good quality.
Alright, so now we have confirmed
using two OPC clients that we have
good data on our OPC Server.
So our next step is now going to be to configure an
instance of the PI Interface for OPC DA. And
that's what we are going to do in the next video.