JAVA-BASED OPERATOR INTERFACE.
G. Obukhov, Institute for High Energy Physics (IHEP) Protvino, Russia
M. Clausen, Deutsches Electronen Synchrotron (DESY) Hamburg, Germany
N. Kamikubota, High Energy Accelerator Research Organization (KEK) Tsukuba, Japan
Abstract
The proposal for Java-based Operator Interface(JOI) is discussed in this paper. Several examples wereimplemented for demonstration purpose. These examples
can communicate with real equipment at DESY. JOI
was implemented as 3-tier architecture: JavaBeans as
reusable components on the client side, they
communicate through CORBA/IIOP protocol withservers which provide connection to different control
systems of DESY. Such approach enables to have multiplatform operator interface for diverse control systems.
The development of JOI's JavaBeans and building of JOI
displays was done under Windows NT. JOI can run
without any modifications on any Java-enabled platform.

JavaBeans, Java Foundation Classes (Swing), JavaIDL,
Java2D, etc.
One of the possible implementations of JOI can be
represented as the following 3-tier scheme (Fig. 1).
In order to provide one solution for any underlying
control system one independent standard protocol should
be selected. It can be either RMI or CORBA/IIOP. The
last one was selected because it provides communication
between objects implemented in any language (Java,C/C++ etc.).

1. INTRODUCTION
Several different types of control systems are in use
at DESY. This is because of distributed and large-scale
nature of heterogeneous equipment involved into theprojects. Each control system uses its own approach tobuilding of Operator Interface (OI). Also they havedifferent protocols for data interchange between OI andreal-time layer of the control system. This leads toincompatibility of OIs. The developer has to create
different OI for each system even if target equipment,
processes have the same functionality. Duplicating offunctionally of the same OIs for different control
systems is inevitable in this case.
Different look and feel is another problem. The
same actions in one OI can cause different behavior inanother OI. It takes some time to learn not only OI itself
but also differences between OIs.
Very often there is a need to add some custom
elements to OI which are not currently in operator’s
disposal. This is a problem in non-modular architecturesof OIs. Usually this leads to rebuilding of the whole
implementation in case of the home-made OIs.
OIs which were built for usage on one platformmainly don't work on another one. This is a portabilityproblem.
There are several possible implementations of Javabased operator interface which could avoid somedisadvantages of current implementations of OIs
described above. Java technology has many features
well-suited for building of OIs. It has many usefulembedded facilities. Many new advanced featuresappeared in the latest JDK 1.1 and Java 2 platform -Fig. 1
Data Gateways (CORBA Servers) could be
implemented as CORBA object in native (regardinglanguage of the control system) language (C/C++ etc.).
Such CORBA objects would be able to read/write data
from/to the control system in proprietary protocol. Also
it would be able to communicate with JOI JavaBeans(JavaBeans Controls) in standard way using
CORBA/IIOP protocol. Implementing such CORBA
objects doesn't take much time if you have ready-to-use
CORBA development system in your disposal.
VisiBroker (Inprise) was used for JOI development.
2. IMPLEMENTATIONJOI development process can be divided into threealmost independent processes. First, implementation ofCORBA Server. Second, development of all necessary
JOI JavaBeans. Third, development of JOI Displays
using those JOI JavaBeans.
All JOI JavaBeans mentioned in this paper weredeveloped in VisualCafe (Symantec) under Windows
NT. The examples of JOI displays were also prepared inVisualCafe. The process of JOI display development
looks very similar to the creation of GUI in any othervisual builders (VisualBasic, VisualC++ etc.). A
developer has just to clicks the appropriate icon (bean) intoolbar and drop this bean to working area. Then allproperties of the bean can be changed in the"Properties list".
2.1 CORBA Servers
Two different control systems EPICS and DOOCS
which are in use at DESY were selected for
implementation of real JOI examples. It was done
intentionally to test the interoperability of the same JOI
Beans with different control systems. The simplified
CORBA IDL program describing the interface for both
example servers follows:
module DESY {interface EPICS {any get(in String name);};interface DOOCS {any get(in String name);};};

Only one method (get) was selected to be supported
by both servers. This IDL file was compiled by
VisiBroker's "idl2cpp" compiler. All necessary C++
client's stubs and server's skeletons were produced as aresult of this compilation. This IDL program was notcompiled by "idl2java" compiler because CORBA
clients (JOI JavaBeans) will be implemented as a clientswith Dynamic Invocation Interface (DII). This meansthat they don't need precompiled stubs, because they willfind CORBA server dynamically during run-time period.
All required source files for implementation of "get"methods were taken from appropriate EPICS andDOOCS libraries. Only getting of float values wasimplemented in those examples of EPICS and DOOCSCORBA servers. Server implementation should belinked with appropriate EPICS or DOOCS library andalso with VisiBroker's CORBA library. This process is
depicted in the following image (Fig. 2).
When both servers were successfully compiled andlinked they were started under Solaris. After registration
servers are waiting for requests from clients.
In order to increase reliability of the system twoinstances of the same server can be started on different
computers over the subnet. They should have the same
module, interface and object names. When one server
will be stopped because of some reasons (crashing,switching off) clients (JOI Beans) will be seamlessly
reconnected to the other server.

