SlideShare a Scribd company logo
1Week© Vocational Training Council, Hong Kong.
│ Lecture 7 │
Communication using PLC
EEC3420 Industrial Control
Department of Electrical Engineering
2© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Learning Objectives

To know the communication protocol and the PLC
communication technique.
3© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Introduction to Industrial Networks
Multiple control systems will be used for complex
processes.
These control systems may be PLCs, but other controllers
including robots, data terminals and computers may also
be used. For these controllers to work together, they must
communicate.
4© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Introduction to Industrial Networks
The simplest form of communication is a direct connection
between two computers.
A network will simultaneously connect a large number of
computers on a network.
Data can be transmitted one bit at a time in series, this is
called serial communication.
Data bits can also be sent in parallel.
5© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Introduction to Industrial Networks
The transmission rate will often be limited to some
maximum value, from a few bits per second, to billions of
bits per second.
The communications often have limited distances, from a
few feet to thousands of miles/kilometers.
6© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Industrial Network Characteristics
• Hierarchy
• Response Time and Variance
• Bandwidth
• Efficiency
• Access Method
• Topology
• Distance
• Number of Devices
• Capabilities
• Length of Messages
• Vendor Support
7© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Hierarchy
• What is the network used for?
• Connect I/O back to the controller?
• Connect PLCs and operator interfaces together?
• Link manufacturing computers together?
• Link manufacturing with the rest of the company?
• Link manufacturing with other plants that supply
raw materials or consume the products you
manufacture?
8© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Hierarchy
• There are at least three levels of communications in
manufacturing and laboratories.  
• The lowest level is networking of I/O.
• A typical I/O network usually requires deterministic,
“daisy-chain”, real-time responses of 10 to 50
milliseconds.
• The alternative to using a network for I/O is to pull all
those wires and cables back to your controller.
9© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Hierarchy
I/O network typically has the following advantages: 
• Analog data is more accurate
• Typically more data is available from intelligent
devices: meters, drives, etc.
• More diagnostics
• Easier to expand
• Higher hardware costs but lower installation costs 
10© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Hierarchy
The next higher level is for PLC to PLC, PLC to HMI, and
PLC to SCADA.
PLC to PLC communications may be real-time depending
on the information they are sending each other.
Most PLC to operator interfaces are non real-time.
Depending upon what you are doing in SCADA, PLC to
SCADA could be real-time but not as fast as I/O.
However, if you are trying to record timing events or high
speed data acquisition then your PLC to SCADA link
needs to be real-time.
11© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Hierarchy
The highest level is SCADA to SCADA: sharing of alarms,
process status, reporting of quality control data, etc.
These are typically non-real-time or greater than one
second.Note that there are definitely higher levels of
communications in a manufacturing facility.
Note that there are definitely higher levels of
communications in a manufacturing facility.
However, once you get these higher levels, usually their
communications needs are best-fulfilled using standard
Ethernet and office type networking.
12© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Response Time and Variance
• What is the typical response required on the network?
• Are some messages high priority and some low priority?
• Are the messages continuous or intermittent?
• Does the network need to operate in “real-time” or not
“real-time”?
• How fast do the devices need to respond to each other?
• How much can the response time vary?
• What happens if the devices communicate sometimes
at ten millisecond intervals and other times at one-
13© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Bandwidth
• What is the raw speed that the data travels?
• Bandwidth is the ability to pump data through the
communications link.
• Think of it as how big are the pipes and pumps to
pump the data.
• Theoretically a 100 Mbps network is ten times
faster than a 10 Mbps network.
14© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Bandwidth
Note that some networks, such as Ethernet, can only
use about 30 to 40 percent of the available bandwidth
without having major problems.
So a 100 Mbps Ethernet network may really only be
35 Mbps. If all devices on the network are full-duplex
then they could theoretically handle 70 Mbps.
15© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Efficiency
Efficiency is a measure of how much additional work
has to be done to send a message.
There are at least three different concerns:
(1) How much overhead is required to send a message?
(2) How many messages have to be sent and
(3) how much is the host CPU required to do?
16© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Efficiency
For example, suppose you want to send 10 bytes of data
from device 1 to device 2.
In this message packet you usually have to include, in
addition to the 10 bytes of data, data that specifies who
should receive the data, who sent the data, the type of
data, the length of data, and some sort of checksum or
other error detection.
A second question of efficiency is how many messages
need to be sent to read and write data to a device. For
example, assume you have a PLC that needs to read
inputs and write outputs to a block of I/O.
17© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Efficiency
The third question of efficiency is how much the host
computer has to do.
For example, on a typical industrial network you configure
the communications for the bus and then the
communications controller has its own processor that
does all the communications.
18© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Access Method
Two main types of access methods are covered:
• deterministic
• collision detection 
Deterministic means that given the number of devices
on the network you can calculate what the maximum
response time will be. The response time of
deterministic networks tends to vary less than
networks based on collision detection.
19© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Access Method
Collision Detection is where a device listens before it
starts talking.
If the device does not hear anything then it starts
talking.
If someone else starts talking at the same time -- then
each device stops for a random amount of time and
then starts listening for silence again.
20© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Topology
Can all cables run back to a hub or do you “daisy-
chain”? 
Topology refers to how cables are run. A star or hub
topology has all of the devices running a cable back
to the centralized hub. You need to check the
distance that each cable can be from the hub to the
device. The good news is that if one device loses
power it should not affect communications with the
other devices.
21© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Topology
A hub receives data from one device and
rebroadcasts data to all the other devices connected
to the hub.
A switch creates many separate communications
links that allows two devices to talk on ports 1 and 2
while two other devices talk on ports 3 and 4.
A ring or “daisy-chain” network is where you run the
cable from device to device. This usually results in
less cable being used. However, you still have to
consider the total length of the cable.
22© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Distance
Each type of network has distance and speed
limitations that are related.
The most common characteristic to all networks is
that the longer the distance – the slower the speed.
Repeaters, bridges, gateways, hubs, switches are
ways to get around these limitations – but you need
to be aware when and where to use them.
There is a limit to how many repeaters you can use
on one cable to extend the cable
23© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Number of devices
Another factor limiting the response time, speed,
and distance is the number of devices on the
communications network.
The higher the number of devices is then the
shorter the distance, slower the baud rate, and
higher the response time.
24© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Capabilities
The communications capabilities of each device have to
consider, some examples of capabilities might be:
Device can talk RS232, RS422, or RS485.
Device servers that allow you to send RS232 / 422/ 485
communications over Ethernet.
Device can talk Devicenet, Modbus, DH+, Profibus Device
can talk Ethernet but only 10Mps
25© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Length of Messages
Theoretically you want similar sized messages on the same
network. For example, do not put I/O (typically a lot of short
messages) on an office Ethernet (typically fewer, but longer
messages).
When someone on the same network starts downloading a
lot of pictures and video or decides to print a large file, it
could be a while before the I/O gets updated again.
26© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Vendor Support
Ideally there would be one best network and all
automation vendors would support it.
Another consideration is how well is this
industrial network supported by third party
vendors?
27© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
OSI Seven Layer Model
Layer 7: Application
Specifications and protocols for applications and users
using the network: how to send a request, how to
specify a filename over the net, how to respond to a
request.
A definition of what messages will be permitted and
what responses are to be taken in response to each of
these messages. Protocols commonly used are FTP,
SNMP, SMTP, HTTP, Telnet
28© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
OSI Seven Layer Model
Layer 6: Presentation
Computers represent data in different ways
(character, integer) thus the protocol needs to
translate the data to and from the local node.
Data encryption and compression are typically done
at this level.
Layer 5: Session
Establishing a communications session, Security,
Authentication, passwords
29© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
OSI Seven Layer Model
Layer 4: Transport
Transfer correctness, error detection.
Data is segmented into manageable packet sizes.
Responsible for resending failed messages and that
good messages are not processed more than once.
Protocols commonly used are TCP, UDP
Layer 3: Network
Address assignment, packet’s forwarding methods,
routing. Protocol commonly used is IP.
30© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
OSI Seven Layer Model
Layer 2: Data Link
Frame format, transmission of frames, i.e. bit / byte
stuffing, checksums, flow control, parity bits. Common
example is the Ethernet.
Layer 1: Physical
This is the basic hardware components for networks, i.e.
RS232 specification, it converts 1s and 0s into electrical
pulses. Common example is the Ethernet.
31© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Traditional Industrial Networks
There are many industrial networks currently available,
for examples, the DeviceNet, the Modbus, the Profibus,
and the industrial Ethernet, etc.
The DeviceNet network is an open device level network
that provides connections between simple industrial
devices (such as sensors and actuators) and higher-
level devices (such as programmable controllers and
computers).
Uses the proven Common Industrial Protocol (CIP) to
provide the control, configure, and data collection
capabilities for industrial devices.
32© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Traditional Industrial Networks
Created in 1989 by a consortium of companies and
institutions, PROFIBUS has become the world’s most
popular fieldbus in discrete manufacturing and
process control.
It is mature, proven technology that is ideal for
supporting modern automation systems.
With over 14 million installed devices, it is a significant
driving force for the world’s production plants.
33© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Traditional Industrial Networks
Several years ago Ethernet was not a consideration
for manufacturing since it is was slow and not
deterministic.
With the development of high bandwidth and
inexpensive Ethernet switching technology, Ethernet
is emerging as a good alternative.
The application is constantly broadening its coverage
to include Ethernet TCP/IP applications.
34© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Introduction to PLC Communication
Multiple control systems will be used for complex processes.
These control systems may be PLCs, but other controllers
include robots, data terminals and computers..
The simplest form of communication is a direct connection
between two computers.
A network will simultaneously connect a large number of
computers on a network.
Data can be transmitted one bit at a time in series, this is
called serial communication. Data bits can also be sent in
parallel.
35© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Introduction to PLC Communication
The transmission rate will often be limited to some
maximum value, from a few bits per second, to billions
of bits per second. The communications often have
limited distances, from a few feet to thousands of
miles/kilometers.
36© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Introduction to PLC Communication
An example of a networked control system
PLC
Process
Computer Devicenet
Actuators
Process
Process
Sensors
Process
Actuators
Process
Sensors
RS-232
Normal I/O on PLC
37© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
Serial communications send a single bit at a time
between computers.
This only requires a single communication channel, as
opposed to 8 channels to send a byte.
With only one channel the costs are lower, but the
communication rates are slower.
The communication channels are often wire based, but
they may also be can be optical and radio.
38© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
RS-232c is the most com-mon standard that is based on a
voltage change levels.
At the sending computer an input will either be true or false.
The line driver will convert a false value in to a Txd voltage
between +3V to +15V, true will be between -3V to -15V.
A cable connects the Txd and com on the sending computer to
the Rxd and com inputs on the receiving computer.
The receiver converts the positive and negative voltages back
to logic voltage levels in the receiving computer.
39© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
The cable length is limited to 50 feet to reduce the
effects of electrical noise.
When RS-232 is used on the factory floor, care is
required to reduce the effects of electrical noise -
careful grounding and shielded cables are often
used.
40© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
Serial Data Standards
RS-232c
RS-422a
RS-423a
50 ft
3000 ft
3000 ft
Txd Rxd
com
In
Out
In
Out
In
Out
41© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
A typical data byte looks like the one below
true
false
before start data parity stop idle
before - this is a period where no bit is being sent and the line is true.
start - a single bit to help get the systems synchronized.
data - this could be 7 or 8 bits, but is almost always 8 now. The value shown here is
a byte with the binary value 00010010 (the least significant bit is sent first).
parity - this lets us check to see if the byte was sent properly. The most common
choices here are no parity bit, an even parity bit, or an odd parity bit. In this case
there are two bits set in the data byte. If we are using even parity the bit would be
true. If we are using odd parity the bit would be false.
stop - the stop bits allow a pause at the end of the data. One or two stop bits can be
used.
idle - a period of time where the line is true before the next byte.
Descriptions:
42© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
Some of the byte settings are optional, such as the
number of data bits (7 or 8), the parity bit (none,
even or odd) and the number of stop bits (1 or 2).
The sending and receiving computers must know
what these settings are to properly receive and
decode the data.
Most computers send the data asynchronously,
meaning that the data could be sent at any time,
without warning.
43© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
Another method used to detect data errors is half-
duplex and full-duplex transmission.
In half-duplex transmission the data is only sent in
one direction.
But, in full-duplex transmission a copy of any byte
received is sent back to the sender to verify that it
was sent and received correctly.
44© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
The transmission speed is the maximum number of
bits that can be sent per second.
The unit for this is baud.
The baud rate includes the start, parity and stop bits.
Lower baud rates are 120, 300, 1.2K, 2.4K and 9.6K.
Higher speeds are 19.2K, 28.8K and 33.3K.
45© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
The handshaking lines are to be used to detect the
status of the sender and receiver, and to regulate the
flow of data. It would be unusual for most of these
pins to be connected in any one application. The
most common pins are provided on the DB-9
connector, and are also described below.
46© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
TXD/RXD - (transmit data, receive data) - data lines
DCD - (data carrier detect) - this indicates when a
remote device is present
RI - (ring indicator) - this is used by modems to
indicate when a connection is about to be made.
CTS/RTS - (clear to send, ready to send)
DSR/DTR - (data set ready, data terminal ready)
these handshaking lines indicate when the remote
machine is ready to receive data.
COM - a common ground to provide a common
reference voltage for the TXD and RXD.
47© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
When a computer is ready to receive data it will set
the CTS bit, the remote machine will notice this on
the RTS pin. The DSR pin is similar in that it
indicates the modem is ready to transmit data. XON
and XOFF characters are used for a software only
flow control scheme.
48© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
A normal handshaking protocol between a computer
and a modem looks like this
49© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
1 The computer sets DTR to indicate that it
wants to make use of the modem.
50© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
2 The modem signals that it is ready and that a
connection has been established.
51© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
3 The computer requests permission to send.
52© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
4 The modem informs the computer that it is
now ready to receive data from the computer and
send it through the phone wires.
53© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
5 The modem drops CTS to signal to the computer
that its internal buffers are full; the computer stops
sending characters to the modem.
54© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
6 The buffers of the modem have been purged,
so the computer may continue to send data.
55© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
7 This situation is not clear; either the computer's buffers
are full and it wants to inform the modem of this, or it doesn't
have any more data to be send to the modem.
56© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
8 The modem acknowledges RTS by dropping
CTS.
57© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
9 RTS is again raised by the computer to re-
establish data transmission.
58© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
10 The modem shows that it is ready to do its
job.
59© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
11 No more data is to be sent.
60© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
12 The modem acknowledges this.
61© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
13 DTR is dropped by the computer; this
causes most modems to hang up. After hang-up, the
modem acknowledges with DSR low.
62© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Serial Communication and RS232
14 Communication terminates
63© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
ASCII ladder function in PLC
Many PLC processors have an RS-232 port that is
normally used for programming the PLC
PLC5 RS-232 Cable
Terminal
AWT
Channel 0
String Location ST9:0
Length 4
Emulator
com 1
channel 0
A
64© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
ASCII ladder function in PLC
The AWT (Ascii WriTe) function below will write to
serial ports on the CPU only. To write to other serial
ports the message function in Figure 2.11.3b must
be used. In this example the message block will
become active when A goes true. It will use the
message parameters stored in message memory
MG9:0.
The parameters set indicate that the mes-sage is to
Write data stored at N7:50, N7:51 and N7:52. This
will write the ASCII string ABC to the serial port.
65© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
ASCII ladder function in PLC
Message Function for Serial Communication
MSG
Control Block MG9:0
Memory Values: Read/Write
Data Table
Size
Local/Remote
Remote Station
Link ID
Remote Link type
Local Node Addr.
Processor Type
Dest. Addr.
Write
N7:50
3
Local
N/A
N/A
N/A
20
ASCII
N/A
N7:50
N7:51
N7:52
65
66
67
setup stored
in MG9:0
Data Stored in memory
A
66© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
ASCII ladder function in PLC
PLC-5 ASCII Functions
ABL(channel, control)- reports the number of ASCII characters including line endings
ACB(channel, control) - reports the numbers of ASCII characters in buffer
ACI(string, dest) - convert ASCII string to integer
ACN(string, string,dest) - concatenate strings
AEX(string, start, length, dest) - this will cut a segment of a string out of a larger string
AIC(integer, string) - convert an integer to a string
AHL(channel, mask, mask, control) - does data handshaking
ARD(channel, dest, control, length) - will get characters from the ASCII buffer
ARL(channel, dest, control, length) - will get characters from an ASCII buffer
ASC(string, start, string, result) - this will look for one string inside another
ASR(string, string) - compares two strings
AWT(channel, string, control, length) - will write characters to an ASCII output
67© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
ASCII ladder function in PLC
An ASCII String Example
ARL
Channel 0
Dest ST10:0
Control R6:0
Length 2
AWT
Channel 0
String ST10:2
Length 7
R6:0/DN ACN
StringA ST10:1
StringB ST10:0
Dest ST10:2
ST10:1 = "HI "
ACB
Channel 0
Control R6:1
R6:1/EN
GEQ
Source A R6:1.POS
Source B 2
68© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
ASCII ladder function in PLC
A String to Integer Conversion Example
ACI
String ST9:10
Dest N7:0
ACI
String ST9:11
Dest N7:1
ADD
SourceA N7:0
SourceB N7:1
Dest N7:2
AIC
Source N7:2
String ST9:12
69© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
ASCII ladder function in PLC
String Manipulation Functions
ACB
Channel 1
Control R6:0
ABL
Channel 1
Control R6:1
AEX
Source ST9:0
Index 5
Length 2
ASR
StringA ST9:2
StringB ST9:3
A
Dest ST9:1
O:001/2
B
70© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Communication example
Problem:
A robot will be loading parts into a box until the box
reaches a prescribed weight. A PLC will feed parts
into a pickup fixture when it is empty. The PLC will tell
the robot when to pick up a part and load it into the
box by passing it an ASCII string, "pickup".
71© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Communication example
Example: PLC Interface To a Robot
PLC
Robot
Box and
RS-232
Parts
"pickup" = pickup part
Feeder
Parts Pickup
Fixture
feed part part waiting box full
Weigh Scale
72© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Communication example
The following ladder logic will implement part of the
control system for the system
part waiting box full
feed part
ONS
Bit B3:0
AWT
Channel 0
String ST10:0
Length 6
part waiting
ST10:0 = "pickup"
73© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Summary

