209
Correspondents' Reports
Interface Problems Interface Problems in Legal Metrology * Harald S C H U M N Y ** Physikalisch - Technische Bundesanstalt, 33 Braunschweig, FRG
I. Situation
We define legal applications to be those measures necessary when public interests have to be protected. For example, the weighing machines in stores or petrol stations where it has to be guaranteed that the customer only pays for 200 g bacon or 50 1 petrol, if he has ordered just these quantities, or if the display shows such data. The situation in G e r m a n y and some other European countries is as follows: Let us assume the manufacturer of a new microcomputer-controlled weighing system wishes to sell his products for public use in a big store, which means for legal
* Originally published in Microprocessing and Microprogramrning: The Euromicro Journal, Vol. 11, no 3-4. ** Harld Schumny graduated in 1970 from Braunschweig's Technical University, West Germany, as a physicist specializing in the field of current noise in semi-conductors. After this. research work on surface acoustic waves led to a dissertation and a degree in engineering (Dr.-Ing.). His first research efforts concerning the compatability of magnetic media for the storage of digital data, led to national and international standardization works and to intensive work on minicomputers and microprocessors which were used to design automatic measurement systems. Since 1979, he has been head of the PTB laboratory for measurement techniques and data acquisition at the PTB nuclear research reactor which is used as a neutron source. Schumny act as editor of Information Techniques and Calculator & Microcomputer Yearbook of Vieweg Publishers, and since 1981 he has been a Euromicro Director for Germany and a section editor for "Interfacing and Communications" of the Euromicro journal, Microprocessing and Microprogramming.
North-Holland Computers & Standards 2 (1983) 209-217
applications. The procedure fixed by German law is then: (1) to request the P h y s i k a l i s c h - T e c h n i s c h e Bundesanstalt (PTB, Braunschweig, F R G ) to examine the system and, after that, to obtain acceptance for verification (in German called 'Eichung', which could also be referred to as "legal calibration") (2) If such a certificate is obtained, to request the local calibration officer to perform the verification of the system under test. Conventionally, a weighing system consists of the scale itself and, for example, a remote printer or display, which together comprise the system to be verified. If the manufacturer or the user wishes, for instance, to replace the printer with another type then, consequently, (1) a new approval and (2) a new verification is to be requested. This is a time-consuming and uneconomical procedure. As nowadays such systems are microprocessor controlled, each new examination and verification means extensive research and tests with the digital interface between sytem components. Discussing strategies to overcome these problems, the PTB and industry have reached the following agreement: to define a uniform interface (or a family of consistent interfaces) which corresponds, at least in part, to accepted standards and can be used for legal and scientific purposes. When complying with the respective specification, the interface itself could be given an permanently valid certificate of verification for use in legal metrology. All modules, system components, devices etc. which are equipped with the certified interface, could then be plugged together or replaced by any other component without requesting a new ap-
H. Schumny / Interface Problems
210
Table 1 Some existing parallel interfaces for data transfer, process control, or documentation Type
Characteristics
Standards
TTL
5 V; any number of lines; short distances
De facto
BCD
Similar to TTL
Several industrial
Centronics
8 bits plus control lines; especially for printers
Quasi-industrial
HP-IB
8 bits data, 8 bits control; max. 15 devices, max. 20 m
IEC 625 IEEE-488
proval and verification of the complete system. It should be pointed out that the European industry in question can expect to benefit a great deal from the development of qualified interfaces, because not only with the legal procedures work more efficiently, but the OEM business, too, could proceed more smoothly.
2. Drawbacks of Existing Interfaces The section editor has been charged by the President of the PTB to develop interface specifications in his Laboratory for Measurement Techniques and Data Acquisition and to design test equipment for certification purposes. The question which could now be asked is: why the need for new interfaces and special test equipment? Obviously, a tremendous number of specifications exist, industrial, national, regional, international, or any de facto standards, and various implementations for test instruments and interfaces between components or modules in a binary working system are known. And this, in brief, is the problem; namely, the possibility of individually selecting the relevant specifications from the various families of standards, according to respective needs or, simply, being motivated by tactical directives. In fact, existing standards are usually born as a compromise, often giving definitions only in general. The so-called V.24 (RS-232-C) serial interface, for instance, specifies a number of control lines. Designers are, however, free to select those
Table 2 Some relevant serial interfaces for communication and process control Type
Characteristics
Standards
TTY
20 mA current loop; none control lines; up to about 100 m
DIN 66 258 T1
V.24
20 kbit/s; 15 ... 20 m; several control lines; 1 driver, 1 receiver
CCITT V.24/V.28 ISO2110 EIA RS-232-C DIN 66 020/66 021 T 1 / 6 6 258 T 1 / 66 259 T1
V.10
100 kbit/s; 1200 m; unbalanced; none control lines; 1 driver, 10 receivers
CCITT V.10/X.26 ISO 4902/4903 (connectors) EIA RS-423 DIN 66 259 T2
V.11
10 M b i t / s ; 1200 m; balanced; none control lines; 1 driver, 10 receivers
CCITT V.11/X.27 ISO 4902/4903 EIA RS-422/449 DIN 66 258 T2/66 259 T3
V.12 *
Similar to V.11, but 32 drivers, 32 receivers (bus system)
under progress at e.g. CCITT, ISO, EIA, DIN
Data Way, Highway, or Proway
Very fast and highly reliable; for real-time applications
D I N 19 241 T1; under progress at IEC
* V.12 is only a project name, not an official CCITT denotation
H. Schurnny / Interface Problems
lines which seem to be useful for the problem confronting them and in doing so, to define the pins of the 25-pins D-Sub socket. Before continuing with the discussion of problems and drawbacks, Tables 1 and 2 with lists of some of the relevant standards which could be considered, will be given. Special implementations like the parallel C A M A C system are not included. In engineering and scientific laboratories, the BCD interface, the HP-IB, current loop or, most usually, the V.24 interconnection, are often to be found. In addition, there are very producer-specific modifications or completely new interface definitions. The mass market for legal applications is usually characterized by two facts: the interfaces must be both inexpensive and reliable, that is, transmission errors must at least be perceptible and free of feedback. To guarantee this, designers use a current loop (TTY), for instance, together with special methods of transferring and checking measurement data. In other words, the hardware is often identical with or similar to standardized versions, but the software (that is, the protocol) is not at all standardized. This is because no suitable protocol has been standardized. H D L C is not at all suitable. Yet another hardware problem exists: the transmission line length must often be longer than 100 m (e.g., at a large petrol station between,/xP-controlled dispensing pumps and the office with the cash desk). The solution to this problem can be found in that which has been specified with the V.10 (RS-423) and V.11 (RS-422) recommendations. Practice shows that the V.11 specification is greatly favoured, primarily because of the differential amplifiers used for drivers and receivers. We can thus summarize as follows: Hardware standards for various requirements are available, but either these standards allow variations and reference to different sub-groups, or designers modify them at their own discretion; Software is, for several classes of application, only very insufficiently specified. The only reference for protocols is the ISO standards family 1155, 1745, 2111, 2628, and 2629 in which 'basic mode control procedures' have been defined (references from ECMA or DIN are available).
211
3. Concept for a Solution
There have been a number of working meetings at the Physikalisch-Technische Bundesanstalt (PTB) with participants from German industry and from several associations, some of which are part of a European federation. The idea was to find out: what the state of the art is: - which requirements are needed from the technical and economic point of view, relating to hardware (physical, electrical) and software (protocol, error detectioi1): what is acceptable regarding the verification law and the PTB resources: what the technological and manufacturing trends are: - where restrictions could arise from the fact that some producers have plants in several countries, and intend to sell their products not only nationally, but also regionally (e.g., in Europe) or even internationally. The hardware situation is as follows: Connections according to V.24 (or RS-232-C) are sometimes in use, often without control lines (only pins 2, 3, and 7), but in other cases, with at least two control lines. In most cases, a 20 mA current loop (TTY interface) forms the transmission medium. This is especially true of low-cost systems. Some innovative producers are already using V.11 drivers and receivers. The software situation can be characterized by the definition of three levels: the lowest is that control codes are not defined at all. This means that data bytes are transmitted without 'Start of text', etc. Another group of designers use codes defined by the 1SO family 1745 etc. But, of course, there are as many implementations as there are designers. The highest level is distinguished by more sophisticated protocols including interrupt structures, time controls, repeaters, and so on. The discussions resulted in the following being realized: The hardware of digital interfaces has been standardized covering differing fields of application. Tools for the software definition (protocol) have also been specified. But there is no standard available which completely defines an interface, that is, which defines the mechanical, physical and electrical characteristics and the software in an unambiguous form.
H. Schumny / Interface Problems
212
It was therefore decided that: (1) One entire interface recommendation or, if necessary, a family of consistent interfaces should be defined; (2) These recommendations should be established as official standards - first national, but later also regional (as European standards) or even international; (3) The interface recommendations should be implemented and test equipment should be developed.
4.
First
Results
In the first step, hardware and software were defined in order to cover existing systems (that is, point-to-point connections) and to keep open future developments.
4.1. Hardware
7477-1981. I S O / D I S 7480 has been cited as reference for the signal quality. The ISO 4903 15-pin D-Sub connector is the first choice. But, also permitted are: - marked clamps; 9-pin D-Sub; - c i r c u l a r connector (e.g., IEC 10, IEC 11, or DIN 45 329), for instance with 7 pins (4 signal, 1 ground, 2 for remote 5 Volts). The construction and test of this interface is to be performed according to the framework directive for measuring instruments of the European Community. -
4.2. Software At present, the software recommendations lay down transmission protocols or basic control modes at three levels:
(A) Data transmission without control codes
(i) CS interface (current serial) according to D I N 66 258 part 1 This, in fact, is the 20 mA TTY current loop using the 25-pin D-Sub connector (series 17). The following connections are also permitted: marked clamps; - 9-pin D-Sub according to ISO 4902. Two alternative pin configurations are shown in Fig. 1. The alternative 2 / 3 / 4 in optional instead of the "standard configuration" 2 / 4 ; 6/8. -
This most primitive procedure uses the ASCII code (ISO 646 or ECMA-6 or DIN 66003) and vertical redundancy check (VRC) with even parity. Control codes are not used.
Transmitting station (Noster) 01
0 000
011
STX Start of Text
Text (II) Serial interface according to V.11 (or RS-422) RS-422 (in Germany DIN 66 259 part 3) defines the electrical characteristics of a balanced (that is, differential) interface (see Table 2). The physical characteristics are chosen from I S O / D I S I
,1 0 0 0 0 0 0 x xxxx xy 2o 26 p
ETX End of Text Block Check Character
]
L_AHernotive-- ----I
Shield
Briver {
Eommon return
]
.I.
::::;:::l -T
r----
~ J
Signolground
Responses of receiving station (Slave) I O 1 1 0 0 00iOI [1010100,
} Receiver
Fig. 1. Pin configurations for the 9-pin D-Sub connector according to ISO 4902.
I0 0 1 20
ACK Acknowtedge
[1 I NAK Negative Acknowledge i
0 0 0 0111 EOT End of Transmission 26~,p
Fig. 2. Protocol according to level B of D I N 66 258 part l.
H. Schurnny / Interface Problems Table 3 Control codes and functions for the point-to-point protocol level C Polling mode including: ~,ENQ polling address 1,ENQ selecting address ENQ none address at contention mode (enquiry) ENQ calling or abort EOT end of transmission STX ETB ETX
control codes
NAK ACK ~,1
negative acknowledge positive acknowledge (DLE 3/q~, 3/1)
DEE 3/15 - WAIT: not ready for data until timer A stops I)LE 3/12 - RVI; reverse interrupt; only at contention mode Time T¢ T1 1"2 -
supervision: Receiver supervision Response supervision Operating mode supervision
Repetition counter for: calling phase and link phase (B) Protocol according to level B of D I N 66 258 part 1 This low-level p r o t o c o l is roughly d e s c r i b e d in Fig. 2. In a d d i t i o n , enquiry ( E N Q ) a n d t i m e - o u t s are allowed. V R C a n d b l o c k check m u s t have even parity. (C) Higher-level protocol for point-to-point connections This p r o t o c o l use the c o n t r o l codes a n d functions which are listed in T a b l e 3. T h e control codes are taken from I S O 1745 ( E C M A - 1 6 or D I N 66019). T h e time controls a n d r e p e t i t i o n counters have been r e d u c e d as m u c h as possible. T h e W A I T f u n c t i o n indicates that a slave station is not r e a d y for data. T h e reverse i n t e r r u p t ( R V I ) allows a slave station in c o n t e n t i o n m o d e to stop the transfer for a specified time. This p r o t o c o l has a l r e a d y been i m p l e m e n t e d b y industry. It seems to b e possible to u p g r a d e it for m u l t i p o i n t systems.
213
5. Implementations and Future Plans T h e results d e s c r i b e d in section 4 have b e c o m e the basis of one G e r m a n d r a f t s t a n d a r d D I N 66 258 part 2. W i t h this, the first two s t a n d a r d s of a new family for ' I n t e r f a c e s a n d basic d a t a link c o n t r o l for d a t a c o m m u n i c a t i o n ' are: D I N 66 258 p a r t 1 ' C S interface ( T I ' Y ) and VS interface (V.24/V.28)', D I N 66 258 part 2 ' B a l a n c e d interface for startstop transmission using basic d a t a link control p r o c e d u r e s on p o i n t - t o - p o i n t c o n n e c t i o n
(V.11)'.
Part 3 of this family has been reserved for a m u l t i p o i n t interace (including m u l t i p o i n t p r o t o c o l ) to be d e v e l o p e d in the near future. The need for identical E u r o p e a n or w o r l d w i d e s t a n d a r d s will be discussed. Similar efforts will result in interface testers which e m u l a t e the h a r d w a r e as well as the p r o t o cols of s t a n d a r d interfaces. A t the p r e l i m i n a r y stage, the i m p l e m e n t a t i o n follows Fig. 3, which m e a n s that p r o c e d u r e s are written in B A S I C to m a k e p o s s i b l e an interactive change of p a r a m e t e r s a n d control structures, and to simulate c o n t r o l states of the station u n d e r test, including error handling. Because of the relatively slow B A S I C i m p l e m e n t a t i o n , a final version with m a c h i n e c o d e instructions should follow. A one-chip C M O S device can d o the j o b , a n d a h a n d - h e l d a u t o m a t i c tester could be expected as a final result.
V.24serial interfaces \\\
HP-85 ~ - ~
~
\
HP-85
!
V.ll adapters (or futureimplementations) Fig. 3. Implementation of an interface emulator system programmed in BASIC.