\parindent 0pt
\parskip 0.3cm
%\section{The PE$\,$3220 Telescope Computer}~\index{telescope computer}
\section{THE PE$\,$3220 TELESCOPE COMPUTER}~\index{telescope computer}
\label{ch7:PE3220}
\subsection  {Introduction} \label{ch7:intro}
The INT is controlled by a Perkin-Elmer 3220 computer interfaced through
CAMAC. The computer system is found in the CLIP Centre, a temperature-controled
clean room on the second floor of the INT building, west of the central void. 
The machine stands in the south-west corner. Both
computer and its AMPEX disk drive are powered via the Buffer Set.

Control of the computer is via one of two terminals: either from the System
Console in the Telescope Control Room, on the third floor, standing on the
far left-hand side of the Control Desk, or from the Local Console in the CLIP
Centre, a standard VT220 terminal on the desk next to the PE$\,$3220.
The two-position switch for selecting either Control Room or CLIP Centre 
normally stands right beside the Local Console.

The PE$\,$3220 software is controlled by the Telescope Operator via the User
Interface, which is the VDU currently standing on a small table to the left of
the Control Desk in the Telescope Control Room.
The computer drives the ``Information
Display'', which is a monitor showing the Date, Time and Positions of the
current or next sky object. The Operator can move this Information Display to
any of a selection of different monitors by pressing the appropriate button(s)
on the Control Desk. Such is also the case for the MIMIC display 
(both Cassegrain and
Prime Focus), and for the Autoguider Display. The PE$\,$3220 also takes care of
some of the Control Desk hardware, in particular the Beckmann Displays, 
which display
the UTC, LST, RA, Dec and Zenith Distance in red illuminated numerals.

\subsection  {Checking the state of the telescope computer} 
\label{ch7:statenorm}
This section covers the ways of finding out the state in which the  
telescope computer\index{telescope computer state} has been left.   
The possibilities are:-

\begin {enumerate}
\item
{\bf Control system loaded and running.}

If the Telescope Control System is running, the Beckmann Display of UTC and LST
on the Control Desk in the telescope control room will be updating. \\
{\bf If such is the case, you are in business and need 
not read further in this Chapter.}

\item
Closed down deliberately, with the disc write-protected (Section 
\ref{ch7:noresp}).

\item
Running, but with the disc protected in hardware and/or software
(Section \ref{ch7:protected}).

\item
Running, with the disc write-enabled, 
but no telescope software working (Section \ref{ch7:normal}).

\item
In some strange condition, which will require a system reboot.
(Section \ref{ch7:reboot}).   
\end{enumerate}

\subsubsection{Control system not working.}
\begin{enumerate} 
\item
Press RETURN on the System Console. If you do not get the ``$*$'' prompt, the
system is dead. Continue at section \ref{ch7:noresp}.

\item 
Probe the current state of the computer by attempting to   
type on the System Console:-

\PE{D(ISPLAY) D(EVICES)}

If you get no response, then either the computer needs to be initialised 
or the terminal is not connected. See Section \ref{ch7:noresp} in both cases.   

Otherwise, you will see a list of devices.
\end{enumerate}

\subsubsection{Running but with disc write-protected}
\label{ch7:protected}
\begin{enumerate}
\item
Go to the CLIP Centre and
check that the hardware write-protect switch on the AMPEX disk drive front
panel is OFF ({\it i.e.} not protected). The tumbler switch should be
pressed/positioned to the left; the ``Read Only'' light should be off.

\item
Go back to the control room and execute the DISPLAY DEVICES command.
Check in the output listing that the
fixed disc with physical name {\bf MSMD:} is software enabled.
That is, the line commencing MSMD: should read:-

{\tt MSMD FC 0000 SYS CDIR}

If, instead you find:-

{\tt MSMD FC 0000 OFF}

you will need to enable the device in software by typing:-

{\tt MA MSMD:,ON,,CD=ALL}

\item
Type:

\PE{FINISH}

to remove any running software and reduce the system to a known state.
\item
Proceed with Normal Startup (Section \ref{ch7:normal}).
\end{enumerate}

\subsubsection  {No response on the System Console} \label{ch7:noresp}
\begin{enumerate}
\item 
Proceed to the CLIP Centre.   
\item Check that the correct System Console is selected 
(Section \ref{ch7:intro}) or
set the switch to Control Room, so that the computer can be addressed from the
telescope control room. Return to the control room and try DISPLAY DEVICES 
again.
   
