st20063 f1 workbook

34
PROGRAMMABLE LOGIC CONTROLLERS The Mitsubishi F1 PLC Work Book P.J. Rimmer (Revised J Hilton 2011)

Upload: john-hilton

Post on 23-Mar-2016

218 views

Category:

Documents


1 download

DESCRIPTION

Workbook for F1 PLC.

TRANSCRIPT

Page 1: ST20063 F1 Workbook

PROGRAMMABLE

LOGIC

CONTROLLERS

The Mitsubishi F1 PLC Work Book

P.J. Rimmer (Revised J Hilton 2011)

Page 2: ST20063 F1 Workbook

2

CONTENTS Introduction ........................................................................ 3 Ladder Diagrams ............................................................... 4 Introductory Programming Procedures .............................. 6 Sample Programs .............................................................. 8 Further Programming Procedures ..................................... 15 Student Exercises 1 ........................................................... 20 Timers and Counters .......................................................... 23 Internal Relays ................................................................... 26 Student Exercises 2 ........................................................... 33

Page 3: ST20063 F1 Workbook

3

Introduction The Mitsubishi F1 Programmable Logic Controller, PLC, is of a “shoebox” or “brick” construction that has electrically protected inputs, using opto-isolators, and outputs that employ relays. This minimises potential damage if an incorrect voltage is applied to the device. The PLC can be programmed either by a hand portable programmer or by using “Medoc” software. The software is DOS based and modern software is Windows based and more user-friendly. The programs can be in the form of an instruction list or ladder, or stepladder, format. The latter resembles a flowchart construction. The basic element numbering system of the F1 PLC is octal, that is, using a number base of 8. Thus the numbers available are 0 7, 10 77 and 100 777. So between 7 and 100 (pronounced „one-zero-zero‟ not „one-hundred‟) the following are available; 10 17, 20 27, 30 37, 40 47, 50 57, 60 67 and 70 77. Below is summary of the available function elements of the F1 PLC:-

Function No. Element No. Comment

Inputs 12 X400 X407 X410 X413

Outputs 8 Y430 Y437

Timers (on-delay) 24 8

T50 T57 T450 T457 T550 T557 T650 T657

0.1s timers (0.1 999s) 0.01s timers (0.01 99.9s)

Counters 30 1

C60 C67 C460 C467 C560 C567 C662 C667 C660 C661

Down counters (0 999) Paired counter as a 6-digit up/down counter

Auxiliary Relays 128 64 16

M100 M177 M200 M277 M300 M377 e.g. M70 M73

In octal groups In octal groups with battery back-up Special relays

Page 4: ST20063 F1 Workbook

4

All PLCs will exhibit slight delays between changing an input state and the corresponding change in output. This delay is made up of an inlet delay, a processing delay and an output delay. The input delay is due to filtering circuits attached to the input circuits that counteract false signals caused by electrical noise present on the input wiring and switch-bounce problems. The input delay is usually between 5 10ms and the output delay may be in the order of 10 20ms with an electro-mechanical relay. Processing delays can be from tens of microseconds for small programs and almost a second for a large program. Another source of delay may be due to the ladder diagram being constructed in an inefficient manner. Ladder Diagrams A ladder diagram is a pictorial representation of a logical electrical circuit. The term ladder is used as each completed line of logic resembles a rung on a ladder. Each horizontal line, known as a ladder line, represents a line of a program. Consider the simple circuit shown below:- In this circuit there is a normally open switch in series with a normally closed switch and a lamp. This may be represented in the following way as a type of ladder diagram:-

IN 1 IN 2

Lamp

24V Supply

IN 1 IN 2

Lamp

Power Rail Earth Rail

Page 5: ST20063 F1 Workbook

5

A ladder diagram for a PLC is comprised of two vertical lines that represent the power and earth rails, with the power rail to the left. The internal switch contacts of the PLC have their own symbols for identification on a particular rung. The ladder diagram is read from left to right and from top to bottom. The PLC will continuously scan through the ladder program. The general symbols are shown below:- Normally open input contact Normally closed input contact Or Output device (sometimes called a coil) The circuit would then become a true ladder diagram as shown below:- Some general rules for ladder diagrams are:-

