Programmable logic controller questions

profiletzn789
PLC-5-2.pdf

MODULE TITLE: PROGRAMMABLE LOGIC CONTROLLERS

TOPIC TITLE: THE STRUCTURE OF THE PLC

LESSON 2: SYSTEM FEATURES I

PLC - 5 - 2

© Teesside University 2011

Published by Teesside University Open Learning (Engineering)

School of Science & Engineering

Teesside University

Tees Valley, UK

TS1 3BA

+44 (0)1642 342740

All rights reserved. No part of this publication may be reproduced, stored in a

retrieval system, or transmitted, in any form or by any means, electronic, mechanical,

photocopying, recording or otherwise without the prior permission

of the Copyright owner.

This book is sold subject to the condition that it shall not, by way of trade or

otherwise, be lent, re-sold, hired out or otherwise circulated without the publisher's

prior consent in any form of binding or cover other than that in which it is

published and without a similar condition including this

condition being imposed on the subsequent purchaser.

________________________________________________________________________________________

INTRODUCTION ________________________________________________________________________________________

In a previous lesson we were introduced to ladder diagrams, their symbols and

meaning and some methods of rung simplification. In this lesson we shall look

at how program listings relate to ladder diagrams.

We shall be introduced to examples of PLC programmer unit hardware that is

used to enter instructions into the PLC and build up a program.

A common ladder diagram is used to illustrate three variations in presentation

together with a brief assessment of the keyboards and displays used to handle

each variant.

Common blocks of hardware, anticipated to be a requirement of every system,

are also mentioned or expanded upon if previously mentioned in earlier

lessons.

________________________________________________________________________________________

YOUR AIMS ________________________________________________________________________________________

Upon completion of this lesson you should be able to:

• relate ladder diagrams to program listings for different machines

• explain common methods of entering program listings into PLCs

• draw comparisons between the facilities and operations of

commercial PLC keyboards

• explain the differences between common PLC display methods.

1

Teesside University Open Learning (Engineering)

© Teesside University 2011

________________________________________________________________________________________

PROGRAMMING IMPLICATIONS ________________________________________________________________________________________

When a ladder diagram drawn on paper is to be implemented by a PLC it must

first be entered into the machine so that it may be RUN. The diagram is stored

as a sequence of data within a special section of the memory of the

microcomputer which controls the operation of the PLC. This data is used to

produce a microprocessor program. In digital computers all programs are

sequential in operation. This means that the microprocessor which executes

the machine instructions does so one at a time as if it were working through a

list of jobs.

Due to the microprocessor being held to this sequential method of operation

the programmer must arrange the 'list of jobs' in the correct order so that the

PLC will behave in the expected manner. To do this the programmer converts

the ladder diagram into a program listing and enters this listing into the PLC

using some form of programmer unit.

Manufacturers each make their own programmer unit, which means that

variations in programming procedures are bound to exist from machine to

machine.

The ladder diagram of FIGURE 1 will now be used to provide examples of

program listings.

NOTE: At this point you will notice that we have stopped drawing in the

right vertical upright of the ladder diagrams. Since nothing is allowed to

follow an output element on a rung we simply assume that it is there and don't

bother drawing it in. This is a generally accepted convention and will be

followed in all future ladder diagrams.

2

Teesside University Open Learning (Engineering)

© Teesside University 2011

FIG. 1

Example 1

The first example breaks down the ladder diagram into steps.

Each step is programmed by having:

(a) the step identified by a step number

(b) the operation specified by an op-code (a mnemonic)

(c) the element concerned specified as an operand.

This is very similar to assembly language programming of a microprocessor

based system.

The listing is derived in a step-by-step manner in the same way as the

conventional method of reading ladder diagrams mentioned in previous

lessons. Each operation with the element concerned is specified as each rung

of the ladder is traced out.

Rung 1

Rung 2

Rung 3

000 001 MR000

002 MR000 MR001

MR001 OUT 000

MR000

End

3

Teesside University Open Learning (Engineering)

© Teesside University 2011

The ladder diagram of FIGURE 1 becomes the following listing:

Step Mnemonic Operand

op-code

000 LD 000 The first operation and element specified

001 OR MR000 The second operation and element specified

002 AND NOT 001 The third operation and element specified

003 OUT MR000 The fourth operation and element specified

The first four steps (000 to 003) define RUNG 1.

The remainder of the rungs are listed in a similar way.

004 LD 002

005 AND MR000 Steps 004 to 006 define RUNG 2

006 OUT MR001

007 LD MR001 Steps 007 to 008 define RUNG 3

008 OUT 000

009 END Defines the end of the listing

When this type of listing is entered into the PLC it is entered one step at a

time. Each step is set up on a display panel and then written into the PLC's

memory before the next step is set up. After the last step in the program an

END instruction must be added to indicate that the listing is complete. The

END instruction is considered to be very important in most systems. If it is

omitted the PLC will probably not run the program, an error message would

almost certainly be displayed.

4

Teesside University Open Learning (Engineering)

© Teesside University 2011

The programming sequence for this listing would be:

000 → LD → 000 → WRITE (the step to memory) 001 → OR → MR → 000 → WRITE 002 → AND NOT → 001 → WRITE 003 → OUT → MR → 000 → WRITE 004 → LD → 002 → WRITE 005 → AND → MR → 000 → WRITE 006 → OUT → MR → 001 → WRITE 007 → LD → MR → 001 → WRITE 008 → OUT → 000 → WRITE 009 → END → WRITE

The arrows indicate the flow of the sequence of the programming procedure.

The WRITE operation is not a part of the listing but it is a vital part of the

