Now we've got everything installed in this video we'll configure an interface instance to connect
to the data archive and the OPC server. An interface instance is essentially a service
running under an account of our choosing on a machine for the rest of this course when I say
the interface I mean an interface instance. When configured and started up the interface will make
connections to the data archive and to the OPC server and get data flowin. We'll go into more
detail here a little bit later in the course but for now we're aiming to have a service connecting
to the data archive, what do you think we need to configure before it can connect? A mapping!
So let's talk about that we'll configure our interface to run under PI school slash
svc dash PI int which is another group managed service account that's been created for us.
We need to come over here to the data archive and create our identity. We're calling it svc
dash PI int to match the account name then we need to create the mapping to the account,
after we've done that all there is to do is open the ICU on PIINT01 create our instance and tell it
to connect to our OPC server and our data archive. Then we'll configure it to run under the svc dash
piint account and then we'll run it. Another final step is to enable buffering on the interface.
So this will make the interface resistant to interruptions between it and the data archive
and it'll buffer data during a network outage then when the network comes back
it'll flow right through again. Sounds easy right? Let's do it.
We're on PISRV01 about to create the mapping for the account that will run our interface instance.
So open up smt and navigate to security then identities users and groups the identity that
we created for our analysis service is already here we'll create another one for our interfaces
to use. So click on new mapping and then type in svc dash PI int as the name. So the name doesn't
actually need to match the account name but I like to name these the same as the windows groups or
accounts that they map to just makes it easier in the long run. We'll talk more about strategy
with mappings later in the class when we talk about user access to the system.
Click create on that then go to mappings and trusts. Create a new mapping and type in our
service account name PI school backslash svc PI int with a dollar sign at the end
because it's a group managed service account. Check names and we're good.
Click the ellipsis next to PI identity and find our new identity then click ok and create
this mapping will map to the identity that we created it doesn't have any permission right now
but we are going to give it permission later to access the tags that it needs to access.
Let's switch to PIINT01 and if your ICU isn't already open you can open it through the
start menu. One point here is that unlike system management tools you need to be on the interface
node to run the ICU. So you can connect to data archive from anywhere with system management tools
but to manage an interface you run the ICU on the interface machine itself.
We're creating a new interface instance so click on the interface menu then create a new interface
from bat file. Creating it from a bat file really means great from a template we could configure
one from scratch if we wanted but most of the settings we need are in the default template.
Go to the OPC int underscore read only folder and you'll find the OPC in readonly.bat underscore new
which is that template so open that up. This next menu is asking us what data archive we
want to configure this interface to connect to, we'll select PISRV01 we only have one choice here
and here we are in the ICU. We're in the general configuration tab
we can see a few things here, so we can see the instance we're currently configuring
and select between instances if we have more than one on this machine we can see some important
settings for the instance that we'll talk about in a later lesson and which data archive the
interface will connect to. On the left side there's a whole lot of configuration menus
we're going to go into a few of these the OPC interface is very mature it has a ton of
configuration options for different configurations and use cases. Most likely you're not really going
to touch many of these options outside the ones we go over in this class but if you're interested
in the rest check out the documentation to PI live library we'll link that in the comments.
We're configuring an OPC interface here but there are actually a ton of different interfaces
most will have similar configuration options to the OPC interface except
for the interface specific configuration menu item second from the top. The only thing we need to
change here is the name of the OPC server that the interface will connect to, the servers actually
on the same machine as of the interface in our configuration so we'll leave it a local host.
To generate a list of available server names on our machine which will list them
all in the drop-down and from the drop-down we'll choose OPC sample.opcda20server.one
in real life when you're configuring one of these this is when you talk to your operations people
and you'd need to work together to choose the right server to connect to
with the right configuration that hosts all the tags you need access to.
You will also need to work with them to configure appropriate permissions if the server is actually
on a different machine to the interface there's a whole lot more steps you need to run through.
We've greatly simplified it here but the configuration is generally
different for every situation. So we're not really going to go into specifics
there's a big nice article for you to walk through if you need it.
So click apply there and then move to the services tab click create and we're done and there you go
we created our interface instance but we've got a few more steps to go through before it's able to
do anything. Step one is switching on buffering, so go to tools and then buffering and click yes
we'd like to configure buffering now and continue and check the box for PISRV01 indicating that
we'd like to buffer data to the server click next and don't worry about the error saying
security isn't configured we're going to deal with that afterwards. Click next and then yes.
Our buffer location is going to be on d drive just like everything else we're separating out
our PI related stuff to our operating system on the c drive so let's change it to d drive
buffer. Click next, next we get the same security message but that's fine we're
actually going to fix that right now for both the interface and the buffer so exit the wizard.
All right we're going to make both the buffer and the interface instance run under our svc-PI
int account now. There's two steps here, step one is to give the account permission to control the
buffer so open up computer management and then go through local uses and groups and into groups and
then PI buffering administrators. We need to add the account that's going to run the buffer here.
So add the svc PI int account to the group, step two is to change the account that runs
the services. Open up the windows services applet and click anywhere and press the letter p for PI
and find the PI buffer subsystem, so go right click properties then log on and then write in
our PI school backslash svc dash PI int account with a blank password and don't forget the dollar
sign at the end. We're using a blank password here because the domain manages passwords for
these accounts, they actually have passwords they're just managed by the domain and not us.
Apply then ok and ok and ok then do the same for the interface instance service.
Right click and restart the buffer then close all ICU and buffer manager windows,
say yes to any save prompts and then run the ICU again. Okay note that no
instance is selected when it starts so a common mistake here is to create new instances whenever
you open up the ICU don't do that it's just right here in the drop down. So select that.
Note now there's a buffering status on here looks like the interface has picked up that we've turned
on buffering for PISRV01 that's fantastic click the service tab the ICU is recognized that we've
configured buffering and wants to add a dependency so the service will always start after the buffer.
How kind of it say yes that's exactly what we want. Here we've got our interface running under
our svc PI into account like we can figure in the services applet and looks pretty good to me.
We're going to run the interface but before we do let's start up a scrolling log
rule one of interface maintenance and configuration or is this rule two
it's a rule anyway whenever you start up the interface always click on the scrolling
log button first so you can see what's going on otherwise you're running blind.
Start the interface and that's a lot of log messages.
Let's scroll up to the top and I’ll point out some important ones.
The first thing an interface prints to the log after starting is its own configuration
this can be really useful especially if you're on a support call with us.
If we scroll down a little we see the interface successfully connects to the PI data archive
and it's a buffered connection and we see that with this buffered and one in brackets.
Down a bit more and we see that we're connected to our OPC server successfully
which is good it's what we want. Then we get errors down the bottom about rejected points
but we haven't configured any points yet so that's fine. All right so if your log isn't like mine if
you've got extra errors then places to check are the general tab you should see buffering
status is on if it's not go back to the buffering part of this video make sure it's configured.
If you see any errors in the part where it's trying to connect to the OPC server
then your OPC server may not be configured correctly in the OPC int menu here.
So yours should look like mine. If you see any security errors or warnings
that it can't connect to the PI data archive then it's probably a problem with your mapping
or the accounts you're running the interface under so go back to the
mapping configuration section of this video and the services applet configuration section.
Other than that we should be good we're ready to create some points and get data flowing
and we'll find out if it really really works.