Industrial automation networks have many
characteristics in common with non industrial
networks such as Response Time, Bandwidth,
Efficiency, Access Method, Topology, and
Distance, etc.

The standard model for networking protocols and
distributed applications is the International
Standard Organization's Open System
Interconnect (ISO/OSI) model. It defines seven
network layers: the Application, Presentation,
Session, Transport, Network, Data Link and
Physical Layer.
74© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Summary

The more everyone tries to create one universal
standard for the industrial network, the more
universal standards we get. As a result, there are
different industrial network standards offered by
different network vendors.

Industrial automation networks have many
characteristics in common with non industrial
networks such as Response Time, Bandwidth,
Efficiency, Access Method, Topology, and
Distance, etc.
75© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week

The standard model for networking protocols and
distributed applications is the International Standard
Organization's Open System Interconnect (ISO/OSI)
model. It defines seven network layers: the Application,
Presentation, Session, Transport, Network, Data Link
and Physical Layer.

The more everyone tries to create one universal
standard for the industrial network, the more universal
standards we get. As a result, there are different
industrial network standards offered by different network
vendors.
Summary
76© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week

Serial communications pass data one bit at a time.

RS-232 communications use voltage levels for short
distances. A variety of communications cables and
settings were discussed.

ASCII functions are available of PLCs making serial
communications possible.
Summary
77© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Summary

