Instrument Control System Created On the Basis of the X11/OS-9

A.S.Kirilov and J.Heinitz
Frank Laboratory of Neutron Physics, Joint Institute for Nuclear Research,
141980 Dubna, Moscow Region, Russia.

Key words: neutron instrument, control system, remote control, OS-9, X11, spectra visualization.


Nowadays VME-based systems to control neutron measurement instruments are forcing out those built with PC and CAMAC /1/. This replacement makes these systems more powerful, easy to extend, stable, reliable and have modern graphical user interface. One of several possible solutions is presented here. Its main feature is the implementation of the entire system on the VME site on the basis of the X11/OS-9 package. The instrument can be controlled locally or remotely via local network (even from PCs) with a modern-styled graphical user interface.
The first system was maintained at the Neutron Spectrometer of High Resolution (NSHR) /2,3/ at beam 7a of the pulsed reactor IBR-2 of the FLNP JINR in March 1995. A second copy of the system has been used for the newly created texture diffractometer SKAT /2,3/ since April 1997. At the moment the system is transferring to the Multicrystal Inverted Geometry Spectrometer NERA-PR /4/ at beam 7b.
The general requirements for these systems were:
- direct diffractometer management by the VME computer in the experimental hall;
- remote supervising and control possibilities via the local network;
- possibility of running experiments in spite of network failures or switch off;
- modern window-styled graphical user interface;
- spectra visualization during the measurement;
- ease of extending the complex to handle new experimental equipment;
- ease of making changes in the experimental procedure.
Our developing strategy was to create a new complex using the X Window System as the basis.
Our tactics were determined by two main principles:
- to obtain a product ready for use as quickly as possible;
- to use hardware and software facilities which we already had at our disposal.
We started with the following VME-computer configuration:
- CC112 processing board (68030+68882, 20 Mbytes RAM);
- Enp10i (CC126) ethernet node processor;
- CC143 graphics controller (1280x1024, 8 bits) with appropriate monitor, keyboard and mouse;
- hard- and floppy-discs, tape streamer.
The software included:
- OS-9 operating system v.2.4;
- ISP v.1.3;
- X11/OS-9 R4 v1.1 package from CompControl International B.V./5/ ( we use now the X11R6.1 package);
- gcc compiler (we use now v2.6.3).

Main software features

We would like to consider the basic ideas which determine the main features of our software complex:
  • We decided not to split the complex into "interface" and "development" parts. The VME computer is used to control the measurement. Even with the not up-to-date CC112 slow processor board/5/ ( look at the table in the "Operating experience" below) this computer is fast enough to satisfy user requirements. In the future it will be replaced by an E17 /6/ board, which is five time faster. This will make user work more comfortable.
  • The X11/OS-9 package is not only used as a nice user interface but mainly as the whole complex environment. The complex is organized as a community of X-clients (fig.1). Each of these clients completely controls one spectrometer unit, e. g., goniometer, TOF-analyzer, heater or refrigerator.

    Fig.1. Sample layout of the user screen

  • To eliminate routine work to spectrometer control, a measurement procedure called experiment program is provided. This is especially important for texture measurements because it mainly consists of a long sequence of two steps: "sample movement" and "measurement". It is also important if measurement have to be done in a predefined sequence of sample temperature states. This program is in ASCII format and can be easily modified. There is also a special task to interpret this script file and handle various clients and to co-ordinate the work of the other tasks of the complex. The clients usually have two working modes: a "self-controlled" mode to satisfy user who would like to make some actions manually, and an "auto" mode, to be handled by the interpreter. Appendix A contains an example of a measurement program for the NSHR spectrometer.

    Fig.2. Spectra visualization task window

  • There are two ways of running the complex: locally from the graphic facilities and remotely from any workstation or X-terminal connected to a local network. It is essential to note that in case of external running VME local graphics is no longer required. This means that the system can be transferred to any computer without local graphic facilities. On the other hand, having a computer with such facilities, the user can work locally even without a network connection.
  • Special clients are intended to supervise a measurement process from outside. These tasks may be run from any "point" of the local network and have no side effects on the measurement.
    The user can run it, get information about the status of the measurement, can stop it, etc. Several copies of these clients can work simultaneously. One of these tasks is devoted to visualize and perform a primary analysis of an experimental data during the measurement / 7, 8/ (fig.2), another/7,8/ - obtains and displays information about all the clients of the complex involved in a measurement. (fig.3). It also can help in managing the script file interpretation. It allows one to start, stop, suspend, or abort the program execution. To make user work more comfortable, we prepared special versions of these clients for PC, because users generally have PC at their tables.
  • The configurability of the clients allows easy adaptation to changes of the experimental equipment. A common configuration file provides for the clients' interrelation. In our complex, many clients are configurable, this yields good results. For instance, we use the same set of clients to handle both NSHR and SKAT, although they differ in the number of detectors, texture goniometer characteristics, etc. In appendix B there is the NERA-PR configuration file.

