RS-485: allows multiple talkers and listeners on one serial line (this can be the basis for a network)
• A typical data byte looks like the one below. The voltage/current on the line is turned on/off. The width of the bits determines the possible bits per second (bps). The value shown before is used to transmit a single byte.
• The bits shown correspond to,
before: this is a period where no bit is being sent and the line is high
start: a single bit to help get the systems synchronized
data: this byte could be 7 or 8 bits, but is almost always 8 now. The value shown here is 01001000 binary.
parity: this lets us check to see if the byte was sent properly. The most common choices here are no parity bit (just drop it out), or even parity, or odd parity. In this case there are two bits set. If we are using even parity the bit would be set. If we are using odd parity the bit would be off
stop: the stop bits allow form a natural pause at the end of the data.
after: a period of time where the line is high before the next byte.
• Typical electrical connections look like,
• This standard is based on a high being +3 to +15V, and an off being -3 to -15V (+/-12V is commonly used).
• The typical connection scheme is shown below. notice that the lines are crossed between connectors. Also note that in some cases the dsr/dtr lines are not used. (Note: these are the lines used when connecting to a modem)
• The line names are,
TXD/RXD: (transmit data, receive data) these lines pass data one way from sender to receiver.
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 keep things from blowing up, etc.
• A cable that emulates a modem connection between two devices is shown below and is called a null modem cable.
• There are typically two connectors used for these devices. (Note: the connectors have very fine numbers on them)
• The main pin assignments for the DB-25 are,
Commonly used pins
1: GND (chassis ground)
2: TXD (transmit data)
3: RXD (receive data)
4: RTS (request to send)
5: CTS (clear to send)
6: DSR (data set ready)
7: COM (common)
8: DCD ()
20: DTR (data terminal ready)
9: Positive Voltage
10: Negative Voltage
11: not used
12: Secondary Received Line Signal Detector
13: Secondary Clear to Send
14: Secondary Transmitted Data
15: Transmission Signal Element Timing (DCE)
16: Secondary Received Data
17: Receiver Signal Element Timing (DCE)
18: not used
19: Secondary Request to Send
21: Signal Quality Detector
22: Ring Indicator (RI)
23: Data Signal Rate Selector (DTE/DCE)
24: Transmit Signal Element Timing (DTE)
• The pin assignments for the DB-9 are,
• There are other settings such as half/full duplex.
• When communicating between two devices the setting must agree baud rate, stop bits, parity, data bits, full/half duplex, etc.
• The figure below shows a PLC connected to a data terminal with a serial line. This is followed by ladder logic to use the serial connection.
220.127.116.11 - ASCII Functions
• ASCII functions can be used to interpret and manipulate strings in PLCs.
• These functions include,
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
AWT(channel, string, control, length): will write characters to an ASCII output
Problem 28.1 Add the following numbers and store the results in ST10:2
28.3.2 American Standard Code for Information Interchange - ASCII
• While numbers are well suited binary, characters don’t naturally correspond to numbers. To overcome this a standard set of characters and controls were assigned to numbers. As a result, the letter ‘A’ is readily recognized by most computers world-wide when they see the number 65.
28.4 Parallel Interfaces
• This I/O port uses multiple data lines (one for each bit) and extra lines for handshaking.
• These cables can permit very high data transfer rates.
• Because of the extra conductors the cables are large, most costly, length limited and much less flexible
28.5 Networks for Communication
• A Network is a way of connecting different computers to allow data and message passing, and resource sharing.
• Early communication techniques included telegraphs (with morris code), telephones and teletypes.
allows shared computers and peripherals
provides communication and cooperation tools for people and computers
increases reliability by having alternate computers available
decreases isolation of many computers
more sophisticated hardware and knowledge required
allows remote access to databases and libraries
distributed computational facilities
remote control of applications
• The relationship between various network types is shown below
• The Star Network topology uses many connections to a central server
• When all computers are connected to the same network cable, there are a number of structures which may be used. The bus topology below is simpler, and the tree topology is more flexible and versatile. This approach uses a single cable which is easy to add to
• The ring topology below shows a closed loop of cable which can be simple to implement, but limited in capabilities
• An enhanced ring topology is pictured below
• Significant issues in networks are,
Network power: does the network distribute power, or does each station need to be separately powered.
Network tees: to tap into the network cable simple connections can be used, or the connection can have circuitry.
Transmission type: switched voltage levels (baseband), single band FSK (carrierband), multiple frequency FSK (broadband). The FSK methods allow much higher network speeds.
Bus access: When network nodes share the same wire they may try to talk at the same time (this is called a network collision). Different schemes for dealing with collisions include,
CSMA/CD (Collision Sense Multiple Access/Collision Detection): if two nodes start talking and detect a collision then they will stop, wait a random time, and then start again.
CSMA/BA (Collision Sense Multiple Access/Bitwise Arbitration): if two nodes start talking at the same time the will stop and use their node addresses to determine which one goes first.
Master-Slave: one device one the network is the master and is the only one that may start communication. slave devices will only respond to requests from the master.
Token Passing: A token, or permission to talk, is passed sequentially around a network so that only one station may talk at a time.
28.5.2 OSI Network Model
Computers not necessarily from the same manufacturer
Allow computers to communicate information.
Sharing of equipment such as printers, disks, etc.
Programs can run on multiple machines improving performance
Access to machines with better/different resources.
• General OSI Diagram contains seven layers
18.104.22.168 - Physical Layer
• Physical layer is concerned with transmission of raw bits over a physical circuit.
• Deals with voltages, timing, connections, etc.
• Responsible for bit synchronization and the identification of a signal element as either a 0 or a 1.
• Protocols: RS-232, RS-449, CCITT X.25 and X.21, IEEE 802
22.214.171.124 - Data Link Layer
• Data link layer breaks input data into “data frames” and processes acknowledgments.
• Object is to provide a error-free transmission line to the network layer.
• Responsible for the reliable delivery of information over a point-to-point or multipoint link.
• Supervises interchange of both link control data and user information
• Protocols: ANSI X3.28, HDLC, X.25, ISDN, IEEE 802
126.96.36.199 - Network Layer
• Network layer determines the interface between the computer and the intermediate system, how packets are routed.
• Chooses a route from the available data links that form the network.
• Object is to take messages, convert them to packets and send them towards the destination.
• Protocols: CCITT X.25, X.21, IP, CCITT Q.931, ISO 8473
188.8.131.52 - Transport Layer
• Transport layer takes data from the session layer, splits it up if necessary, and passes this to the network layer.
• Ensures that pieces all arrive correctly at the other end.
• Isolates the user from any concern for the actual movement of the information.
• Protocols: TCP, ISO 8073
184.108.40.206 - Session Layer
• Session layer defines a connection between users (presentation layer processes).
• Includes specification of the remote machine, authorization, options for the communication, and recovering from errors in broken transport connections.
• The set-up of communications is called binding.
• Protocols: ISO 8327, CCITT X.225, T.62, ECMA 75, NFS, RPC.
220.127.116.11 - Presentation Layer
• Ensures compatible syntax among the communicating processes by adjusting data structures, formats, and codes.
• Presentation layer is generally represented by library routines which the user accesses to perform network operations.
• This layer can also perform transformations such as compression and encryption.
• Protocols: DIS 8823, 8824, 8825, CCITT X.409, T.61
18.104.22.168 - Application Layer
• Application layer is written by the user, or is a program that performs some function for the user.
• Provides a window by which the user gains access to the communication services provided by the architecture.
• Protocols: DIS 8571, 8832, 9040
22.214.171.124 - Open Systems
• Open Systems Principles
Entity is a group of functions for a particular task. Accept input, and produce output.
Layer is a group of functions designed to provide a set of services related to the mission of that layer
Entities provide a set of services to the layer above. In doing this they use the services of the underlying layers.
Each layer isolates the layer above from the details of the underlying layers, and thus a lower layers characteristics can change without affecting the rest of the system.
Primitives control the layer’s services and data flow. Primitives fall into 4 groups: Request, Indicate, Response, and Confirm
• We can do a simple comparison of networking models
126.96.36.199 - Networking Hardware
• A number of basic components are required for networks
• Computer (or dedicated computing equipment)
An obvious must. Without the computer there is no need for networking
Approximate cost $500 to $1,000,000
• Network Interface Hardware
Some computers come with built in network interfaces, If these are for the wrong network types, or there is no network interface, a networking interface must be purchased.
examples are ethernet, latticenet, fibre, etc.
Approximate Cost $30.00 and up
• The Media,
This is the cabling which will connect the computers
10base2 (thin wire) is thin shielded coaxial cable with BNC connectors
10baseF (fiber optic) is costly, but signal transmission and noise properties are very good.
10baseT (twisted pair) is the most popular. It is a pair of twisted copper wires terminated with an RJ-45 connector.
Approximate cost for thick net $40 + $5/station, for thin net $10 + $1/station
A device which is sometimes included between the network media, and the network interface hardware.
Allows easy changes to media type.
Not used for thin cable computer interfaces.
Approximate costs $100 to $200
Connects separate wires and will route local traffic to local wires and remote through external connections.
approximate cost $50/wire
• Bridges, (Data link layer)
Used when hooking one network type to another, or isolating one part of a network from another.
A bridge can be used for hooking an ethernet cable to an optical backbone cable.
Has one input, one output, and will only handle sorting by network address (like ethernet address of machine).
Approximate cost $2,000 to $5,000
Same functionality as router.
• Routers, (Network Layer)
When there are too many networks on the same network, a router can be used to isolate small loops of the network from traffic which does not involve it.
More intelligent than a bridge, multiple inputs/outputs.
Sorts Network packets by IP address.
Approximate cost $5,000 to $10,000.
• Repeaters, (Physical Layer)
If network cables are too long, the repeaters will boost the signal strength so that it may complete it’s journey.
Also allows media to be changed
• Networking Software / Networking Management Software
Handles networking interface control for,
Examples of this are NFS (Network File Server), SNMP (Simple Network Management Protocol)
Approximate costs >$1,000, unless provided with system
• Gateways (Application, Presentation, Session and Transport layers)
• An example of a micro computer with a networked interface
• Basic network hardware can be described with the 7-layer ISO model,
28.6 Bus Types
• Low level busses,
• General open buses,
Smart Distributed System (SDS)
• Specialty buses,
• Devicenet is meant as a noise resistant, robust, shop floor network.
• The main change that the user will notice is that a rack of a PLC can be broken up and CPU, I/O, etc. are now connected by Devicenet.
• Devicenet is an open standard, so components can come from a variety of suppliers.
• Based on the CANbus (Controller Area Network) protocol.
• Some advantages,
open system is not tied to a single vendor
diagnosis of devices is possible
wiring becomes easier (no long wire runs)
complex devices are easy to connect
possibility of using a PC based control package
multiple controllers can share the net
• Basic features
up to 64 nodes on the network
lengths of 500m/250m/100m for speeds of 125kbps/250kbps/500kbps respectively
data packet size of 0-8 bytes
power and signal in the same cable
single bus cable
addressing includes peer-to-peer, multicast, master/slave, polling or change of state
devices can be added/removed while power is on
• Devicenet is a layer 7: application protocol (Note that CANbus is level 2)
• A typical structure for Devicenet is shown below,
• There are two types of wire used,
Thick trunk: carries up to 8A for power up to 500m
Thin trunk: up to 3A for power up to 100m
• Power supplies are directly connected to the cable to supply power.
• The drop lengths are limited
total length/speed 156m/78m/39m are 125Kbps/250Kbps/500Kbps respectively
a single drop is limited to 6m
• The wiring can come in a form of end/connectors,
unsealed screw connector
sealed mini connector
sealed micro connector
• Devices may have a red/green status light for the network status.
• Devicenet used the CANbus indentifier to specify,
message types (5 bits)
node number (6 bits) up to 64 nodes on the net
• On a PLC-5 rack you would need a devicenet interface and could use the instructions below.
• On a Softlogix PLC the I/O will be copied into blocks of integer memory. These blocks are selected by the user in the setup of the software. Here the inputs are copied into N9 integer memory, and the outputs are set by copying the N10 block of memory back to the outputs.
• The CANbus (Controller Area Network) uses bit wise resolution for collisions on the network (i.e., the lower the network identifier, the higher the priority for sending)
• A data frame for the CANbus is shown below,
• Each device listens to the frame it sent to ensure proper communication.
• This is intended for communication between controllers, and permits more complex messages than Devicenet.
• A control network that is popular overseas, and primarily pushed by Siemens.
• General features include,
A token passing between up to three masters
maximum of 126 nodes
straight bus topology
length from 9600m/9.6Kbps with 7 repeaters to 500m/12Mbps with 4 repeaters
2 data lines and shield
power needed at each station
2048 bits of I/O per network frame
28.6.5 Proprietary Networks
188.8.131.52 - Data Highway
• Major features of the DH+ network,
up to 64 nodes
peer to peer with token passing
uses shielded twisted pair cables
data rates of 57.6Kbps, 230 Kbps
• The basic data frame looks like,
• The data packet looks like that shown below (but it will vary depending upon the requested command).
• Some command examples include,
• Example for the Allen-Bradley PLC-5 Data Highway Network Connection
28.6.6 Other Network Types
• PROFIBUS (Professional Field Bus) is an emerging standard for PLC communication that Siemens has incorporated into its product line with the “SINEC L2” bus. Companies such as Festo have agreed to follow the bus standard.
28.7 Design Cases
28.7.1 PLC Interface To Robots And NC Machines
• Most robots have inputs and outputs that can be connected directly to sensors, actuators, PLCs, etc.
• Consider a case where a PLC controls a press and a robot unloads it.
Problem 28.2 Explain why networks are important in manufacturing controls.