NSLS Beamline Control and Data Acquisition Computer-System Upgrade
Shuchen Kate Feng, and D. Peter Siddons
National Synchrotron Light SourceJohn Skinner and Robert M. Sweet
Biology Department
Brookhaven National Laboratory, Upton, NY 11973, USAThe NSLS beamline computer systems have gone through two major updates: (1) a graphical user interface(GUI) was incorporated into the original beamline-control and data-acquisition program ACE to form the new composite program GrACE, and (2) we updated device drivers to run GrACE on a Pentium PC running the UNIX-likeoperating system LINUX. With a proper PC CMOS setup and a PCI local-bus graphics card, the LINUX X server ona Pentium is dramatically accelerated to run GUI applications. With in-house-designed CAMAC and MCA device
drivers and a public-domain GPIB device driver, we can run the original beamline-control and data-acquisition program without changing the computer-interface hardware. The updates produce powerful, low-cost, flexible, and userfriendly computer systems.

1. Introduction
The original NSLS beamline-control and data-acquisition program ACE [1] had enough functions to serve
its purpose. However, we recognized that a graphical user interface on top of ACE is necessary to provide a friendlier
user interface. GUI applications had tremendously negative impact on program execution speed due to the poorarchitecture of the software and hardware of the original 486 PC-UNIX platform[2]. LINUX [3] supports a wide
range of software, from X-windows to the GNU C/C++ compiler to TCP/IP. It’s a versatile, bona fide implementation of UNIX, freely distributed by the terms of GNU General Public License. After Intel marketed the Pentium,
some developers wrote device drivers for PCI local-bus graphics cards to take the advantage of the local bus systemcapable of moving 32 bits of data at 33 MHz which accelerates GUI applications dramatically. We updated the original system with low-cost computer systems and in-house-designed software to achieve powerful, reliable, and userfriendly computer systems.

2. Hardware configuration
The PCI local bus greatly improves I/O performance, especially graphics. The PCI bus can transfer data
between the processor and the peripherals at up to 132 MB/s, far faster than the ISA bus rate of 5 MB/s. A full-featured PCI-compliant VGA card, with at least 1 to 2 MB of video RAM, will accelerate graphics performance further.
We bought several 66MHz, 100MHz, and 120MHz Pentium P5 [4] computers, each equipped with a PCI EIDE harddisk controller, thirty-two megabytes of RAM, a 256 kB cache, an ATI MACH 64 with 2MB of VRAM, and a 1GB
hard disk drive. We chose PCI local-bus Ethernet cards [5] for network communication.

Table 1 and table 2 shows the CPU and system benchmark among various computer systems we studied during evaluation. We only compared systems under $12K in price and picked the best values.

TABLE 1. CPU benchmarks [6]Pentium
66MHZ

Pentium
120MHZ

HP 715/50

HP 715/80

SUN/SPARC/20/50

SUN/SPARC/20/61

Cache size

256 KB

512 KB

256 KB

256 KB

256 KB

256 KB

SPECint92

78.0

133.7

49.2

83.5

69.2

88.9

SPECfp92

63.3

99.5

78.8

120.9

78.3

102.8

TABLE 2. System performance using BYTE Benchmarks [7]Pentium P5

Pentium P5

Pentium P5

Sun Sparc 10

KernelLINUX 1.2.8

LINUX 1.2.8

LINUX 1.2.8

SUN OS

Clock

90 MHZ

100 MHZ

100 MHZ

50 MHZ

Hard disk controller

EIDE

PCI EIDE

PCI SCSI-II

RAM

32 MB

16 MB32 MB

128 MB

Average Index

6.6

11.6

11.6

7.9

The system performance was an average index of arithmetic tests, file copy, pipe-based context switching
tests, shell scripts and so on.

3. Software development
Some of the source codes of the following software development is sharable [8]. The user manual for ACE
is on the World Wide Web [9].

