Virtual Instrument Technology Used in the BEPC Beam Diagnostic System
K. Xue, P. Shi and L. Ma
Institute of High Energy Physics, Chinese Academy of Sciences
P.O.Box 918-10, Beijing 100039, China
xuekw@bepc3.ihep.ac.cn
Abstract
The virtual instrument technology is going to be used inthe BEPC beam diagnostic system using LabVIEW® totake the automatic measurement, the beam parameter
analysis and the dynamic display. In this paper, we will
discuss the implementation of LabVIEW® applications
based on the client/server model via TCP/IP. The
hardware interface to instruments and the softwareinterface to other programs are described. A summary of
integrating virtual instrument technology with the existing
BEPC beam diagnostic system is given.
1 Introduction
The Beijing Electron Positron Collider (BEPC) is amachine designed for high energy physics experiments aswell as synchrotron radiation research. The beamdiagnostic system was built at the same time as BEPC.
The basic hardware of the most important beam parametermeasurement systems are now working. During the nineconsecutive years of operation, BEPC beam diagnosticsystem has become more and more important and has beenhighly beneficial to the success of the accelerator.
Since the operation and data acquisition of some subsystems were done manually, the measurement efficiency
was low. In order to take the measurements more easily
and more efficiently, we have done some upgrading andintroduced the virtual instrument technology into oursystem.

instrument system is an open system based on computers,
it can be connected conveniently to peripheral equipment,
the network and other applications. In such a system, thesoftware acts as the heart of the system while thehardware gives the input and output channels. Thefunctions of the virtual instrument can be designed
flexibly by the software, hence the term ″the software isthe instrument″.
2 System outline
The upgrade program of the BEPC beam diagnosticsystem has been carried out since the beginning of 1995.
In the machine operation from 1996, several computers(PCs) were added to the BEPC beam instrument system.
Those PCs mainly take the device control and also the data
communication[2].
The on-line control computer VAX4500 with theoperator’s console VAX4090 workstation, running underVMS forms a central control room layer of the BEPCstorage ring[3]. The personal computers were added
between the central control room layer and the devices.
They act as the kernel of the communication between theBEPC control system and the beam diagnostic hardware.
The industrial PCs are chosen to take the instrument
control and another high performance PC is used as thedatabase server. Microsoft Windows NT™ is the network
operating system (NOS). Those PCs connect upward withthe control room layer via TCP/IP over the Ethernet, while
they also connect downward with each device via CAMAC
or GPIB interfaces. The measured results can betransmitted through the beam diagnostic system, also to
the central control room layer.
3 Use of the virtual instrument technology
The virtual instrument technology is going to bedelivered in the BEPC beam diagnostic system by using
LabVIEW® at many stages. LabVIEW® is used in themeasurement system in order to take some of the
responsibilities of what the traditional instruments do andalso what the operators do before.
3.1 Client/Server model and database structure

Fig. 1 The basic system of the virtual instrument technology
Figure 1 is a basic virtual instrument system given bythe National Instruments Corporate[1]. The virtual

In the BEPC beam diagnostic system, there are many
devices in different local stations to take different
measurements and also various services, such as thedevice control, the data archiving and the data display.
The applications should access to the services on thenetwork transparently. So the client/server model that isthe most commonly used paradigm in constructing
distributed applications is the natural choice.
There are two database servers in the system, one is thedynamic database server and the other is the historicalarchiving database server.
The dynamic database server is written in Microsoft
Visual C/C++ using the Windows sockets application
program interface (API). That API defines and documents
the use of Windows in conjunction with the Internet
Protocol Suite (generally referred to as TCP/IP). Thus the
dynamic database is in common use. It can respond to therequests from any client on local or remote computers. The
dynamic database stores almost all the important BEPC
machine parameters not only from PCs running on
Microsoft Windows but also from VMS system via TCP/IP
through Ethernet. The data is kept up-to-date.
The historical archiving database server is made ofMicrosoft SQL Server. The Microsoft SQL Server running on Microsoft Windows NT Server is a relational
database management system (RDBMS) based onclient/server model. The historical archiving databaseserver is running all the time. Parameters of various
systems such as the beam diagnostic instrumentation, themagnet power supply, the injection, the vacuum and theaccelerating RF are stored in the database. These usefulmachine parameters are gathered for further querying atanytime.
3.2 Using of LabVIEW®
Compared with other software development environment, LabVIEW® is the language mainly designed forscientists and engineers[4]. In brief it has two advantages:
The first is the characteristics of graphicalprogramming. It is easy to create and modify sophisticateddata acquisition and control systems by the completegraphical programming system rather than using codebased programs in a conventional programming language.
The second, LabVIEW® is an engineering-oriented
development environment. It comes with the hardwareinterface to most instruments, also includes an extensive
analysis library. It is suitable for data acquisition, control,
data analysis, graphics, and data presentation.
Because of the advantages of LabVIEW®, some
applications will be implemented in the BEPC beamdiagnostic system with that software package.
3.3 Beam diagnostic VI
In the BEPC beam instrumentation system, LabVIEW®
applications are called virtual instruments (VIs) and areused as clients. They will take the instruments control, thedata acquisition and the data process. Then the clients will
ask the server to refresh the dynamic database. From theoperators′ point of view, they are facing a group of virtual
instruments that look like traditional ones but more
intelligent, more automatic, and easy to use. Many things
are done by the VIs, while all the necessary parameters