1. The power flow is from the left to the right, the 24V power rail to the 0V earth rail.

2. An output coil cannot be directly connected to the left hand power rail.

3. No contact should be located to the right of an output coil.

4. Each ladder line has only one output coil.

5. Each output coil is normally only specified once in a program. If there

are conflicting output conditions, then the last one in the program is the one that will be used.

6. To prevent the CPU scanning all 1000 steps an END instruction is used

to shorten the scan cycle time.

IN1 IN2 Output

24V 0V

Page 6: ST20063 F1 Workbook

6

Introductory Programming Procedures Clearing the memory This is good practice before starting to enter any new program. The PLC should be in STOP mode. That is; RUN is off and the programmer switched to PROGRAM.

Procedure Step Key Operation Instruction Display

Indicator

1 CLEAR 000

2 STEP 0 000

3 STEP 999 999

4 DEL 000

The EEPROM memory has now been cleared and it is ready for programming. If you are downloading a program from a PC it will automatically overwrite the existing program for the length of the new program and put an END statement in place so that the PLC will ignore any of the previous program after this point. To enter a new program

Procedure Step Key Operation Instruction Display

Indicator

1 CLEAR 000

2 INSTR NOP

3 0 LOAD 400 LD 400

4 WRITE

5 1 AND 401 AND 401

6 WRITE

Enter the rest of the program step by step

Remember to finish the program with an END statement. Note that the „X‟ and „Y‟ prefixes for each element are not required with the hand programmer. Typical mnemonic instructions for the Mitsubishi F1 PLC are shown overleaf and these will be investigated in due course.

Page 7: ST20063 F1 Workbook

7

Instruction mnemonic

Function Description Ladder Diagram Symbol

LD Load Start rung or string with a signal corresponding to the logical state of the contact

LD-NOT Load inverse Start rung or string with a signal corresponding to the logical inverse state of the contact

AND Logical AND AND the state of the contact with the previous state

AND-NOT Logical AND-NOT (NAND)

NAND the state of the contact with the previous state

OR Logical OR OR the state of the contact with the parallel connected contacts

OR-NOT Logical OR-NOT (NOR)

NOR the state of the contact with the parallel connected contacts

AND-BLOCK AND a block of data

Series connection of the current block with the previous block

OR-BLOCK OR a block of data

Parallel connection of the current block with the previous block

OUT OUTput data Output data via a relay, timer or counter

Page 8: ST20063 F1 Workbook

8

Running Programs To run a program the hand programmer should be switched from “Program” to “Monitor” and the input on the PLC to “Run”. Reading a Program This is a useful tool in debugging programs that may contain errors. The PLC should again be in STOP mode (that is with “Run” off), and the programmer set to PROGRAM.

Procedure Step Key Operation Instruction Display

Indicator

1 CLEAR 000

2 INSTR LD 400

3 0 STEP(+) AND 401

4 2 STEP(+) ANI 402

5 3 STEP(+) OUT 430

Enter the rest of the program step by step

The STEP(-) key may be used to step back through the program. Sample Programs

Procedure Step Key Operation Instruction Display

Indicator

1 CLEAR 000

2 INSTR NOP 000

3 0 LOAD 400 LD 400

4 WRITE NOP 000

5 1 OUT 430 OUT 430

6 WRITE NOP 000

7 END END -

8 WRITE NOP 000

Run the program and toggle switch X400 and observe the output from Y430.

X400 Y430

Page 9: ST20063 F1 Workbook

9

Procedure Step Key Operation Instruction Display

Indicator

1 CLEAR 000

2 INSTR NOP 000

3 0 LOAD INVERSE 400 LD 400

4 WRITE NOP 000

5 1 OUT 430 OUT 430

6 WRITE NOP 000

7 END END -

8 WRITE NOP 000

Again run the program, toggle X400 and observe the output on Y430.

Procedure Step Key Operation Instruction Display

Indicator

1 CLEAR 000

2 INSTR NOP 000

