COMPUTER CONTROL SYSTEM OF PHOTON FACTORY STORAGE RING
C.O. Pak, T. Igarashi, N. Kajiura *, A. Mishina and S. Shibata
National Laboratory for High Energy Physics
Oho-machi, Tsukuba-gun, Ibaraki-ken, 305, JapanINTRODUCTION
The electron storage ring at KEK Photon Factory(PF) has been successfully operated at an energy of 2.5
We have constructed a computer network system
GeV.
which is expected to offer a unified way of machine
control and a powerful tool for analyzing machine
characteristics, Our goal is highly automated control
by a few, ideally one, operator and to realize complete
These arereproducibility of machine conditions.
essential to provide a stable synchrotron radiation
constantly for experiments.
Thus, the network system which connects distributed control computers is strongly required tooperate the machine as a total system.
This paper will describe the outline of hardware
and software of the control system with the computer
network.
SYSTEM OVERVIEW
The layout of the control computer system is shownin Fig. 1. The control system consists of 7 control
stations which are connected to each other through one
exchange station, so each station can communicate with
(Only exception is RF station, it
any other station.
cannot access this network because of its different
operating system. The reason is explained later.)
Usually, each control station performs almost independently its own tasks, control/monitoring of themagnet system, the RF equipment, the vacuum system, thesafety interlocks, operators console and beam monitoring system, etc. When a station needs to send/receive
some data to/from other station, they can achieve it
facility
communication
program-to-programusing
supported by the network system.
Both vacuum and beam monitoring stations leavea part of their work to micro-computer (PANAFACOM
C-180, NEC PC9800) which sends/receives data to/fromthe host computer through RS-232C link.
The medium-size computer (FACOM M-200) with 6 MBof memory is also linked to the network through afront-end processor (FACOM U-400) to log and analyze
operation data or do some simulation on orbit analysis.
The computer is shared by TSS for batch users andexperiment users.
CONTROL STATION
Hardware Configuration
A typical hardware configuration of the control
station is shown in Fig. 2.
Almost all objectives of controlling or monitoring
are driven through CAMAC interfaced modules such as
input/output register, control register, ADC, DAC and
For some GPIB-interfaced devices
multiplexer, etc. .
such as digital multi-meter and coaxial relay etc. arealso driven through CAMAC using GPIB-CAMAC conversion
module.
The processing power is supplied by a 16-bit minicomputer (AICOM C-6) with 1 MB of memory. The CAMAC
branch driver was specially developed for the computer.
The computer has also serial I/0 ports to drive somedevices which have a I/0 interface to the RS-232C linkisItetc.).
microcomputers(graphic displays,equipped with hard disks with capacity of 40 MB and a
Furthermore, a magnetic tape unit isline printer.
also installed to some stations for system maintenance.
The local console is used only for system set-up ormaintenance, so the operator usually interacts withtouch panels or other console desk devices through
CAMAC interfaces.
The communication with other control station isachieved by network interface modules of CAMAC as
described in section 4 in detail.
Software Structure
Figure 3 shows a schematic view of the memory
assignment of the control station computer.
The multi-task real time operating system was de-RS -4221 SOLCNETWORK BY PFX'IFig. 1=CONTROL STATION

Layout of the computer control system of Photon Factory storage ring.

*Present address; R/D division, Ai Electronics Corp., 347
Shimomaruko, Ohta-ku, Tokyo, 146, Japan

to GRAPHIC DISPLAYCONTROL UNITCOMPUTER etc.

-+-to EXCHANGE STATIONrT--rT,+~+rrh-.-r~ccA-2'------y----J

OTHER CAMAC MODULES

10MB~ 4I

CONSOLE( FIXED\cARTRIDGE~3)
X1

DISPLAY DRIVER
TOUCH PANEL INTERFACEINPUT REGISTER, OUTPUT REGISTER, CONTROL REGISTER( GPIB INTERFACE ,COMMUNICATION INTF.!AS RS-232C PORT)
MULTIPLEXER, ADC, DAC

Fig. 2

Typical configuration of a control station.
NETWORK SYSTEH

veloped and installed to perform both local dataprocessing and network processing simultaneously.
An interactive language, 'PF-BASIC' (Photon Factory Basic) was specially prepared as a common language
for the control program code. This has all features ofstandard BASIC with some extended functions and commands such as matrix calculation, virtual memory
access, synchronized data communication with othercomputers and various interrupt handling (LAM of CAMAC,The PF-BASIC interpreter
clock, network action) etc.
code is made to re-entrant because it may be used by
two or more programs at the same time.
A users space of main memory is divided into twoareas, one for 'local space' and the other for 'remote
space'. A boundary of two spaces is changeable and set
at system boot-strapping. A single job is run in thelocal space by operators commands from the system
console and one or more jobs are able to be executed inthe remote space by an action from other computersthrough the network.
Two spaces are fully independent to each other, so
there remains possibility that two or more programs
access one CAMAC module at the same time. The system(CAHAC exclusive controls)'CXC'
software module,
avoids this situation by keepi.ng a ;;;anagement -table of
CAMAC, and all users program must access CAMAC only
through CXC.
Some extended features like block transfer ofmemory, string functions and generalized treatment ofsome CAMAC modules (input/output register, multiplexer, GPIB interface, ••• etc.) are provided in a formof BASIC-callable subroutines for users convenience,

LOCAL SPACE

1 REMOTEI

Hardware of Network
The intercommunication between computers is performed using network interface modules of CAMAC which
are specially developed for the PF network system.
The interface consists of two modules. One is afundamental module which processes CAMAC functions (asTheshown in Table 1) and controls interface unit.
other is a line control module which handles signals ona physical link. Various types of link, SDLC, RS-232C
and parallel I/0 etc., can be supported only byreplacing the line control module without any change ofTwo modules areother hardware/software environment.
connected by 60-wire flat cable.
Table
CAMAC functions of network interface module
A0111001158000161717172211314Function
Read Received Data
Read Received Data Length
Read Status
Read Module ID CodeTest LAM
Write Transmitting Data
Write Transmitting Data Length
Write Control Word
Write LAM Mask
Selective Clear of LAM

Q-Res;eonseReceive
11LAM
Transmit
111
1

Line error, Transmit error, Receive error,

NETWORK ACTIONFROM OTHER STATION

LAM sourceSPACE

The interface has two buffers of 2 kB each forboth data to be transmitted and those received.
The possible errors of transmitted data arechecked by means of CRC, check-sum and parity bit, sothe interface requests re-transmission of data when it
detects errors.
The PF network system uses SDLC protocol on RS-422
as a physical link, and the line speed can be chosenfrom 62.5 k ~ 1 Mbps which is selectable by 4-bit DIP
switch in the line control module.

Transmit done, Receive done

OPERATING____Fig. 3F___,]""

