Data Acquisition System with Database at the SPring-8 Storage Ring
A. Taketani, T. Fukui, K. Kobayashi, T. Masuda, R. Tanaka, T. Wada, and A. Yamashita
SPring-8, Kamigori, Ako-gun, Hyogo 678-12, JapanAbstract
The SPring-8 storage ring control system has two kindsof access to the machine components, that is, an interactive
operation and a periodic reading/monitoring operation.
This paper describes the later. The machine status areperiodically taken by processes on VME CPU(named thepoller) and stored into shared memory.
Aprocess(collector client) running on the operator consoles
cyclically collects the latest data set through its server
process(named the collector server) running on the VME
system. The collected data sets are sent to the on-line
database by the collector client. Most of the machine status
are updated every 5seconds. Many processes on theoperator consoles can get current status of the machinefrom the on-line database without requiring direct access tothe machine components. This data acquisition systemprovides good performance monitoring hundreds ofdevices without placing significant load on the VME CPUand network traffic.

access with the device abstraction concept. The poller isdeveloped with the same framework and function set asthat of the EM. The interactively working EM receives thecommands through the network with the remote procedure

1 Overview
In the SPring-8 storage ring control, there are two ways
to access machine components. One is an interactive
read/write access and the other is cyclic reading to monitor
machine status. During interactive access, the control
command is issued by the operator workstations in thecentral control room and sent to the Equipment
Managers(EM)[1] running on the VME CPUs through theAccess Servers(AS)[2]. The EM manipulates the machinecomponents and the results of operation are sent back to
the workstations. Thia roundtrip takes 10msec for eachcommand typically. This interactive access is suitable forreal-time access to a small number of the machinecomponents. On the other hand, cyclic data acquisition ismore efficient when a large number of signals must becommunicated.
The cyclic data acquisition system consists of threemajor parts: the poller processes, the collector servers (CS)and the collector clients(CC) (see Figure 1).
The poller processes on the VME CPU boards reads theequipments status from the I/O modules sequentially andstores it into a shared memory. With assistance from thecollector server process on the VME system, the collector
clients running on the operator workstations collect shareddata memory and store it into the database[3]. The list ofequipment status to be monitored is managed by theparameter database and downloaded to the appropriate
process.
2 Poller
We have developed the EM to support an interactive

call(RPC), on the other hand, the poller is a process to callthe EM locally.
Figure 1. Schematic diagram of the poller/collector dataacqusition system.
Several number of pollers are able to exist according to
its cycling speed. Ordinarily we use two pollers at themaximum, that is, the fast poller and the slow poller. It isconvenient with the different access speed because theVME system has both of slow access components such as
GP-IB controlled DVM and fast components. The pollers
are installed on the CPU either fast poller only or both fastand slow pollers according to the VME board
configuration.
2.1 Poller/Collector Management File
The poller stores the command list to be carried out inthe local memory space. At the initialization of the process,these commands are loaded from the Poller/Collector
Management File(PCMF) which is generated from thedatabase. Since the operating system of VME CPU(HP-RT)
can not access the database directly, the PCMF is used to
get the informations on the database. An example of thePCMF is shown in Table 1.
The PCMF is generated for each VME CPU and it has
the informations as follows:lthe CS name communicated with the CC,lthe poller name forked by the CS,ll

the cycle of the poller,
the signal names to be taken and the correspondingcommands.
As can be shown in Table 1, two poller processes areforked from the CS named "srrfcavbcs". One poller named"srrfscavbpl1" takes 2 signals with 1sec period, and thepoller named "srrfscavbpl2" gets only one signal with
60sec period.

st/pc_po_main,serverid=7</poller><signal>id=20144,pollerid=7,type=int,kind=2,signame=sr_rf_circulator_tcu_b/alarm</signal><signal>id=20145,pollerid=7,type=float,kind=1,signame=sr_rf_cir
culator_tcu_b/current</signal><poller>id=20,cycle=60.0,name=srrfscavbpl2,table=/prj/bin/rfscav_b/poller_slow/config.tbl,ringsize=10,exec=/prj/bin/rfscav_b/polle
r_slow/pc_po_main,serverid=7</poller><signal>id=20088,pollerid=20,type=float,kind=1,signame=sr_rf_c
av_body_1_b/temp</signal>

