PC-based Control System in Storage Ring TERAS
H.Ohgaki, R.Suzuki, S.Sugiyama, T.Mikado, M.Chiwaki, K.Yamada, T. Ohdaira, N.Sei,
H.Toyokawa, and T.YamazakiElectrotechnical Laboratory, 1-1-4 Umezono, Tsukuba, Ibaraki 305, Japan
Abstract
Personal Computer (PC) based control system has beendeveloped for the storage ring TERAS at ElectrotechnicalLaboratory (ETL). The system consists of device control
PCs with several I/O boards, man-machine interface PCs
and a network system. Intel-based PCs, running on theMicrosoft Windows95 and the WindowsNT, are used withthe built-in TCP/IP protocol. Each I/O board has aclient/server-type application written with Borland Delphi.
A database sub-system has been developed for watching
the status of the ring and for helping the daily operation.
1 Introduction
Recently high-speed and low-cost Personal Computers(PCs) allow constructing a control system for a small- anda medium-scale accelerator facility[1]. A PC-control
system is suitable to construct a distributed control systemwith a restricted budget because of its cheap price.
Moreover, a recent operational system (OS) running on a
PC has a built-in network service that smoothly works with
their applications. Therefore, an inexpensive (but highperformance) control system can be constructed with PCs
with a network system that is commonly adjusted in mostof facilities. A PC-based control system has also beendeveloped for the storage ring TERAS at ElectrotechnicalLaboratory (ETL). The system consists of device control
PCs (DCPCs), which are equipped with several I/O boards
that are commercially available, of man-machine interface
PCs (MMPCs) and of a network system. The Microsoft
Windows95 is used for the OS running on the DCPCs,
because direct accessing to an I/O port can be available
without any special device drivers. Both the Windows95
and WindowsNT are used for the MMPCs. The
development of the new system has been started in 1990. In
this paper, we would like to describe a brief history of ourcontrol system and a short review of the new PC-basedsystem.

cables. Since no computer system was employed in theoriginal system, an operator with a good skill(typically userhimself) was needed to change the ring parameters.
Therefore, a computer control system has been greatly
desired. The PC-based control system for the main magnet
was started in 1990[2]. Then, the steering magnets and theRF-control PC[3] were added to the system. However,these PCs were operated independently; operators stillneeded to operate these independent sub-systems
simultaneously. In 1996, the system has been developed touse the network system to unify several independent subsystems and to satisfy the requirement from users who needto control the ring parameters from their experimentalstations.
Liniac Control room

Database

Ring room

MMPC

ADC-DCPC

BTS
knobs

16bit-16ch
ADC

Injectionknobs

isolation
ampDAC-DCPC

Timingknobs

Bend
Focussing Q
Defocussing Q

16bit-4ch
DAC
12bit-8ch
DAC x 2

Steering1~8
SteeringV1~V4
Sextupole1,2

RF-DCPC

12bit-4ch
ADC

Cavity field
Cavity Temparature
RF Phase

12bit-4ch
DAC

RF output power

BPM-DCPCGPIB

BPM readout
circuit

BPM1~7

BTS magnets
Septum, Kicker

2 Historical perspective
The storage ring TERAS was constructed for a multipurpose synchrotron radiation source in 1979. The ring has
been injected with a linac at the injection energy of 300
MeV. After the ramping up/down, the ring has been
operated with various modes in the stored current, in theoperation energy (from 200 MeV to 800 MeV) and in theelectron orbit. These ring parameters have been fitted toseveral specific experiments. The original control system
was also constructed in 1979. All knobs and switches weremanually controlled from the control room with hard-wired

Bend
Focussing Q
Defocussing Q
Steering1~8Hall Prob
DCCT
VaccumExperimental roomMMPC

MMPC

MMPC

MMPC

Fig.1 Schematic view of the PC-based control system. Dotted line
indicates the hard-wired line and dotted boxes indicate knobs
inherited from the original system.

