%PLC programming etc.                                Steve Chappell

\chapter{The PLC Gas \& Vacuum System Controller}

This appendix describes aspects of the Programmable Logic Controller
(PLC) peculiar to the MEGHA system.  Operators are referred to the
documentation that is supplied with the PLC and the software ``Melsec
Medoc'' for further information.

\section{Hardware}

The PLC system has two components:\\ {\bfseries 1)} The front panel
control which occupies the top half of the right hand rack of the Gas
Control System.\\ {\bfseries 2)} The PLC unit which is in the left hand
rack. Two ribbon cables connect this unit to the control panel.\\ The
PLC consists of a master (FX80) plus a slave (FX48) unit manufactured
by Mitsubishi. Together these units provide for up to 64 inputs
(labelled X) and 64 outputs (labelled Y). The inputs are taken from the
front control panel, the valve switches and vacuum gauges. The outputs
go to the front panel LED's and solenoid valves.  These have been wired
according to the scheme shown in tables \ref{pinsa} to \ref{pinsf}.
Note the PLC numbering system X/Y 0,1,2,3,4,5,6,7,10 etc.  Six
connectors (A to F) take signals to/from the PLC and the system
hardware. The allocation of these pins is also shown in tables
\ref{pinsa} to \ref{pinsf}, where the pin labelling for connectors C,D
and E is given in Fig. \ref{connpins}.

After power-up of the gas rack, the PLC control begins when the
``Run/Stop'' key is switched to RUN. This is the normal mode for
operating the system. When this key is in the STOP position all
pneumatic valve operations are inhibited and the system is effectively
``OFF''.

\section{Software}

The inputs and outputs of the PLC are separated from one another by a
Ladder Logic control program residing in the master FX80 unit. In this
case the program may contain up to 2000 Ladder Logic steps and is
loaded/monitored through a connection on the front panel of the control
rack. A PC may be used to download new software or monitor the active
program in real time by connecting it to this socket using the adaptor
supplied. A smaller designated hand held interface may also be used to
inspect the ladder logic instead of the PC. These two interfaces may
not be used at the same time. The PC software ``Melsec Medoc'' has been
used for programming the current system.  {\bfseries\itshape Please DO
NOT attempt to modify the core PLC program without proper training or
discussion.  Corruption of this program or loading of a new module
without due notification to ALL other users could result in a SERIOUS
failure of the system! Note that Ladder ``Logic'' suffers from a number
of unusual quirks that combined with the MEGHA system can at times
appear incredibly illogical.} The core program may be changed by an
experienced user when the PLC is STOPped.\\
\\
{\bfseries The following PLC programs are available:}\\
{\itshape MEGHA1:} Default Master program giving fully protected system.\\
{\itshape VATST:} Bare valve operation tests.\\
{\itshape PBTST:} Bare pushbutton tests.\\
{\itshape TEST:} The latest TEST version of the Master program.\\
{\bfseries Please DO NOT erase, overwrite or otherwise modify these programs.}