3 0 LOAD 400 LD 400

4 WRITE NOP 000

5 1 AND 401 AND 401

6 WRITE NOP 000

7 2 ANI 402 ANI 402

8 WRITE NOP 000

9 3 OUT 430 OUT 430

10 WRITE NOP 000

11 END END -

12 WRITE NOP 000

Run this program and check the operation of switches X400, X401 and X402 against the output on Y430.

X400 Y430

X400 Y430

X401 X402

Page 10: ST20063 F1 Workbook

10

This is a latch circuit that could be used where X400 and X401 are push buttons. The test rigs are fitted with toggle switches, but use them as push buttons ON – OFF. Pressing X400 will activate Y430. So on the next cycle of the program there will be two paths available. X400 as it is still „ON‟ and Y430 as it is active. This means that X400 can be released and Y430 will continue active. That is until X401 is pressed, when the circuit is broken and Y430 becomes inactive. When X401 is released there will be no signal to Y430, until X400 is again pressed and the cycle will repeat. In short, an output can be used as an input elsewhere in a program.

Procedure Step Key Operation Instruction Display

Indicator

1 CLEAR 000

2 INSTR NOP 000

3 0 LOAD 400 LD 400

4 WRITE NOP 000

5 1 OR 430 OR 430

6 WRITE NOP 000

7 2 ANI 401 ANI 401

8 WRITE NOP 000

9 3 OUT 430 OUT 430

10 WRITE NOP 000

11 END END -

12 WRITE NOP 000

Hopefully by now the programming method has become more apparent, so the instructions will now be written in a modified form.

CLEAR INSTR LD X400 WRITE AND X401 WRITE OUT Y430 WRITE LD X402 WRITE ANI X403 WRITE OUT Y431 WRITE END WRITE

X400

Y430

X401 Y430

X400

X402

X401

X403

Y430

Y431

Page 11: ST20063 F1 Workbook

11

CLEAR INSTR LD X400 WRITE OR X403 WRITE ORI X404 WRITE AND X401 WRITE ANI X402 WRITE OUT Y430 WRITE END WRITE Now let us consider parallel output:- CLEAR INSTR LD X400 WRITE OUT Y430 WRITE OUT Y431 WRITE OUT Y432 WRITE END WRITE Conditional outputs are where, for each successive output, all the previous conditions must have been met plus an additional input for each output. CLEAR INSTR LD X400 WRITE OUT Y430 WRITE AND X401 WRITE OUT Y431 WRITE AND X402 WRITE OUT Y432 WRITE END WRITE

X400

X403

X404

X401 X402 Y430

X400 Y430

Y431

Y432

X400 Y430

Y431

Y432

X401

X402

Page 12: ST20063 F1 Workbook

12

Let us examine the instructions for deleting, inserting and rewriting within programs. The PLCX should be in STOP mode, that is RUN off, and the programmer switched to PROGRAM.

The initial listing would be:- CLEAR INSTR LD X400 WRITE AND X401 WRITE OUT Y430 WRITE LD Y430 WRITE ANI X402 WRITE OUT Y431 WRITE LD X404 WRITE OUT Y433 WRITE END WRITE

If we now want to change ANI X402 to ANI X405 the procedure would be:- CLEAR ANI X402 SEARCH INSTR ANI X405 WRITE The sequence has over-written the ANI X402 instruction with ANI X405. Check this by using the view instructions method, shown on page 8.

X400

Y430

X404

X401

X402

Y430

Y431

Y433

X400

Y430

X404

X401

X405

Y430

Y431

Y433

Page 13: ST20063 F1 Workbook

13

The next requirement is to insert the element ANI X406 on line 3, between X404 and Y433, to obtain the following:- The procedure is:-

CLEAR OUT Y433 SEARCH INSTR ANI X406 INS*

*Note:- If you used the WRITE key instead of the INS(ert) key it would have overwritten the OUT Y433. Also note that you must search for the element after where the new element is to be inserted. The next step is to insert the following line between lines 2 and 3.

X400

Y430

X404

X401

X405

Y430