\item Otherwise check the computer hardware in the CLIP Centre:
\begin {enumerate}   
\item
Set the switch to CLIP Centre, for local control.
\item
Check that the disc drive is powered up and is up to
speed, and that the computer is powered up (both should have the green ``ready''
lights on their front panels illuminated).
\item
Make sure that the write-protect switch on the disc drive is set to 
OFF ({\it i.e.\/} unprotected). The switch should be positioned/pressed to
the left, and the ``Read Only'' light should be off.
\item
On top of the left-hand module of the PE$\,$3220 is a long grey box. On this box
press the INIT spring-loaded switch. This will `cold' start the computer. If the
machine refuses to start, check that the little plastic key is turned to ON 
and not to STANDBY.
\item
Reboot the computer by answering the questions at the Local Console.

ENTRY=3

FILENAME=MSMD3220.LPO \hspace {2cm} (Beware ``0'' and ``O'')

and wait for the message saying:-

END OF ENVIRONMENT CONFIGURATION
\item  
Reset the switch to Control Room, to transfer control to the INT control room.
\item
Now return to the telescope control room and proceed with Normal Startup 
(Section \ref{ch7:normal}). 
\end{enumerate}
\end{enumerate}

\subsection  {Loading and starting the control software} \label{ch7:loading}
\subsubsection   {Normal startup} \label{ch7:normal}
If the system is running, with the disk write-enabled, the normal
procedure to start the telescope software is to type on the System Console:

\PE{GO INT}

Once the startup is completed a message including the name of
the telescope appears on the User Interface terminal.

\subsubsection   {Startup using COMPILE option} \label{ch7:compile}
The normal startup will not work correctly on change of focal station or 
if system parameters like pointing coefficients have been altered. In these
cases use the COMPILE option.

The control software is initialised from two text files, one
containing quantities which do not depend on the focal station or   
instrument (e.g. servo constants and CAMAC addresses), the other
containing focus-specific data such as pointing coefficients.   The 
files currently available are:-

\begin{tabular}{lll} \\
INT.STD &Telescope File & \\
INTCASS.STD &Focus File &(Cassegrain) \\   
INTPFRCA.STD & & (Prime focus with RCA CCD)   \\
INTPFGEC.STD & & (Prime focus with GEC CCD)   \\\\
\end{tabular}

If one of these files has been changed, or if there has been a change of
focal station (involving a top-end change), the control software MUST be 
loaded by typing:-
   
\begin{tabular}{ll} \\
\PE{GO INT, CASS, COMPILE}  &  for the INT Cassegrain focus \\
\PE{GO INT, PFRCA, COMPILE} &  for the INT with Prime focus with RCA CCD \\
\PE{GO INT, PFGEC, COMPILE} &  for the INT with Prime focus with GEC CCD \\ \\
\end{tabular}

The process takes about 2 minutes, and prints various messages on the
System Console. \\
(The COMPILE option generates a pair of binary files
INPSCF.SYM and INPSCF.VAL from the .STD files, which can be read in
more quickly when the normal startup GO INT is used on subsequent
occasions.)
\subsubsection   {Potential problems}
\label{ch7:CAMAC}
\begin{enumerate} 
\item
{\bf Incorrect startup}

The GO command objects if you type a command of illegal format, or if   
one of the requested input files does not exist, so it should not be
possible to initialise the system with {\it e.g.} the pointing
coefficients missing.   Beware of using the wrong files, and  
especially of trying to run the INT with the JKT software and vice  
versa!   Check for the absence of error messages on the
System Console and the reassuring presence of the proper telescope name in
the startup message on the User Terminal.
\item 
{\bf CAMAC} 

Amongst the messages which are output during startup are a group which  
refer to the initialisation of the CAMAC crates.   These all begin with
INITIAL: (the name of the task).   Check that there are no messages of  
the form

INITIAL: $***$  ERROR: Branch {\bf x} Crate {\bf y} off-line
 
If there are, check that every CAMAC crate is powered up and/or reset it.
There is one branch crate in the telescope control room at the left-hand end
of the Control Desk behind a blue door. The system crate and another branch 
crate are found in the CLIP Centre. Reset a crate as follows:
Turn the crate off-line, press the C/Z switch first to C and then to Z, and
finally switch the crate back on-line. If you still have problems, call the
Duty Technician.

If there are any other suspicious messages ({\it e.g.} containing the words
PAUSE, ARITH-ERR, LOAD-ERR or indeed any other -ERR), consult Section   
\ref{ch7:reboot} to bootstrap the computer and, please, 
note any such errors accurately on an Software 
Enhancement Report. If even rebooting fails, call the Duty Technician.
\end{enumerate}

\subsection   {Rebooting the computer after a power failure or crash} 
\label{ch7:reboot}
After a power failure or system crash the telescope computer has to be rebooted,
and the telescope control program has to be restarted (from scratch). Note,
that after a power break it can take some time before the power supply to the
PE$\,$3220 is restored. Wait for a message from the Duty Officer to restart the
Buffer Set. This will normally be done by the Duty Technician or the Telescope
Operator. Once the power supply is restored, reboot as follows:
\begin{enumerate}
\item 
Go to the CLIP Centre.   
\item
Check that the computer and disc drive are powered up, {\it i.e.} some lights
on the front panels should be illuminated. If there is no power, check the
mains isolator, a rotary switch on the wall behind the machine, and, if off,
switch it on. 
\item
Make sure that the disc drive is up to operational speed, and that the
 Write-protect rocker switch on the disc drive is set to 
OFF ({\it i.e.} unprotected). The switch should be positioned to the left,
and the ``Read Only'' light should be off.
\item
Make sure that the control switch is set to CLIP Centre 
(section~\ref{ch7:intro}), for local access.
 \item
Press the INIT button at the top of the front panel of the PE$\,$3220 (See
section \ref{ch7:noresp}). 
\item
Boot the computer by answering the questions at the Local Console:

ENTRY={\tt 3}

FILENAME={\tt MSMD3220.LPO} \hspace {2cm} (Beware ``{\tt 0}'' and ``{\tt O}'')

and wait for the message saying:-

END OF ENVIRONMENT CONFIGURATION
\item
Initialise 
the CAMAC crates associated with the PE$\,$3220 (Section \ref{ch7:CAMAC}). This
is most important after a power failure.
\item  
Reset the control switch to Control Room.
\item
Return to the telescope control room and proceed with Normal Startup 
by typing:-

\PE{GO INT}

Do not worry about messages saying POTENTIAL LOST DATA, which are 
generated everytime an open file is closed. However, if you get messages about
BAD SECTORS, ask for technical support, as there has probably been
a disc crash.

\end{enumerate}

\subsection {Regular Shutdown}
\label{ch7:shutdown}
In order to stop the Telescope Control Program type at the System Console:

\PE{FINISH}

Wait for the message explaining how to close down computer or restart the
control system. Nothing needs to be done at the User Interface. Notice,
however, that only under computer control the telescope can parked at zenith, 
by pushing the ZENITH button on the Control Desk. That, therefore, has to
be done before stopping the control program.

Further, to shut down the computer itself, after observing or as a precaution
before an anticipated power cut, type, again at the System Console:

\PE{MA MSMD:,OFF}

\subsection{Tasks and miscellaneous problems}
\subsubsection {Control system tasks}  
The control system contains the following tasks:

\begin{tabular}{ll}
LIBRARY  & Library subroutines  \\
TSKCOM   & Task common (global variables shared by the whole system)\\
MESSAGES & Initiation of operations (e.g. slew to source)   \\
USER & User Interface   \\
AGBX & Acquisition and guiding panel\\
AUTOGUID & Autoguider control   \\
CONTROL  & System control panel buttons \\
TNHZ & 10Hz loop controlling pointing, tracking and fast displays   \\
INFODISP & Information display  \\
IPL  & Interprocessor link between telescope and instrumentation computers\\
SERVICE  & Interprocessor link service task \\
UTILITY  & Dome, shutters, focus and Cassegrain turntable   \\ \\
\end{tabular}

In addition, three tasks run as part of the startup procedure but are
not  normally resident: 

\begin{tabular}{ll}
INPSCF   & Reads system configuration files and initialises task common \\
INITIAL  & Clears and checks CAMAC and initialises lamps and displays   \\
LOADER   & Controls loading and starting of other tasks.\\ \\
\end{tabular}

The INPSCF task deals with the setting of constants used by the telescope
control software, in particular those which must be updated regularly, such
as coefficients for the pointing model. A ``guide to the use of INPSCF'' is
given in La Palma Technical Note 39 (Laing \& Wood, 1986).

A number of tasks may run alongside the control system. These are: 

\begin{tabular}{ll}
INPSCF   & see above\\
POINT& Logs pointing data   \\
ENCODERS & Displays INT encoder readings on SC  \\
FERRDIFF & continually logs differences between Ferranti encoders   \\
CAMTST   & Tests CAMAC  \\
EDIT32   & Text editor  \\  \\
\end{tabular}

\subsubsection{Checking for tasks}
In order to find out what tasks are running, type on the System Console:

\PE{D(ISPLAY) M(EMORY)}

During normal operation, all tasks should be   
active (A), except for LIBRARY and TSKCOM, which should be dormant  
(D).   If one of these tasks is paused (P) and this has not been done   
deliberately, there will be problems, as described below.   

\subsubsection{Problems due to tasks}
\begin{enumerate}
\item
{\bf The control software has stopped and the displays are not updating.}

The likeliest problem is that the 10$\,$Hz task has paused.   There may
be a message like TNHZ: ARITH-ERR AE5A on the System Console.  Type 

\PE{D(ISPLAY) M(EMORY)}

on the System Console and look at the line beginning TNHZ.   If the 
task is paused (P) rather than active (A), try continuing it:   

\PE{T(ASK) TNHZ; CO(NTINUE)} 

If this doesn't work, restart it:-

\PE{RESTART TNHZ}

If ARITH-ERR's occur on every cycle, then TNHZ is probably being fed
rubbish by the time service or the encoders.   Call the Duty Technician.
\item
{\bf There is a continuous stream of LOGQ-ERR's on the System Console. }

If TNHZ is the task responsible, you will not be able to recover
control without either removing the 10$\,$Hz interrupt line from the box   
on the wall in the CLIP Centre (it may be labelled) or rebooting the
computer.   The latter is preferred.
\item
{\bf The Autoguider Panel on the Control Desk is not working.}

Check that the task AUTOGUID is alive.  If not:-

\PE{RESTART AUTOGUID}
\item
{\bf The Acquisition \& Guiding Panel on the Controle Desk is not working.}

Check that the task AGBX is active.   If not:- 

\PE{RESTART AGBX}
\item
{\bf The Beckmann Displays are working, but the Information Display
is not updating.}

In this case, the 10-Hz synchronous task (TNHZ) is running, but the 
Information Display task (INFODISP) is not.   If the latter is paused,  
try to continue it: 

\PE{T(ASK) INFODISP; CO(NTINUE)}

and if this fails:

\PE{RESTART INFODISP} 
\item
{\bf The User Interface terminal hangs up and gives no response.}

Check on the System Console whether Task USER (or any other) has 
failed with an error message. Type on the System Console:- 

\PE{RESTART USER}  (or whichever task it was)

If the User Interface does not now restart, try stopping and restarting the
telescope control system with \PE{FINISH} and \PE{GO INT}.
\end{enumerate}

\subsection{Enquiring and Defining parameter values with INPSCF} 
\label{ch7:query}
The INPSCF task deals with the definition of constants used by the telescope
control software. A comprehensive ``Guide to the use of INPSCF'' is given
in La Palma Technical Note 39 (Laing \& Wood, 1986). Here is only briefly
outlined how to enquire and (re)define parameter values. Details about
restrictions on newly entered values are given in the aforementioned 
Technical Note.

Run INPSCF by typing at the TCS terminal:

\PE{INPSCF}

This will start the INPSCF task. It can run alongside other tasks of the
telescope control software (see previous section). However, it can {\bf not} 
run simultaneously with POINT.

You may now query the values of various control constants by typing:

\INPSCF{@PARAMETER}

where {\tt PARAMETER} is the name of the constant, {\it e.g.\/} HATERM,
AOXNOM, TDATA(11), {\it etc.\/} (see LPTN 39 for full details). Its current
value will appear on the terminal.

If you don't like a value and want to change it, only if you are very sure
of what you are doing!, type:

\INPSCF{PARAMETER new-value} \hspace{2.0cm}, for instance: {\tt HATERM 2}

Notice the absence of an `equals' symbol. The control software
will immediately use the new value, but it will be lost as soon as you 
shut down the INT. Notice, that some parameters, and in particular the
software limits on the telescope pointing, can only be modified by someone
who has a detailed knowledge of the telescope drive software; a password
has to be provided. Thus, if a soft limit has to be altered, consult a
qualified member of the La Palma staff.

