NETWORK BASED EPICS DRIVERS
FOR PLC’S AND MEASUREMENT STATIONS
K. Furukawa , J. Chiba, N. Kamikubota and H. Nakagawa
High Energy Accelerator Research Organization (KEK)
Oho 1-1, Tsukuba, Ibaraki, 305-0801, Japan
Abstract
The control system of the JHF (Japan Hadron Facility)
linac is being designed employing EPICS. An overall discussion of the system is provided elsewhere [1]. In thesystem it is planned to install PLC’s and measurement stations for accelerator equipment and beam instrumentation,
which are connected via an Ethernet/IP network.
The reason for the choice of network is that modern controllers can be better managed using a TCP/IP network,
even for software downloading and debugging and that theIP network and Ethernet are de facto standards. Device
support software is being developed in order to integratethese controllers into an EPICS environment.
The use of Yokogawa’s PLC’s are being considered,since many installations are already running in other accelerators at KEK although not under EPICS. The EPICS
software for these PLC’s is relatively straightforward.
For measurement stations, WE7000 systems from Yokogawa are being evaluated, which are carefully designed tobe immune against accelerator electromagnetic noise, andare also cost efficient. The network driver software was developed at first on Unix, and is now being adapted into anEPICS environment.

1INTRODUCTION

The JHF project will be carried out in several phases, andthe first part, an injector linac, is under construction atpresent.
We have several control systems at KEK. After studying those systems [1], it was decided to employ EPICS [2],which has been successfully used to commission the KEKB
ring accelerator. The main reason to choose EPICS was tomake maximum use of the sharable resources among accelerators and laboratories.
During the study, we realized that a number of field networks are being used at these accelerators. Some of them
are homemade and others are proprietary products for limited devices. Also, they need certain human resources to bemaintained.
At the KEK electron linac, during the rejuvenation for
the KEKB project [3], several kinds of IP (Internet Protocol) connected controllers were introduced, and more than e-mail: kazuro.furukawa@kek.jp

150 controllers are being utilized [4, 5, 6]. Although oldhomemade networks had to be kept, no new field networks
were introduced.
These types of controllers need only IP connections forboth maintenance and operation, for which many kindsof commercially available components can be employed.
They also have simplified the software development, management and troubleshooting. An IP connection is often
the most efficient in speed, cost and manageability amongst
other solutions.
Thus, in the JHF project, these controllers are considered to be useful for certain accelerator equipment to ease
controller management and to save human resources.

2NETWORK CONNECTEDCONTROLLERS

In control systems choosing the field networks and fieldbuses is a difficult issue. The reliability, speed, maintainability and costs should be taken into account. For
medium-to-large accelerators, equipment is spread over awide area. Thus, we may have to use local networks. Often
the maintenance of these dedicated networks needs humanresources.
Recently, however, because the cost of human resources
is most expensive, we must build and maintain a new accelerator without new resources. On the other hand, the pricesof the standard network devices, such as Ethernet includingfast 100BaseTx, fiber-optic 10BaseFL, have become verycheap.
If we introduce Ethernet-connected controllers, a selection of standard network device technologies and standard
software can be utilized, not only for operating the accelerator, but also for maintaining the equipment controllers.
Simple IP packet switching or routing may increase theflexibility in designing the network. In addition people
in hardware groups may understand them easily since theyuse IP network technology in their offices.
If we use the UDP/IP protocol over Ethernet, we only
need a standard IP protocol stack and the software can beshared between many environments. If we use TCP/IP,
some parts of the error-handling procedures may be platform dependent, since the interface to parameters, suchas the timeout values, are not well standardized. Thus,
UDP/IP should be applied to critical purposes, while both

UDP and TCP may be used for other areas. (Nevertheless, an interrupt message through out-of-band TCP packets which is supported by certain network controllers may
be employed in some applications.)

3 NETWORK CONTROLLERS IN JHF
LINACIn JHF Linac the following types of network based controllers are planned to be integrated with the EPICS controlsystem.

3.1

Programmable Logic Controller, PLC

Formerly, PLC’s had often been used as a simple logic sequencers, and were not considered good controllers to communicate directly with a large control system. Recently,
PLC’s have powerful and flexible options, and their processing speed is fast enough to be used as remote I/O controllers.
The response time of the PLC’s over Ethernet is 5 to 30
milliseconds depending on the processor types. Although
this is 10-times slower than the modern VME processors orPC’s, it is acceptable for most slow control applications.
Modern PLC’s have good processing power, and evenscientific functions can be applied to floating-point numbers. Thus, they allow pre-processing of the control variables as well as logic controls if the hardware group prefers
to do so.
We are using more than 130 PLC’s, called FA-M3 (Factory ACE) series from Yokogawa, at the electron linac [5]and have decided to employ this type at JHF as well. Themain reason is that the same Ethernet can be used for theirmaintenance. That is we don’t need any dedicated communication links in order to download software. Most PLC’ssold in Japan do not have this capability, without which wecannot maintain a large number of PLC’s.
We are currently planning to install PLC’s for the control of vacuum, magnets, ion sources and radio-frequency
equipment.

3.2

Measurement Station, WE7000

A waveform observation is often necessary for beam instrumentation and microwave measurements. We have beenusing GPIB connected oscilloscopes or VXI systems inthese applications.
At the JHF linac, the pulse width of the accelerated beam
is several hundred nanoseconds. Taking cost performance
into account, we leave few choices and furthermore electromagnetic noise from modulators makes even some oscilloscopes are inadequate.
We realized that measurement stations called WE7000[7] from Yokogawa might meet our requirements. Its 100-Ms (Mega-sample per second) waveform digitizer is cheap
and reliable. Also a 500-Ms version will be soon available.
Although it was originally designed for a Windows environment, the Ethernet interface was recently developed andits specification have been disclosed. We are evaluating IP
communication software on Unix.

