FORTH-NODAL: CONCEPT AND PRELIMINARY
Yuuki Kawarasaki and Masayoshi Sugimoto
Japan Atomic Energy Research InstituteTokai- mura, Ibaraki- ken, 319-11, JapanAbstract
The concept and preliminary works about thedevelopment of the multi-computer real-time control
system like NODAL using the unusual language, FORTH,
are described. Its specific feature is the high-speed
response and the transparency in the interactive andnetworking environment.
Introduction
It is highly desirable to obtain a high-speed,
real-time control system for the accelerators and otherapplications. The bunch of ready-made monitors existin the world, however our demands are always specificto the own systems and we must tune them before in use.
And the recent development of the computer hardware
technology is so fast that the present newest models
become obsolete soon. One possibility to overcome sucha situation is to employing a well-documented standard(or portable) monitor which may be implemented for all
new coming models( e.g. TRON 1 or Thoth 2 ). Thesestandard monitors are usually designed to hide theinternal structure as a black box. This does not fit
to our purpose, and we need a fully transparent systemfor precise tuning and free modification. So, anotherchoice to adopt the original monitor as the kernel ofthe control system seems to be attractive. However, is
it realistic to develop such a monitor from the scratch
in a relatively low cost? We have some experiences on
the personal computer based control system, and there
exists the most suitable language, FORTH 3 . Although it
has an exotic syntax compared with the other languages
in a look4, it is the fastest interpretive language
using a technique of the threaded interpreter with someoptimizations. It is interactive and self-expandable.
The program code, called WORD, is compact and it can beconstructed by using both the high-level and thelow-level programming styles. All these favorable
characteristics conduct us to develop an interactive,
distributed multi-computer control system like NODAL 0
on the personal computer environment. The similar
approach in the different context is investigated inother laboratories( e.g. CERN 6 ), too.
In the following, the preliminary work to implement
the FORTH-NODAL system on micro computer system isintroduced. And as a typical application, the control
system for JAERI Free Electron Laser is described.
Preliminary work
As the starting point of the development, we first
implemented the original FORTH system on the NEC PC9801 personal computer series and evaluate its speed 7 .
There are three targets to extend the previous
version:
ClJ writing the FORTH words to access the numericalco-processor directly,(2) developing the multi-segmented program, and(3) enhancing the graphics words to handle the graphics
images. And these works were carried out by using NEC
PC-9801 VM2Ccpu V30) with 640kB memory and a numerical
data processor(i8087J. The demonstration program tocompare the speed with BASIC interpreter shows theresults as follows.
First, the boot-up is done using N88-disk BASICC86) andFORTH system is resident on top of the disk operating
system codes. At this stage, you can enter the usual
BASIC mode and come back to FORTH freely. The FORTH
words for applications are created in a different
segment with the main body of the FORTH system,

including the FORTH compiler and other tools. Afterthe demonstrating application words are installed, you
can choose one of the following tests.
CAJ It draws the seven sine curves with the differentcolors, which uses the different codes for the floating
point functions but graphics procedures are same ones(in BASIC-ROMJ.
CBJ It draws the bifurcation plot, which shows one of
the simplest chaotic system.
CCJ It draws the same plot as CBJ but with the tuned up
version of the corresponding FORTH word, which means
one can develop a FORTH word by prototyping and modify
it as the maximum speed is obtained finally.
The actual speed is dependent of the cpu's clock
rate, version of hardware and software you use( and thenature of the tests), but the 2-10 times improvement of
the execution time is expected, generally. And themaximum speed can be able to reach to the assembler'sone. As an interesting case to obtain a compact andfast code, the direct generation of the floating-number
uniform random number is offered. The generator itself
is coded by using only seven instructions of i8087,
based on the usual linear congruential method.
Real World Control
As a typical example to apply the concept of theFORTH-NODAL described above, we are considering thecontrol system for the JAERI Free Electron LaserBsystem. It is now in the development stage andrequires a small but flexible system for controllingand monitoring of various kinds of parameters. It
consists of three major components, injector section,
accelerator part and optical instrumentations. And
they are constructed and used in a different timescale, so we need to employ the local control modules
to each major components and connect them step by step9
The components are linked by computer network andthe realtimeness of the response is the most important
issue in this system. Usually, main console is only
monitoring the status of each local station, and theprogrammed controls are performed at the local control
modules. However, this system is used for R&D study
and the modifications of the local hardware and its
control software would be frequent. So the flexibilityof the system is also necessary. From these aspects,
we must develop~ control software with high-speed (execution and transfer J and flexible configuration (such as modularity, portability, expansibility J. The
FORTH is an attractive candidate of the system language
to fulfill such requirements. It has compact code andthe high-speed operation is possible in the interactive
environment, so we can exchange a programCexactly,
FORTH word) in a short period and upgrade dynamically.
Some drawbacks may come from its unpopular syntax andprogramming style. We need to pay attention for users
who would like to use the system without knowing thedetailed structure of the whole system. At the steadystate operation, it is useful to access through such aneasy or user friendly console software. As one of theuser interfaces for these users, the graphicalinterface based on the window graphics much like as
Apple Macintosh computer. In this interface, we look asystem visually and monitor the malfunctions. Of
course, the direct use of FORTH to control is thefastest and precise, but multiple user interfaces of
the control system enrich the operation styles. So weare considering the other possible control styles, suchas database oriented and spreadsheet style. The former
would be used in the operations according to the-262-

historical lists of the parameters to gain the guidance
to the present operation, which may be coupled to theexpert system or theoretical calculations. The latter
would be used to control many parameters associatedwith some numerical calculations and automatedcontrols.
Conclusion
The concept of FORTH-NODAL is the best solution to
the problem of the conflicts between the development
people and machine users. It has the maximum speed
obtainable from the interpretive language( i.e.
The most
interactive and easy to use one ).
significant contribution to the control system is its
compactness. The whole system can be easily reinstalled into a new hardware and its maintainability
becomes so high. The optional user interfaces based on
the window graphics may look like as those employed by
the Apple Macintosh, and, of course, they can be
developed by using FORTH itself. A user can select his
favorite one from both methods for controls: using
FORTH words directly or using the graphical userinterface.
References
1. K. Sakamura, TRON Architecture Copyright 1986,
1987.
2. D.R. Cheriton, M.A. Malcolm, L.S. Melen and G.S.
Sager, Communications of the ACM vol.22, no.20979)' 105.
3. Y. Kawarasaki, Proc. of the 1st Workshop on
Control Systems at KEK, Nov. 26-27, 1987, KEK
Report 87-25 (1988), 106.
4. M.G. Kelly and N. Spies, FORTH: A Text andReference, Prentice-Hall, 1986.
5. M.C. Crowley-Milling and G.C. Shering, CERN 78-07(1978).
6. P.S. Anderssen, Comput. Phys. Commun. 50 (1988),89.
7. Y. Kawarasaki, Proc. of the 14th Linear
Accelerator Mtg. in Japan at Nara, Sep. 7-9, 1989,342.
8. M. Ohkubo eta!., Proc. of the 1989 Linear
Accelerator Conference at Florida.
9. M. Sugimoto andY. Kawarasaki, Proc. of the 14th
Linear Accelerator Mtg. in Japan at Nara, Sep.
7-9, 1989, 322.

-263-