3 Current system
3.1 System outline
The system consists of device control PCs with I/Oboards, man-machine interface PCs and a network system.
Intel-based personal computers are used for the control
PCs. Microsoft Windows95 was chosen as the OS of theDCPCs, because 1) it works with a small resourcePC(486CPU with 8 MB RAM), 2) the I/O board is directly
accessed from Windows95 application, 3) the built-in
TCP/IP protocol is ready-to-use, and 4) it is commonlyused and many excellent applications and developmenttools are available with low-prices. Both Microsoft
Windows NT and Windows95 are running on MMPCs.
Client/server-type applications written with Borland Delphi
has been developed to control the ring. Each I/O board
equipped on the DCPC has an individual server application
with the Winsock procedure to deliver the I/O data throughthe TCP/IP protocol. Client applications, which interface tooperators, run on any MMPC connected to the networkwith the TCP/IP. Figure 1 shows a schematic view of thesystem. Several sub-systems, shown as dotted lines andboxes in the figure (the beam transport, the injection
system and timing system) are still isolated from thenetwork and are wired with cables. These sub-systems will
be added to the network system in near future.
3.2 DCPC and MMPC
Conventional I/O boards interface to the control devices.
If the system manages a small number of control devices, asystem constructed with conventional I/O boards is cheaper
than that with a standard bus (CAMAC or VME system).
In addition, the new system has been developed one by one
during the daily operation of the storage ring. Thus, a 16channel 16-bit ADC-card was first installed in the ADCDCPC that monitored the magnet power-supplies of thebending magnet, of the two family quadrupole magnets andof the steering magnets. A special care for the large
switching noise from the power supply was paid for using
the ADC board. The ADC-DCPC is placed apart from thepower supply and the ADC data are smoothed by 500 times.
The latter limits the data acquisition rate of a few Hz that isenough speed for our storage ring. The data acquired by theADC-DCPC is delivered to any MMPCs when they request
the data. Therefore, MMPCs simply display the ADC datataken by the ADC-DCPC and never access any I/O devices
directly. After the magnet monitor sub-system has
succeeded, a DAC sub-system, which controls the main
magnet power supplies, was developed. The control data issent from any MMPCs to the DAC-DCPC consisting of a
4-channel 16-bit DAC-card and of two 8-channel 12-bit
DAC-cards. Then, the BPM sub-system was added to thesystem. A GPIB card on the BPM-DCPC also acquires thedata from beam position monitor (BPM)[4]. The RF-DCPC
consisting of 12-bit ADC-card and of 12-bit DAC-card has
been installed in the system. The ADC reads the RFparameters, i.e. the temperature, the strength of the electricfield in the RF-cavity and so on. An operational energy ofthe ring that is monitored by the ADC-DCPC is referred via

network communication to provide an optimized RF power
fed into the cavity. The 12-bit DAC controls the output
power of the RF amplifier.
Operator

MMPC

DCPC

MMPC application

DCPC application

Windows

TCP/IP

TCP/IP

I/O Board

I/O

ControlServerand aBoard
Manager
DevicetheFig.2 BlockGUIdiagram Clientof the MMPC
DCPC. Ovals
show
Windows95/NT
Windows95
data-flow in the system.