Get out of INPSCF by typing: \INPSCF{END}

\subsection {Summary of startup and shutdown}
\subsubsection{Normal Startup}
\begin{enumerate}
\item
Type at System Console:-

\PE{D D}
\item
If MSMD: is OFF, type:-

\PE{MA MSMD:,ON,,CD=ALL}
\item
When MSMD: is ON, type:-

\PE{GO INT}
\end{enumerate}
\subsubsection{Shutdown}
Type at the System Console:-
\begin{tabular}{ll}
\\
\hspace{0.7cm}\PE{FINISH} & to terminate the telescope control program.
\\
\hspace{0.7cm}\PE{MA MSMD:,OFF} & to shut down the PE$\,$3220.
\end{tabular}

\subsubsection{Reboot after a power cut or INIT pressed}
\begin{enumerate}
\item
Press INIT on CPU.
\item
Boot the computer by answering:-

ENTRY={\tt 3}

FILE={\tt MSMD3220.LPO} \hspace {2cm}

and wait for the message saying:-

END OF ENVIRONMENT CONFIGURATION
\item
To start the control system, type:-

\PE{GO INT}
\item
If there has been a power failure check the CAMAC crates (Section 
\ref{ch7:CAMAC})
\end{enumerate}

\subsubsection {After a change of focal station}
Once the system is running with the disk marked ON (write-enabled),
type at the SC:-

\begin{tabular}{ll}
\\
\PE{GO INT, CASS, COMPILE}  &For Cassegrain Focus \\
\PE{GO INT, PFRCA, COMPILE} & For Prime Focus  \\
\PE{GO INT, PFGEC, COMPILE} & For Prime Focus  \\
\\
\end{tabular}
\vfill
\eject
