Development of object-oriented data acquisition system for LHD fusion plasma
experiment using O2 database
Emoto M., NIFS. Toki, Japan, emo@nifs.ac.jp
Kodaira J., NIFS. Toki, Japan, kodaira@nifs.ac.jp
Kojima M., NIFS. Toki, Japan, kojima@lhd.nifs.ac.jp
Komada S., NIFS. Toki, Japan, komada@lhd.nifs.ac.jp
Nakanishi H., NIFS. Toki, Japan, nakanisi@lhd.nifs.ac.jp
Ohsuna M., NIFS. Toki, Japan, ohsuna@lhd.nifs.ac.jp
Sugisaki H., CTS-SP. Nagoya, Japan
Sudo S., NIFS. Toki, Japan, sudo@nifs.ac.jp

Abstract
The data acquisition system using the object-oriented
databases has been newly developed for the LHD fusion
plasma experiment. It is designed entirely to be based on
the object-oriented methods, and its application programsfor the data acquisition and storage are all written in theobject-oriented programming language Visual C++ on
Windows NT. The data management programs consist ofhierarchical class definitions that have the diagnostics, theCAMAC module, and the module channel class. The
lowest channel objects contain the substance of thediagnostic data. As for the data object archiving, theobject-oriented database management server product,
named O2, is applied to each diagnostic acquisition
computer locally. It enables to store and retrieve thewhole data object directly into/from it. For compacting thedata object size and improving the database transaction
throughputs, the archived-channel class is also applied inwhich the raw data block is compressed by GNU-zip
library engine named zlib. Archived-channel objects areheld in the bag objects that are made for each discharge
experiment and each diagnostics. As the data retrieving
user terminal, the data visualisation products IDL or PVWAVE are applied in which the O2 client function can becalled through the Windows NT DLL.

1 INTRODUCTION
At the National Institute for Fusion Science, LHD(Large Helical Device) experiment has begun on 31stMarch 1998. LHD has many diagnostics devices to study
various aspects of the plasma in it, and each of themproduces about from 1.5 to 24 MB data per one plasma
shot. And plasma is discharged each 3 minutes. Then thedata acquisition system must acquire the data from thosediagnostics devices via the optical fibre and store it to thedatabase for immediately view by users in 3 minutes.
Then job for development of the data acquisition system ishuge, and it is necessary to divide job for someprogrammers. For easy job division, the data acquisition
system is designed entirely to be based on the objectoriented methods. The program is written in C++, and O2
database is adopted for its database. Both C++ and O2 areobject-oriented. They make the data acquisition andstorage function be described autonomously and make thesource code more recyclable.
For finishing acquisition and storage in 3 minutes, thedata acquisition system acquires the data, compresses it,and stores it. By compressing it, the system decreases thedata size and the database transaction. Compression needs
a little time, but the system runs in multi-thread, andacquisition, compression and storage are done
concurrently, then total of time does not increased.

2 BASED ON THE OBJECT-ORIENTED
METHODS
The system is designed to be based on the objectoriented methods in order to increase the efficiency fordevelopment.

2.1 Diagnostics Objects
For LHD plasma diagnostics, CAMAC is used.
CAMAC has some modules, and one module has 6channels. By the object-oriented methods, CAMAC
diagnostics, modules and channels are described as
objects in the program of data acquisition system.
Diagnostics object manages whole CAMAC system,
CAMAC module object manages the actual CAMAC
module, and module channel object manages the actual
CAMAC module channel. Like the actual CAMAC
system is hierarchical, the definition of classes ishierarchical. A diagnostics object has some CAMAC
module objects as same as a CAMAC has some modules,
and a CAMAC module object has 6 module channelobjects as same as an actual CAMAC module has 6channels. For the data acquisition, the module channel

object acquires and stores the data of the actual channel
that it correspond to.

2.2 Database Objects
In the database, there are archive shot and archive
channel objects. The archive shot object has someparameters and some archive channel objects. The archive
channel object has some parameters and the diagnostics
data buffer. For data acquisition and storage, the system
makes an archive shot object that has the present shot
number and archive channel objects have same number of
the actual CAMAC channels. The archive channel object
receives data from module channel object, compresses it,
and stores it to it own data buffer. After all data are stored
in archive channel objects, the system stores them withthe archive shot object. When users retrieve data, thesystem refers the archive shot object by the shot numberthat users want to view and transfers archive channel
objects of that archive shot object to user client machines.

3 DATA COMPRESSION
In order to improve the database transaction
throughputs, the system compresses diagnostics data
before stores it. In fact, the archive channel object
compresses and it makes other thread for compression.
Then the system can acquire data consecutively, and datathat has been acquired is compressed concurrently. Inview of these facts, the data acquisition system canacquires and stores data to O2 database in about 40
seconds in case that CAMAC has 10 module (60 channel)
and it produces 15-MB data. Additionally, datacompression is effective to decrease the necessary RAID
disk space and time for data backup.

4 DATA VISUALISATION
For viewing the acquired and stored data, the datavisualisation system is necessary. For it, the datavisualisation products IDL or PV-WAVE is applied inwhich the O2 client function can be called through theWindows DLL. Users can retrieve data by awarding shot
number and channel number to this DLL and view itgraphically by IDL or PV-WAVE. The data acquisition
system can acquire and store data in several ten seconds,
then users can retrieve the newest data of plasma with alittle delay after it is discharged. The data in O2 databaseis compressed, then the DLL uncompresses it after gets it.
Therefor, the size of data running on the network and thetime to transfer the data is reduced. And byuncompressing on the client machine, the load of theserver machine is reduced.

5 GENERAL
By using the object-oriented methods, the dataacquisition system is developed very efficiently. It is

described by hierarchical classes, and they make thesource code of the system self-intelligible andfunctionalized. And by using them, development can bedone in the short term and by limited manpower.
An additional feature of the data acquisition system isthat it stores data to database directly by using O2
database object. It uses the compression method, therefor
the storage space in database occupied by diagnostics data
is reduced and performance of the system and throughputsof network traffic are improved.
For data visualisation, IDL or PV-WAVE is applied,
and it can always view data in the midst of the LHD
experiments. For access to O2 server, the O2 client DLL
is made, then users can retrieve data by only assignation
shot number and channel number.
Current system can acquire and store diagnostics data
in a matter of several ten seconds, such as about 40
seconds for diagnostics device has 10 CAMAC modules.
It is enough performance for current LHD plasmaexperiments.