Proceedings of ICALEPCS2003, Gyeongju, Korea

THE OPERATION LOGBOOK SYSTEM AT KEKB LINAC AND RING
S.Kusano, M.Tanaka
Mitsubishi Electric System & Service Co., Ltd., Tsukuba, Ibaraki, 305-0045, Japan
K.Furukawa, N.Kamikubota, M.Satoh, N.Yamamoto
High Energy Accelerator Research Organization (KEK), Tsukuba, Ibaraki, 305-0801, Japan
Abstract
The operation logbook system of KEKB linac and ringhas been developed and operated with the relational
database composed of MS-SQL and MS-Access on PCs.
The operator interface to the system is provided throughthe Web or MS-Access with Visual Basic. The operationof the logbook system started in 1995 at the linac. It wasalso introduced to KEKB ring and PF-AR in 2002 with alittle restructuring. Operators put accelerator information
through MS-Access in Japanese language. The accelerator
status record is stored automatically through the control
system when it changes. The number of such logging
items per day is about 500. With introduction of thissystem, accelerator experts can monitor real-time
information anytime, anywhere through a web browser.
And they often find and resolve problems remotely fromoffices or homes.

INTRODUCTION
In the KEKB linac, we have used PCs introducing DOS
PC as an operator console from the end of the 80s. In
1996, the DOS-based console system was replaced with
Windows system [1]. The following points werepreferable for us: a) enhanced capability of multi-byte
code (Japanese characters) handling, b) gooddevelopment environment of graphical application, and c)
low cost.
Before 1995, the operation logbook was recorded withhandwrite by operators. With this method, it was difficult
to reuse and search the past data. In order to improve suchsituation, we have developed database of the accelerator
operation log (the operation logbook system) using
Windows PC and relational database (MS-SQL/MSACCESS) [2]. Recently, the Internet become popular, andalso it becomes more requests such that the accelerator
experts like to see the operation logbook through the webbrowser. To realize the requests, a web interface has beendeveloped in 2000.
In the KEKB ring and PF-AR, the logbooks wererecorded by handwriting. As reusing the logged data wasdifficult, the logbook system of KEKB linac wasembedded into KEKB ring and PF-AR.

THE CONTROL SYSTEM OF KEKB
LINAC AND RING
The control system of KEKB linac is composed of threeclasses, the server class with 5 Unix servers (HP Tru64
Unix), the subsystem class with various front-end (27VME, about 140 PLC, 11 CAMAC), and operator
430

interface class with the console system, the touch panel,
X-terminal, etc [3]. In order to control the accelerator, theserver program is prepared for each device type and ahomemade RPC (Remote Procedure Call) is used for
KEKB linac communication between the clients andservers.
The control system of KEKB ring is based on EPICS
tool kit, which is developed in an international
collaboration. EPICS is composed of two classes, theoperator interface class with several Unix servers (HPTru64 Unix and HP HP-UX) and subsystem class with theabout 100 VME computers. Script language ofSAD/Tkinter and Python/Tkinter are mainly used for theaccelerator control.

OPERATION LOGBOOK SYSTEM
The configuration of Console System
The operator console system of KEKB linac and ringconsist of 3 server PCs (Windows2000 Server) and 8console PCs (Windows2000 Pro), which communicate
each other via Microsoft Network (Fig 1). The operation
console system communicates with the KEKB linac
control system through the Gateway PC. Each PC
communicates with the Gateway PC using OLE, and theGateway PC communicates with each device server
program on Unix server (control system) via RPC. Thechange the accelerator is also distributed in UDP/IP toeach PC through Gateway PC.

Linac Control Systemdevelop
PC
PC

MSSQL

Gateway PC

PC
PC
PC
PC

PC
PC
PC
PC

Linac Control

KEKB Control

Fig.1: Configuration of console system

Proceedings of ICALEPCS2003, Gyeongju, Korea

Operator Interface
MS-ACCESS was introduced as an operator interface,because of easy management database (MS-SQL) anddevelopment of the user interface and Windows affinity.
MS-ACCESS is a front-end, and it decreases the CPU
load of MS-SQL. The console PC and MS-SQL areconnected by ODBC, and an operator can enter thecurrent status of accelerator in Japanese (Fig 2). Data size
was about 60MB per year from 1995 to 1998 (including
the evaluation period). In this period, accelerator
operation time was short because of the construction ofKEKB ring and the upgrade of KEKB linac. After 1999,
the injection into KEKB ring started and the data size isincreasing year by year (Fig 3). In Fig3, 03 denotes fromJanuary to June in 2003. The number of records became
101,950 during six months.

