Now most of the time after you have installed PI
people tend to do a quick reboot, and
if you have chosen the default to Auto-start PI
when the Operating System reboots, then all of PI's
going to go ahead and start up, and you can go ahead and start,
you know, just using PI at that point. However,
there are a couple of other ways you can start PI.
And, actually, since in this case I, I do not
want to reboot in order to start up PI, I want to show you some of the other
options. And, also, for troubleshooting purposes, it's nice to know what the
other options are. First of all, let me show you
an option that I suggest you do avoid.
And that is, in Administrative Tools there's a Services applet --
it's under
there it's under Control Panel, Administrative Tools --
and in the Services applet you can look
at the individual PI Services
and you might be tempted to say, hey, I will just start these one by one,
like that. Please do not do that. That's --
it is something you will actually see some of our
tech support people do sometime, not, not generally for a start-up,
but sometimes for troubleshooting. They may stop and restart
individual subsystems. But, there, there are so many dependencies
built into these different subsystems, I will tell you, it would be a one-in-a-million
shot that you would actually start everything in the
proper order. So, we do not suggest
you do it that way. If you do reboot
the Operating System, then, of course, we preserve all those
dependencies just fine, so that's not a problem,
you know, when it just reboots. Now, for most purposes, if you are
going to start up PI, and the Operating System's
already running, you would do that using this right
here. It's pisrvstart.bat.
And that is in the, as you can see, it's in the
PI-Admin Directory.
Now, what's the difference between that
and pistart.bat? This actually seems like
a very cruel joke here. Why, why in the world
do we have something called pistart and
pisrvstart, which, you know, if I had to choose between the two and I
did not know either way, I would choose pistart. Well,
it's the history of the software. The, originally, the only
way you could start PI was to start it using
pistart, and what that does is it starts each and every
subsystem in its own command window. This was
actually before PI started, before PI was
actually running as a series of services. Now, it, we
kept it in there because it's still a very useful utility
if you need to do some troubleshooting, because,
if you run pistart, each and every
application is going to start up in its own little window,
and you might actually see some messages, some error messages,
that we did not think to write into the logs. It's
unlikely but, you know, that's, it's kind of a last-ditch effort
we sometimes ask people to run pistart.
But, for most of the time we would suggest,
you know, unless you are in some heavy-duty troubleshooting mode
here, go ahead and run pisrvstart.
So, let's say you are at the point where you
would like to go ahead and start up PI without rebooting the Operating
System. You may think to just double-click
on pisrvstart.bat and that's actually fine in most
instances. Once you have been running PI for a while and you are
confident everything's going to start up fine, there, there's no
problem. You could even, you know, create a shortcut over on your
desktop and do that. We have seen folks do that. But, when
you are just starting it for the first time, what I would suggest you do
is, instead of running this from the Windows, Windows interface
here in Windows Explorer, I would run it from the
Command Prompt. And the reason for that is because,
well, if you do have some kind of a problem
in executing this pisrvstart.bat,
if there's a problem
and that command window disappears, you know, unless you are
quick enough to read the message off your retina or something,
you are just going to miss what the error is.
So, for that reason, we suggest you go into Start,
Run, and type in c-m-d. We are going to start
up the Command Prompt, or however you prefer to get into the Command
Prompt here, and go into that
PI Admin Directory. Let me change
Directories over to there.
[typing]
There we go. I will go into
the PI Directory, and the
Admin Directory, and if we do a
Directory here, you can see -- let's look at all the Batch Files
here. There's a lot of them. We are going to be running
this pisrvstart.bat.
Now, again, no reason you cannot do it from the
Windows prompt, or from the Windows Explorer,
but, as I said, the nice thing about this is when I run
pisrvstart.bat,
when I run it from here, if I do encounter some kind
of a problem, well, this window will remain open.
What you will find if you run it from Windows
Explorer is the -- as soon as you encounter an error, that
window disappears. It's very difficult to troubleshoot it that
way. So, anyway, that's, that's a
suggestion. So now, PI is starting up.
And actually, there's a certain sequence that's going on
as this start-up occurs. One of the first things that
happens is we execute a file called
pisrvsitestart.bat, and as the name
implies, this is going to be a site
specific start-up file. This is where all those things
that are specific to your site are going to be
started up. And those would typically be any interfaces
that are running on your computer that, you know, may not be a generic
interface like Random or Ramp Soak. So if we
take a look at this file, as
you can see right now, it's just, it's configured with
all these things were marked out. This,
or excuse me, with several things were marked out, but several not. It's
starting up the Ramp Soak Interface and the Random
Interface. Now these other interfaces, piperfmon_basic,
ping, SNMP, etc -- these are things that we do
ship, but we do not start them by default as you can see here.
The REM Statements remarks those out.
So, what you would do is then add your new
site-specific start-up files here. So, for
example, if you were running a copy of the OPC
Interface, you might add
net start pi-opc or whatever the,
whatever the technical name is for that service that you are going to be
starting up. Let me delete that.
And, as you might guess, there is a corresponding
pisrvsitestop.bat
and in that you would go ahead and stop
those interfaces that are site-specific. Now, any
other things that you have got that are site-specific, if you have written little
sdk applications or app
vb applications that use OLE DB or ODBC
to do things to the PI Server, these are things you should
start up as well at that point. Let's see where
we are in the start-up. It looks like the start-up
worked properly, you know, and
as you can see here the very last thing that happened is
that it went ahead and did all those site-specific starts. That's
what we see right here. And, I am sorry. I, I said that
incorrectly at first. I said the first thing we do is an
srvsitestart. That's actually the last thing we do
during the pisrvstart. It's the first
thing we do during a pisrvstop.bat.
We run this pisrvsitestop and stop
those things first. So, to reiterate, when we run
pisrvstart.bat we are going to start up all those
things that make up the PI System. And, if you
look at this list here -- this is a list of all
the different services that, you know, together comprise what we
call the PI System, or I should say the PI
Data Access Server. Now, and then the very
last thing we do during that srvstart is we call
pisrvsitestart which calls those things that,
that we have placed in that file, plus anything that you may have added.
And, to belabor the obvious, perhaps,
perhaps if I go ahead and refresh my view of
Services, we should see
that our Services are now -- the, those PI Services are
now running.
Yeah, there we go.
As you, as you can see, most of these
processes, or many of these processes, are now
started up, but not all of them. Remember,
some of the PI Processes are optional like this PI
Batch Generator Interface, the PI Buffer
Subsystem, etc. Those things are optional.
The, and things like the Recalculator and
Shut-down are not going to be running on the PI Server.
Okay. Now, let's return back to our
pisrvstart and pisrvstop. The
pisrvstart is how you, you start the PI System when the Operating System's
already running, when Windows is already running. Now,
when it's time to shut down PI,
you can just stop down the Operating System. Just
go into Start, Shutdown, and that will work
but there are occasions where
Windows will get -- you know, by default, Windows has
certain time-out periods for shutting down
processes that are, you know, that need to be --
or services that need to be shut down in order to shut down the Operating
System. And, if Windows perceives
that the, a particular service
is taking too long to shut down gracefully,
it will just go ahead and shut that system,
that service down, you know, ungracefully,
which means there's certain, you know, services
that, if they are not shut down properly, they can
lead to certain problems on the PI Server.
So, what we suggest is, instead of just,
you know, choosing a shut down, Start, Shut Down,
what you do when you need to stop PI is to run
pisrvstop.bat. pisrvstop
is going to, as I said before, first of all it's going to run
the site-specific Stop File,
stop all of your interfaces and local site-specific things,
and then it will go ahead and shut down all of those different
things that we started up earlier. So, that's how you would start
your PI System. And one more reminder: remember, anything
that you put in your pisrvsitestart.bat,
anything you enter there, you should have a corresponding
entry in the pisrvsitestop.bat
just to make sure that, you know, you are shutting down all those
things that are site-specific.