Serial communications pass data one bit at a
time.

RS-232 communications use voltage levels for
short distances. A variety of communications
cables and settings were discussed.

ASCII functions are available of PLCs making
serial communications possible.
78© Vocational Training Council, Hong Kong.
EEE3420 Industrial Control
Week
Communication using PLC
End of Lecture 7
 Revision

More Related Content

PPT
Eee3420 lecture08 rev2011
PPT
Eee3420 lecture03 rev2011
PPT
Eee3420 lecture02 rev2011
PPT
Eee3420 lecture07 rev2011
PPT
Eee3420 lecture01 rev2011
PPT
Eee3420 lecture06 rev2011
PPT
Eee3420 lecture05 rev2011
PPT
Eee3420 lecture04 rev2011
Eee3420 lecture08 rev2011
Eee3420 lecture03 rev2011
Eee3420 lecture02 rev2011
Eee3420 lecture07 rev2011
Eee3420 lecture01 rev2011
Eee3420 lecture06 rev2011
Eee3420 lecture05 rev2011
Eee3420 lecture04 rev2011

What's hot (14)

PPTX
Pe 5421 plc aftermid week 10 onwards
PPTX
Kamlesh meena tarinig ppt instrumentation limited
PPT
Practical Programmable Logic Controllers (PLCs) for Automation and Process Co...
PDF
Control system of automatic garage using programmable logic controller
PPTX
PLC Architecture
PPTX
ppt on PLC
PDF
Introduction to IO-Link - Russell Smith
PDF
D132027
PDF
Intro to IO-Link
PPTX
Plc (analog and special io)
PPTX
DOCX
Plc notes
PDF
PLC Programming Languages
PPTX
Industrial Automation Using B&R PLC.
Pe 5421 plc aftermid week 10 onwards
Kamlesh meena tarinig ppt instrumentation limited
Practical Programmable Logic Controllers (PLCs) for Automation and Process Co...
Control system of automatic garage using programmable logic controller
PLC Architecture
ppt on PLC
Introduction to IO-Link - Russell Smith
D132027
Intro to IO-Link
Plc (analog and special io)
Plc notes
PLC Programming Languages
Industrial Automation Using B&R PLC.
Ad