(Apache), which provides the Internet with information, isconnected to KEK laboratory network and the network
for KEKB linac control. Since the direct datacommunications were difficult between a Unix server andMS-SQL server, we prepared an application (Web Log) inthe middle. The Web Log acquires data from MS-SQL
every 5 minute, and writes into the file on Unix server
through SAMBA [4].
WebServerFileServerMSSQLInternetsamba

5min pollingPC(Web Log)

Console system
Fig.4: Configuration of Web interface

Automation Log
After 1998, the commissioning of KEKB ring became
more active every year and the data logged by operators
had become huge. This forces an operator to input large
amount of data and it became an obstacle in anotherservice of an operator. To solve this problem, we havedeveloped the application (Fig 5), which records theoperational information automatically, for example, beam
on/off, the iterative change of beam and so on. The
information sent through the gateway PC is logged indatabase by an application developed with Visual Basic.

itembyte size

350

Linac Control

300
250
200
150
100

data size(MB)200000180000160000140000120000100000
80000
60000
40000
20000
0StatusGateway PC

50

‚X‚T
‚X‚U‚X‚V
‚X‚W
‚X‚X
‚O‚O
‚O‚P
‚O‚Q
‚O‚Ritems

Fig.2: Operator interface

0MSSQL

year

PC(Auto Log)

Fig.5: Configuration of Automation log

Fig.3: items and data size of operation logbook in
KEKB Linac

Web Interface
The configuration of Web interface in an operation
logbook system is shown in Fig4. The Web Server
431

Because the operation logbook system in KEKB linac
operates very well, this system was installed into KEKB
ring and PF-AR in the summer of 2002. This system
introduced with a very little restructuring (chart structure,operator interface).

Proceedings of ICALEPCS2003, Gyeongju, Korea

Change the database system

DIRECT COMMUNICATION WITH AN
UNIX SERVER
The operation logbook system runs on a closed
Microsoft Network and it cannot communicate directlywith Unix servers, which rule the KEKB linac controlsystem. Another software is required between them and it
is expected that further extension of the function will bedifficult without it. We evaluate the followings to realize
the direct communication.

Extension of existing database system
A direct communication between a Unix server andMS-SQL requires the Tabular DataStream (TDS) protocol
in Unix server (Fig 6). Combination of UnixODBC [5]and FreeTDS [6] was evaluated to enable thecommunication with the existing database system from 2
Unix servers (Tru64, Linux).
Since Tru64 Unix is 64-bit OS, and FreeTDS is notdesigned for 64-bit OS, it was excluded from thecandidate for the evaluation. On Linux, thecommunication is possible without any problems.
However the communication with the operation logbook
system could not work correctly in acquisition of data,
because the operation logbook system uses Japanesecharacters in the table name of the database. To change ofthe table name into English was turned out to be difficult,because many applications ever need to be modified.

Application

Application
Unix

ADO

ODBC

WindowsOLE DB

The present logbook system is used with the text base,so that the image of devices and screen, etc, cannot
display on web browser. To solve this problem, it isnecessary to change MS-Access into another operator
interface, for example, Zope, which can display he images
on web browser like Zope interface [7]. Zope is an open
source, cross platform (Mac OSX, Linux, Widows, etc)
and support database and SQL.

CONCLUSION
We developed the operation logbook system with therelational database composed of MS-SQL and MS-Accesson PCs. With this new system, accelerator experts canmonitor real-time information anytime, anywhere throughthe web browser. Information can often be very helpful
for an accelerator expert, when the machine failure. Inaddition, automation log system makes operator more freefrom input procedures.

[1] K.Furukawa, N.Kamikubota, OHO’02, 2002.
[2] M.Tanaka, et al., Proceedings of the 23rd Linear
Accelerator Meeting in Japan, Tsukuba, Sep.1998.
[3] N.Kamikubota, et al., Proceedings of the 26th Linear
Accelerator Meeting in Japan, Tsukuba, Aug.2001.
[4] http://www.samba.org/[5] http://www.unixodbc.org/[6] http://www.freetds.org/[7] http://www.zope.org/

ODBC
Net Library

Future logbook interface

REFERENCES

FreeTDS
TDS

Conversion of Operation logbook system to a databasesystem on Unix server makes the communication fromeach control system to the database system easy. Oracle
and PostgreSQL are given as database system on Unixserver. Although, Oracle has higher shares in industry andhas high performances, it is very expensive. On the otherside, PostgreSQL is a freeware and has a lot of users. A
stable performance and continuous maintenance can beexpected. The evaluation of communication between
PostgreSQL on Tru64 Unix and a Windows application
went smoothly without any trouble. We are now
considering these two methods further.

TDSMS-SQL
Fig.6: Connect to database432