and information are available to the operators.
Since we are the beam diagnostic group of BEPC,
besides providing static and numerical parameters display,
we want to give more intelligent results. We not only want
to show operators the beam parameters but also want toshow operators the information of how to control thequality and the behaviors of the beam. We want to makeour virtual instruments realize the beam diagnostic
functions in a lively style.
The working of establishing the beam diagnostic VIs
can be divided into several steps: The first step is theautomation of instruments control and the data acquisition.
The second step is the data communication between VIs
and the dynamic database. The third step is the dynamicdisplay.
Since some of the device drivers are coming with theLabVIEW® software package, it is easy to control theinstrument and acquire data through the GPIB interface or
the RS232 interface. The beam parameters we want tomeasure with virtual instruments include:• the tunes, measured with the spectrum analyzer model
HP3588A (10Hz to 150MHz);• the transverse beam size, measured with the digital
oscilloscope model HP54610B (500MHz);• the bunch length, measured with the digital multi-metermodel Fluke8520A.
The data communication through the beam control anddiagnostic network is depend on the dynamic database that
we have already used. The virtual instruments can senddata to the dynamic database and also read data from thedatabase. Since various beam parameters can be gathered
to the virtual instruments, different kinds of data analysis
can be performed with that data.
Dynamic Database

Archiving Database

DatabaseSystem

Ethernet TCP/IP
Acquisition

AnalysisPresentation

Transmimssion

VirtualInstrument

Instrument Drivers

GPIB

HardwareSpectrum Analyzer
for Tune Measurement

Oscilloscopefor Beam Size

DVM for
Bunch Length

Fig. 2 The structure of VIs made for beam diagnostic
systemFigure 2 is the structure of those VIs. For each virtual
instrument, it obtains data from the instrument through theGPIB interface and also acquires data from the dynamic
database through the Ethernet via TCP/IP. The on-line
analysis can be done and the dynamic display can beshown with that data. Another kind of data communicationis transmiting the data gathered from the instruments tothe dynamic database. Then the data will be stored in thearchiving database for further querying.
Figure 3 gives the VI for beam size measurement. The
beam size is measured by the synchrotron light withthefront panel. The clear chart button can be used when thechart is confused with too many data points.
4 Summary
The primary virtual instruments for some parametermeasurements have been established by LabVIEW®.
These VIs will be put into operation in the next run. In
these VIs, useful beam parameters can be gathered and theon-line analysis can be done. The VIs can work smoothlywith the existing beam diagnostic system. In the future,
the VIs we have already made will be improved step bystep, and more things will be done with LabVIEW® for theBEPC beam instrumentation system.
Acknowledgments
The authors would like to thank many colleagues
especial for Prof. H.Cheng, who has given us a lot of
useful ideas of using LabVIEW®. We would especiallythank our colleagues in the beam instrumentation group
who contributed to the establishment and the upgrade ofthe beam diagnostic system.

Fig. 3 Beam size measurement virtual instrument
photodioal array. The output waveform is sent to thedigital oscilloscope model HP54610B. The left two
waveforms are the beam size of horizontal (Beam Size_x)
and vertical (Beam Size_y) directions. Some analyses areshown on the right waveform. The vertical axis of thewaveform can be chosen from the Beam Size_x or Beam
Size_y. The horizontal axis can be chosen from the beam
current (DCCT), or the accelerating RF voltages. Thefunction of the beam size vs. DCCT or the RF voltage canbe shown on the screen. The digital control at the bottomof the VI front panel configures the sample period ofHP54610B. Other configurations of HP54610B were fixedby the program. The user can not change them from theReferences[1] National Instruments Corporate, “PC-Based IndustrialAutomation”, 1996

[2] L. Ma et al., “Using PCs in The BEPC Beam
Diagnos-tic
Instrumentation
System”,
ThisProceedings.
[3] J. Zhao et al., “The BEPC Control System Upgrade”,
PAC’95, Dallas, May 1995
[4] W. BLOKLAND, “Integrating the commercial software package LabVIEW with Fermilab’s Accelerator
Control NETwork”.