Viewers also liked (20)

PPT
Eee3420 lecture01 rev2011
PPT
Eee3420 lecture02 rev2011
PPT
Eee3420 lecture08 rev2011
PPT
Eee3420 lecture06 rev2011
PPT
Diwan Annexure Starter panels Presentation Rev-1 Dt16-11-2014
PDF
Learn Automation from professionals
PPTX
Vfd sharad
PPT
Eee3420 lecture05 rev2011
DOC
3. ac drive (misc.)
PPTX
A study on PLC basic
PPT
Eee3420 lecture04 rev2011
PPT
Eee3420 lecture03 rev2011
PDF
Lập trình plc delta
PPTX
Varaible frequency drive
PPTX
Siemens Open Library- Summit 2016
PPT
Programmable logic Controller
PPT
Basic plc
PPTX
PLC Circuit Design And Basic Programming By Manish kumar
PPT
three phase induction machine starter
PPT
PLC Basic
Eee3420 lecture01 rev2011
Eee3420 lecture02 rev2011
Eee3420 lecture08 rev2011
Eee3420 lecture06 rev2011
Diwan Annexure Starter panels Presentation Rev-1 Dt16-11-2014
Learn Automation from professionals
Vfd sharad
Eee3420 lecture05 rev2011
3. ac drive (misc.)
A study on PLC basic
Eee3420 lecture04 rev2011
Eee3420 lecture03 rev2011
Lập trình plc delta
Varaible frequency drive
Siemens Open Library- Summit 2016
Programmable logic Controller
Basic plc
PLC Circuit Design And Basic Programming By Manish kumar
three phase induction machine starter
PLC Basic
Ad

Similar to Eee3420 lecture07 rev2011 (20)

