LINUX/PCI: THE ESRF BEAMLINE CONTROL SYSTEM MODERNISATION A. Homs-Purón, D. Beltrán, A. Beteva, M. C. Domínguez, P. Fajardo, A. Götz, J. Klora, E. Papillon, M. Pérez, V. Rey, ESRF, BP 220, F-38043 Grenoble Cedex, France Abstract The ESRF control system was developed more than 10 years ago, using VME Motorola 68000 CPUs with OS/9, connected to control HP/Sun workstations (WS) through TACO. Needs of faster experiments and change to sup- ported hardware require the modernisation of beamline (BL) control. Industrial PCs with Pentium III CPUs run- ning Linux have been chosen as main control PCI crates. Support of current VME instrumentation is ensured through PCI/VME bus couplers; cPCI crates can also be controlled by PCI/cPCI bus extenders. TACO/TANGO is used to export the instrumentation control through the network. This system is very flexible in terms of configu- rations; it can control a simple BL from a single PC, and it can fit more complex experiments with dedicated PCI/cPCI crates controlled by a client WS. Fast acquisi- tions are implemented with a soft real time, kernel-based mechanism called Hook, which allows simultaneous read- ing of PCI, cPCI and VME cards. SPEC is used as main control application, now featuring a server mode that al- lows PyQt GUIs to easily access the hardware from a higher level. INTRODUCTION The ESRF beamline (BL) control system is based on VME Motorola 68000 (M68K) CPUs running OS/9, con- trolled by HP/Sun workstations through TACO, a net- work-based client/server environment developed in-house for the machine control. Such a system, based on the state-of-the-art technology more than ten years ago, needs to be upgraded to fulfil the demand of much faster ex- periments and the integration of modern hardware. HARDWARE IMPLEMENTATION The evolution of the BL control system includes the upgrade of both the hardware and software architectures. Industrial PCs, featuring high performance Intel x86 workstations, have been chosen as the main control plat- form due to their strong support and the high availability on the market of PCI-based devices. This environment provides very interesting cost/performance ratios. The compatibility with the current instrumentation is ensured through the use of commercial PCI/VME bus couplers, allowing the smooth introduction of the system into the BLs. The fiber optic link of up to 35 m long used by these bus couplers permits the control of distributed crates. This, together with the possibility of controlling several crates from the same PC, simplifies its introduction in the BLs and reduces the costs of the transition. The system also supports the industrial cPCI platform, either as stand alone systems or as slave crates of the PCI workstations by means of PCI/cPCI bus extenders. One of the more important features of this architecture is its flexibility: it does not require the network for simple and time-critical applications, and, at the same time it supports distributed system for more complex configura- tions. SOFTWARE STRUCTURE Operating system and drivers Linux has been selected as the control operating system because it is stable, open and free. It offers a strong de- veloping community and a growing number of companies supporting it, resulting in an increasing amount of hard- ware that it can control. In addition, the software mainte- nance is simplified because of the unification to the other UNIX control operating systems at the ESRF. The Linux drivers of the VME boards offer, in general, more functionality than the obsolete OS/9 implementa- tion, and they can deal with a disconnection of the VME crate, allowing easy hardware maintenance. This is done through a common interface, developed to keep transpar- ent the real mechanism to access the VME bus [1]. As a result, the same driver codes works for Intel x86 with bus coupler, M68K VME and PPC VME; the porting to Intel x86 VME is in progress. Driver configuration and start-up tools notably simplify installation and maintenance. A GUI-based application manages the PCI, cPCI and VME devices, including bus couplers/extenders. For PCI/cPCI, the system keeps track of the slots on which the cards are connected, based on a database of known crates and back-planes. This mecha- nism overcomes the problem associated to PCI board enumeration, which causes the identification number of board to change when another of the same type is added/removed in a slot closer to the PCI host. In the case of VME bus couplers, this changes the crate number; in cPCI bus extenders it changes the sub-bus enumeration. Middleware The next layer in the software architecture is TACO/TANGO, which basically exports the hardware functionality over the network, and at the same time, en- capsulates the device in an intelligent remote object. It’s implemented through device servers, originally developed in Object In C (OS/9), and later ported to C++. A new TACO framework that exploits the C++ capabilities pro- vides a higher device abstraction and a uniform interface for developers, including high throughput debug, start- up/clean-up, compound (complex) devices, etc. For in- stance, all VME devices inherit the functionality for Proceedings of ICALEPCS2003, Gyeongju, Korea 172