\begin{table}
\begin{center}
\begin{tabular}{ccccc} \hline
{\bfseries PIN ID} &  {\bfseries PLC IN} &  {\bfseries PLC OUT} &  {\bfseries FROM} &  {\bfseries TO}\\
\hline \hline
1 &  X0 & &  VA1 PNL SW & \\
2 &  X1 & &  VA2 PNL SW & \\
3 &  X2 & &  VA3 PNL SW & \\
4 &  X3 & &  VA4 PNL SW & \\
5 &  X4 & &  VA5 PNL SW & \\
6 &  X5 & &  VA6 PNL SW & \\
7 &  X6 & &  VA7 PNL SW & \\
8 &  X7 & &  VA8 PNL SW & \\
9 &  X10 & &  VA9 PNL SW & \\
10 &  X11 & &  VA10 PNL SW & \\
11 &  X12 & &  VA11 PNL SW & \\
12 &  X13 & &  VA12 PNL SW & \\
13 &  X14 & &  VA13 PNL SW & \\
14 &  X15 & &  VA14 PNL SW & \\
15 &  X16 & &  VA15 PNL SW & \\
16 &  X17 & &  VA16 PNL SW & \\
17 &  X20 & &  VA17 PNL SW & \\
18 &  X21 & &  VA18 PNL SW & \\
19 &  X22 & &  VA19 PNL SW & \\
20 &  X23 & &  VA20 PNL SW & \\
21 &  X24 & &  TPU1 SW `A' & \\
22 &  X25 & &  TPU2 SW `A' & \\
23 &  X26 & &  RP3 SW `A' & \\
24 &  X27 & &  ALARM RST SW  & \\
25 &  RUN & &  RUN KEY SW  & \\
26 &  NONE & &  TPU1 SW `B' & PWR CTRL TPU1 RELAY\\
27 &  NONE & &  TPU2 SW `B' & PWR CTRL TPU2 RELAY\\
28 &  NONE & &  RP3 SW `B' & PWR CTRL RP3 RELAY\\
29 &  X77 & &  MAN KEY SW & \\
30 & & & &\\
31 & & & &\\
32 & & & &\\
33 & & & &\\
34 & & & &\\
35 & & & 24V PSU IN PWR CTRL & TPU1,2\&RP3 SW\\
36 & & & 24V PSU IN PWR CTRL & TPU1,2\&RP3 SW\\
37 & & 24V & 24V P/S ON PLC & P/S COMMON\\
38 & & 24V & 24V P/S ON PLC & P/S COMMON\\
39 & & 0V & 0V LINE-PLC \& 24V P/S & PNL LED COMMON\\
40 & & 0V & 0V LINE-PLC \& 24V P/S & PNL LED COMMON\\
\hline
\end{tabular}
\end{center}
\caption{Pin allocations and PLC wiring. Connector A.}
\label{pinsa}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{ccccc} \hline
{\bfseries PIN ID} &  {\bfseries PLC IN} &  {\bfseries PLC OUT} &  {\bfseries FROM} &  {\bfseries TO}\\
\hline \hline
1 & &   Y30 & & ALARM RESET LED\\
2 & &   Y31 & &  \\
3 & &   Y32 & &  \\
4 & &   Y33 & &  \\
5 & &   Y34 & &  \\
6 & &   Y35 & &  \\
7 & &   Y36 & &  \\
8 & &   Y37 & &  \\
9 & &   Y40 & &  VA1 LED\\
10  & &  Y41 & & VA2 LED\\
11  & &  Y42 & & VA3 LED\\
12  & &  Y43 & &  VA4 LED\\
13  & &  Y44 & &  VA5 LED\\
14  & &  Y45 & &  VA6 LED\\
15  & &  Y46 & &  VA7 LED\\
16  & &  Y47 & &  VA8 LED\\
17  & &  Y50 & &  VA9 LED\\
18  & &  Y51 & &  VA10 LED\\
19  & &  Y52 & &  VA11 LED\\
20  & &  Y53 & &  VA12 LED\\
21  & &  Y54 & &  VA13 LED\\
22  & &  Y55 & &  VA14 LED\\
23  & &  Y56 & &  VA15 LED\\
24  & &  Y57 & &  VA16 LED\\
25  & &  Y60 & &  VA17 LED\\
26  & &  Y61 & &  VA18 LED\\
27  & &  Y62 & &  VA19 LED\\ 
28  & &  Y63 & &  VA20 LED\\
29  & &  Y64 & &  TPU1 LED\\
30  & &  Y65 & &  TPU2 LED\\
31  & &  Y66 & &  RP3 LED\\
32  & &  Y67 & &  AIR PRESS LED\\
33  & &  Y70 & &  ALARM BUZZER\\
34  & &  Y71 & &  ALARM LED\\
35  & &  Y72 & &  GAS `A' ONLINE LED\\
36  & &  Y73 & &  GAS `A' EMPTY LED\\ 
37  & &  Y74 & &  GAS `B' ONLINE LED\\
38  & &  Y75 & &  GAS `B' EMPTY LED\\
39  & &  Y76 & &  MAN MODE LED\\
40  & & & &  \\
\hline
\end{tabular}
\end{center}
\caption{Pin allocations and PLC wiring. Connector B.}
\label{pinsb}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{ccccc} \hline
{\bfseries PIN ID} &  {\bfseries PLC IN} &  {\bfseries PLC OUT} &  {\bfseries FROM} &  {\bfseries TO}\\
\hline \hline
A &  & Y0 & & VA1 LIVE\\
B   & & COM1 & & VA1 NEUTRAL\\
C  &  & Y1 & & VA2 LIVE\\
D  &  & COM1 & & VA2 NEUTRAL\\
E  &  & Y2 & & VA3 LIVE\\
F  &  & COM1 & & VA3 NEUTRAL\\
G  &  & Y3 & & VA4 LIVE\\
H  &  & COM1 & & VA4 NEUTRAL\\
J  &  & Y4 & & VA5 LIVE\\
K  &  & COM2 & & VA5 NEUTRAL\\
L  &  & Y5 & & VA6 LIVE\\
M  &  & COM2 & & VA6 NEUTRAL\\
N  &  & Y6 & & VA7 LIVE\\
P  &  & COM2 & & VA7 NEUTRAL\\
R  &  & Y7 & & VA8 LIVE\\
S  &  & COM2 & & VA8 NEUTRAL\\
T  &  & Y10 & & VA9 LIVE\\
U  &  & COM3 & & VA9 NEUTRAL\\
V  &  & Y11 & & VA10 LIVE\\
W  &  & COM3 & & VA10 NEUTRAL\\
X  &  & Y12 & & VA11 LIVE\\
Y  &  & COM3 & & VA11 NEUTRAL\\
Z  &  & Y13 & & VA12 LIVE\\
a  &  & COM3 & & VA12 NEUTRAL\\
b  &  & Y14 & & VA13 LIVE\\
c  &  & COM4 & & VA13 NEUTRAL\\
d  &  & Y15 & & VA14 LIVE\\
e  &  & COM4 & & VA14 NEUTRAL\\
f  &  & Y16 & & VA15 LIVE\\
g  &  & COM4 & & VA15 NEUTRAL\\
h  &  & Y17 & & VA16 LIVE\\
i  &  & COM4 & & VA16 NEUTRAL\\
j  &  & Y20 & & VA17 LIVE\\
k  &  & COM5 & & VA17 NEUTRAL\\
m  &  & Y21 & & VA18 LIVE\\
n  &  & COM5 & & VA18 NEUTRAL\\
p  &  & Y22 & & VA19 LIVE\\
q  &  & COM5 & & VA19 NEUTRAL\\
r  &  & Y23 & & VA20 LIVE\\
s  &  & COM5 & & VA20 NEUTRAL\\
t  &  & & & \\
u  &  & & & \\
v  &  & & & \\
w  &  & & & \\
x  &  & & & \\
y  &  & & & \\
z  &  & & & \\
aa  &  & & & \\
\hline
\end{tabular}
\end{center}
\caption{Pin allocations and PLC wiring. Connector C.}
\label{pinsc}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{ccccc} \hline
{\bfseries PIN ID} &  {\bfseries PLC IN} &  {\bfseries PLC OUT} &  {\bfseries FROM} &  {\bfseries TO}\\
\hline \hline
A & X30  & & VA1 SW OPEN &\\
B & & 24V &  VA1 SW COMMON &\\
C & X31  & & VA1 SWITCH CLOSED &\\
D & X32  & & VA2 SW OPEN &\\
E & & 24V &  VA2 SW COMMON &\\
F & X33  & & VA2 SWITCH CLOSED &\\
G & X34  & & VA3 SW OPEN &\\
H & & 24V &  VA3 SW COMMON &\\
J & X35  & & VA3 SWITCH CLOSED &\\
K & X36  & & VA4 SW &\\
L & & 24V &  VA4 SW COMMON &\\
M & X37  & & VA5 SW  &\\
N & & 24V &  VA5 SW COMMON &\\
P & X40  & & VA6 SW  &\\
R & & 24V &  VA6 SW COMMON &\\
S & X41  & & VA7 SW  &\\
T & & 24V &  VA7 SW COMMON &\\
U & X42  & & VA8 SW  &\\
V & & 24V &  VA8 SW COMMON &\\
W & X43  & & VA9 SW  &\\
X & & 24V &  VA9 SW COMMON &\\
Y & X44  & & VA10 SW  &\\
Z & & 24V &  VA10 SW COMMON &\\
a & X45  & & VA11 SW  &\\
b & & 24V &  VA11 SW COMMON &\\
c & X46  & & VA12 SW  &\\
d & & 24V &  VA12 SW COMMON &\\
e & X47  & & VA14 SW  &\\
f & & 24V &  VA14 SW COMMON &\\
g & X50  & & VA15 SW  &\\
h & & 24V &  VA15 SW COMMON &\\
i & X51  & & VA20 SW  &\\
j & & 24V &  VA20 SW COMMON &\\
k & X52  & & PS1 SW  &\\
m & & 24V &  PS1 SW COMMON &\\
n & X53  & & PS2 SW  &\\
p & & 24V &  PS2 SW COMMON &\\
q & X54  & & PS3 SW  &\\
r & & 24V &  PS3 SW COMMON &\\
s & X55  & & PS4 SW  &\\
t & & 24V &  PS4 SW COMMON &\\
u & X56  & & PS5 SW  &\\
v & & 24V &  PS5 SW COMMON &\\
w & X57  & & PS6 SW  &\\
x & & 24V &  PS6 SW COMMON &\\
y & X60  & & AIR SW  &\\
z & & 24V &  AIR SW COMMON &\\
aa  &  & & & \\
\hline
\end{tabular}
\end{center}
\caption{Pin allocations and PLC wiring. Connector D.}
\label{pinsd}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{ccccc} \hline
{\bfseries PIN ID} &  {\bfseries PLC IN} &  {\bfseries PLC OUT} &  {\bfseries FROM} &  {\bfseries TO}\\
\hline \hline
A & X61  & & GP2 PRESS SW &\\
B & & 24V &  GP2 SW COMMON &\\
C & X62  & & GC2 PRESS SW &\\
D & & 24V &  GC2 SW COMMON &\\
E & X63  & & GP1 PRESS SW &\\
F & & 24V &  GP1 SW COMMON &\\
G & X64  & & Valve A status &\\
H & & 24V &  Valve A COMMON &\\
J & X65  & & TPU1G &\\
K & & 24V &  TPU1G COMMON &\\
L & X66  & & TPU2G &\\
M & & 24V &  TPU2G COMMON &\\
N & X67  & & &\\
P & & 24V & &\\
R & X70  & & &\\
S & & 24V & &\\
T & X71  & & &\\
U & & 24V & &\\
V & X72  & & &\\
W & & 24V & &\\
X & X73  & & &\\
Y & & 24V & &\\
Z & X74  & & &\\
a & & 24V & &\\
b & X75  & & &\\
c & & 24V & &\\
d & X76  & & &\\
e & & 24V & &\\
f  &  & & & \\
g  &  & & & \\
h  &  & & & \\
i  &  & & & \\
j  &  & & & \\
k  &  & & & \\
m  &  & & & \\
n  &  & & & \\
p  &  & & & \\
q  &  & & & \\
r  &  & & & \\
s  &  & & & \\
t  &  & & & \\
u  &  & & & \\
v  &  & & & \\
w  &  & & & \\
x  &  & & & \\
y  &  & & & \\
z  &  & & & \\
aa  &  & & & \\
\hline
\end{tabular}
\end{center}
\caption{Pin allocations and PLC wiring. Connector E.}
\label{pinse}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{ccccc} \hline
{\bfseries PIN ID} &  {\bfseries PLC IN} &  {\bfseries PLC OUT} &  {\bfseries FROM} &  {\bfseries TO}\\
\hline \hline
1  & X24 & & SEE CONN A24 & CONTACTOR1(TPU1)\\
2  & X25 & & SEE CONN A25 & CONTACTOR2(TPU1)\\
3  & X26 & & SEE CONN A26 & CONTACTOR3(TPU1)\\
4  &  & & & \\
5  &  & & & \\
6  &  & & & \\
7  &  & & & \\
8  &  & & 24V PSU IN PWR CTRL & TPU1,2\&RP3 SW\\
9  &  & & 24V PSU IN PWR CTRL & TPU1,2\&RP3 SW\\
\hline
\end{tabular}
\end{center}
\caption{Pin allocations and PLC wiring. Connector F.}
\label{pinsf}
\end{table}
\begin{figure}
\centerline{\psfig{file=./figs/connpins.ps,height=8cm}}
\vspace{1.0cm}
\caption{Pin allocations for connectors C,D, and E on PLC box rear panel.}
\label{connpins}
\end{figure}