PDF
IT Essentials (Version 7.0) - ITE Chapter 5 Exam Answers
PDF
Ethernet in Harsh Environments
PPTX
PLC and SCADA communication
PDF
Practical Troubleshooting and Problem Solving of Modbus Protocols
PPTX
#1 What is Networking.pptx
DOCX
Final Project
PDF
Module 03 IoT Networking.............pdf
PDF
Industrial Ethernet Facts - The 5 major technologies
PPTX
6TiSCH + RPL @ Telecom Bretagne 2014
PDF
Iaetsd bluetooth based smart sensor networks
PDF
Intern
PDF
Graduation Project Documentation.PDF
PDF
Performance Evaluation of Bidirectional Forwarding Detection (BFD) over the ...
PDF
Practical Troubleshooting & Problem Solving of Industrial Data Communications
PDF
Final project report
PPTX
MS-CIT Unit 8.pptx
PDF
Lecture12 ie321 dr_atifshahzad - networks
PPTX
cs presentation
PPTX
Performance Testing Internet of Things
PDF
LORA BASED DATA ACQUISITION SYSTEM
IT Essentials (Version 7.0) - ITE Chapter 5 Exam Answers
Ethernet in Harsh Environments
PLC and SCADA communication
Practical Troubleshooting and Problem Solving of Modbus Protocols
#1 What is Networking.pptx
Final Project
Module 03 IoT Networking.............pdf
Industrial Ethernet Facts - The 5 major technologies
6TiSCH + RPL @ Telecom Bretagne 2014
Iaetsd bluetooth based smart sensor networks
Intern
Graduation Project Documentation.PDF
Performance Evaluation of Bidirectional Forwarding Detection (BFD) over the ...
Practical Troubleshooting & Problem Solving of Industrial Data Communications
Final project report
MS-CIT Unit 8.pptx
Lecture12 ie321 dr_atifshahzad - networks
cs presentation
Performance Testing Internet of Things
LORA BASED DATA ACQUISITION SYSTEM

More from benson215 (18)

PDF
Chapter 5 - DC-AC Conversion.pdf
PDF
Chapter 0 - Introduction.pdf
PDF
Chapter 1 - PWM DC-DC Converter.pdf
PDF
Chapter 2 - Isolated DC-DC Converter.pdf
PDF
Chapter 3 - Resonant-mode DC-DC Converter.pdf
PDF
Chapter 6 - Modelling and Control of Converters.pdf
PDF
Chapter 4 - AC-DC Conversion.pdf
PDF
Chapter 7 - EMI.pdf
DOC
2. ac drive (common inverter drive)
PDF
1. revision on 3 phase conventional inverter
DOC
2. dc drive
PDF
1. revision on 3 phase controlled rectifier
PDF
2. motor drive dynamic
DOC
5. two phase servo motor
DOC
4. linear motor basics
PDF
2. brushless dc motors
PDF
1. servo basic
DOC
3. relutance and hysteresis motor
Chapter 5 - DC-AC Conversion.pdf
Chapter 0 - Introduction.pdf
Chapter 1 - PWM DC-DC Converter.pdf
Chapter 2 - Isolated DC-DC Converter.pdf
Chapter 3 - Resonant-mode DC-DC Converter.pdf
Chapter 6 - Modelling and Control of Converters.pdf
Chapter 4 - AC-DC Conversion.pdf
Chapter 7 - EMI.pdf
2. ac drive (common inverter drive)
1. revision on 3 phase conventional inverter
2. dc drive
1. revision on 3 phase controlled rectifier
2. motor drive dynamic
5. two phase servo motor
4. linear motor basics
2. brushless dc motors
1. servo basic
3. relutance and hysteresis motor

Recently uploaded (20)

PDF
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
introduction to high performance computing
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
August -2025_Top10 Read_Articles_ijait.pdf
PDF
Soil Improvement Techniques Note - Rabbi
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PPTX
Software Engineering and software moduleing
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
Exploratory_Data_Analysis_Fundamentals.pdf
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PDF
Design Guidelines and solutions for Plastics parts
Improvement effect of pyrolyzed agro-food biochar on the properties of.pdf
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
introduction to high performance computing
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Sorting and Hashing in Data Structures with Algorithms, Techniques, Implement...
Visual Aids for Exploratory Data Analysis.pdf
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
August -2025_Top10 Read_Articles_ijait.pdf
Soil Improvement Techniques Note - Rabbi
Fundamentals of safety and accident prevention -final (1).pptx
Software Engineering and software moduleing
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Exploratory_Data_Analysis_Fundamentals.pdf
Categorization of Factors Affecting Classification Algorithms Selection
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Design Guidelines and solutions for Plastics parts

