In this video, I'm going to
show you how to configure a new instance of the
PI Interface for OPC DA. So we are back
on our PI Interface node and currently we are at the point
where we have installed the PI Interface Configuration Utility and the PI
Interface for OPC DA. We've also
verified the data on the OPC server using the OPC
Client Tool. So before we create our new
instance, we are going to want to make sure that security has been
properly configured on the PI Data Archive. So
we need to make sure an identity has been created for PI Interfaces
connecting to the PI Data Archive,
and that this identity has read access to the PIPOINT
table. We also need to make sure that
trusts have been created for our specific instance of the
PI Interface for OPC DA. Finally, we need to make sure
that the user running the PI ICU has administrator
privileges on the PI Data Archive and should
have read write access to the PI module
databases for %OSI and interface's module.
To see a full list of permissions
required by the user running the PI ICU,
go see the PI Data Archive Security Configuration
Guide. So if you are missing any of these
steps and you need some help, you can check out our
configure PI Data Archive Security playlist on our
learning channel.
So now we are going to start
by running the PI Interface Configuration Utility or PI
ICU.
So first let's make sure that we
are connecting to the PI Data Archive using the proper
credentials. So let's go to interface and SDK
connections. And here I can see that I'm
connecting to my PI Data Archive. And I
can see that I'm connecting using
my domain account and I'm connecting
as piadmins. So we
are good to go. So finally, we can
create a new instance of the PI Interface for
OPC DA. We can use two buttons to do that, the first
is create a new interface instance from .exe
which is this button here. Or we can use
the create a new instance from .bat
file which is this button here. So both
options are valid, the second option is
going to allow you to select an existing .bat file and
you can just duplicate it into a new .bat file. And
even if you haven't created an instance yet, you can actually use the
template which is the OPCInt.bat_new
file which comes with the installation of the PI Interface
for PI OPC DA. This is actually going to fill in some of
the parameters instead of just leaving them blank.
But I don't want to do that, I want to pick all of my parameters myself.
So I'm going to use the first option.
So the first thing to do is
browse to the interface executable.
You should already get to the proper
location but if you didn't, please go under
PIPC, Interfaces and OPCInt.
And then I'm going to check the PI Data Archive that
I'm going to be sending data
to. OK, so next I need to select my point
source and interface ID. And the combination of these
two parameters is going to by my unique identifier
on the PI Data Archive. So you want this combination to be
unique for this interface. So if I had selected
the create a new interface instance
from batch file and selected the .bat_
new file, I actually would've gotten a point source of
OPC and an interface ID of 1
selected automatically. Now an important point to keep in
mind is that when your PI
Interface starts up, it's going to load all the points
with the point source that matches its own. So
let's say you configure a ton of interfaces with the same
point source. Every time you start up one of those interfaces,
it's going to load all of those points. And this might significantly
slow it down when it's trying to start. So it's actually
recommended to select a unique point source for
every interface that you are creating. So I'm going to
select the point source GBX
since my OPC server is a grey box
simulator. And I'm going to select an interface ID of
1. You can also select here an interface
name to display in the ICU, but I'm just doing to leave this as
default. So now you have to hit the add
button.
So this is going to create a new
PI Interface batch file and it's going to allow me to continue
configuring the PI Interface.
So the first thing that we are going to want to
do is create a scan class.
So in the last video, we talked about the
fact that when OPC clients get data from
OPC servers, they request data in groups. So
these scan classes are essentially those
groups. So you need to press on this button
to create a new
scan class.
And the first thing to select is a scan
frequency. This is going to be the rate and which
the data is requested. So here I
can select any scan frequency
I want. We don't really have any
specific recommendations for scan
frequencies, it all depends on which OPC server you are using, what your network
bandwidth is, how many
points per scan class you are going to have. But essentially
you want to make sure that you are not requesting too much
data at too high of a frequency. So right now I'm just going to
select a scan frequency of 10 seconds.
So the format here is going to be
hour hour, colon, minute, minute, colon, colon,
second, second. So this is how you would write
10 seconds. So now I'm going to go
to my OPCInt tab which is
here.
It's going to ask me if I want to
save, but since I don't have an OPC server selected yet, I'm going to hit
no. OK, so here is
where I select my OPC server.
And right now the OPC server name is
localhost. So that means it's going to look for OPC
servers that are installed locally. So if your OPC
server is not local, you are going to want to replace this with the
IP address or hostname where your OPC server is
located. And I want to make an important point
here, and that is if your OPC server is not
local, you will have to configure DCOM security before
your PI Interface for OPC DA can get data from the OPC
server. OPC clients and OPC
servers use Microsoft's COM and
DCOM communication models to communicate. COM
specifies how applications on the same computer communicate,
whereas DCOM specifies how applications on different computers
communicate. And obviously this has pretty
severe security implications. So by default,
two applications can't communicate using
DCOM. And specific permissions need to be given to the
accounts that are going to be running the OPC
server and OPC client. So if you haven't
configured DCOM and your OPC is not local,
you will have to do that first before configuring your
PI Interface for OPC DA. So my OPC
server is local, so I can continue.
So now I'm going to want to hit list available
servers.
And now I can go to the
drop down menu and I can select my
OPC server. Now if your OPC server
didn't show up and it is installed locally, what you want to do
is just write out the name of your OPC server in this
field and it should still work.
And we've essentially configured everything that a
PI Interface for OPC DA needs in order to work
properly. But I'm going to give you a few extra
parameters that are a good idea to set just as
best practice. So the first one is going
to be located under data
handling.
So here you are going to want
to check the write status to tags on
shut down.
This is going to make sure that interface shut down is written to your
tags whenever the PI Interface for OPC DA is shut down.
Next, you are going to want to
go to the UniInt tab.
And you are going to want to select the API
connection name.
And here you want to put a
name, OPCI. So if you remember, for our
trusts, they were restricted with the application
name OPCIE. So that's an API
connection name that's truncated with an E at the end, with just
four letters. So to make sure that our PI Interface for
OPC DA should always be able to use these trusts,
we want to specify this API connection name.
Finally, we are going to want to go to
disconnected start-up.
And here we want to check
enable disconnected start-up.
So normally when a PI Interface starts, it
needs to connect to the PI Data Archive before loading the points
and starting to collect data for those points. So checking
this is going to make sure that our PI Interface is going to be able
to start-up and start collecting data,
even if it doesn't have a connection to our PI Data
Archive. So that's pretty much everything
and we just need to hit apply.
So now we have configured
everything that we need for the PI Interface for OPC
DA, including our best practices. Now what we are going to want to
do is configure the Windows service that's
going to be running our PI Interface for
OPC DA. So we want to go to the Service
tab.
So these are all the
parameters of our Windows service. And we are going to want to leave
most of these as default. But one thing
that we could and probably should change is the account that is going to
be running our servers. And that is located
here.
So by default, the selection is
local system. And this account should have all of the proper
permissions to reach our OPC server if
it's local and also access the system files that it needs. But it also
gives the PI Interface for PI OPC DA
many more permissions that it doesn't actually need. And this
isn't a very secure configuration. So it's actually recommended
to change this to a custom account. However,
I want to reiterate here that if you are
using a custom account, you will have to configure
DCOM security whether or not this
account is local or if it's a domain account. And
whether or not your OPC server is local or
remote. So if your OPC server is local,
you can choose a local account or a domain
account. Whereas, if your OPC server is not local,
you'll most likely need a domain account.
And DCOM security is not the only permissions that you are going to
need for this account. You also need to give this
account write access on the PIPC
folder and the right to execute
the OPC interface application. So I
actually have a local account that has all of these permissions.
So I'm going to change it here. Again, if you
do not have an account with all these proper permissions, you are
going to need to do that first or use local system.
OK, so my
account is a local account. So I'm going to use
. as my domain. And my account name is
OPCInterface.
So I just need to put in the
password.
And I need to hit
create, to create the
service.
Alright, now we have everything configured and
we are ready to start our PI Interface for
OPC DA. So first what we are going to want to do is
start the message log which is this button
here.
And that's going to make sure that when we start the interface, we see
all of the messages and confirm that our PI Interface for
OPC DA has been properly configured. And then we
can press on the start button.
So there are a few messages that we want to look out
for here. First, we want to make
sure that our interface was able to connect to the PI
Data Archive. So we can see that message here.
Next we want to make sure that it was able to
connect to the OPC server. So that should be
located a little bit lower.
And we can see it here.
If your PI Interface for PI OPC DA wasn't
able to connect, you would see a message like, can't connect to
OPC server. And you might also get a reason, such as
access being denied.
So most likely, that means that DCOM
security hasn't been configured or there is an issue with your OPC
server. Finally, we want to see whether our
PI Interface for OPC DA detected any tags.
So here we see that it's saying that the total number of points
matching the point source is zero.
So that's actually normally because we haven't configured
any PI points on the PI Data Archive
yet. The last thing we can check is
whether our PI Interface is connecting to our
PI Data Archive properly. So for that, we are going to go back
to PI SMT. And we are going to go check
network manager statistics.
So if we go to the bottom, we can actually
see that one of the last connections is from our
OPC interface.
And we can see that
it is connecting using the
trust and it's connecting with the proper
identity.
Alright, so now we have
properly configured our PI Interface for
OPC DA. And in the next video, I'm going to show you how to
create PI points for that PI interface.