procedure. Each time the WRITE key is pressed the step data is entered into

memory and the next step number is presented ready for the next step. A

favourite mistake by newcomers to this method is forgetting to write the END

instruction into memory. Eagerly switching to RUN displays the error

message 'NO END INSTRUCTION'.

5

Teesside University Open Learning (Engineering)

© Teesside University 2011

Consider now the ladder diagram of FIGURE 2. Provide a listing of the type just

considered which would be suitable for the programming of this diagram. Write the

listing below.

FIG. 2

Step Op-code Operand

000

001

002

003

004

005

006

007

008

009

________________________________________________________________________________________

Check your listing against that given on page 26.

Rung 1

Rung 2

000 001 MR000

004

MR000 OUT 000

MR001

End

003

002

6

Teesside University Open Learning (Engineering)

© Teesside University 2011

Example 2

The second example follows a similar format to the previous listing. This time

the step is called a step address and the op-code is specified as a number

representing the operation required. The element identification (operand) has

been changed to fall in line with that used in the ladder diagram of FIGURE 3.

The circuits and operation of FIGURES 1 and 3 are the same.

FIG. 3

The listing for FIGURE 3 becomes:

Step Address Op-code Operand

0000 01 000 (Next Address)

0001 05 288 " "

0002 04 001 " "

0003 10 288 " "

0004 01 002 " "

0005 03 288 " "

Rung 1

Rung 2

Rung 3

000 001 288

002 288 289

289 OUT 032

288

End

7

Teesside University Open Learning (Engineering)

© Teesside University 2011

0006 10 289 " "

0007 01 289 " "

0008 10 032 " "

0009 20 0000 " "

Here again each step is programmed before the 'next address' key is pressed.

The operation of this key writes the step into the computer memory and

increments the step address ready for the next step.

Compare this listing with the diagram of FIGURE 3. Add the op-codes to the

diagram and then answer the following questions.

What operation does each of the following numerical codes perform?

(a) 05

(b) 03

(c) 04

(d) 10

(e) 20

(f) 01.

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

________________________________________________________________________________________

Answers on pages 26 and 27.

8

Teesside University Open Learning (Engineering)

© Teesside University 2011

FIG. 4

Refer now to the diagram of FIGURE 4.

Provide a listing below, using the method of example 2, which would be suitable for the

programming of the diagram of FIGURE 4. FIGURE 4 represents the same circuit as

FIGURE 2.

Step Address Op-code Operand

0000

0001

0002

0003

0004

0005

0006

0007

0008

0009

Solution given on page 27 and 28.

Rung 1

Rung 2

000 001 288

004

OUT 032

288

End

003

002

288

9

Teesside University Open Learning (Engineering)

© Teesside University 2011

The methods employed in Examples 1 and 2 are often used with a hand-held

programmer unit which can only display information about one step at any one

time. The information is lost from the display when the WRITE or NEXT

ADDRESS key is pressed.

Example 3

The third example illustrates the programming of the diagram of FIGURE 1 by

a function key method. This method is slightly different from the other two

previous examples and would be used with a programmer unit equipped with a

display screen. The ladder diagram is progressively drawn on the display as

the function keys are pressed. In this way the build up of the ladder diagram is

in full view all of the time making mistakes less likely.

The diagram of FIGURE 1 has had the element identification changed so that

it conforms with the programming method. Note the return of the use of X, Y

and R.

FIGURE 5 shows the redefined diagram of FIGURE 1.

FIG. 5

Rung 1

Rung 2

Rung 3

X000 X001 R000

X002 R000 R001

R001 Y000

R000

End

10

Teesside University Open Learning (Engineering)

© Teesside University 2011

Function key listing for the diagram of Figure 5.

FIG. 6

Three variations of programming procedures have now been examined. These

are by no means the only procedures employed but they do help to establish

the fact that the sequence of entering information into the PLC must be a

faithful reproduction of the contents of the ladder diagram.

END

PRG

W R T

PRG

W R T

PRG

W R T

PRG

W R T

PRG

W R T

PRG

W R T

PRG

W R T

PRG

W R T

PRG

W R T

PRG

W R T

X000

X001

R000

R000

X002

R000

R001

R001

Y000

FUNCTION KEY OPERAND WRITE (TO THE DISPLAY)

SFT

11

Teesside University Open Learning (Engineering)

© Teesside University 2011

PROGRAMMING KEYBOARD

Any computer, no matter how powerful it is, would be useless if it did not

allow communication between itself and the outside world. It must be able to

take in data and give out the results of its computations as well as having a

means of receiving instructions which it will interpret as a program to be

executed.

Personal computers have their keyboards laid out in a similar way to

typewriters i.e. a QWERTY keyboard. Larger PLCs and those programmed by

high level language are provided with similar keyboards.

The keyboard provided at a bank's cash dispenser needs to be more robust and

weatherproof and does not require very many keys. Most are arranged in a

matrix having either a 3 × 4 or a 4 × 5 layout. The keys are marked with the numbers from 0 to 9 and simple answers/commands such as YES, NO,

ENTER, CANCEL etc.

What would you expect to be needed for the keyboard of a PLC?

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

________________________________________________________________________________________

12

Teesside University Open Learning (Engineering)

© Teesside University 2011

Certainly some numbers; 0 to 7 for an octal system or 0 to 9 for a decimal

system. Additionally we would probably expect some program command

keys, although these will vary with the manufacturer and the programming

method used. Command keys may be given in the form of function keys

showing directly the functions which are to be carried out (i.e. an 'AND' key,

an 'OR' key, etc.).

The diagram of FIGURE 7 shows the layout of the keyboard of a popular PLC.