Y431

Y433 X406

X403 Y432

X404

Page 14: ST20063 F1 Workbook

14

The necessary instructions are as follows:-

CLEAR LD X404 SEARCH INSTR LD X403 INS ANI X404 INS OUT Y432 INS

Check the instruction listing. You should confirm it for the following:- Finally, let us delete the ANI X406 on line 4:-

CLEAR ANI X406 SEARCH INSTR DEL

Again, verify the final listing.

X400

Y430

X401

X405

Y430

Y431

X404 Y433

X406

X403 Y432

X404

Page 15: ST20063 F1 Workbook

15

Further Programming Procedures Auxiliary or Dummy Outputs Most PLCs have more input elements that output elements, as the output elements require more expensive circuitry. For ladder rungs that do not require an output outside of the PLC auxiliary or dummy outputs are provided and these are given the prefix „M‟.

CLEAR INSTR LD X400 WRITE OUT M100 WRITE LD M100 WRITE OUT Y430 WRITE END WRITE

An example of the use of auxiliary or dummy outputs could be where a set of machine guards must all be closed before any rungs of the program, starting machinery, become active. Instead of having to program every guard input on every rung only a dummy output need be used. „M‟ elements are also used for constructing shift registers and acting as general purpose flags that denote program position and activity. Monitoring the program with the PLC in RUN mode and the programmer in MONITOR mode may be used to check the state of auxiliary elements. For example to monitor M100:-

X400 M100

M100 Y430

X400

M100

X401

X404

M100

Y430

M100 Y431

X405

X402 X403

Page 16: ST20063 F1 Workbook

16

CLEAR M100 SEARCH MONITOR You will notice that the „ACT‟ indicator LED will illuminate when the contact is energised. The “Push Down Stack” The push down stack can be used to create sub-networks that can be stacked within the CPU for later use. The stack has eight levels and its operation can be demonstrated in the following exampls. Consider the following ladder program:- At first glance it may appear that the instruction list would be:-

CLEAR INSTR LD X400 WRITE OR X402 WRITE AND X401 WRITE OR X403 WRITE OUT Y430 WRITE END WRITE

Enter this program and check it by operating the switches:-

1. X400 and X401. 2. X402 and X401. 3. X403 alone.

X400 X401 Y430

X402 X403

Page 17: ST20063 F1 Workbook

17

The ladder that has been produced is:- By using the push down stack the ladder can be divided up into two sub-networks. The instruction list becomes:-

CLEAR INSTR LD X400 WRITE OR X402 WRITE

At this stage the CPU is waiting for either another input instruction (AND, OR, etc.) or an output instruction. It will not be expecting a new LD instruction:-

LD X401 WRITE OR X403 WRITE

When the CPU receives the second LD instruction it immediately takes the result of the sub-network of X400 and X402 and places it at the top level of the push down stack. The AND BLOCK instruction causes the result held at the top of the stack to be retrieved and connected in series with (AND) the result of the last computation. Thus the final steps of the program become:-

X400 X401 Y430

X402

X403

X400 X401 Y430

X402 X403

Page 18: ST20063 F1 Workbook

18

ANB WRITE OUT Y430 WRITE END WRITE

Now consider the following ladder diagram:- Without the push down stack it is not possible for this to be programmed. In this case we use the OR BLOCK function.

CLEAR INSTR LD X400 WRITE AND X401 WRITE LD X402 WRITE AND X403 WRITE ORB WRITE OUT Y430 WRITE END WRITE

Now consider the following ladder diagram:- There are two ways in which this ladder diagram can be programmed:-

X400 X401 Y430

X402 X403

X400 X401 Y430

X404 X405

X402

X406

X403

X407

Page 19: ST20063 F1 Workbook

19