Software of NetworkThe software of the network system has a threelayered structure as shown in Fig. 4.
The lower layer called 'DLC' (Data Link ~ontrol)
manages a link between physical node~
The 'PC' (Path Control) is the middle layer andcontrols logical comm~nication paths in order that PF
network allows multiple communications simultaneously

A schematic view of memory assignmentof a control station.

348

STATION-AFig. 4

However, these must beformat and sampling rate.
treated in a unified way to provide easy and speedy
access tools for database users.
To realize this request, we adopted 'multi-leveled(A part of thisfile architecture' as shown in Fig. 6.
work is still in preparation.)Transferred data are added to 'temporary dataset
Every control(TDS) 1 group as one member of them.
station has its own TDS. The length and format of data
are different for each control station, but each data
should have a common heading which contains informations on time/date and beam current at the time when
After pre-processing likethese data were taken.
deletion of unnecessary record, condensation and timesorting, the data in TDS are stored to 'Reserved dataRDS isset (RDS) 1 , so TDS is ready for next data.
unique for a system and dumped to 1 Archived dataset(ADS)' on a magnetic tape when it is full.
All these processes are performed by logged dataprocessing utilities referencing a logged data management table (LDMT) which keeps all records on this procedure.
Users can search and access any data of a certain
period of time using time/date and beam current as
They can save a copy of extracted data inindeces.
their own work file or use interactive data processing
service (IDPS) which makes time-dependence plot of any
data or correlational plot of two or more quantities
etc. from a TSS terminal.

STATION-S

Three-layered structure of the network software. DLC = Data Link Control, PC = PathControl, PFX = Photon Factory Executive.

The upper layer called
on a single physical link.
'PFX' (Photon Factory Executive) defines the protocol of
Each layer is absolutely
the actual communication.
independent to its upper-side layer.
TheFig. 5.
The message format is shown inmessage packet has three types of header corresponding
The 'DLC'to the software structure mentioned above.
header includes receiver/transmitter address, packet
The 'PC'
control word and transmitters terminal name.
header contains informations on an identity of a comThe 'PFX'
munication and a message order number.
header keeps informations on length and content oftext.
A text has variable size up to 2 kB and its content will be command, data, response or command completion code.
A fundamental features provided by PFX are as
data
program-to-programtransfer,filefollows;transfer and submitting program to other stations.
These are supported by both operators command and BASIC(A program-to-program data transfer isstatement.
realized only by BASIC.)
The exchange station simply distributes packets
according to its physical node address, and all protocol processing of the networks must be done by eachcontrol station. This would be rather heavy load for a
Furthermore, multi-task
control computer sometimes.
operating system, which is installed to realize theFor RF
network, pays cost of large system overhead.
control station, this turned out to be an unendurable
demerit because it lowers the speed of CAMAC accessing.
So it uses ordinary single-task disk operating system
Howwhich is unable to support the network by PFX.
ever, a data transfer from RF station to other control
station is realized using the same network interface
module and special protocol even in a restricted form.

HEADER FOR DLC-r
1 4 bytes

HEADER FOR PC

26

HEADER FOR PFXTEXTCONTROL STATIONSOADSFig. 6_Lr+r
4

CONCLUSION
The computer control system of Photon Factorystorage ring has been constructed and operated. Minicomputers which are distributed along various machine
devices achieved control and monitoring tasks withThe network system of the comfairly satisfaction.
puters has been developed and almost all designed
features are realized. However, it became rather heavy
load to support this network system for mini-computers
Consequently thiswith sizable operating system.
turned out to be slowness of a network operation orother I/0 service. At some control stations, tasks to
be processed are already beyond their processing power.
To improve this situation, installation of more
powerful processors, 32-bit super mini-computers, withDesign of anhigh-speed network system is scheduled.
architecture of new system is proceeding, and it will
be some 'computer complex' bound closely by a network.

52000

ICHECK-SUM
Fig. 5Block diagram of the operation data acquisition. TDS = Temporary Dataset, RDS = ReservedDataset, ADS = Archieved Dataset, LDMT =Logged Data Management Table, IDPS = Interactive Data Processing Service.

=tt

Format of a message packet.
OPERATION DATA ACQUISITION

Continuous acquisition of data on the machineparameters is very useful for a trouble-shooting or aanalysis of machine characteristics.
each control station areOperation data ofgathered to the library computer through the network
system. These data have a variety in their quantities,The authors woultl like to thank Professor K. Huke
for his valuable advice and encouragement for this~ork.
349