78
1 Week © Vocational Training Council, Hong Kong. │ Lecture 7 │ Communication using PLC EEC3420 Industrial Control Department of Electrical Engineering

Eee3420 lecture07 rev2011

Embed Size (px)

Citation preview

Page 1: Eee3420 lecture07 rev2011

1Week © Vocational Training Council, Hong Kong.

│ Lecture 7 │

Communication using PLC

EEC3420 Industrial ControlDepartment of Electrical Engineering

Page 2: Eee3420 lecture07 rev2011

2© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Learning Objectives

To know the communication protocol and the PLC communication technique.

Page 3: Eee3420 lecture07 rev2011

3© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Introduction to Industrial NetworksMultiple 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.

Page 4: Eee3420 lecture07 rev2011

4© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Introduction to Industrial NetworksThe 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.

Page 5: Eee3420 lecture07 rev2011

5© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Introduction to Industrial NetworksThe 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.

Page 6: Eee3420 lecture07 rev2011

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

Page 7: Eee3420 lecture07 rev2011

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?

Page 8: Eee3420 lecture07 rev2011

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.

Page 9: Eee3420 lecture07 rev2011

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

Page 10: Eee3420 lecture07 rev2011

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.

Page 11: Eee3420 lecture07 rev2011

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.

Page 12: Eee3420 lecture07 rev2011

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-second intervals?

Page 13: Eee3420 lecture07 rev2011

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.

Page 14: Eee3420 lecture07 rev2011

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.

Page 15: Eee3420 lecture07 rev2011

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?

Page 16: Eee3420 lecture07 rev2011

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.

Page 17: Eee3420 lecture07 rev2011

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.

Page 18: Eee3420 lecture07 rev2011

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.

Page 19: Eee3420 lecture07 rev2011

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.

Page 20: Eee3420 lecture07 rev2011

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.

Page 21: Eee3420 lecture07 rev2011

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.

Page 22: Eee3420 lecture07 rev2011

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

Page 23: Eee3420 lecture07 rev2011

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.

Page 24: Eee3420 lecture07 rev2011

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

Page 25: Eee3420 lecture07 rev2011

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.

Page 26: Eee3420 lecture07 rev2011

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?

Page 27: Eee3420 lecture07 rev2011

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

Page 28: Eee3420 lecture07 rev2011

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

Page 29: Eee3420 lecture07 rev2011

29© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

OSI Seven Layer Model Layer 4: TransportTransfer 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: NetworkAddress assignment, packet’s forwarding methods, routing. Protocol commonly used is IP.

Page 30: Eee3420 lecture07 rev2011

30© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

OSI Seven Layer Model Layer 2: Data LinkFrame format, transmission of frames, i.e. bit / byte stuffing, checksums, flow control, parity bits. Common example is the Ethernet.

Layer 1: PhysicalThis is the basic hardware components for networks, i.e. RS232 specification, it converts 1s and 0s into electrical pulses. Common example is the Ethernet.

Page 31: Eee3420 lecture07 rev2011

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.

Page 32: Eee3420 lecture07 rev2011

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.

Page 33: Eee3420 lecture07 rev2011

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.

Page 34: Eee3420 lecture07 rev2011

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.

Page 35: Eee3420 lecture07 rev2011

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.

Page 36: Eee3420 lecture07 rev2011

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

ProcessSensors

ProcessActuators

ProcessSensors

RS-232

Normal I/O on PLC

Page 37: Eee3420 lecture07 rev2011

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.

Page 38: Eee3420 lecture07 rev2011

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.

Page 39: Eee3420 lecture07 rev2011

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.

Page 40: Eee3420 lecture07 rev2011

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

InOut

In

Out

Page 41: Eee3420 lecture07 rev2011

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:

Page 42: Eee3420 lecture07 rev2011

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.

Page 43: Eee3420 lecture07 rev2011

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.

Page 44: Eee3420 lecture07 rev2011

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.

Page 45: Eee3420 lecture07 rev2011

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.

Page 46: Eee3420 lecture07 rev2011

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.

Page 47: Eee3420 lecture07 rev2011

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.

Page 48: Eee3420 lecture07 rev2011

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

Page 49: Eee3420 lecture07 rev2011

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.

Page 50: Eee3420 lecture07 rev2011

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.

Page 51: Eee3420 lecture07 rev2011

51© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Serial Communication and RS232

3 The computer requests permission to send.

Page 52: Eee3420 lecture07 rev2011

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.

Page 53: Eee3420 lecture07 rev2011

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.

Page 54: Eee3420 lecture07 rev2011

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.

Page 55: Eee3420 lecture07 rev2011

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.

Page 56: Eee3420 lecture07 rev2011

56© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Serial Communication and RS232

8 The modem acknowledges RTS by dropping CTS.

Page 57: Eee3420 lecture07 rev2011

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.

Page 58: Eee3420 lecture07 rev2011

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.

Page 59: Eee3420 lecture07 rev2011

59© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Serial Communication and RS232

11 No more data is to be sent.

Page 60: Eee3420 lecture07 rev2011

60© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Serial Communication and RS232

12 The modem acknowledges this.

Page 61: Eee3420 lecture07 rev2011

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.

Page 62: Eee3420 lecture07 rev2011

62© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Serial Communication and RS232

14 Communication terminates

Page 63: Eee3420 lecture07 rev2011

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

AWTChannel 0String Location ST9:0Length 4

Emulator

com 1

channel 0

A

Page 64: Eee3420 lecture07 rev2011

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.

Page 65: Eee3420 lecture07 rev2011

65© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

ASCII ladder function in PLC Message Function for Serial Communication

MSGControl Block MG9:0

Memory Values: Read/WriteData TableSizeLocal/RemoteRemote StationLink IDRemote Link typeLocal Node Addr.Processor TypeDest. Addr.

WriteN7:503LocalN/AN/AN/A20ASCIIN/A

N7:50N7:51N7:52

656667

setup storedin MG9:0

Data Stored in memory

A

Page 66: Eee3420 lecture07 rev2011

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 endingsACB(channel, control) - reports the numbers of ASCII characters in bufferACI(string, dest) - convert ASCII string to integerACN(string, string,dest) - concatenate stringsAEX(string, start, length, dest) - this will cut a segment of a string out of a larger stringAIC(integer, string) - convert an integer to a stringAHL(channel, mask, mask, control) - does data handshakingARD(channel, dest, control, length) - will get characters from the ASCII bufferARL(channel, dest, control, length) - will get characters from an ASCII bufferASC(string, start, string, result) - this will look for one string inside anotherASR(string, string) - compares two stringsAWT(channel, string, control, length) - will write characters to an ASCII output

Page 67: Eee3420 lecture07 rev2011

67© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

ASCII ladder function in PLC An ASCII String Example

ARLChannel 0Dest ST10:0Control R6:0Length 2

AWTChannel 0String ST10:2Length 7

R6:0/DN ACNStringA ST10:1StringB ST10:0Dest ST10:2

ST10:1 = "HI "

ACBChannel 0Control R6:1

R6:1/EN

GEQSource A R6:1.POSSource B 2

Page 68: Eee3420 lecture07 rev2011

68© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

ASCII ladder function in PLC A String to Integer Conversion Example

ACIString ST9:10Dest N7:0

ACIString ST9:11Dest N7:1

ADDSourceA N7:0SourceB N7:1Dest N7:2

AICSource N7:2String ST9:12

Page 69: Eee3420 lecture07 rev2011

69© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

ASCII ladder function in PLC String Manipulation Functions

ACBChannel 1Control R6:0

ABLChannel 1Control R6:1

AEXSource ST9:0Index 5Length 2

ASRStringA ST9:2StringB ST9:3

A

Dest ST9:1

O:001/2

B

Page 70: Eee3420 lecture07 rev2011

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".

Page 71: Eee3420 lecture07 rev2011

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

FeederParts PickupFixture

feed part part waiting box full

Weigh Scale

Page 72: Eee3420 lecture07 rev2011

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

ONSBit B3:0

AWTChannel 0String ST10:0Length 6

part waiting

ST10:0 = "pickup"

Page 73: Eee3420 lecture07 rev2011

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.

Page 74: Eee3420 lecture07 rev2011

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.

Page 75: Eee3420 lecture07 rev2011

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

Page 76: Eee3420 lecture07 rev2011

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

Page 77: Eee3420 lecture07 rev2011

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.

Page 78: Eee3420 lecture07 rev2011

78© Vocational Training Council, Hong Kong.

EEE3420 Industrial Control

Week

Communication using PLC

End of Lecture 7

Revision