JAERI-Conf 95-021

PB20

Analysis of the PLC Object Model in the PF Linac
Isamu Abe, Akihiro Shirakawa, Kazuo Nakahara and Masahiko Tanaka
KEK, National laboratory for High Energy Physics
Oho1-1, Tsukuba-shi, lbaraki 305, Japan

Abstract
Device controllers (front end) for the KEK
PF Linac, which has been operated for morethan ten years, had to be renewed, because there
is no longer support from hardware
manufacturer. To reduce maintenance costs,
device controllers are planed to be replaced by
PLC (Programmable Logic Controller).
Investigations launched in the late 1994s for thePLC [1] have carried out in order to make sureof the I/0 stability and network possibilities. Inthis paper, the software for the PLC isdiscussed based on the OOP concept.

1. Introduction
An Object oriented approach to a PLC
control(device control) system analysis anddesign was adapted to the Linac. The oldconsole system has a graphic display written
using FBHG (Fujitsu High grade modularBasic). It has not been very simple to change
the display and it's programs, which werewritten in structured FBHG. To change theconventional language to the new OOP language
is a big paradigm shift, and there are two
aspects which are good and not good. One
aspect is high productivity at OOP, though morelearning cost for users is needed. We are
therefore providing a top class which can inherit
objects for users without any programming on
the GUI windows. Users can make a control
and display windows very easily and quickly byjust copying a visual object from it's mothers
class inheriting method and properties. Afternaming the object and changing some properties
if necessary, it can be run as a user's program.

2. About the PLC
The performances of the PLC is almost
good enough for controlling the magnet power
supplies, vacuum systems and klystron
modulators as a slow speed control. Mostly,Since PLC can be connected to Ethernet thesedays, it is now possible to be controlled fromcomputers, even though each maker has its own

network. In the PF linac, the stability wasactually measured and rotnpared with theproducts of a couple of makers. Although thePLC is not for a high-speed multi-purpose
machine interface, DAC and ADC modules arestable enough for magnet control. The PLC
commercial product has been commonly used inchemical plants and other wide fields. The priceis cheaper than other interfaces, like VME orCAMAC, and maintenance is more easy.

3. PLC networking and speed
The PLC which we have selected has two
CPUs: one is for 1/0, and the other is forcommunications. TCPIIP and UDP are available
protocol used to communicate with othercomputers on Ethernet. The PLC has its own
programming and tools inside, and allows itself
to be an intelligent controller using a ladderprogram. For all channel scans on MS
windows3.1 with a pentium 90MHz CPU, 10to 20 refreshes are proceeded. That is asufficient scan speed for an operator when headjusts the magnet current or other. In thesystem of the PLC and host computers, thePLC is the bottle neck at communications
specified in a data/command transfer. The hostcomputer has several device-control network
segments, which are managed in serial; there
would be no collisions in it's communication
packet.

4. G UI object model
The common classes for linac control wereanalyzed and implemented using MS VisualC++ on Visual BASIC based on OMT (ObjectMaking Technique) [Z,3l. In the accelerator
domain it is possible to be defined in two majorclasses as the device class and the generic class.
The device class may have several derived subclasses; the other super classes, likecommunications, components and other relatedclasses. These classes were developed as acontrol pack which appear on the toolbox for
Visual Basic when it is in the interpreter mode.

-304-

JAERI-Conf 95-021

The basic model of top classes and it's relations
are shown in figure-1.

completed it's first version based on the Object
models shown in the OMT. Since Visual
BASIC has a simple inheritance system, aMother class has been coded using visual C++,and was made as *.VBX tool on Visual
BASIC. Visual BASIC has limitations inmemory size and execution time when there aremany objects derived from the mother class.
PLC and other objects are shown in figure-2.

figure-1

5. Device class of the Linac
Device class; klystron, magnet, vaccum,gun, monitor and others are defined and coded
as a super class on the control pack. Theinstances (real object) are derived in the GUI
windows from its control pack: for example, themagnet class has its sub class (such a amagnet, STC-magnet and Bending-magnet).
Each device class· may use a PLC object forcommunicating between them. It is defined sothat the PLC class is related the other superclass.
6. PLC class
PLCs are produced by several companies,
and there are no standards among themanufactures. A PLC support many I/0
modules: such as DI/0, DAC, ADC and IRQmodule. The PLC is the super class, and the I/0
modules are defined as belonging to the subclass. The PLC top class can communicate tothe PLC communication class. These PLCclasses should be installed on the device layer.
In the PF Linac, device classes are set on the
Human interface layer, and the device class of
the GUI should communicate with PLC deviceclass.
7. Implementation
It is being planned to install the PLC for the
Linac device controller, which will be connectedwith about 400 sets of magnets and 200 sets ofvacuum systems and 60 sets of klystrons which
are slow devices in control. In October 1995, aprototype is going to control the vacuum systemat the 2nd sector of the Linac. In advance to thehardware system, software development has

figure-2

8. Results and conclusions
Sufficient speed to control the magnet
current setting was achieved based on Ethernet
communications between PC and PLC. There
are a reasonable number of PLC connections we
can run in series because of PLC
communications speed. We could actually makestandard class for the PLC and GUI device
object or class. The standard class brings out anice reusable object, which makes the control
system very flexible. OOP also gives users aneasy way to make modification and to produce ahighly productive control system for accelerator
users or machine operators.
references[1] Feasibility study for PLC as a devicecontroller, A. Shirakawa
Linac conference 1995, Osaka[2] GUI object model in Accelerator control
I.abe, K.Nakahara, M.Mutoh, Y.Shibasaki
Linac conference 1995, Osaka[3] Object-Oriented Modeling and Design
James Rumbaugh. Prentice Hall, Inc.

-305-