The key arrangement is a five by six matrix laid out in a strategic manner.

Each key is clearly labelled. The top two rows are function keys relating

directly to the elements used in the ladder diagram. Some of these functions

are still to be examined in future lessons. The ten numeric keys are grouped to

the left and more specialised operation keys to the right. The WRITE (to

memory) key is at the bottom, extreme right; far (so to speak) away from the

other keys so that a conscious effort is required to press it at the end of entering

the step data.

This type of keyboard is suitable for programming the listings considered

earlier in this lesson as method 1.

13

Teesside University Open Learning (Engineering)

© Teesside University 2011

FIG. 7

In many cases some of the keys which are provided will serve more than one

purpose. For example, at one time a key may represent a number and at

another time the same key may represent a function. This may be achieved by

the use of a SHIFT key to obtain the upper case specification of the key or it

may be achieved by the machine's own interpretation of the order in which the

keys have been pressed. Whichever method is used it can result in almost

halving the number of keys required because nearly each one could do two

jobs.

FIGURE 8 shows another version of a keyboard. This is also an actual

keyboard which is in common use.

ORAND LD NOT END

OUT/1 MR/2 KR/3 TIM/4 CNT/5

DELETE SEARCH7 8 9

4 5 6

1 2 3

0 CLEAR

INSERT MONITOR

CLEAR DISPLAY

CLEAR VERIFY READ WRITE

(+)

(–)

Ladder function

keys

Numeric keys

Special operation

keys

14

Teesside University Open Learning (Engineering)

© Teesside University 2011

FIG. 8

Examine the keyboards of FIGURE 7 and FIGURE 8.

What differences are apparent?

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

________________________________________________________________________________________

Possibly the most notable difference is what appears to be a lack of keys in

FIGURE 8. Only sixteen keys are provided which means that this keyboard is

smaller.

7 8 9

4 5 6

1 2 3

0 L E C

+

A

15

Teesside University Open Learning (Engineering)

© Teesside University 2011

Why only sixteen keys? Does this mean that fewer or no functions are available?

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

________________________________________________________________________________________

We have the numbers in the same range of 0 to 9 but none of the keys is

marked as a function. This is because the functions are also specified as

numbers. A different number code is used to represent each function. Listings

of the type previously mentioned as method 2 are programmed using this

keyboard.

It should be noted that the keyboard of FIGURE 7 provides twelve ladder

diagram functions but the keyboard of FIGURE 8 provides in excess of thirty!

The simplicity of the appearance of the keyboard can, therefore, be deceptive

and should not, in any way, be taken as an indication of the function ability of

the PLC.

Keyboards may be part of the PLC as a permanent facility. However, the

temptation for unauthorised personnel to tamper with them is sometimes too

great and this could well result in a malfunction of the PLC or corruption of

the program. To reduce this possibility modern PLCs have their keyboards

provided as part of a detachable programmer unit. Authorised personnel can

carry the programmer unit from PLC to PLC. This also reduces the number of

programmer units required and produces a consequential saving.

16

Teesside University Open Learning (Engineering)

© Teesside University 2011

The most modern programmer units are, in fact, microcomputers in their own

right as they possess a microprocessor and circuitry in addition to that housed

in the PLC. The microprocessor in the programmer unit handles the reading of

the keyboard, the provision of a programming display, the temporary storage

of a user's program (such as those of the listings previously mentioned) and

possibly the driving of the circuitry to transfer the program from the

programmer unit to the PLC via a cable link.

Programmer units which can themselves store user programs are very useful if

the same program is to be used in many identical PLCs. The programmer unit

can be plugged-in, the program downloaded and it can then be unplugged

before progressing to the next PLC. The keying-in is therefore done only

once.

FIGURE 9 shows a third version of a keyboard. The keys are laid out in a five

by seven matrix. Again each key is clearly and indelibly marked, different

colours being employed to indicate groupings. In use, the keys are pressed by

working through the groups of keys from left to right. The blue keys to the left

signify the ladder diagram operation and type of element concerned. The grey

keys in the middle (0 to 9) identify the number of the element and the yellow

keys to the right are the specialised operations. Note that a number of the keys

have two purposes. The code shown above the line drawn across the key is

brought into action by first pressing the red SFT shift key.

17

Teesside University Open Learning (Engineering)

© Teesside University 2011

FIG. 9

The first two keyboards examined use separate keyswitches but this example

uses a touch membrane keypad which some users may find awkward to use.

There is very little sensation experienced in pressing the surface of the keypad

which makes it difficult to tell if the keypress has been recognised. To

alleviate this problem the system emits an audible beep each time a key is

pressed.

The keyboard of FIGURE 9 is used to program the listing of Example 3.

C

T

END SFT

SCR

CLR

S

R

F

L

PRG

WRT

FI N

Blue keys

Grey keys

Red key

Yellow keys

TOP

X

Y

7

4

1

0

8

5

2

9

6

3 BLK

MON

TRC

SCH

DIS

RST

DIS

SET

PRG

INS

FWD REV

JMP

MC

DEL

CMD

18

Teesside University Open Learning (Engineering)

© Teesside University 2011

DISPLAY DEVICE

What form should the display device take?

If a personal computer is being used as the programming console, the viewing

monitor would seem to be the obvious choice of display device. However, the

major problem with this is its lack of portability, especially when it is to be

carried around a factory as part of a technician's tool kit. A small, portable

device is called for which will be reasonably robust and cheap and yet capable

of supplying enough information when it is needed.

What information is needed and when should it be displayed?

The main use of the display device is at the time of entering the program

listing into the machine. When this process is complete and the program is