Fig. 2This switching to another server will be done by
VisiBroker’s ORB transparently for clients. Thisapproach can also be used for building of flexible
loadingmechanism when server "migrates" from one
overloaded computer to another one with spareresources.
2.2 JOI JavaBeans
All JOI Beans could be divided into two generalparts, such as "Indicators" and "Controls". "Indicators"means Beans which can visually represent value or stateof the object under control. Voltmeter, oscilloscope,
speedometer are the examples of indicators in realmeasurement technique. "Controls" means Beans which
can be used for changing the value or state of thecontrolled object. Buttons, switches, knobs etc. are justseveral examples of real controls (Fig. 3).
There are several possible types of JOI Beans fromthe graphical representation point of view:• Vector/Bitmap/Combined (vector and bitmap)• With Double Buffering/Without Double
Buffering• With Anti-aliasing/Without Anti-aliasing• Static/Dynamic (animated)
There
aretwo possible
algorithms
ofcommunication between JOI JavaBeans and CORBA
Servers. First, polling is just periodical calling ofcommunication task for reading remote data. Second,callback bares a strong resemblance to hardwareinterrupts. During callback client and server change theirroles. A server notifies a client that some event
interesting for client occurred on server side. For
example, the status of equipment was changed. As arule, client invokes relevant method upon thisnotification (e.g. fetching modified data).
Several additional JOI JavaBeans could be also
developed in JOI framework. It could be JavaBeansproviding the following functionality:• logging and archiving• reading CAD files (e.g. DWG, DXF)• decoration elements in vector format (e.g. pipes,valves etc. for OIs of vacuum systems)• implementing some kind of calculations (e.g.
arithmetic, FFT etc.)

ORB initialization and for reading real data. The nameofFig. 4

Fig. 3
Not all these Beans need GUI. But it's possible tochange their properties in JavaBeans development tools
as well. Some of these Beans could also have ability tocommunicate with CORBA Server. For example,calculation Bean could get data from equipment, makesome calculations and forward the result to "indicator"
Bean for graphical representation.
All JOI JavaBeans should support three mainfunctions:control system is used only during ORB initialization
phase for binding to CORBA server. This server shouldhave corresponding name (e.g. EPICS, CDEV, ...). The
scanning period is used as a period of communication
thread activation. That thread invokes method (“get”) for
reading value from control system. Standard CORBA
Exception messages will be printed to Java console incase of wrong process variable name or bad network
connection to CORBA server.
JOI JavaBeans have a Communication Customizer
which allows to change the server’s name, process
variable name and scanning period during run-timeperiod (Fig. 5). If another server name was specified theJOI JavaBean will be reconnected to the server with newname.

• read data from control system• make graphical representation of this value• fire event in case of alarm value
The properties and different appearance of "DigitalIndicator" JOI JavaBeans follow (Fig. 4).
It's properties related to CORBA communication(with “Comm” prefix) should be properly configured
during design time before real communication. For thispurpose should be specified such properties as the nameof control system (e.g. EPICS, CDEV, ...), the name ofprocess variable and scanning period in seconds (ifpolling mechanism is in use). All these properties haveto be just typed into properties window of corresponding
Beans' development tool. During run-time period thisinformation will be used by communication thread forFig. 5
The user can invoke this customizer clicking rightmouse-button when mouse pointer is inside of Bean'swindow (Fig. 5).
Two additional utility JOI Beans were developed.
First, "Imager" Bean loads GIF and JPG images
according to URL specified during design-time. It can beused for loading bitmap backgrounds for JOI displays.
"CGM Viewer" is another utility Bean which can beused for loading files in vector CGM (ComputerGraphics Metafile) format. Almost all widely usedvector graphics packages have possibility to export files
in CGM format.
2.3 JOI Displays
Any JavaBeans development tool can be used forbuilding of JOI Displays (Fig.6). All JavaBeansdeveloped for JOI can be placed in Beans' palette ofcorresponding development tool (VisualCafe in thisexample).

standard vector clipart elements were used during
drawing of this background. Afterwards, it wasdownloaded into
VisualCafe by "CGM Viewer" JOIJavaBean. Then Digital Indicators were placed in proper
positions over thescreen. At last, all necessary labels(from AWT package) were set and at this point thevisual part of JOI display was completed.

