Standardised interfaces for intelligent measurement H. Schumny Physikalisch-Technische Bundesanstalt, Braunschweig, FRG Keywords: Personal instrumentation, de facto standards, serial and parallel interfacing, networking
Introduction Modern measurement techniques are in all disciplines, at least, influenced by microelectronics and information techniques. The 'master module' of an instrument or a measuring system can be a microprocessor, a microcomputer or a mainframe (or a combination of these). One result of microelectronics technologies is the onechip microcomputer including in the same package a complete system with a CPU, RAM, ROM, I/O ports, drivers, converters, etc (see Fig 1). Industrial controllers and measuring instruments are often based on such devices. Microcomputers come out in different forms: as singleboard CPUs, board-level systems, or closed units. In very many cases is a low-cost desktop computer the direct controller or the system's central processor. Terms in use for this kind of machine are workstation or personal computer (PC). We are now in the situation that most of the workstations or PCs are constructed according to specifications defined by IBM: the open and modular concept
i
5V
[1 J k_)
40
OrechipEPROM
i Fix, 1 One-chip microcomputer 50
21
that has become a worldwide de .[acto standard for personal computers. At the time being the main 'compatibility' criteria are those given with Table 1. But unfortunately there is a serious drawback inherent in the PC/XT/AT 'standard': it is intentionally designed for business applications and office automation. That means that special extensions and adaptations (hardware and software) arc needed when using a 'standard P C ' for engineering applications. The degree of compatibility can vary. Several PCs run under MS-DOS but differ in the BIOS or graphics control. Others use specific disk formats or size (or both). Compatibility goes up near 100 % if the operating system is identical to PC-DOS, the IBM MS-DOS version, and the IBM diskette format is used (software compatibility), and the internal IBM slots, the so-called PC Bus, as well as the keyboard and graphics are identical (hardware compatibility). The near-100% degree of PC compatibility is worldwide, supported by an innumerable amount of designers and producers of software and hardware. Even specialiscd real-time operating systems are now available allowing ' s t a n d a r d ' PCs to be used for measurement and control but still providing all MS-DOS advantages.
Concepts of intelligent measurement Intelligent measurement is mainly characterised by computer control. That is, instruments or systems either have a built-in processor ('stand-alone') or must be connected to a computer ('computer-based'). With this we classify intelligent instruments by the following: • stand-alone • computer-based
(compact, dedicated) (modular, flexible).
Stand-alone instruments have all necessary components included in one casing and therefore function autonomously. There is often an interface interconnecting with a host computer by which the instruments run under program control. This is a priori the case (and is necessary) with computer-based systems where the controlling part can be a mainframe or a personal computer (PC}. In the latter case the designation Personal Instrumentation (Pl) will be used. A first generation of intelligent instruments interfaced the computers with dedicated instruments through an IEC-Bus. The next generation took the form of boardlevel instruments, hooked directly on to PC buses. Indicative of the emerging third generation, which combines the advantages of dedicated and board-level instruments, are intelligent front-ends that acquire and analyse signals and data. Measurement
Vol 5 No 2, Apr-Jun 1987
Schumny TABLE 1 : Specifications for "compatible' PCs
Microprocessors Co-processor Main memory Floppy disks Winchester Graphics resolution Operating system
PC and XT
AT 286
AT 386
8088, 8086, 80186 8087, 80187 up to 640 Kbyte 5~", 360 Kbyte 10-20 Mbyte 320/640 x 200 ... 720 x 350 MS-DOS v.2
80286 80287 several Mbyte 5~4 ~', 1.2 Mbyte 2 0 4 0 Mbyte > 100 Mbyte 640 x 350; 640 x 480 ... 720 x 350 MS-DOS v. 3; later 5 UNIX version
80386
Usually the modular design preserves the flexibility of board-level approaches, in which features can be added or deleted as required in building-block fashion. At the same time, the system performs on a par with conventional dedicated instrument systems, but eliminates their redundant manual control and displays (See Fig 2). The following list shows the basic concepts of instrumentation. (1) Components have direct access to the processor bus of a system (fastest version). In some implementations stackable or changeable blocks can be used. (2) Boards have access to the backplane or system bus of a PC. Free slots can take up acquisition or measuring boards. (3) Bus extension means that an external box is connected to the PC by only one slot. This guarantees more free slots for (eg) interface cards, but the bus length is limited to about 2 m maximum. (4) The IEC Bus (also called IEEE-488) is a peripheral system allowing up to 15 devices to work together with a bus length of no more than 20 m, which seems particularly suited for laboratory automation. (5) Serial interconnection allows wider distances - depending on the technology used, up to 1 km, but only 20 m and slow with RS-232. Communication inside a building or control of a factory floor is possible.
~eQs UreY~e~Jc
~'taO.surin9 ~oc~x Fig 2 Concept of personal instrumentation (PI) M e a s u r e m e n t Vol 5 No 2, Apr-Jun 1987
(6) Front-end as subsystem is the latest concept. It allows the design of powerful, flexible and economical measuring and control systems. Before discussing interface and bus details, we will mention the ISO Reference Model for Open Systems Interconnection (OSI RM according to ISO 7498). This is now the accepted basis for interface specification. Western countries, for example, have agreed upon a harmonisation strategy by which uniform European interface standards for Open Systems Interconnection are to be created. Intelligent measurement is a special field where such harmonised standards will be applied.
Some principles and requirements Interfacing is, unfortunately, a matter of different interpretations, and the realisation can vary considerably depending on the application and level of interactions. We, therefore, will first define some principles and later discuss the most important interface standards. Main aspects for these discussions are: synchronisation of all interactions; real-time behaviour by which the response time is restricted to a span no longer than one process or measurement cycle; data rate, noise, distortion, and electromagnetic interference. This means that the electrical characteristics of interface circuitry and transmission lines are of relevance, as are the access method and controlling software protocols. One of the main principles is to allow an event to interrupt a running program, centrally or peripherally initialised. The first case is deterministic because it underlies software control. Only peripherally initialised 'service requests' can be immediately responded to. Identifying an interrupt source is usually done by polling, that is, software controlled reading, but this is only moderate concerning response time. For the fastest transfer of measurement data, a Direct Memory Access (DMA) channel should be implemented. With this, a data transfer rate of several hundred kbyte/s becomes possible. Buffering is a main principle for handling I/O operations. A buffer is a memory cell or block for the temporary storing of data. Buffers can be of constant size and dedicated to specific peripherals; or they are dynamically available for all peripheral units. Of special interest are alternate buffers which allow buffer loading and transferring of data at one time. Some I/O ports need a buffer with a size identical to the processor word length. A one-bit buffer is called a 'latch'. If a measuring system consisting of several devices is to 51
Schumny be configured, the topology used can be important. Most obvious is the classification in point-to-point and multipoint interconnection, the former being the one mostly used. Multi-point systems can have (physically and logically) the topology of a star, a ring or a true bus. Very specific interfaces and protocols are needed to manage the addressing and access procedures in a multi-point measuring system, and to prevent breakdown or even damage. The system control can be centralised or distributed (at least temporarily). Of particular importance is the way the control information is transmitted. A distinction is made between:
• hardware control in this case there are additional control lines (eight in the parallel IEC bus, and at least four in some serial systems) • s~?[tware control all signalling, handshaking, etc is managed by a software protocol which transfers ASCII or other control characters via the data line. Software control is the more up-to-date method although it seems to be slower than hardware control. This restriction can be compensated by the often very high transfer rates (eg, 10 Mbit/s), but interrupt handling and handshaking could become impaired. A combined method where a separate interrupt line joins the one information line may be a solution for short response times. The electrical interconnection method is another relevant criterion. The two basic techniques are: • unbalanced sometimes called single-ended, which is the more antiquated version, eg, used with serial RS232 interfaces • balanced often designated as the differential method, cg, used with modern RS-422 interfaces. The latter technique allows galvanic isolation and guarantees relatively high EMI suppression because of its inherent common mode rejection, especially when used together with twisted-pairs. Of added value is the high data rate (up to about 1 Mbit/s) using long transmission media (up to 1 kin). Programming of interfaces is the least standardised and supported part of intelligent measurement. The programming languages mainly used have only control structures for standard I/O, that is, for a printer or simple serial file transfer, but not for process peripherals, interrupt handling or DMA. There are some special process controllers available which provide excellent support for process 1/O. One disadvantage with these is that they are not compatible with the up-to-date industrial standard workstations and cannot run the numerous MS-DOS software (eg, data acquisition and evaluation packages like Asyst, Notebook, or spreadsheet programs like Lotus).
"De f a c t o ' and official s t a n d a r d s The relevant interfaces for personal instrumentation and intelligent measurement are partly defined in written standards; others are defacto or industrial standards. The following is a selection of these: • System buses Multibus, VMEbus, PC Bus. • Peripheral, parallel - TTL, BCD, IEC-Bus. • Peripheral, serial 20mA, RS-232, RS-422, Serial Bus. 52
\\ \\
INT CPU
GPIO
X
RAM ROM
INT
\\
GPIB
System Bus
, ,
-.'C-C'-.
INT Serial
\X
Fig 3 Microcomputer with a minimum equipment ~[ interfaces Jor intelligent measurements. GPIO." General Purpose Input Output GPIB." General Purpose Interface Bus (identical with IEC-Bus Mr IEEE-488 Bus) Fig 3 is the schematic diagram of a microcomputer system showing the minimum equipment of interfaces for use in intelligent measurement. Table 2 lists the most important system buses. A few of these are processor-independent (eg, STD- and S-100 bus). Some have, judged from their market position, a high relevance; for instance, the buses from DEC, Intel, Motorola, TI, Zilog, and can, therefore, be considered to be de facto standards. The Multibus, VMEbus, and PC Bus predominate, all of them processor-dependent, but plug-in boards are available all over the world. There are also a number of 'institutional' and independent activities, some to be seen from ISO and IEC, but dominated by the IEEE which in the bus field has the following projects running: P 696 P 796 P 896 P P P P P P
S-100Bus, 8 - a n d 16-bit Multibus Advanced Microcomputer System Bus (Backplane or Futuerbus) 959 I/O Expansion Bus 961 STD Bus 970 Versabus 1000 STE Bus 1014 VMEbus. 1296 M u l t i b u s l l
Very recently, an IEEE Working Group began evolving from the Personal Computer Extended Technology Standards Committee (PCET). That industry's ad hoc group released its first version of a bus specification aimed at IBM PC-ATs and compatibles. The document, which contains details for a proposed standard 16-bit bus (with 32-bit extension), will eventually become a design standard sanctioned by the IEEE. A main trend is that new developments follow the Eurocard standard with boards mechanically designed M e a s u r e m e n t Vol 5 No 2, Apt Jun 1987
Schumny TABLE 2: Important system buses Bus
Source (standard)
Processor
ECB STD STE G-64
Kontron and others Prolog, Mostek (IEEE P961) (IEEE P1000) Gespac (single Eurocard)
Z80 independent independent independent
ZB I Q E-/T-
Zilog DEC and others Texas Instruments and others
Z80/Z8000 LSI-11 9900
8/16 16 16
S-100 Euro
many (IEEE P696) Ferranti (ISO/DP 6951; BSI)
independent independent
8/16 18
IBM PC
IBM and very many others
8088/8086
Multi AMS-M
Intel, Siemens a.o. (IEEE P796) Siemens (IEEE P and IEC)
80 family 80 family
8/16/32 8/16/32
Versa VM E
Motorola (IEEE P970) Motorola, Mostek, Philips, Valvo/Signetics, Thomson and others (IEEE P1014)
6800 68 000
8/16 8/16/32
Fast Future
NBS (IEEE P896)
independent independent
32 16/32
Nu
Texas Instruments
99 000
16/32
according to DIN 41 494 and indirect connectors (DIN 41 612). It should be pointed out that IBM with the PC Bus did not follow the Eurocard standards. Parallel interfaces using T T L chips are often called ' T T L interfaces' and can be considered as accepted industrial standards for fast point-to-point interconnection. They are inexpensive and flexible, but usually require assembler programming. Only in the case of system integration is high-level programming possible. The term 'BCD interface' is misleading because it is actually a T T L interface with four-bit ports each used for one binary coded decimal digit. Of eminent importance for measurement and control is the IEC-Bus, of which all specifications have been published by IEC 625 and IEEE 488-1975. Both standards are almost identical. They differ only in the connection: IEC specifies a 25-pins connector, IEEE a 24-pins version. Many measuring devices and workstations are equipped with such a bus interface. For workstations of the PC or AT types, add-in boards are available. There are, however, some problems resulting from the bus specification and the unsatisfactory software situation: (1) Only 15 devices can work on the bus; the possible distance between devices is only 2 to 3 m; the total bus length is no more than 20 m. (2) Transmission rate of sometimes less than 100 readings/s, with 16-bit computers up to about 10000 readings/s. (3) Software has not yet been sufficiently specified; projects and documents: IEEE 728-1982 (Code, Format), IEEE P981 (Device Messages). This IEC-Bus (or IEEE 488 Bus) is the backbone of first generation instrument systems which build in very many laboratories the standard tool for automation. That means, they use bus controllers (eg, Fluke, Kontron, HP, Siemens, Tektronix, Wavetek) together with complete measurement devices able to work on the bus. Based on the open PC architecture is the second generation turning into laboratories and manufacturing sites. A growing M e a s u r e m e n t Vol 5 No 2, Apr-Jun 1987
Data bits
8 8 8 8/16
8/16
number of hardware and software suppliers push this trend and will keep the PC alive even if IBM stops production. Serial interfaces have their origin in specifcations of the post administrations. Adapting these to data processing has caused a number of problems we now have to live with, but there are also some adaptations and specialised developments worked out mainly by the EIA, IEC, ISO and DIN. Table 3 lists all relevant serial standards, including multi-point versions under development. The most important serial interface is that defined in EIA RS-232-C, in Europe often called the 'V.24 interface'. But the CCITT paper V.24 is only a list of about 50 signal names for telecommunication. Electrical characteristics are fixed in V.28, connectors are defined in various modem standards. RS-232 is a V.24 subgroup including electrical and connector specifications (25 pins). The main disadvantages are: (a) Designers are free to choose different sub-groups of control lines. (b) CCITT and EIA specified a computer-to-modem operation; if there is no modem, then data lines 2 and 3 must be connected cross-over (null-modem); the data rate and distance are largely limited. (c) The circuits require + / - 12 V, which is incompatible with the standard 5-V technology. (d) The single-ended driver and receiver configuration implies cross-talk and noise susceptibility. (e) Galvanic isolation is ineffectual because of the ground symmetry. To overcome these drawbacks, CCITT and EIA published the papers V.11 and RS-422, respectively, describing balanced (differential) interface devices. We mentioned the main characteristics earlier. Some of the additional advantages are: • power supply only 5 V; twisted pairs up to about 1 km; • transmission rate up to 10 Mbit/s. One consequent step was to make the V.11 chips 53
Schumny TABLE 3: Serial standards; PP: Point-to-point; MP: Multi-point Name
Standards
Typical line l e n g t h
20mA
DIN 66 258/1 66 348/1
300m
2, 4kbit/s
PP
V.24
DIN 66 020/1 66 259/1 RS-232-C; V.28
20m
19, 2kbit/s
PP
V.11
DIN 66 258/2 66 259/3 RS-422
10m
10Mbit/s
PP
RS-485
DIN 66 258/3* 66 259/4* ISO 8482
ISDN
for ISDN using <1 V
Transmission rate
1 km
100 kbit/s
up to 1 km
up to 1 Mbit/s
MP
MP
*under preparation
capable of multipoint operation. The electrical characteristics are now fixed in RS-485 and ISO 8482. The idea is to make available a low-cost system, eg, for 32 devices coupled together by twisted pairs of 500 m bus length and with a data rate of about 500 kbit/s. The protocol for such a bus is under discussion. More on networks follows in the next paragraph.
Networking Intelligent measurement equipment is not always of the stand-alone or laboratory environment type, but is used increasingly in complex and extended systems. Networking, therefore, becomes more and more relevant. The main standardisation bodies for LANs are the ECMA and IEEE, the latter running the following projects: P802.1 P802.2 P802.3 P802.4 P802.5 P802.6 P802.7
General Structure Logical Link Control CSMA/CD (Ethernet) Token Bus Token Ring Metropolitan Area Network (MAN) Broadband Technical Advisory Group.
One strategy is to integrate LANs in a hierarchy extending from system buses over peripheral connections to Wide Area Networks (WANs), which are mostly public nets. The complete hierarchy (with some examples) is shown in the following. • Internal system bus
Multibus, VMEbus, PC Bus
• Peripheral, point-to-point. TTL, RS-232, RS-422 • Peripheral, multipoint IEC-Bus, Serial Bus • Fieldbus Proway, PDV-Bus, Manchester Bus • LAN Ethernet, PC Net, MAP • WAN Private and public networks. Fieldbus is a term often used for LANs specialised for
54
process automation in smaller environments. Some implementations offer a gateway for the IEC-Bus and another for LANs. Several IEC standardisation projects deal with Process Data Ways (Proways); the West German PDV-Bus proposal has been published as DIN 19 241; chips and boards are available from several sources. The Manchester Bus (or Avionics Bus) is well known as MIL-STD 1553, and is supported by a number of manufacturers. The industrial LAN ' M A P ' (Manufacturers Automation Protocol) has meanwhile received support from all the relevant firms, since it will define all seven ISO layers using existing and stable standards. It can be expected that gateways will be available to interconnect both to a field bus and to a WAN.
Bibliography Lesea, A. and Zaks, R. 1981. 'Microprocessor interface techniques', Sybex, Paris. Schumny, H. 1981a. ' Interface problems in computerised measurement', IMEKO Summer School, Dubrovnik, 2945. Schumny, H. 1981b. 'Interface and bus standardisation', Microprocessing and Microprogramming, 7, 266-268. Sehumny, H. 1983a. 'Interface problems in legal metrology', Microprocessing and Microprogramming, I1, 243-247. Schumny, H. 1983b. 'Measurement and process control need clearly defined interfaces', Microprocessing and Microprogramming, 12, 115 118. Schumny, H. 1985. 'Technical applications of PC's', Euromicro Tutorial, Brussels. Schumny, H. and Schuster, H.-J. 1980. 'Distributed intelligence in an automatic nuclear measurement system', CPEM, 21(~212. Stone, H. 1982. Microcomputer interjacing, AddisonWesley, Amsterdam. Sunshine, C. A. (Ed). 1981. Communication protocol modelling, Artech House, Washington.
M e a s u r e m e n t Vol 5 No 2, Apr-Jun 1987