running at normal speed there is simply not sufficient time to display what is

happening at every point in time. The display, like the programming keyboard,

could be disconnected, leaving the PLC working in the RUN mode.

However, when checking program execution, especially when a fault exists, it

is advantageous to be able to see what is happening inside the PLC. This does

not mean removing the covers and watching the integrated circuits, because no

indication of correct operation can be obtained in this way. It would, however,

be useful to have an indication of whether, for example, internal memory

relays were switched on or off. Remember from previous lessons that these

relays are not physical relays but simply memory cells within the

microcomputer. The display could be used to indicate the state of such

elements by calling upon a MONITORING function whilst the program is

being run.

19

Teesside University Open Learning (Engineering)

© Teesside University 2011

Monitoring is extremely useful even if only one element can be monitored at

any one time. Progressively monitoring selected elements can quickly

indicate what is, and what is not, working to expectation.

The first example of a display is shown in FIGURE 10. This display is a

permanent fixture of its PLC. The diagram shows the use of single and seven

segment LEDs instead of a cathode-ray tube. During the programming

procedure a single line of the program listing would be present on the display.

When that line is written into memory the display clears in readiness to accept

the next line. This display, together with the first keyboard examined, is used

to program the listing of Example 1 (page 3).

FIG. 10

The display is shown with step 002 of Example 1 lit up,

i.e. 002 AND NOT 001.

The second example of a display device is shown in FIGURE 11. This display

has been designed to be extremely portable. As with the previous display,

LEDs are used to show the data for one step address at a time. This display is

used, together with the keyboard of FIGURE 8, to program the listing of

Example 2.

END

CNT

NOT

TIM

LD

OUT

AND

OR

DATASUBADDRESS

20

Teesside University Open Learning (Engineering)

© Teesside University 2011

FIG. 11

As data is entered the single LEDs illuminate to indicate the data field

presently being used. When that field (i.e. step, code or operand) is filled, the

programmer unit moves the indicator so that the user knows that the unit is

interpreting the entered data. Upon completion of the operand field the step

address data is written to memory and the display increments the step address

in readiness for the next step.

The diagram shows step 0002 04 0001 from example 2.

The third example of a display device, shown as FIGURE 12, is slightly more

modern than the first two (FIGURE 10 and FIGURE 11). In this case the

display is of a liquid crystal type. As the steps are entered they appear at the

top left of the screen in the form of the elements of the ladder diagram. When

the element data is complete it is written to the screen at a position indicated

by a cursor. Progressively the ladder diagram builds up on the screen, eight

lines of the diagram representing a full screen. The diagram can spill over onto

a second and subsequent screens. Ladder diagram programming errors are

reduced because of the amount of data displayed. The display, together with

the keyboard of FIGURE 9, is used to provide the programming of the

STEP CODE OPERAND

21

Teesside University Open Learning (Engineering)

© Teesside University 2011

function key listing of Example 3. It is, in fact, the display from the

programmer unit which you will be using for the practical programming

exercises.

FIG. 12

The final programmer unit we shall consider is shown in FIGURE 13. It is

provided with a very simple keyboard and a liquid crystal display. The simple

keyboard does not indicate the powerful capabilities of the system. Option

menus are called up from the keyboard and in each case the keys service the

requirements of that particular menu. Each time the menu is changed the same

keys are used for a different purpose. Again the number of keys in no way

indicates the true capabilities of such a programmer unit.

Y 000

( (

(

) )

)

22

Teesside University Open Learning (Engineering)

© Teesside University 2011

FIG. 13

In a modern commercial PLC, a simple keyboard is likely to indicate more

complex software. If the keyboard has a large number of keys the software

driving it is likely to be relatively simple, although this would not concern

most users. Keyboards with fewer keys are smaller and easier to make but

fewer keys can tend to make the keying-in process slower. As an example,

suppose each key of a simple keyboard had four uses. It would be unlikely that

an indication of each use could be marked on the actual key (or its surround)

because there would not be sufficient space. It would be probable, therefore,

that the user would be expected to cross reference with information provided

on the display or in the accompanying manual before the correct key could be

chosen.

NOP

9

AND NOT

3

LCD display

COMMSFR LD

0

CTR

TIM

END

LD NOT

1

OR

4

AND BLK

7 OR BLK

8

OR NOT

5

AND

2

OUT

6

OPTIONS

INSERT

ENTER

DELETEEDIT

BREAK

23

Teesside University Open Learning (Engineering)

© Teesside University 2011

Alternatively the programmer may need to provide an indication of the

keystrokes required at the time of making up the listing.

DIAGNOSTIC ROUTINES

When power is first applied the CPU an initial program is used to set the

system in readiness for the execution of the user's program. This initial control

program is sometimes called the monitor routine or the executive program.

One important task of this program is to check the serviceability of various

parts of the system before handing over control to the user or the user program.

The term used to represent these checks is 'software diagnostics', i.e. a program

used to diagnose faults in the system. Typical tasks carried out by the

diagnostics program are: checking that the system RAM is working, testing the

condition of the backup battery, supercharged capacitors etc.

Some systems may require an interaction between the PLC and the user –

checking the operation of each key on the keyboard for example. The user,

following prompts, presses each key in a set sequence while the program

checks that the operation of the keyboard is as expected. If any part of the

system fails the test then an indication of some kind is given. An error LED

may light or flash or the display may show a warning.

This is a very valuable asset for the system. Imagine someone trying to use a

computer which is broken and not realising that it is broken. Quite often the

user will think that it's not working because of some error that he/she has

made.

24

Teesside University Open Learning (Engineering)

© Teesside University 2011

Upon conclusion of the diagnostic tests the system runs other sections of