Figure 2 shows a block diagram of a DCPC and a MMPC.
3.3 Applications
The DCPC application consists of an I/O board manager
and of a Winsock server. The TCP/IP protocol is used forthe network protocol and each server application in thesame DCPC has a different IP port, because each I/O board
has an individual server application. Such a tiny server
application is easily developed, maintained and updated.
Moreover, the system consists of several individual
applications and has a great flexibility like the LEGO-block
system[5]. Furthermore, if the number of DCPC isincreased to disperse the I/O board, the total power of thesystem is increased without changing the application andthe system. Of course, the network speed limits the system
ability. Borland Delphi has been used to develop theseapplications, because it produces fast application with shortprogramming time. Moreover, Delphi has a smart databaseback-end (Paradox system). An in-line assembler has beenused for the I/O board manager. A GPIB routine wassupplied from the board manufacture in a DLL[6], which isalso easy to handle within Delphi. The Delphi add-on
component, Sockv3[7], has been used for the Winsockfunctions. The user interface applications running on theMMPCs work as clients. These clients display DCPC dataand interface to the operators via Windows GUI. Figure 3
shows the DAC-DCPC application and the corresponding
MMPC application. Since several magnets are
simultaneously changed at the ramping of the ring, theDAC-client application has three Winsock-connections tocommunicate with three Winsock servers, the 16-bit DAC
and the two 12-bit DACs. This operation is called'Synchronized mode' and the DAC-MMPC application hasa check-box to switch the operational mode.
The TCP/IP communication-rate is one-Hz in the case of
the DACs and two-Hz for the ADCs. The network load issmall because of few k-bps data-traffic on the 10 M-bps
Ethernet line. Since this Ethernet line is multi-purpose line,
many items of information of Intranet and Internet also run
on the same line. However, the control system has never
met any trouble on the network traffic. Moreover, theEthernet line will be upgraded to the 100 M-bps in nearfuture. The network system is protected from the outside of
the institute by using DELEGATE[8], but not from theinside. To avoid any accidental access to the controlsystem, a password is put on the beginning of the data
communication between DCPCs and MMPCs. No trouble
originated from the accidental access has been reported.

A database sub-system has been developed for watching
the status of the ring and for helping the daily operation.
The Paradox database is used for this system, because

Fig. 4 A snapshot of an application for displaying the database
items. The top graph in the application displays the vacuum of thering and the stored current; the bottom graph displays the magnetic
field of the main bending-magnet and the lifetime of the beam.

4 Conclusion and future planA PC-based control system has been developed in thestorage ring TERAS. The system consists of dataacquisition PCs, man-machine interface PCs, and anetwork system. Conventional I/O boards are used forinterfacing to the control devices. The total cost of theDAC-DCPC subsystem, that is the most expensive PC in
our system, was below $5,000. We will add the beamtransport sub-system, the injection sub-system and timing
sub-system to the system to realize a fully computer
controlled ring. A Web server method is planned for theDCPC applications and the database access, becausebrowsers that run on all kind of computers are used for theMMPC applications to reduce the development time and toprovide a multi-platform system. Moreover, the web serverthat accesses to the database table helps the outside users tomonitor the status of the ring. This work is supported by
the Science and Technology Agency of Japan.
Fig. 3 Snapshots of the DAC-DCPC application (upper) and thecorresponding MMPC application (bottom). The check box labeled
as ‘Synchronizer’ is a switch for the 'Synchronized mode'
operation of the ring for the ramping.

Delphi smoothly handles the Paradox data. This databasestores the magnet parameters, the BPM data, the RFparameters, and the vacuum condition. These values areserved by the Winsock servers in the DCPCs. Figure 4
shows an application for displaying the database items. The
top graph in the application displays the vacuum of the ringand the stored current; the bottom graph displays themagnetic field of the main bending-magnet and the lifetimeof the beam. The last item can be selected with the radiobuttons on the application. The database table is quickly
looked up by the Borland Database Desktop utility. The
data acquisition interval of this database system is 3
minutes and the record number of the database is about
14,000 records (4 MB for a file size) for a month.

References[1]many papers for examples, S.Magyary: Proceedings ofthe 1993 Particle Accelerator Conference, Vol.3(1993)
1811;CJ.Vincent et al.: IEEE Trans. Nucl. Sci., Vol-43
No.1(1996)30; Proceedings of the PCAPAC at DESY
(1996).
[2]R.Suzuki et al.:TELL-TERAS Activity Report
1987~1990(1990)63.
[3]H.Ohgaki et al.:Proceedings of the 17th Linear
Accelerator Meeting in Japan,(1992)192.
[4]Proceedings of the 8th Symp. On Acc. Sci. and Tech,(1991) 311.
[5]LEGO, a famous toy-manufacture.
[6]Distributed by National Instruments Corp.
[7]Free add-on component written by G.T.Desrosiers.
[8]Free fire-wall program developed by Y.Sato.