CLEAR CLEAR INSTR INSTR LD X400 WRITE LD X400 WRITE OR X404 WRITE OR X404 WRITE LD X401 WRITE LD X401 WRITE OR X405 WRITE OR X405 WRITE ANB WRITE LD X402 WRITE LD X402 WRITE OR X406 WRITE OR X406 WRITE LD X403 WRITE ANB WRITE OR X407 WRITE LD X403 WRITE ANB WRITE OR X407 WRITE ANB WRITE ANB WRITE ANB WRITE OUT Y430 WRITE OUT Y430 WRITE END WRITE END WRITE In the second listing the 2nd, 3rd and 4th LD instructions will place the previous result on the stack. Into levels 1 3.

LD X402 OR X406

LD X401 OR X405

LD X400 OR X404

With each ANB instruction the result from level 1 will be taken and ANDed with the existing result. The stack then moves up to present the next level as the top level.

Page 20: ST20063 F1 Workbook

20

Student Exercises 1 Write instruction lists and program the F1 PLC with the following ladder diagrams. Ensure that the program works satisfactorily and that your tutor has seen it in operation. The instruction lists will be initialled and should be submitted as part of the assignment submission. 1. 2. 3.

X400 X401 Y430

X402

Y431

X401 X402 Y430

Y431 X403 X404

X400

X402

X403

X401 Y432

Page 21: ST20063 F1 Workbook

21

4. 5.

X401 X403 Y431

Y432 X402 X404

X405 Y433

X400

X401

X402

X403

X404

X407

X400

X401

Y430

X405

Y431

Y432 X406

X410 X411

X402 Y433

X404

X403 X405

Page 22: ST20063 F1 Workbook

22

6. (There are insufficient inputs on some of the F1s to program this fully. So write the instruction set only.)

X400 X401

Y432

X400 Y430

Y431 X402

X405 X406

X411 X412

X403 X404

Y431

Y430

X407 X410

X413

Page 23: ST20063 F1 Workbook

23

Timers and Counters Timers The required times are inserted as „K‟ values. The 0.1 second timers accept the exact input K value; for example 24 = 24s, 2.4 = 2.4s, 0.24 = 0.24s. The 0.01 second timers use the decimal point as a marker; for example 24 = 0.24s, 24.0 = 24s, 004 = 0.04s. It should be noted that the timer accuracy is dependent upon the time for one complete cycle. All the timers are “on-delay” timers. This means that the output will only become active at the end of the time delay period and output would remain active until the input line to the timer is opened. The timer will then reset its K value and the output will go off. A number of timer variations are possible and these will be illustrated in the following examples:- 1. 2.5 second ON-DELAY timer.

CLEAR INSTR LD X400 WRITE OUT T50 WRITE K 2.5 WRITE LD T50 WRITE OUT Y430 WRITE END WRITE

2 0.65 second ON-DELAY timer.

CLEAR INSTR LD X401 WRITE OUT T651 WRITE K 65 WRITE LD T651 WRITE OUT Y432 WRITE END WRITE

X400

T50 Y430

T50

K2.5

T651 Y432

X401 T651

K65

Page 24: ST20063 F1 Workbook

24

3. 5 second pulse timer CLEAR INSTR LD X400 WRITE OUT T50 WRITE K 5 WRITR ANI T50 WRITE OUT Y430 WRITE END WRITE

In a pulse timer the output is activated at the same time as the timer and it is disabled when the timer times out. In practice you will find that the Mitsubishi F1 PLC timers do not function as a pulse timer if there is more than one input to start the timer sequence. 4 10 second Off-Delay timer

CLEAR INSTR LD X400 WRITE OR Y430 WRITE ANI T450 WRITE OUT Y430 WRITE OUT T450 WRITE K 10 WRITE END WRITE

With on-delay timers and pulse timers they will be reset to the preset value with the output disabled as soon as the input contact is opened. To delay this action it is common to latch the timer across the input contact and so only a momentary input is then required.

X400 T50

K5

Y430 T50

X400

T450

K10

Y430 T450

Y430

Page 25: ST20063 F1 Workbook

25

Counters To reset a counter it is necessary to close the input contact on the reset line and then to open it during the count, to prevent it from continually resetting. The counters are battery backed so that they retain their values in the event of a power down. The special auxiliary element M71 provides automatic resetting whenever the PLC is set to RUN. A counter preset to a count of 9 is shown below.