programs which may, for example, do one of the following.

• Request the user to input a password before gaining access to the

machine operation. This prevents unauthorised alterations to

programs held in the computer memory.

• Interrogate a slide or key switch to establish the MODE of operation

required – RUN MODE, PROGRAM MODE, HALT MODE, etc.

Depending upon the mode selected, a further program will be run in

order to satisfy the requirements of that mode.

Now attempt the Self-Assessment Questions given on page 30.

25

Teesside University Open Learning (Engineering)

© Teesside University 2011

________________________________________________________________________________________

ANSWERS TO QUESTIONS ________________________________________________________________________________________

LISTING FOR LADDER DIAGRAM OF FIGURE 2 (FROM PAGE 6)

Step Op-code Operand

000 LD 000

001 OR MR 001

002 AND 001

003 OR 002

004 AND NOT 003

005 OUT MR 000

006 LD MR 000

007 OR 004

008 OUT 000

009 END

FROM PAGE 8

With the op-codes added FIGURE 3 becomes FIGURE 14 below.

FIG. 14

Rung 1

Rung 2

Rung 3

000 001 288

002 288 289

289 OUT 032

288

End

01

04

03

05

10

10

10

01

01

20

26

Teesside University Open Learning (Engineering)

© Teesside University 2011

(a) 05 is the code for OR with a normally open set of contacts.

(b) 03 is the code for AND with a normally open set of contacts.

(c) 04 is the code for AND NOT i.e. a series connected set of normally closed

contacts.

(d) 10 is the code for OUTPUT.

(e) 20 could be taken as meaning the END instruction and this is a perfectly

acceptable answer. In actual fact in this particular case the code 20 causes

the control to jump back to a specified step address – in this case address

0000 which is the beginning of the program listing.

(f) 01 is the code for START A NEW RUNG with a normally open set of

contacts.

FROM PAGE 9

With the op-codes added the diagram becomes:

FIG. 15

Rung 1

Rung 2

000 001 288

288 OUT 032

288

End

01

03

05

10

10

01

20

004 05

002 05

003 04

27

Teesside University Open Learning (Engineering)

© Teesside University 2011

The listing for the ladder diagram of FIGURE 4 is:

Step Address Op-code Operand

0000 01 000

0001 05 288

0002 03 001

0003 05 002

0004 04 003

0005 10 288

0006 01 288

0007 05 004

0008 10 032

0009 20 0000

28

Teesside University Open Learning (Engineering)

© Teesside University 2011

________________________________________________________________________________________

NOTES ________________________________________________________________________________________

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

29

Teesside University Open Learning (Engineering)

© Teesside University 2011

________________________________________________________________________________________

SELF-ASSESSMENT QUESTIONS ________________________________________________________________________________________

1. Explain how a ladder diagram is converted into a program listing in

readiness to be entered into a PLC.

2. Explain the purpose of software diagnostics as used in PLCs.

3. How can one key on a programming keyboard be used for more than one

purpose?

4. What are the advantages of a detachable programming unit?

5. Why should manufacturers find it necessary to provide a beep sound to

accompany certain types of keyboard?

30

Teesside University Open Learning (Engineering)

© Teesside University 2011

________________________________________________________________________________________

NOTES ________________________________________________________________________________________

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

....................................................................................................................................................

31

Teesside University Open Learning (Engineering)

© Teesside University 2011

________________________________________________________________________________________

ANSWERS TO SELF-ASSESSMENT QUESTIONS ________________________________________________________________________________________

1. A ladder diagram is a well known method of representing an electrical

control system. However, not all programmable controllers will accept

programming in a diagrammatic form. Most PLCs are programmed by

first converting the ladder diagram into a program listing and then keying

this listing into the programmer unit. The device controlling the PLC is a

microprocessor and, as with all microprocessor based systems, the

programming must be very precise and exact in detail if the required

operation is to be obtained. Listings derived from ladder diagrams are

drawn up as a faithful reproduction by working through the diagram using

the conventional reading method. That is to say, starting from the top left

of the diagram and working along the rung towards the output device.

After each output or rung terminating device has been handled the next

rung is considered. Each rung element must be precisely defined as the

function being performed together with sufficient information to clearly

distinguish it from all other possible elements. Upon completion of the

list the END instruction is used so that the size of the program can be

identified by the PLC.

2. Software diagnostics is the term used to describe the technique of using a

computer program (firmware) which is resident within the PLC to

conduct a series of tests on the microelectronics and circuitry of the

controller. This is done at the time of power up and before the system

hands over control to the user. System irregularities, if any are found, are

reported using ERROR messages. The user therefore knows that if no

errors have been reported the system should be healthy and it should

operate to expectations.

32

Teesside University Open Learning (Engineering)

© Teesside University 2011

3. Manufacturers may produce keyboards with keys which fulfil more than

one function for the purpose of reducing the size and therefore the cost of

the keyboard. Different methods of achieving this are employed.

(a) Keys which have two functions may be displayed either:

(i) with a line drawn across the middle and having the functions

marked above and below this line.

or (ii) with the functions marked on the switch surround, again above

and below.

Obtaining the lower function would be achieved by pressing the key

on its own. The upper function is accessed by first pressing a shift

key to register the above the line requirement, followed by the

function key.

(b) Alternatively, the software which is driving the keyboard could

interpret the pressed key with respect to the present programming

field being considered. For example, a particular key would

represent a function when the PLC is expecting an operation

(because it happens to be in that field at that time) but when the

operation field is complete and the programmer moves into the

operand field then that same key would now represent an operand.

(c) An extension of (b) is achieved by software interpretation of the