3.1 Device driver development
We wrote a device driver for the AT-bus PC004 PC-CAMAC interface card for a 6001/6002 CAMAC crate
controller, available from DSP Inc., and a device driver for the AT-bus PCAII multi-channel analyzer from Nucleus
Inc.
We obtained the GPIB device driver for LINUX from a public domain site [10]. One has to modify the kernel to use DMA if the PC has more than sixteen megabytes of RAM. One could leave the kernel untouched by disabling the DMA manager. On the GPIB board [11] we used, the DMA operation is unimportant when a chunk of data
less than 32 bytes is transferred and most effective when a chunk of data more than 512 bytes is transferred.
In LINUX, theses device drivers can be installed on the fly without modifying the kernel or rebooting thesystem.

3.2 GUI development
We wanted to add a GUI on top of ACE with minimum changes in the original structure of the ACE program. We developed three GUI processes to communicate with ACE through pipes. It not only facilitates debugging

but also preserves flexibility because each process can run independently. Furthermore, this kind of structure will
facilitate further development into a client/server application. Figure 1 shows the current structure of GUI/ACE.

3.2.1 GUI/GrACE process
Figure 2 shows one example of the GUI/GrACE which maintains a scrollable window to print out the original screen message from ACE (on the lower left corner). In addition, it shows the GUI for the motor database editing,align/scan and counting. Another innovative design is to use Tcl/Tk to implement a GUI builder to build a user’s own
macro definitions. GrACE sends strings of commands to the ACE server whenever users click on a GUI as if thosecommands were typed out by them[12]. The Builder Xcessory[13] was used to build the GUI.

3.2.2 GUI/MCA and GUI/PLOT processes
Figure 3 shows one example of the GUI/MCA and GUI/PLOT called by ACE during a scan. Both processes, capable of running alone, will display the X and Y positions of the cursor in the plotting window interactively.
Initially, the Builder Xcessory was used to layout the GUI. Thereafter, a plotting and user-interface library using
Motif and X-windows graphics were written in-house to develop GUI processes.

4. Discussion
To integrate the LINUX OS on a Pentium PC demands skillful system administration. Although it is notquite well supported commercially[14], we can fulfill most beamline applications to achieve a powerful and userfriendly computer system.

Acknowledgments
This work was supported by the U.S. Department of Energy under Contract DE-AC02-76CH00016 with
Associated Universities, Inc.

Figure 2: GUI/ GrACE calls ACE server

Figure 3: GUI/MCA and GUI/PLOT called by ACE during a scanReferences[1] S. Kate Feng et al., “NSLS Beam Line Data Acquisition and Analysis Computer System”. Nuclear Instrumentsand Methods in Physics Research A347 (1994) 603-606.
[2] INTERACTIVE UNIX, available from SunSoft, (800) 227-9227.
[3] Anonymous FTP sunsite.unc.edu:/pub/Linux/distributions, ftp.linux.org:/pub/mirrors/sunsite or other mirror sites.
[4] Gateway 2000 Pentium P5, available from Gateway 2000, North Sioux City, SD, USA.
[5] SMC8432BT ether power PCI ethernet adapter, available from SMC distributor.
[6] Pentium benchmark was obtained from http://web.jf.intel.com/procs/perf/bench/spec.html, HP benchmark wasobtained from HP9000 Series 700 Configuration Guide, SUN benchmark was obtained from anonymous FTP
ftp.nosc.mil in /pub/aburto.
[7] obtained from http://www.silkroad.com/linux-bm.html.
[8] sharable form anonymous FTP ftp.nsls.bnl.gov in /nsls/pub/beamline.

[9] http://lspc6.nsls.bnl.gov/~giles/man/man.html.
[10] obtained from anonymous FTP enif.astro.indiana.edu in /pub/linux/LINUX-LAB/IEEE488.
[11] AT-GPIB/TNT controller, available form National Instruments, U.S.A., (800) 433-3488.
[12] “Development of a GUI for an Existing Command-line Driven Program”, J.M. Skinner, J.W. Pflugrath, and R.M.
Sweet, Proceedings of SHARE 80, Winter Meeting, San Francisco, California.
[13] Builder Xcessory, Integrated Computer Soluations Incorporated, U.S.A., (617) 621-0060.
[14] S.K. Feng et al., “Application of a TMS320C31 chip for DSP/Embedded System”, these proceedings.