2.2 Polling Procedures===========================================The poller refers the loaded command lists, gets theabstracted commands, and calls the corresponding EM
functions sequentially in order to get the equipment status.
One polling sequence is defined as the sequential executionof all commands in the lists. The poller repeats the polling
sequence in the cycle time given by the PCMF. The
definition of the cycle time is the period between the startof the first polling sequence and that of the next one. Whenthe consumed time is less than the given cycle time, theprocess sleeps up to the next data taking time. Otherwise
the poller starts its data taking immediately.
The status data is stored into the shared memory which
can be accessed by the collector server. The sharedmemory forms ring buffer structure, that is, the newest data
set is overwritten onto the oldest one.
2.3 Priority Control
Generally the periodic machine monitoring should not beprior to the interactive control from the operator consoles.
On the other hand, in cases of device access with locking
mechanism, the poller priority must be same as that of theinteractive EM in order to avoid the dead lock. The poller
can change its running priority with the feature of real-time
operating system.
After the poller starts running, its priority is dynamicallychanged to be lower than that of the interactive EM byitself. When the poller accesses the device with lock, itchanges the priority to be higher same as the interactive
EM. After the access, the poller unlocks the device anddegrades its priority.
For example, during changing the hundreds of themagnet current via the EM, the poller on the same CPUruns with slower speed.
2.4 Checking the Poller Status
It is important for the process surveillance to check
whether the process is running or not. The status of thepoller is checked whether the stored data in the sharedmemory is updated or not. In data taking sequence, thepoller gets the HP-RT system time and sets the time stampin the shared memory as the one of the status.
Table 1. An example of the poller/collector management
file(PCMF).
===========================================<collectorserver>id=7,name=srrfscavbcs</collectorserver><poller>id=7,cycle=1.0,name=srrfscavbpl1,table=/prj/bin/rfscav_b/poller_fast/config.tbl,ringsize=10,exec=/prj/bin/rfscav_b/poller_fa

3 Collector server and client
The machine status is taken and stored into the sharedmemory in the VME CPUs. The CC running on theoperator workstations periodically ask the CS on the VME
CPU to get the latest data set on the shared memory.
The CC sends the data to the on-line database throughthe database libraries. The cycle time of storing thecollected data to the database is defined in the parameter
database. The CC reads this cycle from the parameter
database directly at its initialization step. The CC also
reads informations such as the CS name, host name of theCS to be connected, the number of signals to be taken andso on.
Once the data is stored into the on-line database, they
can be shared among many processes running on operator
consoles without direct machine component accessbothering the interactive control.
One CC can make multiple connections to the CSs. We
make groups such as RF, magnet, vacuum, beam
monitoring, and safety in order to realize independent
operation of different groups. Each equipment group has
one CC and several CSs.
Since the size of the data is depend on the machine
configuration, the variable length data format is adopted forthe data transfer from the CS to the CC.
3.1 Shared Memory Dump Utility
As already mentioned, the poller has a ring buffer. There
are several data sets with different time stamp on theshared memory. It is useful to have an utility to dump theall ring buffer contents into a file. This utility is performedby sending the command to the CC then the corresponding
CS dumps the all data on the shared memory to thespecified file through the NFS. If the size of the sharedmemory is large enough, the dumped data can be used toinvestigate the source of the machine troubles in the offline analysis.
4 Conclusion
The SPring-8 storage ring control system has beensucceeded to operate with the poller/collector dataacquisition system since March 1997 without major failure.
Most of the machine status are stored into the on-line
database in every 5 seconds. These data can be accessed byany processes on the operator consoles. Thepoller/collector data acquisition system provides good

performance to monitor more than hundreds of equipmentswith the minimum load of VME CPUs and network traffic.
Currently poller/collector system is also installed to thebeamline control. The data from the insertion device
system such as the gap position, beam position monitors,
current of corrector magnets are stored onto the machine
database successfully.
References[1] A.Taketani et al., Proc. of ICALEPCS'95, Chicago,USA, 1995, p. 625.
[2] T.Fukui et al., "Design and the network system for thestorage ring control at SPring-8", these Proceedings,
ICALEPCS '97, Beijin, China, 1997.
[3] A.Yamashita et al., "The database system for theSPring-8 storage ring control", these Proceedings,
ICALEPCS'97, Beijin, China, 1997.