pressed key dependent upon a particular menu being displayed by the

PLC. If the display changes, the key press has a meaning relevant to

the new display. This method is very powerful because the keyboard

limitations are defined by software and not the keyboard hardware.

33

Teesside University Open Learning (Engineering)

© Teesside University 2011

4. A detachable programming unit has the following advantages:

(a) If, for example, a factory installs ten identical PLCs then each PLC

would not need its own programmer unit. Perhaps two units would

be considered adequate which would reduce the initial outlay costs.

(b) If the unit is detached then the possibility of unauthorised tampering

is removed, authorised personnel having the only access to the units.

5. With certain types of keyboard, such as those employing a touch

membrane keypad, users experience very little sensation when pressing

the surface of the keypad. This makes it difficult to know if the keypress

has been recognised. To alleviate this problem the system emits an

audible beep each time a key is pressed.

34

Teesside University Open Learning (Engineering)

© Teesside University 2011

________________________________________________________________________________________

SUMMARY ________________________________________________________________________________________

This lesson was the second in the topic 'Structure of the PLC'. The lesson

started at the point where a completed ladder diagram has been prepared in

readiness for entry into the PLC. The same ladder diagram was coded to make

it suitable for three different, but commercially common, variations in program

listings. Each listing was examined to gain an insight into the method of entry

into the PLC.

The lesson also dealt with the requirements of keyboards and displays. An

analysis of a number of such devices, taken from the equipment of leading

manufacturers, enabled points of special interest to be made.

The third lesson in this topic deals with possible methods of handling a

program listing once it has been entered into the PLC.

35

Teesside University Open Learning (Engineering)

© Teesside University 2011