Eee3420 lecture07 rev2011

  • 1. 1Week© Vocational Training Council, Hong Kong. │ Lecture 7 │ Communication using PLC EEC3420 Industrial Control Department of Electrical Engineering
  • 2. 2© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Learning Objectives  To know the communication protocol and the PLC communication technique.
  • 3. 3© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Introduction to Industrial Networks Multiple control systems will be used for complex processes. These control systems may be PLCs, but other controllers including robots, data terminals and computers may also be used. For these controllers to work together, they must communicate.
  • 4. 4© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Introduction to Industrial Networks The simplest form of communication is a direct connection between two computers. A network will simultaneously connect a large number of computers on a network. Data can be transmitted one bit at a time in series, this is called serial communication. Data bits can also be sent in parallel.
  • 5. 5© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Introduction to Industrial Networks The transmission rate will often be limited to some maximum value, from a few bits per second, to billions of bits per second. The communications often have limited distances, from a few feet to thousands of miles/kilometers.
  • 6. 6© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Industrial Network Characteristics • Hierarchy • Response Time and Variance • Bandwidth • Efficiency • Access Method • Topology • Distance • Number of Devices • Capabilities • Length of Messages • Vendor Support
  • 7. 7© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Hierarchy • What is the network used for? • Connect I/O back to the controller? • Connect PLCs and operator interfaces together? • Link manufacturing computers together? • Link manufacturing with the rest of the company? • Link manufacturing with other plants that supply raw materials or consume the products you manufacture?
  • 8. 8© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Hierarchy • There are at least three levels of communications in manufacturing and laboratories.   • The lowest level is networking of I/O. • A typical I/O network usually requires deterministic, “daisy-chain”, real-time responses of 10 to 50 milliseconds. • The alternative to using a network for I/O is to pull all those wires and cables back to your controller.
  • 9. 9© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Hierarchy I/O network typically has the following advantages:  • Analog data is more accurate • Typically more data is available from intelligent devices: meters, drives, etc. • More diagnostics • Easier to expand • Higher hardware costs but lower installation costs 
  • 10. 10© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Hierarchy The next higher level is for PLC to PLC, PLC to HMI, and PLC to SCADA. PLC to PLC communications may be real-time depending on the information they are sending each other. Most PLC to operator interfaces are non real-time. Depending upon what you are doing in SCADA, PLC to SCADA could be real-time but not as fast as I/O. However, if you are trying to record timing events or high speed data acquisition then your PLC to SCADA link needs to be real-time.
  • 11. 11© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Hierarchy The highest level is SCADA to SCADA: sharing of alarms, process status, reporting of quality control data, etc. These are typically non-real-time or greater than one second.Note that there are definitely higher levels of communications in a manufacturing facility. Note that there are definitely higher levels of communications in a manufacturing facility. However, once you get these higher levels, usually their communications needs are best-fulfilled using standard Ethernet and office type networking.
  • 12. 12© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Response Time and Variance • What is the typical response required on the network? • Are some messages high priority and some low priority? • Are the messages continuous or intermittent? • Does the network need to operate in “real-time” or not “real-time”? • How fast do the devices need to respond to each other? • How much can the response time vary? • What happens if the devices communicate sometimes at ten millisecond intervals and other times at one-
  • 13. 13© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Bandwidth • What is the raw speed that the data travels? • Bandwidth is the ability to pump data through the communications link. • Think of it as how big are the pipes and pumps to pump the data. • Theoretically a 100 Mbps network is ten times faster than a 10 Mbps network.
  • 14. 14© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Bandwidth Note that some networks, such as Ethernet, can only use about 30 to 40 percent of the available bandwidth without having major problems. So a 100 Mbps Ethernet network may really only be 35 Mbps. If all devices on the network are full-duplex then they could theoretically handle 70 Mbps.
  • 15. 15© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Efficiency Efficiency is a measure of how much additional work has to be done to send a message. There are at least three different concerns: (1) How much overhead is required to send a message? (2) How many messages have to be sent and (3) how much is the host CPU required to do?
  • 16. 16© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Efficiency For example, suppose you want to send 10 bytes of data from device 1 to device 2. In this message packet you usually have to include, in addition to the 10 bytes of data, data that specifies who should receive the data, who sent the data, the type of data, the length of data, and some sort of checksum or other error detection. A second question of efficiency is how many messages need to be sent to read and write data to a device. For example, assume you have a PLC that needs to read inputs and write outputs to a block of I/O.
  • 17. 17© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Efficiency The third question of efficiency is how much the host computer has to do. For example, on a typical industrial network you configure the communications for the bus and then the communications controller has its own processor that does all the communications.
  • 18. 18© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Access Method Two main types of access methods are covered: • deterministic • collision detection  Deterministic means that given the number of devices on the network you can calculate what the maximum response time will be. The response time of deterministic networks tends to vary less than networks based on collision detection.
  • 19. 19© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Access Method Collision Detection is where a device listens before it starts talking. If the device does not hear anything then it starts talking. If someone else starts talking at the same time -- then each device stops for a random amount of time and then starts listening for silence again.
  • 20. 20© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Topology Can all cables run back to a hub or do you “daisy- chain”?  Topology refers to how cables are run. A star or hub topology has all of the devices running a cable back to the centralized hub. You need to check the distance that each cable can be from the hub to the device. The good news is that if one device loses power it should not affect communications with the other devices.
  • 21. 21© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Topology A hub receives data from one device and rebroadcasts data to all the other devices connected to the hub. A switch creates many separate communications links that allows two devices to talk on ports 1 and 2 while two other devices talk on ports 3 and 4. A ring or “daisy-chain” network is where you run the cable from device to device. This usually results in less cable being used. However, you still have to consider the total length of the cable.
  • 22. 22© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Distance Each type of network has distance and speed limitations that are related. The most common characteristic to all networks is that the longer the distance – the slower the speed. Repeaters, bridges, gateways, hubs, switches are ways to get around these limitations – but you need to be aware when and where to use them. There is a limit to how many repeaters you can use on one cable to extend the cable
  • 23. 23© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Number of devices Another factor limiting the response time, speed, and distance is the number of devices on the communications network. The higher the number of devices is then the shorter the distance, slower the baud rate, and higher the response time.
  • 24. 24© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Capabilities The communications capabilities of each device have to consider, some examples of capabilities might be: Device can talk RS232, RS422, or RS485. Device servers that allow you to send RS232 / 422/ 485 communications over Ethernet. Device can talk Devicenet, Modbus, DH+, Profibus Device can talk Ethernet but only 10Mps
  • 25. 25© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Length of Messages Theoretically you want similar sized messages on the same network. For example, do not put I/O (typically a lot of short messages) on an office Ethernet (typically fewer, but longer messages). When someone on the same network starts downloading a lot of pictures and video or decides to print a large file, it could be a while before the I/O gets updated again.
  • 26. 26© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Vendor Support Ideally there would be one best network and all automation vendors would support it. Another consideration is how well is this industrial network supported by third party vendors?
  • 27. 27© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week OSI Seven Layer Model Layer 7: Application Specifications and protocols for applications and users using the network: how to send a request, how to specify a filename over the net, how to respond to a request. A definition of what messages will be permitted and what responses are to be taken in response to each of these messages. Protocols commonly used are FTP, SNMP, SMTP, HTTP, Telnet
  • 28. 28© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week OSI Seven Layer Model Layer 6: Presentation Computers represent data in different ways (character, integer) thus the protocol needs to translate the data to and from the local node. Data encryption and compression are typically done at this level. Layer 5: Session Establishing a communications session, Security, Authentication, passwords
  • 29. 29© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week OSI Seven Layer Model Layer 4: Transport Transfer correctness, error detection. Data is segmented into manageable packet sizes. Responsible for resending failed messages and that good messages are not processed more than once. Protocols commonly used are TCP, UDP Layer 3: Network Address assignment, packet’s forwarding methods, routing. Protocol commonly used is IP.
  • 30. 30© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week OSI Seven Layer Model Layer 2: Data Link Frame format, transmission of frames, i.e. bit / byte stuffing, checksums, flow control, parity bits. Common example is the Ethernet. Layer 1: Physical This is the basic hardware components for networks, i.e. RS232 specification, it converts 1s and 0s into electrical pulses. Common example is the Ethernet.
  • 31. 31© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Traditional Industrial Networks There are many industrial networks currently available, for examples, the DeviceNet, the Modbus, the Profibus, and the industrial Ethernet, etc. The DeviceNet network is an open device level network that provides connections between simple industrial devices (such as sensors and actuators) and higher- level devices (such as programmable controllers and computers). Uses the proven Common Industrial Protocol (CIP) to provide the control, configure, and data collection capabilities for industrial devices.
  • 32. 32© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Traditional Industrial Networks Created in 1989 by a consortium of companies and institutions, PROFIBUS has become the world’s most popular fieldbus in discrete manufacturing and process control. It is mature, proven technology that is ideal for supporting modern automation systems. With over 14 million installed devices, it is a significant driving force for the world’s production plants.
  • 33. 33© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Traditional Industrial Networks Several years ago Ethernet was not a consideration for manufacturing since it is was slow and not deterministic. With the development of high bandwidth and inexpensive Ethernet switching technology, Ethernet is emerging as a good alternative. The application is constantly broadening its coverage to include Ethernet TCP/IP applications.
  • 34. 34© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Introduction to PLC Communication Multiple control systems will be used for complex processes. These control systems may be PLCs, but other controllers include robots, data terminals and computers.. The simplest form of communication is a direct connection between two computers. A network will simultaneously connect a large number of computers on a network. Data can be transmitted one bit at a time in series, this is called serial communication. Data bits can also be sent in parallel.
  • 35. 35© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Introduction to PLC Communication The transmission rate will often be limited to some maximum value, from a few bits per second, to billions of bits per second. The communications often have limited distances, from a few feet to thousands of miles/kilometers.
  • 36. 36© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Introduction to PLC Communication An example of a networked control system PLC Process Computer Devicenet Actuators Process Process Sensors Process Actuators Process Sensors RS-232 Normal I/O on PLC
  • 37. 37© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 Serial communications send a single bit at a time between computers. This only requires a single communication channel, as opposed to 8 channels to send a byte. With only one channel the costs are lower, but the communication rates are slower. The communication channels are often wire based, but they may also be can be optical and radio.
  • 38. 38© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 RS-232c is the most com-mon standard that is based on a voltage change levels. At the sending computer an input will either be true or false. The line driver will convert a false value in to a Txd voltage between +3V to +15V, true will be between -3V to -15V. A cable connects the Txd and com on the sending computer to the Rxd and com inputs on the receiving computer. The receiver converts the positive and negative voltages back to logic voltage levels in the receiving computer.
  • 39. 39© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 The cable length is limited to 50 feet to reduce the effects of electrical noise. When RS-232 is used on the factory floor, care is required to reduce the effects of electrical noise - careful grounding and shielded cables are often used.
  • 40. 40© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 Serial Data Standards RS-232c RS-422a RS-423a 50 ft 3000 ft 3000 ft Txd Rxd com In Out In Out In Out
  • 41. 41© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 A typical data byte looks like the one below true false before start data parity stop idle before - this is a period where no bit is being sent and the line is true. start - a single bit to help get the systems synchronized. data - this could be 7 or 8 bits, but is almost always 8 now. The value shown here is a byte with the binary value 00010010 (the least significant bit is sent first). parity - this lets us check to see if the byte was sent properly. The most common choices here are no parity bit, an even parity bit, or an odd parity bit. In this case there are two bits set in the data byte. If we are using even parity the bit would be true. If we are using odd parity the bit would be false. stop - the stop bits allow a pause at the end of the data. One or two stop bits can be used. idle - a period of time where the line is true before the next byte. Descriptions:
  • 42. 42© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 Some of the byte settings are optional, such as the number of data bits (7 or 8), the parity bit (none, even or odd) and the number of stop bits (1 or 2). The sending and receiving computers must know what these settings are to properly receive and decode the data. Most computers send the data asynchronously, meaning that the data could be sent at any time, without warning.
  • 43. 43© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 Another method used to detect data errors is half- duplex and full-duplex transmission. In half-duplex transmission the data is only sent in one direction. But, in full-duplex transmission a copy of any byte received is sent back to the sender to verify that it was sent and received correctly.
  • 44. 44© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 The transmission speed is the maximum number of bits that can be sent per second. The unit for this is baud. The baud rate includes the start, parity and stop bits. Lower baud rates are 120, 300, 1.2K, 2.4K and 9.6K. Higher speeds are 19.2K, 28.8K and 33.3K.
  • 45. 45© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 The handshaking lines are to be used to detect the status of the sender and receiver, and to regulate the flow of data. It would be unusual for most of these pins to be connected in any one application. The most common pins are provided on the DB-9 connector, and are also described below.
  • 46. 46© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 TXD/RXD - (transmit data, receive data) - data lines DCD - (data carrier detect) - this indicates when a remote device is present RI - (ring indicator) - this is used by modems to indicate when a connection is about to be made. CTS/RTS - (clear to send, ready to send) DSR/DTR - (data set ready, data terminal ready) these handshaking lines indicate when the remote machine is ready to receive data. COM - a common ground to provide a common reference voltage for the TXD and RXD.
  • 47. 47© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 When a computer is ready to receive data it will set the CTS bit, the remote machine will notice this on the RTS pin. The DSR pin is similar in that it indicates the modem is ready to transmit data. XON and XOFF characters are used for a software only flow control scheme.
  • 48. 48© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 A normal handshaking protocol between a computer and a modem looks like this
  • 49. 49© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 1 The computer sets DTR to indicate that it wants to make use of the modem.
  • 50. 50© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 2 The modem signals that it is ready and that a connection has been established.
  • 51. 51© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 3 The computer requests permission to send.
  • 52. 52© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 4 The modem informs the computer that it is now ready to receive data from the computer and send it through the phone wires.
  • 53. 53© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 5 The modem drops CTS to signal to the computer that its internal buffers are full; the computer stops sending characters to the modem.
  • 54. 54© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 6 The buffers of the modem have been purged, so the computer may continue to send data.
  • 55. 55© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 7 This situation is not clear; either the computer's buffers are full and it wants to inform the modem of this, or it doesn't have any more data to be send to the modem.
  • 56. 56© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 8 The modem acknowledges RTS by dropping CTS.
  • 57. 57© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 9 RTS is again raised by the computer to re- establish data transmission.
  • 58. 58© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 10 The modem shows that it is ready to do its job.
  • 59. 59© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 11 No more data is to be sent.
  • 60. 60© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 12 The modem acknowledges this.
  • 61. 61© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 13 DTR is dropped by the computer; this causes most modems to hang up. After hang-up, the modem acknowledges with DSR low.
  • 62. 62© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Serial Communication and RS232 14 Communication terminates
  • 63. 63© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week ASCII ladder function in PLC Many PLC processors have an RS-232 port that is normally used for programming the PLC PLC5 RS-232 Cable Terminal AWT Channel 0 String Location ST9:0 Length 4 Emulator com 1 channel 0 A
  • 64. 64© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week ASCII ladder function in PLC The AWT (Ascii WriTe) function below will write to serial ports on the CPU only. To write to other serial ports the message function in Figure 2.11.3b must be used. In this example the message block will become active when A goes true. It will use the message parameters stored in message memory MG9:0. The parameters set indicate that the mes-sage is to Write data stored at N7:50, N7:51 and N7:52. This will write the ASCII string ABC to the serial port.
  • 65. 65© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week ASCII ladder function in PLC Message Function for Serial Communication MSG Control Block MG9:0 Memory Values: Read/Write Data Table Size Local/Remote Remote Station Link ID Remote Link type Local Node Addr. Processor Type Dest. Addr. Write N7:50 3 Local N/A N/A N/A 20 ASCII N/A N7:50 N7:51 N7:52 65 66 67 setup stored in MG9:0 Data Stored in memory A
  • 66. 66© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week ASCII ladder function in PLC PLC-5 ASCII Functions ABL(channel, control)- reports the number of ASCII characters including line endings ACB(channel, control) - reports the numbers of ASCII characters in buffer ACI(string, dest) - convert ASCII string to integer ACN(string, string,dest) - concatenate strings AEX(string, start, length, dest) - this will cut a segment of a string out of a larger string AIC(integer, string) - convert an integer to a string AHL(channel, mask, mask, control) - does data handshaking ARD(channel, dest, control, length) - will get characters from the ASCII buffer ARL(channel, dest, control, length) - will get characters from an ASCII buffer ASC(string, start, string, result) - this will look for one string inside another ASR(string, string) - compares two strings AWT(channel, string, control, length) - will write characters to an ASCII output
  • 67. 67© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week ASCII ladder function in PLC An ASCII String Example ARL Channel 0 Dest ST10:0 Control R6:0 Length 2 AWT Channel 0 String ST10:2 Length 7 R6:0/DN ACN StringA ST10:1 StringB ST10:0 Dest ST10:2 ST10:1 = "HI " ACB Channel 0 Control R6:1 R6:1/EN GEQ Source A R6:1.POS Source B 2
  • 68. 68© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week ASCII ladder function in PLC A String to Integer Conversion Example ACI String ST9:10 Dest N7:0 ACI String ST9:11 Dest N7:1 ADD SourceA N7:0 SourceB N7:1 Dest N7:2 AIC Source N7:2 String ST9:12
  • 69. 69© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week ASCII ladder function in PLC String Manipulation Functions ACB Channel 1 Control R6:0 ABL Channel 1 Control R6:1 AEX Source ST9:0 Index 5 Length 2 ASR StringA ST9:2 StringB ST9:3 A Dest ST9:1 O:001/2 B
  • 70. 70© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Communication example Problem: A robot will be loading parts into a box until the box reaches a prescribed weight. A PLC will feed parts into a pickup fixture when it is empty. The PLC will tell the robot when to pick up a part and load it into the box by passing it an ASCII string, "pickup".
  • 71. 71© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Communication example Example: PLC Interface To a Robot PLC Robot Box and RS-232 Parts "pickup" = pickup part Feeder Parts Pickup Fixture feed part part waiting box full Weigh Scale
  • 72. 72© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Communication example The following ladder logic will implement part of the control system for the system part waiting box full feed part ONS Bit B3:0 AWT Channel 0 String ST10:0 Length 6 part waiting ST10:0 = "pickup"
  • 73. 73© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Summary  Industrial automation networks have many characteristics in common with non industrial networks such as Response Time, Bandwidth, Efficiency, Access Method, Topology, and Distance, etc.  The standard model for networking protocols and distributed applications is the International Standard Organization's Open System Interconnect (ISO/OSI) model. It defines seven network layers: the Application, Presentation, Session, Transport, Network, Data Link and Physical Layer.
  • 74. 74© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Summary  The more everyone tries to create one universal standard for the industrial network, the more universal standards we get. As a result, there are different industrial network standards offered by different network vendors.  Industrial automation networks have many characteristics in common with non industrial networks such as Response Time, Bandwidth, Efficiency, Access Method, Topology, and Distance, etc.
  • 75. 75© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week  The standard model for networking protocols and distributed applications is the International Standard Organization's Open System Interconnect (ISO/OSI) model. It defines seven network layers: the Application, Presentation, Session, Transport, Network, Data Link and Physical Layer.  The more everyone tries to create one universal standard for the industrial network, the more universal standards we get. As a result, there are different industrial network standards offered by different network vendors. Summary
  • 76. 76© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week  Serial communications pass data one bit at a time.  RS-232 communications use voltage levels for short distances. A variety of communications cables and settings were discussed.  ASCII functions are available of PLCs making serial communications possible. Summary
  • 77. 77© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Summary  Serial communications pass data one bit at a time.  RS-232 communications use voltage levels for short distances. A variety of communications cables and settings were discussed.  ASCII functions are available of PLCs making serial communications possible.
  • 78. 78© Vocational Training Council, Hong Kong. EEE3420 Industrial Control Week Communication using PLC End of Lecture 7  Revision