Fig.3. Window of the remote supervising and control task

The complex structure

In fig.1, a sample layout of the windows generated by the complex is shown. At the moment, the complex includes the following clients:
- Join - the interpreter of the experiment program;
- Moni - a neutron beam supervisor;
- Goni - the goniometer control task;
- Ultras - the task to perform ultrasonic measurements (High Pressure Chamber (HPC) sub system);
- Press - a sample stress supervising task (HPC subsystem and HERA-PR);
- Temp - the heater control task (HPC subsystem and HERA-PR);
- Vsp - spectra visualization task;
- Info - remote supervising and control task.
We also plan to create a special client to visualize the parameters of the sample environment like the temperature, the pressure etc. in a graphical form.

Implementation notes

Our approach is easier in implementation and thus faster in it than the traditional one with splitting the whole program into a control and interface parts but it requires all components of the system: operating system, network package, X server and client development package - to be stable.
We have found the OS-9 itself in the memory protection mode as a very reliable and stable system.
From the very beginning we used the X11/OS-9 R4 v1.1 package of CompControl International B.V/5/. We had many problems with it, so now we replaced it with Kei Thomsen's ( adaptation of X11R6.1 to OS-9. This package looks better than the previous one and the server works stable.
We had also some problems with the stability of the Internet Support Package (ISP) from Microware/9/. With the ISP V2.0 one of the X-clients of the complex or the X-server itself from time to time "hung" in the "m"-state and where was no possibility to "unlock" it. Now we are testing ISP V2.1 where this error is declared to be fixed.
We used the Libsx v1.5 library designed by D.Giampaolo ( and ported to OS-9 ourselves. This library is "the Simple X library... that sits on the top of the Athena widget set. Its purpose is to write X applications much easier."

Operating experience

There is a point of view that VME computers with OS-9 are not suitable for building an entire spectrometer handling system due to the lack of available software (compared with Unix- machines or PCs), absence of a user friendly interface, slower processors, etc. Also, X Window System adaptations for OS-9 often have more bugs and their work performance is not very stable. This is one of the reasons why an "interface" part is often implemented on the workstations. We would not like to discuss this point. Of course, workstation program development systems are usually better. However let us consider some characteristics of our software complex.
Memory requirements
Each client requires approximately 1 Mbyte. The whole complex with the operating system and some standard clients ( Xterm, Oclock) occupies 13 Mbytes if it is run locally and 8 Mbytes if it is run from an external X-server. There is a memory leak in the beginning of the measurement process. During measurements, it practically disappears. Thus, 20 Mbytes volume of memory is sufficient.
On average (without Vsp influence) the CC112 processor is idle 40-90% of the time. The interface reaction speed is sufficiently fast, and the graphic drawing speed is slow but acceptable. With the E17 system (see below), these parameters will be increased greatly.
To finish with, let us compare some important characteristics of the old CC112 and more modern E17/6/, which is appointed to be used in FLNP for future work. The table below shows that using E17 instead of CC112 makes our approach more natural. To compare with we add a PC AT (486-100, 32 Mbytes) speed characteristic which is five times faster than CC112 and has twice more memory but nevertheless being insufficient to carry the burden of the Windows NT.

&nbsp CC112 E17 PC AT
Processor type 68030 68040 486-100
Processor frequency 20 MHz 33 MHz 100 MHz
Internal Internet controller no yes &nbsp
Internal graphic controller no yes &nbsp
Processor speed (Dstones) 5,000 25,000 26,315
Graphic controller speed (Xstones) 6,000 24,300 &nbsp


The choice of X11/OS-9 as the base for the complex has been determined to be the natural way to construct the whole system which, in our opinion, suits all requirements for a modern spectrometer control systems.
Our approach is characterized by:
- fast implementation;
- ease of extending;
- ease in use;
- client configurability;
- the same version for local and remote running.
Transportation of the complex to a new instrument is rather easy. In the simplest case it is necessary only to modify a configuration file slightly, in the hardest - to add new clients to satisfy new hardware requirements.


We are grateful to all our colleagues from the Texture research group and the Department of electronics, computers and networks FLNP JINR for their help and patience.


1. Yu.A.Astakhov, et al.: Development of the FLNP Measurement-and-Computational Complex. Procs. of the ICANS-XIII meeting (Oct. 11-14, 1995, PSI Switzerland), pp.213-227.
2. K.Walther et al.: Time-of-Flight Texture Analysis of Limestone Standard: Dubna Results. J.Appl. Cryst.(1995). 28, pp.503-507.
3. N.N.Isakov et al.: SKAT-1 a new texture spectrometer at the IBR-2 reactor.Report on XV International Workshop on the Applications of Neutron Scattering to Solid State Physics, 17-23 March 1997, Zarechny, Russia.
4. I. Natkaniec, S.I. Bragin, J. Brankowski, J. Mayer: Multicrystal inverted geometry spectrometer NERA-PR at the IBR-2 pulsed reactor. Proc. ICANS-XII, RAL, Chilton, Didcot, UK (in press).
5. CompControl International B.V.: X Window System X11/OS9 User's Manual, version 1.1, March 1991.
6. EUROCOM-17-5xx.Dual 68040 CPU Board with Graphics. Hardware Manual. Revision 1A. V-E17.-A995. ELTEC Electronick GmbH.
7. A.S.Kirilov et al.: A VME-based accumulation, control and supervising system for neutron texture measurements. JINR prepr., E13-97-220, JINR, Dubna, 1997.
8. A.S.Kirilov , J.Heinitz: Using X11 to create VME based neutron spectrometer accumulation, control and supervising system (features and experience). Report on DANEF-97, 2-4 June 1997, Dubna, Russia (in press).
9. Using OS-9/Internet. Revision A, january 1989, product number INT68NA68MO, Microware Systems Corp.

Appendix A. A fragment of an experimental program
;		NSHR measurement procedure
Tofa: TEST				; test client
Goni: GETPOS				; restore goniometer position
Tofa: user luzin			; set user name
Tofa: sample quartzite 50ab		; set sample name
Tofa: file ab50.$00			; set spectra file name
Tofa: time 450				; set exposition time
Tofa: OPEN_PROT #.txt			; open protocol file
Goni: OMEGA				; set current motor
Goni: FIND R				; goto the right contact position
Goni: SETPOS 0.				; set this position as 0.
Goni: GOTO -83.6			; goto position -83.6 deg
Tofa: EXPO #1.$00			; start of exposure

Appendix B. NERA-PR configuration file
; Configuration of the NERA-PR instrument
; ============================================
;	Author: Kirilov A.S.	27.03.97
;	NERA-PR			 5.11.97
BASE=NERA:0.0		;base display
;	set of clients being used
CLIENT= tofa,TofaWindow,TofaPBox
CLIENT= ultras, UltrasWindow,UltrasPBox
CLIENT= temp,TempWindow,TempPBox
CLIENT= press, PressWindow, PressPBox
MEMSPLIT=256		; splitting factor of the histogram memory
MEMPOS=0       	 	; position of the first (a-) spectrum
DELAY=0.        	; analyzer start delay in us
TCHANNEL=64.    	; channel width in us
CHANNELS=qidm		; symbols of recorded detector channels
RECSTART=1          	; first time channel to be recorded
RECSTOP=3100        	; last time channel to be recorded
FORMAT= 16,3100		; File format: 16 spectra of 3100 elements in each
PERIOD=Nov97c6      	; working cycle of the IBR-2 reactor
;	 goniometer definition
;STEPMOTOR=	phi, 	0.36,		deg, 	275., 0, 1, 0, 0
;STEPMOTOR=	z,	5e-3,		mm,	800., 1, 0, 0, 1
;STEPMOTOR=     omega, 8.333333e-3,	deg,  	400., 1, 1, 1, 1
NSPECTRA= 16		; VSP parameter
;	end of file