Application of a Simple Text Format
as a Device Configuration FileTatsuro T. Nakamura, KEK, Tsukuba, Ibaraki, JapanOverview
In the KEKB magnet control system, relational database management system (RDBMS) has been used for the management of the device configuration. Most ofthe device parameters, such as address of the interfaces, constant parameters of the magnet power supplies, excitation functions of the magnets, limit values forthe operation, etc. are stored in the RDBMS. These parameters are used mainly for the macro expansion to generate the runtime EPICS database files. They arealso used to configure the higher level application programs. Although this system is flexible, it is heavy to maintain with little man power in the KEKB control group.
To reduce the maintenance cost, restructuring of this system is planned. The plan consists of two major changes. One is the reducing data and making data
structure simpler. Another is the replacing tools with simpler ones. As the part of the restructuring, the replacement of the RDBMS with simple configuration files isplanned. The configuration file has simple text format, which is designed easy to read and easy to modify only using text editor. The design of the format and thedevelopment of the tools have been almost completed. Its application to the KEKB magnet control system is also in progress.

(1) About KEKB Control System(4) Restructuring Plan

(6) Format of the TXDB file

KEKB is an asymmetric electron-positron collider
at 8 × 3.5 GeV/c for B-meson physics.

Restructuring plan consists of 2 major changes.

The basic structure:

KEKB started in operation in Dec.1998.
KEKB accelerator control system:
EPICS-based• Reduce data and make data structure simpler•The TXDB file consists of a set of records.

• Replace Oracle with simple configuration files•The record is described in one line of the file.

The new configuration file called “TXDB” has beendeveloped.
TXDB is a text file and has very simple format.

More than 100 VME/VxWorks computers as IOC
Several workstations of 4 kinds of platform
PA-RISC/HP-UX,
PC-AT/Linux,

Alpha/OSF1,
Macintosh/OSX

Scripting language SAD and Python are intensively
used for the higher level applications.

Oracletables
SQL

Parameter generation
PL/SQL scripts

templatedb

RDBMS interface
rdbtool moduleUsers

runtimedb

Generation process is described in PL/SQL, which isthe extended SQL by Oracle Corporation.

Python applications can access to the RDBMS
using “rdbtool” library module.
•It can handle tabular data on memory.

The maintenance difficulty arises for these years.
Unexpected modifications have been
accumulated both in data and PL/SQL scripts.

a) Basic format
name=QF

loc=D08 port=11 SN=L15-001 table=MagnetPS

name=QD

loc=D08 port=12 SN=L03-002 table=MagnetPS

name=QC1 loc=D08 port=13 SN=S07-012 table=MagnetPS bp=Yes
name=QR1 loc=D11 port=26 SN=S21-103 table=MagnetPS
name=QR2 loc=D11 port=27 SN=S21-118 table=MagnetPS limit=380
name=QR3 loc=D11 port=28 SN=S21-073 table=MagnetPS

name=QF

port=11 SN=L15-001

name=QD

port=12 SN=L03-002

block

name=QC1 port=13 SN=S07-012 bp=Yes
name=QC2 port=14 SN=S08-015

TXDB
files
Text
EditorParameter generation
Python script

txdb module

Users%block loc=D11 table=MagnetPS

dbprm
templatedbdbLoadTemplate
Application(Python)

name=QR1 port=26 SN=S21-103
name=QR2 port=27 SN=S21-118 limit=380runtimedb•It has simple interface to the RDBMS to retrieve data.

(3) Maintenance Difficulty

Following 3 examples are equivalent.

%block loc=D08 table=MagnetPS

Oracle has been used as RDBMS.

Major usage is the automatic generation of theEPICS runtime database.

The TXDB allows some compact notations.

b) Block notation --- compact

The data management system based on theRDBMS has been developed.
The magnet control system intensively use theRDBMS.

•Each field is identified by name (field name) anddescribed with the form name=value.

name=QC2 loc=D08 port=14 SN=S08-015 table=MagnetPS

dbLoadTemplate
Application(Python)(2) Oracle RDBMS in KEKBdbprm•Each record consists of a set of fields.

block

name=QR3 port=28 SN=S21-073

c) Column list notation --- more compact%columns

name%block

loc=D08port

QF

11

L15-001

QD

12L03-002

QC1

13

S07-012QC214SN

table=MagnetPS

field names
field values

bp=Yes

S08-015(5) Design Features of the TXDB%block

loc=D11

QR126S21-103

The format of the TXDB is designed with thefollowing guidelines.

QR227

S21-118

QR328

S21-073

table=MagnetPS
limit=380

Simple syntax
Compact notation(7) TXDB and Python

The wiring database is too complex tounderstand the whole structure.

Human-friendly and good readability
User can directly edit the files with a text editor.

Python applications can handle the TXDB format
files using “txdb” library module.

Version up of Oracle is complicated task.
Careful test are necessary to keep compatibility.

Not necessary to be so general but rather
special purpose for the device configuration

The txdb module is designed being similar to therdbtool module.

The man power of the control group decreases
Æ Restructuring is planned.

Therefore porting from the rdbtool to the txdb isexpected to be easy.