3.3

GPIB, Serial and Others

Major measurement instruments still use GPIB or serialline (RS232C) as communication interfaces. Maybe wecannot escape from those devices.
For these interfaces several kinds of gateway boxes to IP
network have recently become available [4]. Control systems with EPICS have also started to employ them, since
they are often located far from IOC’s and any hardware
trouble can be easily isolated.
Hardware venders sell equipment, such as oscilloscopes
and video frame grabbers which can be attached to an IPnetwork. They can be utilized under certain circumstances,
if it simplifies the configurations.

3.4

EPICS Configuration

Since we decided to employ EPICS as a control system
for the JHF Linac, we must investigate the proper network
structure for combination of EPICS and network basedcontrollers.
Most of the control processing is done on the IOC’s (I/O
Controller, such as VME or PC) in an EPICS environment,
and information is exchanged between the IOC’s and OPI’s(Operator Interface). Some processes on IOC’s may poll
network controllers frequently. These access messages on
the network may collide with the channel-access messages
exchanged between the IOC and OPI’s.
The above-mentioned situations can be avoided by using
a network switch, as shown in Fig. 1. Since recent network
switches are not expensive compared with repeaters, wewill install them anyway.

4 EPICS SOFTWARE
Since IP software is standard in a VxWorks environment
on IOC’s, the implementation of interface software for network based controllers should be straightforward. For synchronous access it is easy to implement device support software.
However, because the response time is slow, about 20
milliseconds with our current hardware, and EPICS does
not allow slow synchronous device support, we have to prepare asynchronous device support for these controllers.
Because we are new to writing EPICS device support
routines, we tested our software on Unix first, then are im-OPI'sCA clients

CA access

PLC managementstations

NetworkSwitch(s)Maintenance

Polling, etc
PLC'sIOC(NetworkControllers)(VME or PC)
Figure 1: Same network shared among different protocols.
Message packets for different purposes are ordered by network switches and do not interfere with each other.

plementing a synchronous device support, and finally planto achieve an asynchronous device support.

4.1

PLC

At first, PLC access routines that were used in the electron linac were generalized slightly and tested on Unix machines for the JHF controls. This part does not depend on
any software/hardware environment.
Then, synchronous device support routines for EPICS
IOC’s were written and tested. Although the introductionof synchronous device support routines may slow down oreven block the processing of other records this step helps
us to understand this new architecture.
So far, we have not encountered any difficult issues. Several access methods, which were supported by PLC’s, werecompared. The on-demand or interrupt protocol is considered to be utilized as well, although the IP-address of theserver (IOC) must be hard-coded in the PLC program forthis protocol to work.
An asynchronous version of device support routines isplanned to be implemented soon after we finish the designof the software interfaces. In this version, a block of memory on the PLC may be assigned as a shared memory between a PLC and an IOC.

4.2

WE7000The software WE7000 on Unix is now being evaluated andinvestigated. For a WE7000 station, the status of the station
should be managed by the host software, as in VXI. Thispart is implemented using threads on Windows and Unix.
This software will be ported to VxWorks and an EPICS
environment replacing Posix threads with VxWorks tasks.
A waveform record that is most required will be implemented first.

5 CONCLUSIONS
IP network based controllers greatly simplify designing acontrol system, while we must keep our eyes open concerning the effort to standardize other field buses. So far, thosetypes of controllers seem to be promising at least under ourcircumstances.
Although many pieces of software should be implemented, they are relatively straightforward and will be realized soon.
Perhaps the specifications of variables on PLC’s andWE7000’s should be generalized to include other types ofcontrollers.
Installation of hardware will start from the beginning ofyear 2000. We thus hope to finish writing the software anddesign of record structure soon.

6 ACKNOWLEDGMENTS
The authors would like to thank the KEKB ring control
group for valuable discussions. They also thank Mr. M.
Yokoi of Yokogawa for his software support of WE7000.

7REFERENCES[1] J. Chiba, K. Furukawa, E. Kadokura, N. Kamikubota, J.
Kishiro, H. Nakagawa, K. Nigorikawa and N. Yamamoto,“A Control System of the JHF Accelerator Complex”, inthese proceedings.
[2] Leo R. Dalesio et al., “The Experimental Physics and Industrial Control System Architecture”, Proc. ICALEPCS’93,
Berlin, Nucl. Instr. and Meth. A 352, 1994, p 179.
[3] K. Furukawa, N. Kamikubota, K. Nakahara and I. Abe,
“Upgrade Plan for the Control System of the KEK e /e+Linac”, Proc. ICALEPCS’91, Tsukuba, Japan, 1991, p. 89.
[4] K. Furukawa, A. Enomoto, Y. Ogawa, S. Ohsawa and T.
Kamitani, “Control System for a Bunch/Profile Monitor atthe KEK e+ /e Linac”, Proc. Linac’94, Tsukuba, Japan,1994.
[5] K. Furukawa, N. Kamikubota, H. Hanaki, H. Katagiri,T. Urano, S. Anami and K. Nakahara, “Microwave Control and Measurement System at the KEKB Linac”, Proc.
ICALEPCS’97, Beijing, China, 1997.
[6] A. Shirakawa, I. Abe and K. Nakahara, “New Magnet Control System using PC and PLC”, Proc. ICALEPCS’97, Beijing, China, 1997.
[7] J. Kishiro, T. Toyama, S. Igarashi, Y. Yamaguchi andY. Takeuchi, “A New Remote Data Acquisition Systemand Application to a Betatron Oscillation Monitor”, Proc.
ICALEPCS’97, Beijing, China, 1997.