CLEAR INSTR LD X400 WRITE OR M71 WRITE RST C460 WRITE LD X401 WRITE OUT C460 WRITE K 9 WRITE LD C460 WRITE OUT Y430 WRITE END WRITE

X400

M71

X401

C460 Y430

RST

C460 K9

COUNT

Page 26: ST20063 F1 Workbook

26

Internal Relays Set and Reset These instructions are used for latching and releasing certain elements; for example, all the outputs and M200 M377.

CLEAR INSTR LD X400 WRITE S Y430 WRITE LD X401 WRITE R Y430 WRITE END WRITE

Pulse (PLS) This produces a positive pulse into an auxiliary element, M100 to M377.

CLEAR INSTR LD X400 WRITE PLS M102 WRITE END

The auxiliary element may be monitored as per the instructions on page 15 to 16.

X400

X401

S Y430

R Y430

X400

X401

Y430

X400

PLS M102

M102

X400

Page 27: ST20063 F1 Workbook

27

Master Control

The master control (MC) instruction effectively positions an auxiliary element on the power rail of the ladder diagram and this then allows sections of the program to be switched on and off. CLEAR INSTR LD X400 WRITE OUT M100 WRITE MC M100 WRITE LD X401 WRITE OUT Y430 WRITE LDI X403 WRITE OUT Y431 WRITE AND X406 WRITE OUT M101 WRITE MC M101 WRITE LD X402 WRITE OUT Y436 WRITE LDI X404 WRITE OR X405 WRITE OUT Y433 WRITE MCR M101 WRITE LDI X407 WRITE OUT Y432 WRITE END WRITE

The MCR instruction is used to terminate MC instructions and to return the processor to the rest of the PLC program. Only one MCR instruction is required, as this will cancel all the previous MC instructions. The auxiliary elements that can be used are M100 to M177.

X400 M100

Y430

Y431

M101

Y436

MC M100

X401

MC M101

X402

X403

X406

Y433 X404

X405

MCR101

X407 Y432

Page 28: ST20063 F1 Workbook

28

Now try writing the instruction list for the following ladder diagram and check that it works on a PLC.

X400 M100

X401

X402 M101

X403

Y430

Y431

MC M100

X404

X405

Y432

Y433

MC M101

X406

X407

MCR101

X410 Y434

Page 29: ST20063 F1 Workbook

29

Conditional Jump The conditional Jump (CJP) instruction allows areas of the program to be jumped and it must be accompanied with an end of jump instruction (EJP). Auxiliary elements M700 to M777 are available for this particular instruction. The instructions required would be:- ......................... LD X400 WRITE CJP M700 WRITE ......................... ......................... EJP M700 WRITE .........................

X400

CJP M700

EJP M700

Program section jumped

Program

Program

Jump

Page 30: ST20063 F1 Workbook

30

Shift Register

CLEAR INSTR LD X400 WRITE OUT M120 WRITE LD X401 WRITE SFT M120 WRITE LD X402 WRITE RST M120 WRITE LD M120 WRITE OUT Y430 WRITE LD M121 WRITE OUT Y431 WRITE LD M122 WRITE OUT Y432 WRITE LD M123 WRITE OUT Y433 WRITE LD M124 WRITE OUT Y434 WRITE Etc.. .... END WRITE

The shift (SFT) instruction applies to a shift register, that is a block of sixteen auxiliary elements with consecutive numbers, such as bM100 to M117, M120 to M137, etc., up to M377. Enter some data via X400 and watch the outputs change as it is shifted along by X401.

X400 M120

X401

SFT M120

X402

RST M120

M120 Y430

M121 Y431

M122 Y432

(Data)

(Shift)

(Reset)

Page 31: ST20063 F1 Workbook

31

Stepladder Programming This is a special feature that allows the PLC to act in a similar manner to a sequence controller. It uses the state elements S600 to S647. In effect, stepladder programming is a form of a sequential function chart (SFC). Let us examine an example where three distinct operations are carried out sequentially:- Operation A schematic of a program is shown below. X400 (Start) (first operation) S600 (end of first operation) (Second operation) S601 (end of second operation) (third operation) (end of third operation) (end of stepladder sequence)