Fig. 6Fig. 7

In order to add new element to JOI Display thedeveloper merely has to click its icon in toolbar and drop
it to the working area ("Applet1" in our example). Thenit can be resized. Also any property of selected "Meter"
can be changed in "Property" window. When the wholeoperator interface is completed it can be started either
under development environment (for debugging) or
under appletviewer (in case of Applet) or under Web
browser. If JOI will be used in Web browser the best
way is to use Java plug-in and HTML converter for thisplug-in.

Bitmap background for the second example (Fig. 8)
was prepared in painting program (Adobe Photoshop)and saved in JPEG format.

3. EXAMPLES
Two different JOI displays were created fordemonstration of JOI facilities. The first one is a remakeof the real MEDM display which is in use at DESY in
MKK group (Fig. 7). This JOI display consists of almost
all process variables (22) of its predecessor. Thesevariables are supported by EPICS control system. The
second display consists of 8 process variables (Fig. 8). It
was created to demonstrate the ability of the same JOI
Beans (Digital Indicator) to read data from any controlsystem (e.g. EPICS and DOOCS) using standard
CORBA/IIOP protocol. In contrast with previous display(Fig. 7) this one reads data from DOOCS control system.
These two examples demonstrate also utilizing ofdifferent types of backgrounds for JOI displays. First
example uses vector image for background and thesecond one uses bitmap background.
The background for the first example was preparedin CorelDraw and exported into CGM file. SomeFig. 8It was downloaded to VisualCafe by "Imager" JOIJavaBean. "Local Timer" JOI JavaBean was added tothis Applet for displaying of the current time. All
communication parameters for this Applet were
specified for reading data from DOOCS. Aftercompilation the Applet was started in appletviewer underWindows NT (Fig. 8 top).
In order to check global CORBA network the same
JOI Applet was started in KEK, Japan under Digital
Unix. After establishing connection between Applet(KEK, Japan) and CORBA-DOOCS server (DESY,Germany) it was possible to read data from DOOCScontrol system (Fig. 8 bottom).

Some benchmarks were done to estimate different
communication schemes from efficiency point of view.
For the first test EPICS' Channel Access library for
Windows 95/NT was in use. Simple GUI for this test wascreated in Microsoft's VisualC++. This program justperiodically reads one process variable.
Another testing program was written in Java. It wasstarted on the same computer and communicated withthe same IOC (Input/Output Controller) as previous
testing program. This Java Applet implemented two
different tests. First of them periodically reads data fromIOC via CGI (Common Gateway Interface). The second
one reads the same data but from CORBA-EPICS server.
CGI gateway was implemented as a Perl script which
invokes EPICS' "caget" utility program.
All results of these tests are collected in the table(Table 1):
Table 1

One cycle (ms)

CORBA
Server
10.85[1] Client/Server programming with Java and CORBA.
R.Orfali et al. 1997 ISBN 0-471-16351-1[2] The essential distributed objects survival guide. R.Orfali
et al. 1996 ISBN 0-471-12993-3[3] Instant CORBA. R.Orfali et al. 1997 ISBN 0-471-18333-4[4] The Java class libraries: an annotated reference. Patrick
Chan et al. 1996 ISBN 0-201-63458-9[5] VisiBroker for C++. Programmer's Guide. Version 3.0

4. CONCLUSIONChannelAccess
8.45

REFERENCES

CGI
290.8

Any Java program cannot work faster than program
written in C/C++ because of its interpreter nature. But
from the table follows that Java and CORBA overheadadds only about 2.4 ms to Channel Access time. The
advantage of CORBA approach against CGI one isobvious.
There are only few ready-to-use widgets in standard
JDK package which you can use for JOI JavaBeans (e.g.
Button, TextField etc.). The rest of elements you ought
to implement yourself or buy from third-parties. For
creation of such widgets you can use the same Javadevelopment environment as for building JOI displays,
for example VisualCafe.
ACKNOWLEDGMENTS
The authors wish to thank Kazuro Furukawa andShiro Kusano from High Energy Accelerator Research
Organization (KEK) Tsukuba, Japan, who provided thetesting of JOI applications.

[6] VisiBroker for Java. Programmer's Guide. Version 3.0[7] JavaBeans Homepage.
http://java.sun.com/beans/[8] The Free CORBA homepage.
http://patriot.net/~tvalesky/freecorba.html[9] The Experimental Physics and Industrial Control System(EPICS) homepage.
http://epics.aps.anl.gov/asd/controls/epics/EpicsDocument
ation/WWWPages/EpicsFrames.html[10] The Distributed Object Oriented(DOOCS) homepage.
http://tesla.desy.de/doocs/doocs.html

ControlSystem