Industrial Networking Systems
Industrial Networking Systems
Industrial Networking Systems
Anthony J. WETHERILT
UNIDO-ICHET
Sabri Ulker sok, 38/4
Cevizilbag, Zeytinburnu
34015 Istanbul
TURKEY
________________________________________________________________
These lecture notes are intended only for distribution to participants
Industrial Networking Systems
James Wetherilt∗
UNIDO-ICHET
Sabri Ulker Sok, 38/4,
Cevizlibag, Zeytinburnu
34015 Istanbul
Turkey
LNS
∗
[email protected]
Abstract
Until recently, industrial networking relied heavily on serial based systems
for communication. The physical layers of several such systems are discussed
and communication protocols presented for Modbus, Profibus, Fieldbus and
CANOpen. Industrial Ethernet and bus systems making use of them are
presented. The use of OPC servers as universal interfaces for SCADA systems
is introduced with reference to the OPC Data Access Specification.
Contents
1 Introduction 1
2 Serial communications 1
2.1 RS 232 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
2.2 RS 422/449 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2.3 RS 485 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 Communicating over a RS 485 network . . . . . . . . . . . . 5
2.4.1 Common elements of address based communica-
tion protocols . . . . . . . . . . . . . . . . . . . . . . 5
2.5 Controller Area Network (CAN) . . . . . . . . . . . . . . . . . 7
4 Industrial Ethernet 18
6 Future trends 22
1
1 Introduction
Throughout most of this workshop we will have been talking about the various
methods of networking using the full power of TCP/IP running over Ethernet or
similar physical systems. With modern techniques and hardware what can be
done with such systems is limited basically only by one’s imagination and expe-
rience. Nowadays everyone appears to need TCP/IP and Ethernet in one form or
another and it should thus be found wherever intelligent sensors provide data for
analysis systems. The hard facts of life, however, do not entirely bear this rosy
picture out: there are large data processing wastelands where neither TCP/IP
nor Ethernet can be found and other lower performance networking systems are
routinely employed for control and monitoring purposes. Industrial plants, in
Europe at least, until recently, traditionally have rarely had Ethernet installed:
it is almost entirely confined to office use and seldom ventures onto the factory
floor. Yet monitoring and control are vitally important fields for the process en-
gineer. No industrial plant of even moderate scale could perform without the so
called SCADA (Supervisory Control And Data Acquisition) and DCS (Distributed
Control Systems) software monitoring systems showing the status of critical pro-
cess components.
This chapter reviews the basics of industrial networking solutions and dis-
cusses some of the protocols used for industrial process control. We will begin
by discussing the physical bases of serial communications used by common pro-
tocols. Next we will discuss the systems most commonly used in practice and
show how their protocols work. Industrial Ethernet and the recent extensions of
the common protocols to Ethernet will also be discussed. Finally, we will discuss
briefly attempts to provide a common interface between SCADA systems via the
OPC (OLE1 for Process Control) standard.
2 Serial communications
2.1 RS 232
Since the early days of computing and more recently, the advent of the PC, the
serial communications port has been virtually obligatory on every machine. The
RS 232 standard of the Electronics Industry Association (EIA) is probably the
most well-known and most implemented standard in the history of the computer.
It is also probably the most non-standard ‘standard’ as every implementation
seems to differ from the next. The standard specifies a pair of data transmission
lines (RxD, TxD) together with a common return ‘ground’. Additionally, there are
several control lines intended primarily for modem handshaking control. In its
simplest form therefore, RS 232 communications can be achieved with just the
two data transmission lines and common return. There are however additional
complications that make this simple case difficult to implement. Firstly, equip-
1
Object Linking and Embedding
2 Industrial Networking Systems
2.2 RS 422/449
To overcome the problems inherent with EIA RS 232 communication techniques,
the EIA RS 422 electrical standard was developed. RS 422 uses balanced differ-
ential drivers (labelled A or - and B or +) for transmission of data over twisted
pair cables. Any externally developed noise is induced equally onto both wires
of the twisted pair and hence cancels out. Data rates of up to 100 Kbits/s at
1
The problem is knowing, in advance, what type of device a given piece of equipment thinks it
is. A simple method involves measuring the voltages between the signal ground and TxD or RxD.
If VTxD < −3 V then the device is a DTE; conversely if VRxD < −3 V then the device is a DCE.
3
Pin no Function
1 Frame ground
2 Transmitted data TxD
3 Received data RxD
4 Request To Send RTS
5 Clear To Send CTS
6 Data Set Ready DSR
7 Signal ground
8 Received line signal detect
9 Secondary Clear To Send
6 Data Set Ready DSR
7 Signal ground
8 Received line signal detect
9 Secondary Clear To Send
10 Received line signal detect
11 Undefined
12 Secondary Received line signal detect
13 Secondary Transmitted data
14 Secondary Clear To Send
15 Secondary Transmitted data
16 Secondary Received data
17 Receiver Signal element timing
18 Undefined
19 Secondary Request To Send
20 Data Terminal Ready DTR
21 Signal Quality Detector
22 Ring Indicator RI
23 Data Signal Rate Selector
24 Transmitter Signal Element Timing
25 Undefined
2.3 RS 485
The next instance in our discussion of bus types is the backbone of modern in-
dustrial communications. Like the RS 422 standard it uses balanced differential
drivers and receivers to achieve low noise over long distances at high data rates.
Its main difference is that whereas RS 422 specifies that the output driver is
always active, RS 485 allows the output driver to be activated only during actual
data transmission and disabled at all other times, by tri-stating (employing a
third, high impedance output state in addition to the usual low and high states)
the output. This allows transmission and reception between multiple devices
over a two wire twisted pair bus (plus an additional signal ground). As before
bus contention must be avoided by ensuring that only a single device is active
at a given time. This is generally achieved in software by the use of a designated
bus master, which decides which device is to talk.
The voltage states on the differential lines can be one of the three states: ON;
OFF; and High Impedance. When all drivers are in the high impedance state, the
voltage on the data line can drift to values in excess of the safe common mode
limits, and bias resistors should be used to bring the idle voltages to safe levels
without seriously loading the system at other times. A pull up resistor to 5 V
and a pull down resistor to ground should be attached to the B and A terminals
respectively. The exact value of the resistors depends on many factors including
the cable length, number of attached devices and so on.
At high data transfer rates or long cable lengths problems with reflections can
occur if the lines are not terminated correctly. We can determine the maximum
5
data rate an unterminated line can accept for a given set of conditions1 . Correct
termination can be achieved by placing a resistance greater than or equal to (over
damping is generally preferred to under damping) the characteristic impedance
of the line between the two members of the twisted pair at each end of the cable.
It is not necessary to terminate the individual tapped nodes. Together with the
biasing resistors this technique is known as power termination.
The input impedance of each receiver is specified as being at least 12 kΩ.
At this impedance a minimum of 32 devices can be attached to the network
segment. If more than 32 devices are required, line repeaters must be employed
at suitable intervals. Alternatively, multiport serial adaptors can be used in the
host PC to set up multiple segments with up to 31 attached devices in each
segment. In this manner literally hundreds of devices can be attached to the
network and monitored from a single machine.
A common addition to RS 485 bus systems is a layer of optical isolation be-
tween the transceivers and the device. Industrial equipment can produce large
electrical pulses from the rapid switching of high currents and despite all other
precautions these pulses often find their way on to the twisted pairs where they
manifest themselves as large voltage spikes of very short duration. Such spikes
are often fatal to microprocessor based instrumentation causing resets, cor-
rupted data and other problems. Optical isolation can reduce the effects of these
pulses to manageable proportions allowing devices to function under electrically
aggressive environments.
MASTER SLAVE
MASTER SLAVE
device to receive the command (as well as the address of the sender in a true
multipoint network), the command itself, any data needed by the command and
finally some form of checksum for ensuring that the command packet does not
get scrambled en route to the receiver. In some cases the number of bytes in
the command is fixed, in others the size will depend on both the nature of the
command and any data associated with it. Many protocols start with the ASCII
character “Start of Text” (STX) that has the value 2. Depending on the total
number of devices that need to be addressed, the address field will require 1 or
two bytes. As a total of 256 devices is often sufficient, we will use one byte for
this purpose. We will also assume an arrangement in which one device (typically
the host PC) is designated as the master. In this case we do not need to include
the sender’s address, which we can set to a reserved value (typically 0 or 255).
For simple devices, the number of commands will rarely exceed 256 and so one
byte can be reserved for this purpose. We can also assume that the device can
work out how much data will be sent from the command and it is therefore not
necessary explicitly to reserve a field for this value. Finally, we must indicate a
checksum value that can be constructed from the other bytes in the packet and
reconstructed again by the receiver to check the validity of the packet. There are
many ways of constructing this checksum but we will use the simple method of
forming the “exclusive OR” of the previous bytes in the packet and using this as
the checksum. The receiver will take the packet and again form the “exclusive
OR” of all its bytes. If this value is not zero, the packet has been corrupted and
should be sent again. A typical command packet structure is shown in figure 2.
A good protocol should also specify the response of the receiver to each com-
mand. A satisfactory way of doing this is to echo the first three fields (STX,
ADDRESS, COMMAND). In this case the address field is the address of the re-
sponding device, and COMMAND is the sent command if it was received satis-
factorily or a separate command indicating a receiver error. Again, data may be
sent with the packet and the checksum added as the final byte.
Protocols such as this are simple to implement and are sufficient for remark-
ably sophisticated devices. The actual protocol described here has been used for
multidrop master-slave communications in several instruments.
Function
CAN L (CAN-) Dominant Low bus line
CAN H (CAN+) Dominant High bus line
CAN GND Common ground return
(CAN SHLD) Optional shield
(GND) Optional power ground
(CAN V+) Optional power supply
performs a similar role for the Fieldbus. Whereas Profibus is almost exclusively
European, Fieldbus is the emerging standard in North America and any com-
pany seeking to sell its products in that region had better seriously consider
its implementation. All three systems (Modbus, Profibus and Fieldbus) have
organisations active in embedding their technologies in TCP/IP over Industrial
Ethernet.
The final modern fieldbus to be discussed is CANOpen and is based on the
CAN system described earlier.
Since each of these systems is a topic in its own right, in this chapter we will
give only an overview of the important points in each case.
3.1 Modbus
Modbus uses a twisted pair connection for multidrop communications with one
master and up to 247 slaves. All communications are initiated by the master
and devices talk only in response to a master command. The Modbus protocol
establishes a format for all commands and responses and each packet contains
the desired device address, the command code, any data needed by the command
and an error-checking field. If a device receives a command that either contains
an error or in executing that command the device is in error, the device can
construct an error response containing relevant information.
Modbus uses two distinct modes of communication: ASCII mode or Remote
Terminal Unit (RTU) mode. The mode is selected along with the other commu-
nication parameters (Baud rate, parity, data bits, stop bits, etc) during initial
configuration. It is essential that all devices are configured in the same way as
otherwise the entire network will probably fail.
The start of each packet is always signified by the ‘:’ character and the end
with a carriage return-line feed pair. The longitudinal redundancy check (LRC) is
10 Industrial Networking Systems
calculated as follows. The values of each byte of the message (excluding both the
starting colon and the terminating CRLF pair) are added together without carry
and then two’s complemented to form the result.
In RTU (Remote Terminal Unit) mode each message frame must be preceded by
a period equal to at least 3.5 characters at the selected baud rate. Similarly,
if more than this period of time elapses between successive bytes transmitted
during a message, the packet is assumed to be finished. On the other hand, if a
period less than this value occurs between successive packets, the two packets
are considered as one. This gives the packet structure that is shown in figure 4.
The transmission of each byte consists of one start bit, eight data bits, an
optional parity bit and one or two stop bits (depending on whether parity was
selected). The characters are transmitted as two digit hexadecimal values within
the eight bits of each field.
Calculation of the Cyclical Redundancy Check (CRC) used in RTU mode is a
much more complicated affair than for ASCII mode. First a sixteen-bit register is
loaded with ones. Then each data byte is first exclusively OR’ed with the register
and the contents of the register shifted right towards the least significant bit
(LSB), zeroes being padded in the most significant bit. If the LSB is one, the
register is again EOR’ed with a preset value. The process continues until eight
such right shifts have occurred. Successive data bytes are then subjected to the
same process to obtain the final CRC.
3.1.2.2 Broadcasting The master can broadcast to all slaves by setting the
address field to zero. Any slave receiving such a broadcast will perform the re-
quired action but will not respond for obvious reasons. In particular this means
that error responses will not occur with broadcasts.
11
3.1.2.3 Data and control functions Modbus defines a number of data and
control functions intended to permit a variety of simple instruments and devices
to be controlled by a uniform command set. These are summarised in table 3.
3.2 Profibus
Profibus is a considerably more complex system than Modbus, and is a more
modern attempt to address the problems of device interoperability. It was de-
signed using the Open System Interconnection (OSI) model shown in Figure 5
and utilises layers 1, 2 and 7 of that model.
Layer 7 Application layer (FMS, PA)
Layer 6 Presentation layer
Layer 5 Session layer
Layer 4 Transport layer
Layer 3 Network layer
Layer 2 Data link layer
Layer 1 Physical layer
At the bottom of the model, the Physical layer describes the physical charac-
teristics of the transmission medium. Most frequently this is the RS 485 technol-
ogy discussed earlier, but also can be fibre optic technology. When used with RS
485 cabling Profibus uses four wires: a single twisted pair for data transmission
and one wire for ground return and a second wire at +5 V. All are shielded. Power
termination is used at both ends of each segment, which can have a maximum
of 32 devices attached to it. Profibus RS 485 cable definitions and terminations
are shown in figure 6. Repeaters are used to connect multiple segments together
up to a total maximum of 127.
Communication rates between 9.6 KBaud and 12 Mbaud make data transfer
fast and efficient.
Three varieties of Profibus exist: Profibus DP, Profibus FMS and Profibus PA,
respectively for high speed data communication in automation equipment, object
oriented general purpose communications, and process application areas where
intrinsic safety may be an issue. Approximately 90% of Profibus applications at
this time are Profibus DP which uses only layers one and two of the OSI model
(figure 5).
Both single and multiple masters can exist on a Profibus network. At a single
instant, only one master can be active and all others are temporarily reduced
to slave status. However, within a predefined time, the current master passes
control to the next master by issuing a special command called a token. On
issue of this command the current master relinquishes bus control to the new
master, which in turn takes control. This process repeats itself on a cyclic basis
with the token periodically returning to a particular master device. Most devices,
however, are configured as slaves only and do not take part in the token passing.
A given master can address all the devices on the bus or a group of devices can
be specified. It is important that the time that a master owns the token is long
enough for it to communicate with all slave devices attached to it. This parameter
must be configured before bus usage.
13
VP
390 Ω
Data +
Data + (3)
Data −
DGND
Protective ground
The second layer of the OSI model describes the general format of data pack-
ets, which are known as telegrams (see figure 7 on page 14), and can each con-
tain up to 244 bytes of data. Transmission services defined by this standard
are:
SDA — Send Data with Acknowledge (for FMS only). Data are sent to the master
or slave and a short acknowledgement sent in response;
SRD — Send and Request Data with acknowledgement (for DP and FMS). Data
are sent and received in one telegram cycle;
SDN — Send Data with No-acknowledgement (for DP and FMS). Broadcast or
Multicast (to a selected group telegrams);
CRSD — Cyclic Request and Send Data (FMS only).
Preceding each telegram must be a silent or idle period of at least 33 sync
bits (roughly 3.3 bytes). The first byte in any telegram is the Start Delimiter (SD)
used to distinguish the type of packet.
Telegram 1: Request FDL Status: Used to determine any new active stations on
the bus
SD DA SA FC DU FCS ED
0xA2 8 bytes 0x16
SD DA SA ED
0xDC 0x16
3.3 Fieldbus
Fieldbus is a very advanced system that defines and deals with all aspects of
industrial process control. Like Profibus it is based on layers 1, 2 and 7 of the
OSI model but achieves its implementation in a very different manner. Again its
goals are interoperability of devices, open but regulated definitions that encour-
age independent manufactures to produce compatible devices and intrinsically
safe operation.
The only communication medium yet available is a cable consisting of a sin-
gle twisted pair. Rather than the asynchronous RS 485 based systems dis-
cussed earlier, Fieldbus uses synchronous communications based around what
is known as the Manchester Biphase-L coding technique (figure 8). In this sys-
tem a clock and a data signal are combined to give an output signal in which the
edges of the transitions rather than the amplitude of the signal are important. A
rising edge corresponds to a logical 0 and a falling edge to 1. The output voltage
16 Industrial Networking Systems
Clock
1
Data
0
Encoded
signal
Each packet starts with a preamble consisting of a sequence of four 1,0 val-
ues. The data start and end with delimiters which are not Manchester encoded
(allowing transitions on the rising edge of the clock pulse).
It is possible to obtain power from the DC levels used to transmit the signal
although the number of devices that make use of this feature is limited by the
total current drawn.
From the Fieldbus point of view, any device attached to the bus is seen as
a node containing sets of parameters which collectively form what is known as
the Virtual Field Device (VFD). The design of Fieldbus uses an Object Oriented
approach to model the complex structures of typical devices in such a way that
they can properly be controlled. The VFD is responsible for communicating the
various objects that describe the device to other devices wishing to interact in
some way. Various classes of objects are defined such as Input classes, Con-
trol classes, Calculation classes and Output classes, and each device must be
described in terms of its class. Other properties of a device may be specified in
terms of standard objects such as alarm objects or trending objects and once it is
known that a device supports a type of object it can be manipulated accordingly.
Fieldbus goes well beyond any other system in its process control capabili-
ties, but its introduction has been slow. At present, the Fieldbus Foundation’s
official website boasts of 100 registered devices, in comparison with over 300 for
Profibus in roughly the same time span. It is extremely versatile at the expense
of complexity, and only time will probably tell whether what is advertised as the
”21st century fieldbus” will really succeed.
3.4 CANOpen
CANOpen and DeviceNet are derivatives of the CAN system outlined earlier (sec-
tion 2.5). At any one time only a single device can be allowed to talk and effec-
tively become the master. The mechanism whereby a device recognises whether
or not it is to respond to a message is interesting and worth outlining.
17
Figure 9 illustrates how a CAN bus handles contention when three devices A,
B and C contend for the bus at the same time. All are in step until position 5
of the Identifier when device A emits a high (recessive) level and drops into the
listening state. Similarly device B drops out at position 1, leaving device C as
bus master.
S R
O 10 9 8 7 6 5 4 3 2 1 0 T
F R
A 11111111111111111111
00000000000000000000
00000000000000000000
11111111111111111111
00000000000000000000
11111111111111111111 Listen only
0000000000000
1111111111111
B
0000000000000
1111111111111
0000000000000
1111111111111 Listen only
C 00000000
11111111
00000000
11111111
00000000
11111111 Transmit data
BUS
S I R I D D C A E I
IDLE O D T D L A R C O F IDLE
F E R E C T C K F S
N A
When the bus is idle, the lines are held in the recessive state. At this stage
a device that wishes to communicate, pulls the bus to a dominant state and im-
mediately releases it to indicate the start of a new frame (SOF). Figure 10 shows
the CAN message frame. Each listening device must then follow the sequence
of bits defined in the message identifier and put the correct value onto the bus.
The message identifier is a sequence of 11 or 29 bits (depending on whether the
frame is extended or not as determined by the IDE bit) starting with the most
significant bit. As the bits are output, each device checks to see whether it can
match the identifier output so far. If it cannot it goes into a passive listening
condition and outputs a recessive state. Otherwise it continues trying to match
bits. In this way as the identifier bits are output, devices pass from the active to
the passive listening states one by one until the message identifier is complete.
If a device is still active at the end of the identifier it starts to processes the mes-
sage. Following the message identifier, the RTR bit distinguishes the message as
either a request for a device to send data or actual data. In the later case the
data are contained in up to 8 data bytes in the DATA field with the actual num-
ber of bytes set in the DLC byte. Error checking can be performed by a cyclic
18 Industrial Networking Systems
4 Industrial Ethernet
As industrial automation and control gets more sophisticated and ubiquitous,
a natural step is to use the information gathered directly in planning, stock
control, and management systems. Previous attempts at Process Application
Management (PAM) and Enterprise Resource Planning (ERP) have utilised sepa-
rate networks such as fieldbus systems for the factory level, and the office level
Local Area Networks running TCP/IP, with PC based gateways acting to cross
the divide. As noted in the introduction, traditionally very few devices have had
Ethernet connectivity. This situation is, however, changing with the introduc-
tion of Industrial Ethernet and other networking systems. Industrial Ethernet is
basically a more robust version of standard Ethernet, better suited to the more
extreme conditions met in industry, with greater operating temperature range,
higher noise immunity hardware, and a wider range of connectors. All equipment
is specified to operate using the industrial standard 24 V DC and is guaranteed
to be backward compatible for at least 10 years, the typical lifetime of industrial
components. TCP/IP is used as the main protocol with the existing fieldbus pro-
tocols embedded within the upper layers of the TCP/IP stack. Several protocols
have taken advantage of the many benefits offered by Ethernet (high bandwidth
and transmission rates, fault tolerance, and cost, to name a few) made this tran-
sition within the last few years including Modbus (Modbus TCP/IP), Profibus
(ProfiNet) and Fieldbus (Fieldbus HSE). Widespread usage of any of these has
yet to be achieved, but as instruments equipped with the appropriate hardware
become available, this situation can be expected to change significantly.
19
OPCServer
OPCGroup OPCGroup
Root
Floor 1 Floor 2
Figure 11: An example of namespace and object hierarchies. Each item within
the namespace can have a corresponding OPCItem.
OPC Client
OPCServer
Root
Node1 Node2
Figure 12: A schematic representation of a Data Access Server. The OPC Client
connects to the OPCServer and OPCGroup objects. The namespace, represented
here as a tree starting at Root is scanned at startup and has OPCItem objects
created for the various items within the namespace.
22 Industrial Networking Systems
and humidity of rooms in a multistory building are being monitored and con-
trolled. Each floor of the building has several rooms (in total N) in which mea-
surements are to be made giving rise to the tree shown in figure 12 on page 21.
If all the temperature and humidity measurements are grouped together to form
two OPCGroups, each has N OPCItems representing measurements from each
room. The client can access the data by using the methods of the exposed OPC
object interfaces.
6 Future trends
As field buses get more complicated, faster and cheaper hardware solutions are
required. One of the great selling points of Profibus for example was the re-
duction in cost possible over the old 4-20 mA current loop technology, mostly
achieved as a result of using linear cable topologies rather than bringing all ca-
bles back to a central star point. It is evident that the main remaining expense
(apart from software) is the cost of the interfaces themselves. On the other hand
Ethernet technology is cheap and widely available. It can be expected that Eth-
ernet will become an important player in industrial networking.
Whether the ‘Fieldbus Wars’ as one commentator has described the current
position will be resolved in favour of a single standard is doubtful. Probably a
few of the older, less open standards will slowly disappear, as the advantages of
the modern systems become more apparent, but as in any democracy, there will
always be a small but vocal minority of devotees to a particular system who will
stoutly refuse to allow its demise.
23
Foundation Fieldbus Under Ethernet, many Twisted pair T/P 100m @ 100MkBaud
0
0
Fieldbus Foundation IEEE 802.3u suppliers Optic fiber O/F 2km @ 100MBaud
test
HSE
References
[1] http://www.can-cia.org. 2.5, 3
[2] http://www.modbus.org. 3
[3] http://www.profibus.org. 3
[4] http://www.fieldbus.org. 3
[5] Iwanitz F and Lange J, (Eds), OPC Fundamentals, Implementation and
Application, Hüthig Fachverlag, 2002. 5
[6] http://www.opcfoundation.org. 5