1st

2nd

3rd

time

S S600

S S601

S S602

R S602

RET

Page 32: ST20063 F1 Workbook

32

The input X400 results in the setting of S600, the first stepladder rung. The code contained in that stepladder rung will be executed. The program will pass over the rungs S601 and S602, without executing the code in those rungs. Until the output S601 is set. Then S600 will be reset and the rung following S601 as an input will be executed. This sequence will continue until the final R602 – Reset 602 – is activated. Then all the rungs will be reset. The sequence of events will be; on start up, none of the code shown will be active. Then input contact X400 will be made. This will set relay 600. This in turn will allow the code following STL600 to be executed. No other rungs will be active. Thus, for example, if output Y431 set a pneumatic piston in motion, and X401 was the end stop detector, then at the end of the travel, the ladder would activate, by setting S601, the next rung. It would also deactivate the rung S600, by resetting S600. Consider the following diagram and code. Enter it and verify the operation.

CLEAR INSTR LD 400 WRITE S 600 WRITE STL 600 WRITE OUT 431 WRITE LD 401 WRITE S 601 WRITE STL 601 WRITE OUT 432 WRITE LD 402 WRITE S 602 WRITE STL 602 WRITE OUT 433 WRITE LD 403 WRITE R 602 WRITE RET WRITE END WRITE

The STL instruction effectively moves the power rail in to the where the arrow shows. The reset instruction, R, is needed to reset the last stepladder element in the sequence. The RET instruction returns the program to the normal power rails. Once you have entered the program its operation may be viewed by toggling the respective switches.

X400

S S600

Y431

STL600

S S601

X401

Y432

STL601

S S602

X402

Y431

STL

600

S S601

X401

Y433

STL602

R S602

X403

Y431

STL

600

S S601

X401

RET

Page 33: ST20063 F1 Workbook

33

Student Exercises 2 These exercises will be completed using the hand-held programmer. 1. Write a program where a single push button is used to start a pulse time

whose length is determined by the position of two other switches. With both switches “OFF” the pulse timer will not work; with only switch one “ON” the pulse time is 5 seconds; with only switch two “ON” the pulse time is 10 seconds; and with both switches “ON” the pulse time is 20 seconds.

2. The tank illustrated below shows an open tank that is filled by activating

valve V1 and emptied by activating valve V2. Sensors S1 and S2 detect the „tank empty‟ and „tank full‟ conditions. If the sensors give a “one” signal when the liquid is below the level of the sensor, the valves are energised to open and the cycle begins with an empty tank, then:-

a. Produce a basic PLC ladder diagram and code list to operate the

system as above. b. Re-design it to include a master on/off control.

0 S2 1

0 S1 1

V2

V1

Page 34: ST20063 F1 Workbook

34

3. The diagram below shows a tank that can be filled from two hoppers via valves V1 and V2 and emptied through valve V3. The sensors S1, s” and S3 are used to detect “tank full”, “tank half full” and “tank empty” conditions. The sensors give a one signal when the liquid level is below the sensor, the valves are energised to open and the cycle begins with an empty tank. Produce a basic PLC ladder diagram and code to half fill the tank via valve V1, then completing the filling via valve V2. Once the tank is full it is to be emptied via valve V3 and the cycle repeated. Incorporate a master on/off rung so that the process may be interrupted and all the processes should be latched to continue smooth operation once re-started.

4. A small bottling factory is considering the automation of its production line.

A conveyor is used to carry bottles to a packaging unit. The PLC program is to check whether the bottles are full and capped and that six bottles are packed into each container. If a bottle is not full then the conveyor is to be stopped. The capping machine is to be activated when a bottle is in the correct position, with the conveyor stopped for this operation. When six bottles have been counted the packing machine is to be activated and the conveyor stopped if another bottle comes into the packaging point at that time. An alarm is to be activated whenever the conveyor is stopped.

0 S2 1

V1

0 S1 1

V3

V1 V2

0 S3 1

V1