Upload
colin-dye
View
214
Download
1
Embed Size (px)
Citation preview
EU ROM ICRO Journal 4 (1978) 30-38 © EU ROM ICRO and North-Holland Publishing Company
The SEQUEL software language Colin Dye Hawker Siddeley Dynamics Engineering Ltd., Hatfield, UK
Synopsis
SEQUEL is a microprocessor based
sequencer controller for control and mon-
itoring operations in industry. It is
designed to be modular in both hardware
and software so that construction, use
and maintenance of the equipment Can be
achieved by plant engineers.
The hardware is based upon double euro-
card size circuit boards contained within
a standard rack system. The range of
boards available comprises CPU, two types
of memory, digital input and output
boards, analogue input and output boards
etc.
A special easy to learn programming language, called SEQUEL, has been devised
to enable the control requirements to be
entered into the system by the plant
engineer. The system does not depend
upon a host computer or specialist pro- gramming knowledge for its operation.
Full simulation features as well as all
aids necessary to prepare programmes are
included with the supplied software so
that engineers can write and test their
programmes fully before coupling up to
the plant to be controlled.
i. INTRODUCTION
As a prelude to describing the SEQUEL
system software it may be of interest to briefly explain the origins of the SEQUEL
project. The design and construction
of the SEQUEL hardware will then be des-
cribed as the SEQUEL language, and its facilities are intimately tied to the hardware.
SEQUEL arose from a requirement by the Central Electricity Generating Board
(CEGB) for an electronic sequence con-
troller for equipment in one of the new
power stations. Hawker Siddeley
Dynamics Engineering Limited has been in-
volved in microprocessors almost since
their inception on other control equip-
ment and decided to use a microprocessor
to satisfy this requirement. It was
reasoned that the microprocessor would
give a high degree of flexibility for the
controller, as well as cost reductions
and increased reliability. The design
was well under way when the project was
cancelled due to the rise in fuel
prices coupled with a falling demand for
electricity. The Company decided that
the concept of the sequential controller
was sound, would be a viable new product
and decided to press ahead with its
development as a Company-funded venture.
The development guidelines were widened
to expand the system into a general-pur-
pose sequence controller for the indust-
rial market.
2. DESIGN CONCEPTS
The design brief for the hardware and
software engineers was to design a system that was -
(i) Simple
it should not require a
qualified programmer to programme the system, or
a qualified electronics
expert to put it together
(ii) Easy-to-use
the equipment was to be aimed at the plant engineer or production man. He is the one who
30
THE SEQUEL SOFTWARE LANGUAGE 31
(iii)
(iv)
understands his problem
and the system should enable
him to easily solve his
problem without expensive,
long training or recourse
to the controller man-
ufacturer
Flexible
the basic building 'bricks',
both hardware and software,
of the system should be
as flexible and as multi-
purpose as possible, with-
out any compromise over
performance
Modular
(vii)
Conditions encountered
are often harsh, hot, dusty,
vibrations from other
machines, electrical inter-
ference etc., and the system
must be designed accordingly
Low Cost
this almost goes without
saying. The advantages
of using microprocessors
must be passed on in a
competitive price. The
total SEQUEL concept, es-
pecially the price, must
make the system attractive
to a wide variety of users
(v)
(vi)
the equipment should
comprise plug-in components
with easy connection be-
tween the modules. The
software also should be
designed on the 'Lego'
principle to allow for
easy additions and amendments to the system
Ease of Maintenance
an almost automatic by-
product of the modular
concept is ease of main-
tenance. Replacement
of the hardware was to be
reduced to a board re-
placement level. In
software terms the use of
software modules means
easier testing and debug
at the programme develop-
ment stage, and quicker
fault-finding sub-
sequently
Robust Construction
the system should be
capable of operating where
it is needed; on the plant. No special en-
closures should be required and it certainly
should not require a computer room environment.
Fig. 1
3. HARDWARE
POWER SUPPLY AND
CARD FRAME
32 C. DYE
The Power Supply is rack-mounted and
supplies all the necessary logic vol- tages with extra supplies for the relay
cards and front panel displays. The
supply has a power-fail detection system
which, in conjunction with SEQUEL soft-
ware, enables the system to cope with
mains interruptions and failures and
protects the memory from corruption.
The Card Rack is a simple 19" double
eurocard rack, with a backplane buss
structure. This enables any module to
be plugged into any position in the rack
aiding assembly and maintenance.
Fig. THE PROCESSOR CARD
The SEQUEL system utilizes the
ubiquitous Intel 8080. It features
three serial interfaces for current loop,
V24 and modem devices driven by a USART:
programmable baud rate and clock rate
counters, power-fail logic in conjunction
with the Power Supply and a bootstrap ROM
for initial programme loading.
Fig. 3 MEMORY MODULES
Two types of memory module are shown in
Fig. (iii), the 8K Core Store and the PROM/RAM board.
Core memory is used for development of SEQUEL control programmes and when the event-log facility is required. PROM/
RAM is used when absolute programme security is required. In practice we
have found the core stores to be virt-
ually incorruptable.
THE SEQUEL SOFTWARE LANGUAGE 33
The analogue output board has four
channels per board. Each output has 12
bits resolution and provides a physical
output of plus or minus ten volts or
+_ 20mA. The output can be updated as of-
ten as required by the programme.
In addition to these boards others are
currently under design or the subject of
ongoing research and development.
From the foregoing it can be seen how the
design criteria has been met with regard
to the hardware. The system builds up
in the 'Lego' manner and expansion is
merely a question of adding more modules and racks as necessary. Future develop-
ments will follow the existing construction
principles and be fully compatible with
the current range of modules.
Fig. 4 DIGITAL INPUT AND OUTPUT BOARDS
There is a range of digital input and
output boards as shown in Fig. (iv).
They come in two variations.
16-way isolated input and output boards,
where each input or output is isolated
from each other and from ground. These
boards are used to connect to or from
the plant.
32-way non-isolated input and output
boards. This type of interface is used
mainly to connect to and from control
panels and to drive displays.
In addition, there are analogue input
and output boards.
The analogue input is driven through a
32-channel multiplexer board. Up to
four multiplexers may be attached to any
one A-D board giving 128 channels per
A-D. The A-D itself is the integrating type giving l!-bit resolution plus sign
with seven programme selectable input
ranges and overload detection.
3. SOFTWARE
Now how have the original design con-
cepts been implemented in software?
The requirement for simplicity and ease
of use precluded the use of assembly lan-
guage as the programming language. The
system must be capable of being program-
med by a user with the minimum of
training. In our view the typical user
will not be trained in programming, and
rightly so, and need not even have an
appreciation of the operation of computers.
We could utilise one of the ~stablished
high-level languages but these are
generally large in core usage, and often
require the use of a disc drive for
compilation. The use of a disc drive
would make the cost of the system unac-
ceptably high, and would certainly rule
out the use of the equipment in adverse
environments. Also considered was the use of an interpretive language, such as
Basic, but it was soon realised that such
a language did not fit in with the
original design aim and would not execute
fast enough. It was therefore decided
to design our own language.
Fig. (v) shows a typical control require-
ment.
34 C. DYE
L,~,,
SEQUEL PROGRAMMABLE
CC~('fFIR OLLE R
co.,.o, ,,.c~ 0,,,~*,,-
Fig. 5 TYPICAL CONTROL CONFIGURATION
The controller accepts information from
the plant in various formats, it inter- prets the pattern of signals received and
sends control information back to the
plant, based upon the received data. To
perform the control function we must be
able to uniquely indentify any signal to
or from the plant, and be able to refer-
ence these signals from within the pro-
gramme. To achieve this any individual
plant signal to or from the plant is
called a Line.
Because an 8-bit microprocessor is used
these Lines are referenced in groups of
eight, which are called Ports. Thus,
any digital signal to or from the plant
can be uniquely identified by its Port
and Line number. These digital signals
may be in one of two states, either ON
or OFF, usually denoted by a 1 or an 0.
This 0 or 1 state is called the condition.
We now have a means to reference any
signal to or from the plant, and to test
or to set its condition. This plant
connection referencing system is the base
from which the language is constructed.
Each individual action that the control- ler is to perform is defined by one pro-
gramme instruction. Every instruction
must have an 'instruction identifier'
somewhere so that programme action can
be followed and programme changes can be
easily made. A means must be devised
to indicate the type of action to be performed by the instruction: and also a means to tie that action to a particu-
lar plant connection.
Here is a typical SEQUEL instruction -
735 TLI 3,5,1 IS VALVE CLOSED?
First, is the 'instruction identifier'
or statement number which uniquely
identifies the instruction. The state-
ment number can be regarded as a 'label'
to the instruction. It is referenced by
other SEQUEL instructions to transfer con-
trol within a programme and by the various programme testing aids, simulation, pro-
gramme monitor panel etc. to indicate the
position of the programme.
Next comes a three-letter mnemonic field
which defines the action to be performed.
In this case, TLI means ~est Line. All
SEQUEL mnemonics are indicative of the
action to be performed, helping to make
them easily memorised.
Following the mnemonic field is the argu-
ment field. This contains information
which, when taken in conjunction with the
mnemonic field, defines precisely the
operation to be performed.
In this case, the action is to test Port
3, Line 5 for the condition one, (or 'on'
Lastly, comes a comment field, which is
used by the programme writer to describe
his prograntme as he sees fit.
S E Q U E L M N E M O N I C S
P L A N T C O N D I T I O N S
T L I - - T E S T O N E
OLI - - O U T P U T LINE
T P T TEST PORT
O P T - - O U T P U T PORT
p R O G R A M C O N T ! : E ) L J M p - - UNCONOIT rONAL JUM~
JEQ J U M P IF EQUAL
j , '~E - - . J U M ~ IF N O T EQUAL
j G T - - j U M p ?F GREATER THAN
J L T - - J U M P IF" LESS THAN
T I M E R S
R E G I S T E R S
M E S S A G E
S T I - - S T A R T T~MER
C T [ COMPARE T IMER
ip R ~ INPUT PORt T O REGISTER
ORP O U T P U T PEGISTER TO PORT
PEQ -- REGISTER ESTATE
I E INCREMENT REGISTER
DEC - - DECREMENT REGISTER
ADD ADD REGISTERS
SUB - - SLr~TRACT REGISTERS
A N D - - L jOGEAL ANO REGISTERS O ~ R LOGICAL OR R E G I S T E R S
XO R -- LOGICAL EXCLUSWE OR REGISTERS
SL L - - SHIFT LEFT LOGICAL SRL SHIFT RIGHT LOGfCAL
MQV - - MOV E ~EGI~TER TO REGISTER
ERR - - COMPARE REGISTER TO REGISTER
CRG COMPARE REGISTE~ T O LITERAL
PRT - -
SEQUEl_ INTERLOCKS
ASQ -- ACTIVATE SEQUENCE
O S Q - - D E A C T I V A T E S E Q U E N C E
O S Q - - O V E R R I D E SEQUENCE
C S N - - C O M P A R E S T A T E M E N T N U M B E R
Fig. 6 SEQUEL MNEMOniCS
THE SEQUEL SOFTWARE LANGUAGE 35
Using this structure we built up a range
of instructions for all the actions that
we wished the controller to perform.
Fig. (vi) gives a list of all the basic
SEQUEL mnemonics, or instructions.
In later versions of the software, the
register capability of the system has
been enhanced to allow the use of floating
point numbers, thus greatly increasing the
tasks that this system is capable of
performing.
The first four instructions are used to
test or set plant conditions. The TLI
and OLI instructions operate on individ-
ual lines, whilst the TPT and OPT in-
struction is used to test lines in groups
of eight. This can be very useful when
searching for a particular combination
of plant conditions. A refinement of
the Port instructions is the use of X
in the argument field to denote 'don't
care', i.e.
830 TPT 6,01XXI011
This allows us to test from 2 to 8 lines
for any desired simultaneous combination.
The next five instructions are used to
transfer programme control within the
programme. Their argument fields are
the statement numbers of other instruc-
tions. They are used following a test
type instruction, so that programme
action can be made conditional upon the
result of that test.
All plant controllers require timing fun-
ctions to set delays or to time events.
The two Timer instructions allow Timers
to be started and tested at any subsequ-
ent point within the programme. Within
SEQUEL, a 24-hour clock is maintained so
that delays of up to 24 hours can be made
with a resolution of i0 milliseconds.
The CTI instruction can be used as often
as required so that multiple events can
be timed from one timer.
The Print instruction allows messages to
be displayed on any suitable terminal
device. These messages may be instruc-
tions to an operator, test results, or
whatever. The contents of registers as
well as time and date can be printed.
The use of this facility allows quite
sophisticated displays to be constructed
as well as just simple messages.
So far the SEQUEL language and its inst-
ructions have been treated as if it were
one long sequential programme. It was
decided early on in the software design
that the system must be capable of mon-
itoring several plant conditions simul-
taneously. With only one programme in
the machine it is more than likely that
the controller may be performing actions
defined by one part of the programme and
completely miss an important occurrence
on the plant because it is not at the
relevant part of the programme.
This problem was overcome by the use of
Sequences.
Any plant control programme can be
broken down into a number of self-con-
tained functions or tasks. Thgse tasks
are called Sequences. Each sequence
can be allocated to perform a definite
plant function, such as 'start motor'
or 'check lubricating oil circuit', etc.
An important feature of SEQUEL is that
sequences are run in parallel. Fig.(vii)
shows this feature diagramatically.
Within the system are areas in which data
may be stored and manipulated. These
areas are called Registers, and like
ports they are eight lines, or bits, wide.
Data can be read to or from the ports
into these registers, or they may be
loaded with data from within the program-
me. As well as manipulating what is in
effect port data in the registers, we can
also do simple integer arithmetic and logic functions.
SEQUENCE I
Fig. 7
SEQUENCE 2 SEQUENCE 3
~0 TLI ~.29 . . . . . . . . SO,EQ 2 ~ . . . . . . . 3'~0 S!L4
~ L 1 6 7 . 1 . . . . . . . 7 0 IPR 6.5 . . . . 4 0 5 JL3 2 . 0
l l SIMULTANEOUS INSTRUCTIONS
36 C. DYE
Only three sequences are shown as active,
but the dotted line shows the flow of
control taken by the processor. It can
be seen that while each sequence progres-
ses down through its own task, the SEQUEL
software ensures that only one instruc-
tion from any one sequence is processed
before moving control to the next sequ-
ence. Thus, the system is able to per-
form concurrent tasks and these tasks
need bear no relationship to each other.
modifications to be easily made by
copying a programme from one cassette to
another, inserting or deleting programme
instructions as required. A search
facility on the terminal allows a search
at high speed for a particular statement
number to be made speeding up the editing
process. New programmes can be typed up onto cassette and edited completely
off-line from the controller without tie- ing up the machine.
This feature is very useful when provid-
ing a 'safety monitor' type function for
a plant, as the monitoring can be con-
tinuous irrespective of the control as-
pects of the plant.
5. SUPPLIED SOFTWARE
SEQUEL systems are supplied with three system programmes -
Parallel sequences are used to provide
interlocking of plant functions and a
range of mnemonics are available to con-
trol this.
ASQ and DSQ activate and de-activate
sequences respectively. (see SEQUEL
INTERLOCKS - Fig. (vi).
A de-activated sequence has no effect on
the plant. Override sequence, OSQ, and
compare statement number, CSN, are used
to monitor and override any one sequence
from any other sequence.
The objective in designing SEQUEL is
that it must be simple and easy to use.
The modular nature of the hardware means
that physically the system can be easily put together. On the software side,
the programme instructions are simple,
and easy to learn, but the user must
have a means to easily input his instruc-
tions to the machine, and test that his
progra~ne will function correctly. He
should also be able to make programme
changes and modifications quickly and
readily.
4. TERMINALS
For simplicity, it was decided to use a proprietary terminal to construct and
edit programmes. The system is able to use a variety of terminals, including
the ubiquitous Teletype, but the Texas Instruments Silent 700 is preferred. The
twin cassette facility allows programme
The Executive
This programme is permanently resident in
the machine. It is initially loaded by
pressing an Executive Programme Load
button on the control panel, which acti-
vates a bootstrap ROM on the CPU board.
Once in, the programme need only be re-
loaded in the event of a memory failure.
For systems with PROM/RAM memory this
programme will be already present in the PROM.
The Executive provides basic 'house- keeping' facilities for the SEQUEL system,
(i) Real-Time Clock
A 24-hour clock is maintained
which can be set or displayed at any time. The clock reso-
lution is i0 msecs. A cal- endar facility is also in-
cluded, geared to the real-
time clock.
(ii) Power-Fail Management
The power supply indicates to the processor the onset of
power failure. Software is
provided for an orderly shut- down of programme activity.
When power is restored, the
system is able to restart
where it left off if required. This feature guards against
memory corruption due to
supply fluctuations.
THE SEQUEL SOFTWARE LANGUAGE 37
iii)
(iv)
(v)
Health Monitor
Every clock pulse the system
retriggers an indicator on
the CPU board. If for any
reason, hardware or software,
the system fails to retrigger
the lamp it goes out, in-
dicating a system failure.
Communications
The system is able to talk to
a variety of terminal devices,
or other processors, through
any one of the three inter-
faces on the front of the
CPU board. Input and out-
put are interrupt driven
into and out of separate
buffers.
Tape Handling Facilities
Software is provided to
drive remotely the $700
terminal. Each cassette
unit can be commanded
individually to Rewind,
Load, Playback or Record.
The user just needs to ask
the system to Read or Write
a particular tape and the
system does the rest.
In addition, the Executive holds common
sub-routines which are used by the
Translator or Interpreter programme.
The system will only allow an error-
free control programme to be run, so the
user is forced to correct all errors.
Once an error-free programme is obtained,
the Write facility of the Executive can
be used to obtain a machine code copy of
the programme onto a cassette. Subsequ-
ently, if this particular control program-
me is required, it can be quickly loaded
into the system in machine code form
without having to perform a re-Trans-
lation.
The Interpreter
The interpreter takes the machine code
SEQUEL instructions and applies them to
the plant. It contains all the software
necessary for the simultaneous processing
of sequences, the timers, registers, etc.
To aid in programme development some use-
ful features have been built into the
Interpreter.
(a) Programme Monitor Panel
The use of this panel allows
the progress of any sequence
to be monitored. The desired
sequence number can be called
up and the corresponding
statement number within that
sequence will be displayed.
In addition any sequence may
be started or held at any
statement within that sequ-
ence by use of push buttons.
(b) Simulation
The Translator
This programme and the Interpreter both
occupy the same area in memory, and are
thus mutually exclusive. The Translator
is read into the system by the Executive.
Its job is to read through the control
programme, written in the SEQUEL lan-
guage, and convert it to machine code.
Simultaneously, it will produce a paged
listing of the programme for record pur-
poses, and indicate any syntax or logic
errors. The user must correct any pro-
gramme errors by using the edit facilit-
ies of the Terminal.
This allows the programme to
be completely debugged with-
out the need to be connected
to the plant to be controlled
In simulation mode the Inter-
preter displays the sequence
and statement number of every
instruction as it is being
performed. When an instruc-
tion requires a plant condit-
ion i.e. a TLI instruction,
the system asks the operator
to enter the condition, it
does not reference the plant.
Similarly, if an instruction
is encountered which will
C. DYE 38
change a plant condition,
the change is displayed to
the operator, rather than
being sent to the plant. A
sample print-out of the
simulation mode is shown
in Fig. (viii).
-START l.lO SEQUENCE N~:01.STATEMENT NUMBER:00010 OE~O pRC~RA~ SEQUENCE NO:01.STATEMENT NUMBS:00020 ~N ON SWITCH 1 SE~ENCE NO:OI.STAT~E~ ~MB~R:00030 INPUT PORT:015.pREV~OUS STATUS:O0000000.CURRENT STATUS:?0000000 SEQUENCE NO:01.STATEMENT NUMgSR:O0040 SEQUENCE NO:02.STATKME~NT ~.~M~SR:000[0 SEQUENCE NQ~OI.STAT~MENT NUMBER:00050 OUTPUT PORT:015.pREVIOUS STATUS:OIO]OIOI.CURRENT STATUS:J0101010 SEQUENCF. NO:02. STATEMENT N~MBF.R:O0020 SEQUENCE NO:01. STATEMENT NUMSE~ :00060 OUTPUT PORT:016.PREVIOUS STATUS:01010101.CURRENT STATU5:IOIOI01) SEQUENCE NO:02.STATEMENT N"OMB£R:00030 SEQUENCE NO:01.STATEMENT STATUS:00070 SEQUENCE NO:O2.STATKMENT hq/MBER:0004O SEQUENCE NO:OI.STAT~MKN~ NUMBER:000@0 SEQUENCE NO:02.STATF24ENT NUMBER:O0050 SEQUENCE NO:04.STATF~SNT N~M,ER:000[O SEQUENCE NO:02.STATKMENT NUMBER:00060 SEQUENCe NO:O4.STATEMENT NL~I~R:00020 OUTPUT PORT:OI5.PR~VIOUS ZTA?US:I01OI010.CL~RENT STATUS:r~I0101CI
Thus, the user is able to
completely test his pro-
gramme, trying all con-
ceivable combinations of
plant conditions and
verifying that the desired
response is made before
connection to the plant.
The usefulness of this
feature is self-evident,
especially when very
expensive plant is involved.
The Interpreter also allows
the status of registers to
be displayed and changed
at any time. The condition of any Ports may also be
interrogated and individual
Lines may be overridden to
be on or off as desired to
overcome any plant mal-
function.
6. THE FUTURE
This then is what SEQUEL is and how it has developed so far. What of the
future?
The system is in a constant process of
evolution, and the use of the micro-
processor in the system is crucial to
its flexibility. The advances in
microprocessor technology allow us to
build sophisticated interface boards at
low cost. For instance, we have al-
ready built A to D and D to A boards and
we are currently building counter/timer,
stepper motor drive and SDLC link distri-
buted control hoards as well as investi- gating further facilities.
On the software side, the use that can
be made of these boards and the facilities
that can be built into the language seem
almost endless. Already floating point
mathematics and analogue capability are
offered. Shortly three-term control
and data logging will be available. Soft-
ware will also be available for the new
boards as and when they arrive. Distri- buted control is a new and expanding
field and the subject is being followed
closely.
The advent of microprocessors has meant
that we are able to produce a flexible,
simple, powerful industrial controller
with the capability to satisfy most
industrial control problems at a reason-
able cost. Our experience has shown
that new users of SEQUEL are able to use
the equipment effectively to solve their
control problems within a matter of
days. We already have systems in the
field with over a years continuous
operation and the interest shown by
industry leads us to believe that this
equipment is the answer to many control
problems.