Industrial Automation Tutorial
Industrial Automation Tutorial
under development. applications often increase the performance can create networks of devices connected
of RS-232 beyond the distance and speed to a single RS-485 serial port. The noise
Serial Interface listed in the standard. RS-232 is limited immunity and multidrop capability make
Standards to point-to-point connections between RS-485 the serial connection of choice
Many devices used in industrial applica- PC serial ports and devices. in industrial applications requiring
tions use EIA standards RS-232, RS-422, many distributed devices networked
or RS-485 to connect to computers and RS-422 (EIA RS-422-A Standard) is the to a PC or other controller for data
to one another. (In this tutorial, we use the serial connection used on Apple Macintosh collection, MMI, and other operations.
term RS-xxx to refer generically to RS-232, computers. RS-422 uses a differential elec-
RS-422, and RS-485). A common miscon- trical signal, as opposed to the unbalanced
ception about these specifications is that signals referenced to ground with RS-232.
they define specific software protocols. Differential transmission, which uses two
The ANSI/EIA RS-xxx standard specifies lines each for transmit and receive signals,
only the electrical characteristics – not the results in greater noise immunity and
Tem
pe
RS-485
ratu
re
Flo
w
device
Con
trol
Pan
Pre el
RS-485
ssur
eA
larm
Con
ditio
ns
ST
OP
"#0110.000\r"
6-6 NATIONAL INSTRUMENTS PHONE: (512) 794-0100 • FAX: (512) 794-8411 • [email protected] • www.natinst.com
Industrial Automation Tutorial
Tutorial
tion is a set of ASCII strings that constitute uses the 4-20 mA analog signal commonly software drivers and often special inter-
commands to the device. These protocols found on process control instrumentation face hardware. Examples of these proto-
are most commonly implemented as and adds to it a digital signal. The digital cols are those used for communicating
asynchronous protocols, so-called because signal is added in such a way that it does with PLCs, for example DataHighway+
the transmitter and receiver do not have not interfere with the standard 4-20 mA from Allen-Bradley or ModBus+ from
any tightly-coupled synchronization functionality. In a control system where the Modicon. (Figure 2)
mechanisms. These networks are com- HART protocol is understood, the digital
monly master/slave, where one device signals can be read from the device
(usually the computer) is the master and to read and write data.
the devices are slaves. Normally, all devices
power up in receive mode, waiting to receive There are many protocols that are used
messages. When the master transmits a on standard serial interfaces but use much
message, all devices receive the message more sophisticated data packaging schemes.
(on a multidrop network) and determine These protocols use different mechanisms
if the message is addressed to them. If it is,
they act upon the message, writing data Device Type Manufacturer
on the serial interface if required to do so. Gas chromatograph Daniels, Applied Automation, ABB
Figure 1 shows an example of a command Power measurement Multilin, Power Measurements, Bitronics,
string used to set the output level of an Sprecher+Schuh
Analog Devices 6B analog output module. DCS systems Foxboro, Honeywell, Rosemount,
Similar commands are used to read Westinghouse, Fisher&Porter, Fisher Controls
data from a module. Tank level instruments Rosemount HTG, Gauging Systems, Enraf,
Sarasota, Saab, Varec, Endress+Hauser
Most manufacturers of serial devices Value systems Keystone Controls, Limitorque, Pakscan
invent their own ASCII protocol for Single loop controllers Eurotherm, Micon, Toshiba
their particular device. It is a relatively Flow computers/transmitters OMNI, Daniels, MicroMotion, Eliot
straightforward task to read and write these PLCs GE, Square-D, TI, Siemens, Westinghouse,
ASCII strings using the standard serial Modicon
functions built into a language such as RTUs Arcom, Automation Electronics, Westronics,
Visual Basic. You must understand how to (almost every RTU manufactured)
use the string formatting commands and Variable speed drives Allen-Bradley, Telemechanique/Square-D,
serial functions in order to build and Siemens, Toshiba, Magnetek, Saftronics
parse command strings. Instrument Table 2. Devices and Manufacturers that use the Modbus Protocol
PHONE: (512) 794-0100 • FAX: (512) 794-8411 • [email protected] • www.natinst.com NATIONAL INSTRUMENTS 6-7
Industrial Automation Tutorial
Open Systems – It is difficult and costly Intelligent Devices – Device vendors are applications that can use digital
to integrate systems with instrumentation putting more intelligence into their devices communications. For example, simple
from several vendors because of the to satisfy customers’ demands for more proximity sensors on a conveyor belt can
multitude of communication protocols. functionality at lower costs. The increased be networked together to a system that
With standard protocols, devices from information available with a digital network controls the movement of boxes on the
many suppliers can coexist on the is necessary for capitalizing on the extra belt. Another example is a control valve
same network and communicate capabilities made possible by intelligence used to regulate the flow of crude oil
with one another. in the devices. within a petroleum refinery. These two
Tutorial
6-8 NATIONAL INSTRUMENTS PHONE: (512) 794-0100 • FAX: (512) 794-8411 • [email protected] • www.natinst.com
Industrial Automation Tutorial
Tutorial
libraries for the Windows environment.
Though it is not clear that any one net- Figure 3 – The Fieldbus model compared to the OSI 7-layer communications model.
work will satisfy all industrial networking Note that OSI does not define a user application.
requirements, these buses will bring more
standardized interconnection between cations model. FOUNDATION Fieldbus has 1. The Data Link Layer is based on a
computers and the devices used optimized the OSI architecture for process token passing protocol.
in industrial automation applications. control by removing the middle layers that 2. The Link Active Scheduler (LAS) is
are generally associated with non-time a centralized device that acts as the
FOUNDATION Fieldbus critical applications such as file transfer. arbitrator of the bus.
FOUNDATION Fieldbus is a very sophisti- FOUNDATION Fieldbus technology consists 3. The LAS executes a schedule that makes
cated industrial network specifically tar- of a) the Physical Layer, b) the Communi- possible deterministic communication.
geted at the need for robust, distributed cation “Stack”, and c) the User Application. 4. The LAS distributes time to the net-
control in process control environments. Figure 3 shows these components modeled work to permit all devices to share the
The fieldbus specifications were developed using the OSI layered communication same sense of time.
by the Fieldbus Foundation, a group model. The physical layer (electrical,
representing over 80% of the world’s wiring, and so on) is based upon standards A key “8th layer” of FOUNDATION Fieldbus
suppliers of industrial automation systems, created by ISA/IEC (ISA S50.02-1992, is the User Application, or User Layer.
devices, and services. FOUNDATION Fieldbus IEC 1158-2). These physical layer stan- The User Layer defines “blocks” that
is based upon existing standards and other dards specify data communication rates represent the functions and data available
proven technologies, including work from of 31.25 kb/s, 1 Mb/s, and 2.5 Mb/s. in a device. Rather than interface to a
the ISA (International Society for Measure- Devices operating at 31.25 kb/s can draw device through a set of commands as
ment and Control), IEC (International their power directly from the network. commonly used with communication
Electrotechnical Committee), Profibus This Physical Layer also specifies the protocols, a FOUNDATION Fieldbus user
(Process Fieldbus, a German national capability for intrinsically safe operation. interacts with devices through a set of
standard), FIP (Factory Instrumentation blocks that define device capabilities in
Protocol, a French national standard), and The layers above the Physical Layer to- a standardized way. In this tutorial, we’ll
HART (Highway Addressable Remote gether are often referred to as the “stack” describe the most important block type –
Transducer, a widely-used process for fieldbus. Detailed discussion of the Function Blocks.
instrumentation protocol). stack is beyond the scope of this tutorial.
Several characteristics and functions in the Function Blocks are the core components
The FOUNDATION Fieldbus communica- Data Link Layer, however, are key to the with which a user specifies the behavior of
tion protocols are based on the OSI (Open distributed, real-time control capabilities a control system. FOUNDATION Fieldbus
Systems Interconnect) seven layer communi- of FOUNDATION Fieldbus: defines standard sets of Function Blocks.
PHONE: (512) 794-0100 • FAX: (512) 794-8411 • [email protected] • www.natinst.com NATIONAL INSTRUMENTS 6-9
Industrial Automation Tutorial
Controller Area
Figure 4 – A Basic Control Loop Using AI, PID, and AO Function Blocks. Network (CAN)
The Controller Area Network is a serial
There is a set of 10 basic control and second system, however, shows the true bus growing in popularity as a device-
I/O functions (see Table 5). potential of FOUNDATION Fieldbus – level network. CAN was developed by
distributed control, where the control Bosch to address the needs of in-vehicle
The inputs and outputs of individual functionality exists out in the field rather automotive communications. Automobiles
functions blocks can be connected to specify than concentrated in larger controllers. have a variety of control devices in them,
communication of data on the bus. Even for such functions as engine timing,
more importantly, the execution of a A second important feature of the carburetor throttle control, and antilock
function block can be precisely scheduled. FOUNDATION Fieldbus User Layer is brake systems. With increasing demands
This is a very key capability of FOUNDATION Device Descriptions. A key objective for placed upon these systems for safety,
Fieldbus because it allows execution of FOUNDATION Fieldbus is interoperability – performance, and customer needs, CAN
control loops directly over the network. the ability to build systems comprised of was developed to provide a digital serial
The Function Blocks themselves reside devices from a variety of manufacturers bus system to connect controllers. CAN
in individual devices but the overall and take full advantage of both the stan- has been standardized internationally
scheduling of execution is specified and dard and unique capabilities of every device. (ISO DIS 11898 and ISO DIS 11519-2)
executed across the network. Figure 4 Function Blocks go a long way to ensuring and is already available in a number of
shows a simple control loop with three a consistent model of a control system. silicon implementations. The CAN
Function Blocks – AI, PID, AO. From a system point-of-view, however, a protocol meets real-time requirements
mechanism is needed to document in a encountered in many automotive applica-
The function blocks shown in Figure 4 standard way the types of functions available tions. The network protocol can detect
could be implemented on the fieldbus in in any given device. To achieve this end, and correct transmission errors caused
several different ways. The AI, PID, and FOUNDATION Fieldbus defines the Device by electromagnetic interference. Also,
AO could each reside in separate devices, Description (DD), is a standardized the network itself is relatively easy to
such as a transmitter, loop controller, and description of the functions available in a configure and offers the ability to
valve. Alternatively, the PID itself could device. Using the DD, the host in a control perform centralized diagnostics.
reside in the control valve. In the second system, for example a Windows NT-based
case, there is no explicit controller device. MMI, can obtain the information necessary Comparison of automotive and indus-
In either system, the user’s view is the to create the human interface for interacting trial network requirements show that a
same – a series of connected function with the device to configure parameters, number of characteristics of CAN also
blocks and an execution schedule. The perform calibration and diagnostics, and make it suitable for industrial applica-
6-10 NATIONAL INSTRUMENTS PHONE: (512) 794-0100 • FAX: (512) 794-8411 • [email protected] • www.natinst.com
Industrial Automation Tutorial
Tutorial
Figure 5 – CAN defines parts of the Physical and Data Link Layers of the OSI 7 layer com model .
CAN is a communications protocol
specification that defines parts of the OSI 4. Access to the CAN network is per- enable CAN’s widespread use in industrial
Physical and Data Link Layers. CAN does formed using a method called nondes- automation applications.
not specify the entire Physical Layer or the tructive bitwise arbitration. In this system,
Medium upon which it resides, or the when a CAN node wants to send a frame,
Application Layer protcol used to it waits for the bus to become idle, then
move data. (See Figure 5). starts its frame with an arbitration identifier
(ID). Because of the underlying physical
As with the other network protocols layer, a dominant bit (0) always overrides
previously mentioned, detailed technical any recessive bit (1). As a node is writing
description of CAN and CAN-based its bits to the bus, it also reads the bus to
protocols is beyond the scope of this determine if the bit on the bus is different
tutorial. Listed below are some key than the bit written by the node. If the
technical aspects of CAN. bits are different, the node stops its write
because some other node has higher
1. Typical data rates are 125 k/s to 1 M/s, priority to the bus. Thus, the arbitra-
dependent upon the distance over which tion ID determines the priority of
the network is operating. The allowable messages on the bus, with lower
distance ranges from 40 m at 1 Mb/s IDs having higher priority.
to 500 m at 125 kb/s.
The industrial protocols built upon
2. CAN communications are performed CAN add further specifications in such
in a unit called a frame.CAN frames can areas as wiring types, connectors, diag-
be up to 8 bytes in length. nostics indicators, configuration switches,
and hot-swapping capability. Of great
3. CAN provides extensive error correc- importance with such networks is the
tion, including bit monitoring (comparing definition of objects for organizing data
transmitted bits to received), bit stuffing, within devices as well as for defining
CRC checksum, acknowledgment by all classes of devices, such as switches,
receivers, frame check (verify length), motor starters, and I/O systems. These
automatic retry, and fault confinement higher-level software definitions add
(defective devices automatically shut off). the ease of use and standardization to
PHONE: (512) 794-0100 • FAX: (512) 794-8411 • [email protected] • www.natinst.com NATIONAL INSTRUMENTS 6-11
Industrial Automation Tutorial
Te
mp
era
tur
e
Flo
w
Co
ntr
ol Pa
ne
Pres l
sure
Ala
rm
Co
nd
itio
ns
ST
OP
Controller
I/O
Proprietary digital
or custom interfaces
PLC
4-20 mA
4-20 mA plus digital or
Tutorial
proprietary digital
Analyzer
Traditional Hybrid instruments or
analog and discrete Hybrid intelligent instruments with
instruments instruments custom interfaces
Figure 6a. Today’s control systems use a combination of point-to-point analog connections and hybrid or proprietary digital communications networks.
Te
mp
era
tur
e
Flo
w
Co
ntr
ol Pa
ne
Pre l
ssu
re
Ala
rm
Co
nd
itio
ns
ST
OP
Controller
I/O
PLC
Analyzer
Figure 6b. Using industrial device networks, system architecture is simplified because devices share common protocols.
6-12 NATIONAL INSTRUMENTS PHONE: (512) 794-0100 • FAX: (512) 794-8411 • [email protected] • www.natinst.com