<< /ASCII85EncodePages false /AllowTransparency false /AutoPositionEPSFiles true /AutoRotatePages /None /Binding /Left /CalGrayProfile (Dot Gain 20%) /CalRGBProfile (sRGB IEC61966-2.1) /CalCMYKProfile (U.S. Web Coated \050SWOP\051 v2) /sRGBProfile (sRGB IEC61966-2.1) /CannotEmbedFontPolicy /Error /CompatibilityLevel 1.4 /CompressObjects /Tags /CompressPages true /ConvertImagesToIndexed true /PassThroughJPEGImages true /CreateJDFFile false /CreateJobTicket false /DefaultRenderingIntent /Default /DetectBlends true /ColorConversionStrategy /LeaveColorUnchanged /DoThumbnails false /EmbedAllFonts true /EmbedJobOptions true /DSCReportingLevel 0 /SyntheticBoldness 1.00 /EmitDSCWarnings false /EndPage -1 /ImageMemory 1048576 /LockDistillerParams false /MaxSubsetPct 100 /Optimize true /OPM 1 /ParseDSCComments true /ParseDSCCommentsForDocInfo true /PreserveCopyPage true /PreserveEPSInfo true /PreserveHalftoneInfo false /PreserveOPIComments false /PreserveOverprintSettings true /StartPage 1 /SubsetFonts true /TransferFunctionInfo /Apply /UCRandBGInfo /Preserve /UsePrologue false /ColorSettingsFile () /AlwaysEmbed [ true ] /NeverEmbed [ true ] /AntiAliasColorImages false /DownsampleColorImages true /ColorImageDownsampleType /Bicubic /ColorImageResolution 300 /ColorImageDepth -1 /ColorImageDownsampleThreshold 1.50000 /EncodeColorImages true /ColorImageFilter /DCTEncode /AutoFilterColorImages true /ColorImageAutoFilterStrategy /JPEG /ColorACSImageDict << /QFactor 0.15 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >> /ColorImageDict << /QFactor 0.15 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >> /JPEG2000ColorACSImageDict << /TileWidth 256 /TileHeight 256 /Quality 30 >> /JPEG2000ColorImageDict << /TileWidth 256 /TileHeight 256 /Quality 30 >> /AntiAliasGrayImages false /DownsampleGrayImages true /GrayImageDownsampleType /Bicubic /GrayImageResolution 300 /GrayImageDepth -1 /GrayImageDownsampleThreshold 1.50000 /EncodeGrayImages true /GrayImageFilter /DCTEncode /AutoFilterGrayImages true /GrayImageAutoFilterStrategy /JPEG /GrayACSImageDict << /QFactor 0.15 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >> /GrayImageDict << /QFactor 0.15 /HSamples [1 1 1 1] /VSamples [1 1 1 1] >> /JPEG2000GrayACSImageDict << /TileWidth 256 /TileHeight 256 /Quality 30 >> /JPEG2000GrayImageDict << /TileWidth 256 /TileHeight 256 /Quality 30 >> /AntiAliasMonoImages false /DownsampleMonoImages true /MonoImageDownsampleType /Bicubic /MonoImageResolution 1200 /MonoImageDepth -1 /MonoImageDownsampleThreshold 1.50000 /EncodeMonoImages true /MonoImageFilter /CCITTFaxEncode /MonoImageDict << /K -1 >> /AllowPSXObjects false /PDFX1aCheck false /PDFX3Check false /PDFXCompliantPDFOnly false /PDFXNoTrimBoxError true /PDFXTrimBoxToMediaBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXSetBleedBoxToMediaBox true /PDFXBleedBoxToTrimBoxOffset [ 0.00000 0.00000 0.00000 0.00000 ] /PDFXOutputIntentProfile () /PDFXOutputCondition () /PDFXRegistryName (http://www.color.org) /PDFXTrapped /Unknown /Description << /ENU (Use these settings to create PDF documents with higher image resolution for high quality pre-press printing. The PDF documents can be opened with Acrobat and Reader 5.0 and later. These settings require font embedding.) /JPN <FEFF3053306e8a2d5b9a306f30019ad889e350cf5ea6753b50cf3092542b308030d730ea30d730ec30b9537052377528306e00200050004400460020658766f830924f5c62103059308b3068304d306b4f7f75283057307e305930023053306e8a2d5b9a30674f5c62103057305f00200050004400460020658766f8306f0020004100630072006f0062006100740020304a30883073002000520065006100640065007200200035002e003000204ee5964d30678868793a3067304d307e305930023053306e8a2d5b9a306b306f30d530a930f330c8306e57cb30818fbc307f304c5fc59808306730593002> /FRA <FEFF004f007000740069006f006e007300200070006f0075007200200063007200e900650072002000640065007300200064006f00630075006d0065006e00740073002000500044004600200064006f007400e900730020006400270075006e00650020007200e90073006f006c007500740069006f006e002000e9006c0065007600e9006500200070006f0075007200200075006e00650020007100750061006c0069007400e90020006400270069006d007000720065007300730069006f006e00200070007200e9007000720065007300730065002e0020005500740069006c006900730065007a0020004100630072006f0062006100740020006f00750020005200650061006400650072002c002000760065007200730069006f006e00200035002e00300020006f007500200075006c007400e9007200690065007500720065002c00200070006f007500720020006c006500730020006f00750076007200690072002e0020004c00270069006e0063006f00720070006f0072006100740069006f006e002000640065007300200070006f006c0069006300650073002000650073007400200072006500710075006900730065002e> /DEU <FEFF00560065007200770065006e00640065006e0020005300690065002000640069006500730065002000450069006e007300740065006c006c0075006e00670065006e0020007a0075006d002000450072007300740065006c006c0065006e00200076006f006e0020005000440046002d0044006f006b0075006d0065006e00740065006e0020006d00690074002000650069006e006500720020006800f60068006500720065006e002000420069006c0064006100750066006c00f600730075006e0067002c00200075006d002000650069006e00650020007100750061006c00690074006100740069007600200068006f006300680077006500720074006900670065002000410075007300670061006200650020006600fc0072002000640069006500200044007200750063006b0076006f0072007300740075006600650020007a0075002000650072007a00690065006c0065006e002e00200044006900650020005000440046002d0044006f006b0075006d0065006e007400650020006b00f6006e006e0065006e0020006d006900740020004100630072006f0062006100740020006f0064006500720020006d00690074002000640065006d002000520065006100640065007200200035002e003000200075006e00640020006800f600680065007200200067006500f600660066006e00650074002000770065007200640065006e002e00200042006500690020006400690065007300650072002000450069006e007300740065006c006c0075006e00670020006900730074002000650069006e00650020005300630068007200690066007400650069006e00620065007400740075006e00670020006500720066006f0072006400650072006c006900630068002e> /PTB <FEFF005500740069006c0069007a006500200065007300740061007300200063006f006e00660069006700750072006100e700f5006500730020007000610072006100200063007200690061007200200064006f00630075006d0065006e0074006f0073002000500044004600200063006f006d00200075006d00610020007200650073006f006c007500e700e3006f00200064006500200069006d006100670065006d0020007300750070006500720069006f0072002000700061007200610020006f006200740065007200200075006d00610020007100750061006c0069006400610064006500200064006500200069006d0070007200650073007300e3006f0020006d0065006c0068006f0072002e0020004f007300200064006f00630075006d0065006e0074006f0073002000500044004600200070006f00640065006d0020007300650072002000610062006500720074006f007300200063006f006d0020006f0020004100630072006f006200610074002c002000520065006100640065007200200035002e00300020006500200070006f00730074006500720069006f0072002e00200045007300740061007300200063006f006e00660069006700750072006100e700f50065007300200072006500710075006500720065006d00200069006e0063006f00720070006f0072006100e700e3006f00200064006500200066006f006e00740065002e> /DAN <FEFF004200720075006700200064006900730073006500200069006e0064007300740069006c006c0069006e006700650072002000740069006c0020006100740020006f0070007200650074007400650020005000440046002d0064006f006b0075006d0065006e0074006500720020006d006500640020006800f8006a006500720065002000620069006c006c00650064006f0070006c00f80073006e0069006e0067002000740069006c0020007000720065002d00700072006500730073002d007500640073006b007200690076006e0069006e0067002000690020006800f8006a0020006b00760061006c0069007400650074002e0020005000440046002d0064006f006b0075006d0065006e007400650072006e00650020006b0061006e002000e50062006e006500730020006d006500640020004100630072006f0062006100740020006f0067002000520065006100640065007200200035002e00300020006f00670020006e0079006500720065002e00200044006900730073006500200069006e0064007300740069006c006c0069006e0067006500720020006b007200e600760065007200200069006e0074006500670072006500720069006e006700200061006600200073006b007200690066007400740079007000650072002e> /NLD <FEFF004700650062007200750069006b002000640065007a006500200069006e007300740065006c006c0069006e00670065006e0020006f006d0020005000440046002d0064006f00630075006d0065006e00740065006e0020007400650020006d0061006b0065006e0020006d00650074002000650065006e00200068006f00670065002000610066006200650065006c00640069006e00670073007200650073006f006c007500740069006500200076006f006f0072002000610066006400720075006b006b0065006e0020006d0065007400200068006f006700650020006b00770061006c0069007400650069007400200069006e002000650065006e002000700072006500700072006500730073002d006f006d0067006500760069006e0067002e0020004400650020005000440046002d0064006f00630075006d0065006e00740065006e0020006b0075006e006e0065006e00200077006f007200640065006e002000670065006f00700065006e00640020006d006500740020004100630072006f00620061007400200065006e002000520065006100640065007200200035002e003000200065006e00200068006f006700650072002e002000420069006a002000640065007a006500200069006e007300740065006c006c0069006e00670020006d006f006500740065006e00200066006f006e007400730020007a0069006a006e00200069006e006700650073006c006f00740065006e002e> /ESP <FEFF0055007300650020006500730074006100730020006f007000630069006f006e006500730020007000610072006100200063007200650061007200200064006f00630075006d0065006e0074006f0073002000500044004600200063006f006e0020006d00610079006f00720020007200650073006f006c00750063006900f3006e00200064006500200069006d006100670065006e00200071007500650020007000650072006d006900740061006e0020006f006200740065006e0065007200200063006f007000690061007300200064006500200070007200650069006d0070007200650073006900f3006e0020006400650020006d00610079006f0072002000630061006c0069006400610064002e0020004c006f007300200064006f00630075006d0065006e0074006f00730020005000440046002000730065002000700075006500640065006e00200061006200720069007200200063006f006e0020004100630072006f00620061007400200079002000520065006100640065007200200035002e003000200079002000760065007200730069006f006e0065007300200070006f00730074006500720069006f007200650073002e0020004500730074006100200063006f006e0066006900670075007200610063006900f3006e0020007200650071007500690065007200650020006c006100200069006e0063007200750073007400610063006900f3006e0020006400650020006600750065006e007400650073002e> /SUO <FEFF004e00e4006900640065006e002000610073006500740075007300740065006e0020006100760075006c006c006100200076006f0069006400610061006e0020006c0075006f006400610020005000440046002d0061007300690061006b00690072006a006f006a0061002c0020006a006f006900640065006e002000740075006c006f0073007400750073006c00610061007400750020006f006e0020006b006f0072006b006500610020006a00610020006b007500760061006e0020007400610072006b006b007500750073002000730075007500720069002e0020005000440046002d0061007300690061006b00690072006a0061007400200076006f0069006400610061006e0020006100760061007400610020004100630072006f006200610074002d0020006a0061002000520065006100640065007200200035002e00300020002d006f0068006a0065006c006d0061006c006c0061002000740061006900200075007500640065006d006d0061006c006c0061002000760065007200730069006f006c006c0061002e0020004e00e4006d00e4002000610073006500740075006b0073006500740020006500640065006c006c00790074007400e4007600e4007400200066006f006e0074007400690065006e002000750070006f00740075007300740061002e> /ITA <FEFF00550073006100720065002000710075006500730074006500200069006d0070006f007300740061007a0069006f006e00690020007000650072002000630072006500610072006500200064006f00630075006d0065006e00740069002000500044004600200063006f006e00200075006e00610020007200690073006f006c0075007a0069006f006e00650020006d0061006700670069006f00720065002000700065007200200075006e00610020007100750061006c0069007400e00020006400690020007000720065007300740061006d007000610020006d00690067006c0069006f00720065002e0020004900200064006f00630075006d0065006e00740069002000500044004600200070006f00730073006f006e006f0020006500730073006500720065002000610070006500720074006900200063006f006e0020004100630072006f00620061007400200065002000520065006100640065007200200035002e003000200065002000760065007200730069006f006e006900200073007500630063006500730073006900760065002e002000510075006500730074006500200069006d0070006f007300740061007a0069006f006e006900200072006900630068006900650064006f006e006f0020006c002700750073006f00200064006900200066006f006e007400200069006e0063006f00720070006f0072006100740069002e> /NOR <FEFF004200720075006b00200064006900730073006500200069006e006e007300740069006c006c0069006e00670065006e0065002000740069006c002000e50020006f00700070007200650074007400650020005000440046002d0064006f006b0075006d0065006e0074006500720020006d006500640020006800f80079006500720065002000620069006c00640065006f00700070006c00f80073006e0069006e006700200066006f00720020006800f800790020007500740073006b00720069006600740073006b00760061006c00690074006500740020006600f800720020007400720079006b006b002e0020005000440046002d0064006f006b0075006d0065006e0074006500720020006b0061006e002000e50070006e006500730020006d006500640020004100630072006f0062006100740020006f0067002000520065006100640065007200200035002e00300020006f0067002000730065006e006500720065002e00200044006900730073006500200069006e006e007300740069006c006c0069006e00670065006e00650020006b0072006500760065007200200073006b00720069006600740069006e006e00620079006700670069006e0067002e> /SVE <FEFF0041006e007600e4006e00640020006400650020006800e4007200200069006e0073007400e4006c006c006e0069006e006700610072006e00610020006e00e40072002000640075002000760069006c006c00200073006b0061007000610020005000440046002d0064006f006b0075006d0065006e00740020006d006500640020006800f6006700720065002000620069006c0064007500700070006c00f60073006e0069006e00670020006600f60072002000700072006500700072006500730073007500740073006b0072006900660074006500720020006100760020006800f600670020006b00760061006c0069007400650074002e0020005000440046002d0064006f006b0075006d0065006e00740065006e0020006b0061006e002000f600700070006e006100730020006d006500640020004100630072006f0062006100740020006f00630068002000520065006100640065007200200035002e003000200065006c006c00650072002000730065006e006100720065002e00200044006500730073006100200069006e0073007400e4006c006c006e0069006e0067006100720020006b007200e400760065007200200069006e006b006c00750064006500720069006e00670020006100760020007400650063006b0065006e0073006e006900740074002e> >> >> setdistillerparams << /HWResolution [2400 2400] /PageSize [612.000 792.000] >> setpagedevice