You are on page 1of 113

Learning system for automation and communications

Programmable Logic Controller
Fundamentals and Applications of Programmable Logic Controllers

Exercises Solutions

Festo Didactic

E311 Fundamentals and Applications of Programmable Logic Controllers

3
Exercise 1

Exercise 1
The YES Function Problem Description
Actuation of a push button (S1) is to cause a lamp (H1) to be switched on. The lamp is to be illuminated as long as the push button is actuated. • • • Draw the circuit diagram and assemble the equipment. Formulate the PLC program using MultiProg. You can use any one or all of the five languages available.

Festo Didactic

4 Exercise 1 Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

6 0.2 0.1 0.2 0.3 0.0 0.1 0.7 PLC 0.5 Solution 1 Solution 1 Electrical Circuit Diagram 24V 0V S1 I 24V 0V 0.0 0.5 0.3 O H1 0V Variables For Festo PLC Name Input0_0 Output0_0 Attrib [Input] [Output] Type BOOL BOOL Comment Push Button S1 Lamp H1 Festo Didactic .4 0.

FBD Programming Input0_ 0 Output0_ 0 E311 Fundamentals and Applications of Programmable Logic Controllers .6 Solution 1 Ladder Programming Input0_0 Output0_0 IL Programming LD Input0_0 ST Output0_0 ST Programming Output0_0:=Input0_0.

You can use any one or all of the five languages available. Festo Didactic . Formulate the PLC program using MultiProg. which breaks if a burglary is attempted. A close circuit is interrupted as a result of this and a buzzer is sounded. A normally closed switch is used to simulate the unbroken wire.7 Exercise 2 Exercise 2 The NOT Function Problem Description A thin wire has been stretched behind a display window. • • • Draw the circuit diagram and assemble the equipment.

8 Exercise 2 Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

2 0.4 0.1 0.3 O H1 0V Variables For Festo PLC Name Input0_0 Output0_0 Attrib [Input] [Output] Type BOOL BOOL Comment Sensor S1 Siren H1 Festo Didactic .9 Solution 2 Solution 2 Electrical Circuit Diagram 24V 0V S1 I 24V 0V 0.0 0.6 0.3 0.0 0.2 0.1 0.5 0.7 PLC 0.

10 Solution 2 Ladder Programming Input0_ 0 Output0_ 0 IL Programming LDN Input0_0 ST Output0_0 ST Programming Output0_0:= NOT Input0_0. FBD Programming Input0_ 0 OR Output0_ 0 Input0_ 0 NOT Output0_ 0 E311 Fundamentals and Applications of Programmable Logic Controllers .

Formulate the PLC program using MultiProg You can use any one or all of the five languages available.11 Exercise 3 Exercise 3 The AND Function Problem Description A press stamp 1. Draw the electrical circuit diagram and Electropneumatic circuit diagram. Festo Didactic .0 is to advance only if a push button is actuated and a protective guard is closed. Assemble the equipment. the press tool is to return immediately. The position monitored by advanced or solenoid valve • • • • of the closed protective guard B1 is a proximity switch B1. If one of these conditions is not met. The press tool is retracted by means of a spring return (Coil Y1).

12 Exercise 3 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

13 Exercise 3 Festo Didactic .

14 Solution 3 Solution 3 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

FBD Programming Input0_ 0 Input0_ 1 AN D Output0_ 0 Festo Didactic .15 Solution 3 Variables For Festo PLC Name Input0_0 Input0_1 Output0_0 Attrib [Input] [Input] [Output] Type BOOL BOOL BOOL Comment Start Switch S1 Safety Sensor B1 Cylinder Extends Y1 Ladder Programming Input0_ 0 Input0_ 1 Output0 _0 IL Programming LD Input0_0 AND Input0_1 ST Output0_0 ST Programming Output0_0:= Input0_0 AND Input0_1.

• • • Draw the circuit diagram and assemble the equipment.16 Exercise 4 Exercise 4 The OR Function Problem Description An apartment bell is to ring if bell button S1 at the front door is pressed or bell button S2 at the apartment door. You can use any one or all of the five languages available. E311 Fundamentals and Applications of Programmable Logic Controllers . Formulate the PLC program using MultiProg.

17 Exercise 4 Electrical Circuit Diagram Festo Didactic .

18 Solution 4 Solution 4 Electrical Circuit Diagram Variables For Festo PLC Name Input0_0 Input0_1 Output0_0 Attrib [Input] [Input] [Output] Type BOOL BOOL BOOL Comment Push Button S1 Push Button S2 Bell H1 E311 Fundamentals and Applications of Programmable Logic Controllers .

FBD Programming for Festo PLC OR Input0_ 0 Input0_ 1 Output0_ 0 Festo Didactic .19 Solution 4 Ladder Programming Input0_ 0 Output0_ 0 LDInput0_ Input0_1 1 OR Input0_2 ST Outuput0 IL Programming LD Input0_0 OR Input0_1 ST Output0_0 ST Programming Output0_0:= Input0_0 OR Input0_1.

• • • • Draw the electrical circuit diagram and Electropneumatic circuit diagram. whereby it touches two of the three proximity switches B1. B2 and B3. A workpiece is inserted via a guide. Formulate the PLC program using MultiProg. whereby a recess is to be stamped into the workpiece. E311 Fundamentals and Applications of Programmable Logic Controllers . The stamping cycle is to be triggered only if two signal generators are Typeesses.20 Exercise 5 Exercise 5 Combination of AND/OR/NOT Functions Problem Description A stamping device can be operated from three sides. if all three proximity sensors are contacted. This causes a pneumatic cylinder 1. Assemble the equipment. For reasons of safety the cylinder must be prevented from advancing. You can use any one or all of the five languages available.0 to extend via a solenoid valve (Coil Y1).

21 Exercise 5 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram Festo Didactic .

22 Exercise 5 E311 Fundamentals and Applications of Programmable Logic Controllers .

23 Solution 5 Solution 5 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram Festo Didactic .

24 Solution 5 Variables For Festo PLC Name Input0_0 Input0_1 Input0_2 Flag1 Flag2 Flag3 Output0_0 Attrib [Input] [Input] [Input] [Internal] [Internal] [Internal] [Output] Type BOOL BOOL BOOL BOOL BOOL BOOL BOOL Comment Proximity Sensor B1 Proximity Sensor B2 Proximity Sensor B3 Internal Relay 1 Internal Relay 2 Internal Relay 3 Cylinder Extends Y1 Ladder Programming Input0_ 0 Input0_ 1 Input0_ 2 Output0_ 0 Input0_ 0 Input0_ 1 Input0_ 2 Input0_ 0 Input0_ 1 Input0_ 2 E311 Fundamentals and Applications of Programmable Logic Controllers .

25 Solution 5 Instruction List Programming LD Input0_0 AND Input0_1 ANDN Input0_2 ST Flag1 LD Input0_0 AND Input0_2 ANDN Input0_1 ST Flag2 LD Input0_1 AND Input0_2 ANDN Input0_0 ST Flag3 LD Flag1 OR Flag2 OR Flag3 ST Output0_0 Structured Text Programming Flag1:= Input0_0 AND Input0_1 AND NOT Input0_2. Flag2:=Input0_0 AND Input0_2 AND NOT Input0_1. Output0_0:=Flag1 OR Flag2 OR Flag3. Flag3:=Input0_1 AND Input0_2 AND NOT Input0_0. OR Output0_0:= (Input0_0 Input0_2) OR (Input0_0 Input0_1) AND AND Input0_1 Input0_2 AND AND NOT NOT Festo Didactic .

26 Solution 5 FBD Programming AND Input0_ 0 Input0_ 1 Input0_ 2 AND OR Input0_ 0 Input0_ 1 Input0_ 2 AND Output0_ 0 Input0_ 0 Input0_ 1 Input0_ 2 E311 Fundamentals and Applications of Programmable Logic Controllers .

Assemble the equipment. The cylinders are extended in the initial position. You can use any one or all of the five languages available. Formulate the PLC program using MultiProg. Festo Didactic . Once the appropriate silo has been selected using the selector switch (S2). • • • • Draw the electrical circuit diagram and Electropneumatic circuit diagram. pressing the push button (S1) opens the silo.27 Exercise 6 Exercise 6 Logic Control System with Branching. Problem Description The control of a bulk material mixing system consists of a push button (S1) and a selector switch (S2). Use single-solenoid 5/2-way directional control valves to control both cylinders.

28 Exercise 6 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

29 Exercise 6 Festo Didactic .

30 Solution 6 Solution 6 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

31 Solution 6 Variables For Festo PLC Name Input0_0 Input0_1 Output0_0 Output0_1 Attrib [Input] [Input] [Output] [Output] Type BOOL BOOL BOOL BOOL Comment Start Button S1 Selector Switch S2 Cylinder A Retracts Y1 Cylinder B Retracts Y2 Ladder Programming Input0_0 Input0_1 Output0_0 Input0_0 Input0_1 Output0_1 IL Programming LD Input0_0 ANDN Input0_1 ST Output0_0 LD Input0_0 AND Input0_1 ST Output0_1 Festo Didactic .

FBD Programming AND Input0_ 0 Input0_ 1 AND Output0_ 0 Input0_ 0 Input0_ 1 Output0_ 1 E311 Fundamentals and Applications of Programmable Logic Controllers . Output0_1:= Input0_0 AND Input0_1.32 Solution 6 ST Programming Output0_0:= Input0_0 AND NOT Input0_1.

33 Solution 6 Festo Didactic .

If a 1-signal applies both at the S1 and the R input output Q1 is set. i. the value of Q1 becomes 1. Function block SR. Function block RS. dominant setting flip-flop Function block SR contains a dominant setting flip-flop. A 1 signal at reset input R sets the value of Q1 at 0 only if a 0-signal simultaneously applies at the S1 input. Typical examples of storage operations are the permanent setting or resetting of output signals. dominant resetting flip-flop Function block RS contains a dominant resetting flip-flop. The typical behaviour of the SR function block is therefore as follows: • • • A 1-signal at set input S1 sets the flip-flop.34 Exercise 7 Exercise 7 Setting and Resetting of an Output Technical Knowledge Storage operations form part of the elementary PLC operations and apply in cases where a briefly occurring signal status is permanently stored.e. E311 Fundamentals and Applications of Programmable Logic Controllers . The standard function blocks SR and RS are available for the realisation of storage functions.

If 1-signals apply both at inputs S and R1. Festo Didactic . Formulate the PLC program using MultiProg. output Q1 is reset. Assemble the equipment. The buzzer can only be switched off via push button S1.35 Exercise 7 The behaviour of the block represented is as follows: • • • A 1-signal at reset input R1 sets the value of Q1 to 0. A buzzer (H1) is to sound in this event. A 1-signal at set input S sets output Q1 to 1 only if a 0signal simultaneously applies at the R1 input. • • • • Draw the electrical circuit diagram. You can use any one or all of the five languages available. irrespective of which value applies at input S. Problem Description The drill on a drilling unit is monitored by means of a drill breakage sensor (B1). the sensor interrupts the circuit. If the drill is broken.

36 Exercise 7 Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

37 Exercise 7 Festo Didactic .

38 Solution 7 Solution 7 Electrical Circuit Diagram Variables For Festo PLC Name Input0_0 Input0_1 Output0_1 Attrib [Input] [Input] [Output] Type BOOL BOOL BOOL Comment Push Button S1 Sensor B1 Buzzer H1 Name RS_1 Function or Function Block RS Comment RS Function Block 1 E311 Fundamentals and Applications of Programmable Logic Controllers .

39 Solution 7 Ladder Diagram Output0_0 Input0_1 S Input0_0 Output0_0 R IL Programming LDN Input0_1 S Output0_0 LD Input0_0 R Output0_0 OR LDN Input0_1 ST RS_1.Q1.Q1 ST Output0_0 ST Programming RS_1(SET:=Not Input0_1.RESET1 CAL RS_1 LD RS_1. RESET1:= Remember to declare RS_1 in the Variables under Function Block.SET LD Input0_0 ST RS_1. Output0_0:= RS_1. Festo Didactic . Input0_0).

40 Solution 7 FBD Programming RS_1 RS SET RESET1 Input0_ 1 Input0_ 0 Q1 Output0_ 0 Using FBD in Ladder Diagrams RS-1 RS Input0_1 SET Output0_0 Q1 Input0_0 RESET1 E311 Fundamentals and Applications of Programmable Logic Controllers .

41
Solution 7

Festo Didactic

42
Exercise 8

Exercise 8
Transfer of a Part Problem Description
Using a double-acting cylinder, a part is to be moved from one roller track to another. The operation is to be started using a push button. An acknowledgement signal is required when the piston is fully extended to ensure that the part has been transferred. The return stroke is to be automatic. Use a double solenoid valve. • • • • Draw the electrical circuit diagram and Electropneumatic circuit diagram. Assemble the equipment. Formulate the PLC program using MultiProg. You can use any one or all of the five languages available.

E311 Fundamentals and Applications of Programmable Logic Controllers

43
Exercise 8

Electro-Pneumatic Circuit Diagram

Electrical Circuit Diagram

Festo Didactic

44 Solution 8 Solution 8 Electro-Pneumatic Circuit Diagram B1 B2 Electrical Circuit Diagram Y2 E311 Fundamentals and Applications of Programmable Logic Controllers .

45 Solution 8 Variables For Festo PLC Name Input0_0 Input0_1 Input0_2 Output0_0 Output0_1 Attrib [Input] [Input] [Input] [Output] [Output] Type BOOL BOOL BOOL BOOL BOOL Comment Start Button S1 Cylinder A Back B1 Cylinder A Forward B2 Cylinder A Extends Y1 Cylinder A Retracts Y2 Ladder Diagram Input0_0 Input0_1 Output0_0 S Output0_1 R Output0_1 Input0_2 S Output0_0 R IL Programming LD Input0_0 AND Input0_1 ST Output0_0 LD Input0_2 ST Output0_1 Festo Didactic .

FBD Programming AND Input0_ 0 Input0_ 1 Input0_ 2 OR Output0_0 Output0_1 RS_1 Input0_0 Input0_1 Input0_2 AND RS SET RESET1 Q1 Output0_0 Input0_2 Output0_1 E311 Fundamentals and Applications of Programmable Logic Controllers .46 Solution 8 OR LD Input0_0 AND Input0_1 S Output0_0 R Output0_1 LD Input0_2 S Output0_1 R Output0_0 ST Programming Output0_0:= Input0_0 AND Input0_1. Output0_1:= Input0_2.

47 Solution 8 Festo Didactic .

E311 Fundamentals and Applications of Programmable Logic Controllers . If a signal change takes place from 0 to 1 at input CLK. Function block R_TRIG for rising edge detection This standard function block is used for the detection of a rising edge. Rising (positive) edges mark the instant.48 Exercise 9 Exercise 9 Activating a Cylinder Signal Edges Technical Knowledge PLC applications frequently require the detection and evaluation not of signal itself. Falling (negative) edges mark the instant. but of the point of change of a signal. output Q assumes the value 1 during a program cycle. These signal changes are described as edges. during which a signal change takes place from 1 to 0. during which a signal change takes place from 0 to 1.

Assemble the equipment. output Q carries a 1-signal during a program cycle. • • • Draw the electrical circuit diagram and pneumatic circuit diagram. If a signal change takes place from 1 to 0 at input CLK.49 Exercise 9 Function block F_TRIG for falling edge detection This standard function block is used for the detection of a falling edge. To trigger a second movement of the cylinder. Electro- Festo Didactic . the push button must be released and actuated afresh. Push button (S1) is used to actuate the cylinder in such a way that it advances from the retracted end position into the opposite direction. The cylinder must advance only once per push button actuation. Problem Description A cylinder is actuated by means of a spring-returned solenoid valve (coil Y1). Two proximity switches signal the positions "extended" (B2) and "retracted" (B1). Formulate the PLC program using MultiProg.

50 Exercise 9 • You can use any one or all of the five languages available. Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

51 Exercise 9 Festo Didactic .

52 Solution 9 Solution 9 Electro-Pneumatic Circuit Diagram B1 B2 Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

53 Solution 9 Variables For Festo PLC Name Input0_0 Input0_1 Input0_2 Flag1 Output0_0 Attrib [Input] [Input] [Input] [Internal] [Output] Type BOOL BOOL BOOL BOOL BOOL Comment Start Button S1 Cylinder A Back B1 Cylinder A Forward B2 Internal Relay 1 Cylinder Solenoid Y1 Name R_TRIG_1 RS_1 Function or Function Block R_TRIG RS Comment Rising Edge 1 Reset-Set 1 Ladder Diagram R_TRIG_1 Input0_0 R_TRIG CLK Q Input0_1 Output0_0 S Input0_2 Output0_0 R IL Programming for Festo PLC LD Input0_0 ST R_TRIG_1.Q AND Input0_1 S Output0_0 LD R_TRIG_1.Q AND Input0_2 R Output0_0 Festo Didactic .CLK CAL R_TRIG_1 LD R_TRIG_1.

Q Input0_1. RS_1(SET:=R_TRIG1_1. FBD Programming AND Input0_ 1 Input0_ 0 Input0_ 2 AND R_TRIG_1 R_TRIG CLK Q RS_1 RS SET RESET1 Q1 Output0_ 0 AND E311 Fundamentals and Applications of Programmable Logic Controllers . Output0_0:= RS_1.RESET1:=R_TRIG_1.Q1.54 Solution 9 ST Programming R_TRIG_1(CLK:=Input0_0).Q AND Input0_2).

55 Solution 9 Festo Didactic .

Timers are available for the realisation of a pulse time response. E311 Fundamentals and Applications of Programmable Logic Controllers . standard function blocks are available for timers with different time response. Once the timer has started. which has elapsed since the start) is available at output ET.56 Exercise 10 Exercise 10 Bonding of Components Pulse Timer Technical Knowledge A large number of control tasks require the programming of time. a 1-signal applies at output Q for the time specified at input PT. The current timer value (the time. pulse timer Standard function block TP is a pulse timer The response of function block TP is as follows: • • • • Function block TP is started via a short or long signal at input IN. Function block TP. The timer can only be started again once it has expired. Through IEC61131-3. a switch-on signal delay and a switch-off signal delay.

the bonding surfaces are pressed together with a defined force for 5 seconds. the cylinder is to return to the initial position. The bonding process is started by a push button S1.57 Exercise 10 Problem Description Two components are to be bonded together with the help of a pneumatic cylinder 1. • • • • Draw the electrical circuit diagram and Electropneumatic circuit diagram. Formulate the PLC program using MultiProg.0. To do this. The cylinder is controlled by single solenoid directional control valves (Y1). Once the 5 seconds have expired. Festo Didactic . The time is commenced once the cylinder advances from its retracted end position (sensor B1). Assemble the equipment. You can use any one or all of the five languages available.

58 Exercise 10 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

59 Exercise 10 Festo Didactic .

60 Solution 10 Solution 10 Electro-Pneumatic Circuit Diagram B1 Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

Q ST Output0_0 Festo Didactic .IN LD T#5s ST TP_1.61 Solution 10 Variables For Festo PLC Name Input0_0 Input0_1 Output0_0 Attrib [Input] [Input] [Output] Type BOOL BOOL BOOL Comment Start Button S1 Cylinder A Back B1 Cylinder Solenoid Y1 Name TP_1 Function or Function Block TP Comment Timer Preset 1 Ladder Diagram TP_1 Input0_0 Input0_1 IN T#5s PT TP Q ET Output0_0 IL Programming LD Input0_0 AND Input0_1 ST TP_1.PT CAL TP_1 LD TP_1.

Q. FBD Programming for Festo PLC Input0_ 0 Input0_ 1 T#5s AND TP_1 TP IN PT Q ET Output0_ 0 E311 Fundamentals and Applications of Programmable Logic Controllers .PT:= T#5s). Output0_0:= TP_1.62 Solution 10 ST Programming TP_1(IN:=Input0_0 AND Input0_1.

63 Solution 10 Festo Didactic .

which has elapsed since the start) is available at output ET.64 Exercise 11 Exercise 11 Embossing Device Switch-on Signal Delay Technical Knowledge Function block TON. E311 Fundamentals and Applications of Programmable Logic Controllers . Upon expiry of the time specified at input PT. Switch-on signal delay The standard function block TON is used to generate a switch-on signal delay. the value of output Q remains a constant 0. output Q carries a 1-signal. The 1-signal at output Q applies until the input signal IN reverts to the value 0. If the duration of the input signal IN is shorter than the specified time PT. The behaviour of function block TON is as follows: • • • • Function block TON is started by means of a 1-signal at input IN. The current timer value (the time.

In order to ensure that the embossing cycle is not triggered inadvertently. During this time the start button must be permanently actuated. You can use any one or all of the five languages available. The cylinder is controlled by single solenoid directional control valves (Y1). the embossing cycle is to be triggered only after 3 seconds have expired. Festo Didactic . Assemble the equipment.0 is established by means of the proximity switches B1 (retracted) and B2 (extended). • • • • Draw the electrical circuit diagram and Electropneumatic circuit diagram. The position of the cylinder 1. Formulate the PLC program using MultiProg.65 Exercise 11 Problem Description A workpiece is to be embossed by activating a start button (S1).

66 Exercise 11 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

67 Exercise 11 Festo Didactic .

68 Solution 11 Solution 11 Electro-Pneumatic Circuit Diagram B1 B2 Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

69 Solution 11 Variables For Festo PLC Name Input0_0 Input0_1 Input0_2 Output0_0 Attrib [Input] [Input] [Input] [Output] Type BOOL BOOL BOOL BOOL Comment Start Button S1 Cylinder A Back B1 Cylinder A Forward B2 Cylinder Solenoid Y1 Name TON_1 RS_1 Function or Function Block TON RS Comment Timer Delay On 1 Reset-Set 1 Ladder Diagram TON_1 Input0_0 Input0_1 IN T#3s PT TON Q ET Output0_0 S Input0_2 Output0_0 R Festo Didactic .

70 Solution 11 IL Programming LD Input0_0 AND Input0_1 ST TON_1.RESET1:= Input0_2).PT CAL TON_1 LD TON_1.Q S Output0_0 LD Input0_2 R Output0_0 ST Programming TON_1(IN:=Input0_0 AND Input0_1.Q1.IN LD T#3s ST TON_1.Q. RS_1(SET:=TON_1.PT:= T#3s). FBD Programming for Festo PLC Input0_ 0 Input0_ 1 T#3s Input0_ 2 AND TON_1 TON IN PT Q ET RS_1 RS SET RESET1 Q1 Output0_0 E311 Fundamentals and Applications of Programmable Logic Controllers . Output0_0:= RS_1.

71 Solution 11 Festo Didactic .

Output Q simultaneously receives the value 1. After the input signal IN has reverted to the value 0.72 Exercise 12 Exercise 12 Clamping Device Switch-off Signal Delay Technical Knowledge Function block TOF. switch-off signal delay The standard function block TOF is used to generate a switch-off signal delay. The behaviour response of function block TOF is as follows: • • Function block TOF is started via a 1-signal at input IN. the 1 signal continues to be applied at output Q for the time specified at the PT input and then returns to the value 0. E311 Fundamentals and Applications of Programmable Logic Controllers .

0. This time is started with the advancing of cylinder 1.0 and double solenoid DCV for cylinder 2. • • • • Draw the electrical circuit diagram and Electropneumatic circuit diagram. You can use any one or all of the five languages available.73 Exercise 12 Problem Description A workpiece is to be clamped by activating the start button S1. Since the workpiece requires time to cool down. Assemble the equipment. cylinder 2. When the workpiece is clamped by cylinder 1. Formulate the PLC program using MultiProg. it remains clamped for a period of 3 seconds.0.0. Festo Didactic . Use single solenoid DCV for cylinder 1.0 extends and embosses the workpiece.

74 Exercise 12 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

75 Exercise 12 Festo Didactic .

76 Solution 12 Solution 12 Electro-Pneumatic Circuit Diagram B1 B2 Electrical Circuit Diagram Variables E311 Fundamentals and Applications of Programmable Logic Controllers .

77 Solution 12 For Festo PLC Name Input0_0 Input0_1 Input0_2 Input0_3 Input0_4 Output0_0 Output0_1 Output0_2 Attrib [Input] [Input] [Input] [Input] [Input] [Output] [Output] [Output] Type BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL Comment Start Button S1 Cylinder A Back B1 Cylinder A Forward B2 Cylinder B Back B3 Cylinder B Forward B4 Cylinder Solenoid Y1 Cylinder B Extends Y2 Cylinder B Retracts Y3 Comment Timer Delay Off 1 Rising Edge 1 Reset-Set 1 Reset-Set 2 Name TOF_1 R_TRIG_1 RS_1 RS_2 Function or Function Block TOF R_TRIG RS RS Festo Didactic .

78 Solution 12 Ladder Diagram TOF_1 Input0_0 Input0_1 Input0_3 IN T#3s R_TRIG_1 TOF Q ET Output0_0 PT Input0_2 R_TRIG CLK Q Input0_3 Output0_1 S Input0_4 Output0_1 R Output0_2 S Input0_3 Output0_2 R E311 Fundamentals and Applications of Programmable Logic Controllers .

RS_2 (SET:=Input0_4.Q. Festo Didactic . R_Trig_1 (Input0_2).IN LD T#3s ST TOF_1.PT CAL TOF_1 LD TOF_1. RS_1 (SET:=R_Trig_1.Q1.Q AND Input0_3.Q AND Input0_3 S Output0_1 LD Input0_4 R Output0_1 S Output0_2 LD Input0_3 R Output0_2 ST Programming TOF_1 (IN:=Input0_0 AND Input0_1 AND Input0_3.Q ST Output0_0 LD Input0_2 ST R_Trig_1.RESET1:= Input0_3).CLK CAL R_Trig_1 LD R_Trig_1. Output0_0:= TOF_1.RESET1:= Input0_4). Output0_1:= RS_1.79 Solution 12 IL Programming LD Input0_0 AND Input0_1 AND Input0_3 ST TOF_1.PT:= T#3s).

80 Solution 12 FBD Programming Input0_ 0 Input0_ 1 Input0_ 3 T#3s AND TOF_1 TOF IN PT Q ET Output0_ 0 R_TRIG_1 R_TRIG RS_1 RS SET RESET1 Q1 AND Input0_ 2 Input0_ 3 Input0_ 4 CLK Q Output0_ 1 RS_2 RS Input0_ 0 Input0_ 1 SET RESET1 Q1 Output0_ 2 E311 Fundamentals and Applications of Programmable Logic Controllers .

81 Solution 12 Festo Didactic .

Decremental counter Function block CTD being a decremental counter is counterpart to function block CTU. Thereafter. the value CV of the counter is increased by 1 with each rising edge at input CU.82 Exercise 13 Exercise 13 Bending Device with Counter Counters Technical Background Function block CTU. A 1-signal applies at output Q as soon as the current value CV is equal or greater than the preselect value PV. Its interface is defined by means of three input and two output parameters. Function block CTD. E311 Fundamentals and Applications of Programmable Logic Controllers . The characteristic behaviour of an incremental counter is as follows: • • • A 1-signal at reset input R sets the current counter status CV at 0. Output Q carries a 0-signal as long as current counter status CV is less than the preselect value PV. incremental counter Function block CTU realises an incremental counter.

• • • • Draw the electrical circuit diagram and pneumatic circuit diagram. Output Q carries a 0-signal as long as the current counter status CV is greater than 0.83 Exercise 13 The behaviour of a decremental counter is as follows: • • • A 1-signal at the LD input sets the current counter status CV equal to the preselect value PV. Use the Ladder or FBD language. Assemble the equipment. The cycle is started by a push button. Each rising edge at the CD input decreases the current counter status CV by 1. Problem Description A double-acting cylinder is used for a bending process and is to operate for 5 continuous cycle and then stop. Formulate the PLC program using MultiProg. Only if the current value is less or equal to 0. does a 1-signal apply at output Q. The cylinder is controlled via single solenoid valves. Electro- Festo Didactic .

84 Exercise 13 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

85 Exercise 13 Festo Didactic .

86 Solution 13 Solution 13 Electro-Pneumatic Circuit Diagram B1 B2 Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

87 Solution 13 Variables For Festo PLC Name Input0_0 Input0_1 Input0_2 Flag1 Flag2 Output0_0 Attrib [Input] [Input] [Input] [Internal] [Internal] [Output] Type BOOL BOOL BOOL BOOL BOOL BOOL Comment Start Button S1 Cylinder A Back B1 Cylinder A Forward B2 Internal Relay 1 Internal Relay 2 Cylinder Solenoid Y1 Name CTU_1 R_TRIG_1 R_TRIG_2 RS_1 RS_2 Function or Function Block CTU R_TRIG R_TRIG RS RS Comment Counter Up 1 Rising Edge 1 Rising Edge 2 Reset-Set 1 Reset-Set 2 Festo Didactic .

88 Solution 13 Ladder Diagram Input0_0 Flag1 S Input0_1 Flag1 Output0_0 S R_TRIG_1 Input0_2 R_TRIG CLK Q Output0_0 R CTU_1 CTU Flag2 Q CV Flag1 R R_TRIG_2 Input0_2 R_TRIG CLK Q CU Flag2 5 RESET PV Flag2 E311 Fundamentals and Applications of Programmable Logic Controllers .

CLK CAL R_TRIG_1 LD R_TRIG_1.CU LD Flag2 ST CTU_1.Q ST CTU_1.89 Solution 13 IL Programming LD Input0_0 S Flag1 LD Input0_1 AND Flag1 S Output0_0 LD Input0_2 ST R_TRIG_1.CLK CAL R_TRIG_2 LD R_TRIG_2.Q ST Flag2 LD Flag2 R Flag1 Festo Didactic .Reset LD 5 ST CTU_1.PV CAL CTU_1 LD CTU_1.Q R Output0_0 LD Input0_2 ST R_TRIG_2.

Q1. Flag2:= CTU_1.Q1.90 Solution 13 ST Programming RS_1 (SET:=Input0_0. Flag1:= RS_1.PV:= 5).RESET1:=R_TRIG_1. CTU_1 (CU:=R_TRIG_2. Output0_0:= RS_2.Q).RESET1:= Flag2).Q. Function Block Diagram RS_1 RS Input0_ 0 Flag2 AND SET RESET1 Q1 Flag1 Input0_ 1 Flag1 R_TRIG_1 R_TRIG RS_2 RS Q1 SET RESET1 Output0_ 0 Input0_ 2 CLK Q CTU_1 R_TRIG_2 R_TRIG CTU Input0_ 2 Flag2 5 CLK Q CU RESET PV Q CV Flag2 E311 Fundamentals and Applications of Programmable Logic Controllers .Q. RS_2 (SET:=Input0_1 AND Flag1. R_TRIG_2(CLK:=Input0_2).RESET:= Flag2. R_TRIG_1(CLK:=Input0_2).

91 Solution 13 Festo Didactic .

92 Exercise 14 Exercise 14 Lifting Device for Packages Linear Sequence Technical Knowledge Sequence control systems Sequence control systems describe processes. which proceed in several clearly separated steps. The program of a sequence control system must therefore fulfill three basic exercises: E311 Fundamentals and Applications of Programmable Logic Controllers . The transition from one step to the next is dependent on the process statuses. It is possible for the process to be branched into partial processes in relation to the process statuses established.

93 Exercise 14 Steps of a sequential function chart 1 2 1 2 Initial Step Transition Step Action Step Transition Step Action Step Transition Step Action Step Transition Step 2 3 3 4 4 2 Example of double divergence and convergence. 1 1 Initialize Run 2 2 3 Process1 101 101 102 Process2 End of Process 1 Wait for Process 2 End of Process 2 Wait for Process 2 3 1 Festo Didactic true .

E311 Fundamentals and Applications of Programmable Logic Controllers . • • • • Draw the electrical circuit diagram and Electropneumatic circuit diagram. The cylinders are retracted and advanced by means of solenoid valves (Coil Y1 and Y2). packages have been arranged in such a way that they reach the lifting devices individually. On the feed side. Cylinder 1.0 (Lifting cylinder) and then transferred to another conveyor by means of Cylinder 2. Problem Description A roller conveyor is monitored by proximity switch B1 as to whether a package is present. You can use all the programming languages but should try the Sequential Function Chart.0 is to retract first. the package is picked up by a Cylinder 1.0.94 Exercise 14 Note that if it is an “OR” logic. followed by Cylinder 2. The cylinder positions are monitored by means of proximity switches B2 to B5. Formulate the PLC program using MultiProg. Assemble the equipment.0 (Transfer cylinder). the line would be a single line. If a package is present.

95 Exercise 14 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram Festo Didactic .

96
Exercise 14

E311 Fundamentals and Applications of Programmable Logic Controllers

97
Solution 14

Solution 14
Electro-Pneumatic Circuit Diagram
B1 B2 B3 B4

Electrical Circuit Diagram

Festo Didactic

98
Solution 14 Variables For Festo PLC
Name Input0_0 Input0_1 Input0_2 Input0_3 Input0_4 Output0_0 Output0_1 Flag1 Flag2 Flag3 Flag4 Flag5 Attrib [Input] [Input] [Input] [Input] [Input] [Output] [Output] [Internal] [Internal] [Internal] [Internal] [Internal] Type BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL Comment Proximity Sensor B1 Cylinder A Back B2 Cylinder A Forward B3 Cylinder B Back B4 Cylinder B Forward B5 Cylinder A Solenoid Y1 Cylinder B Solenoid Y2 Internal Relay 1 Internal Relay 2 Internal Relay 3 Internal Relay 4 Internal Relay 5

Name SR_1 SR_2 SR_3 SR_4 SR_5 SR_6 SR_7

Function or Function Block SR SR SR SR SR SR SR

Comment Set-Reset 1 Set-Reset 2 Set-Reset 3 Set-Reset 4 Set-Reset 5 Set-Reset 6 Set-Reset 7

E311 Fundamentals and Applications of Programmable Logic Controllers

99 Solution 14 Ladder Diagram Input0_0 Flag5 Flag1 Flag1 Input0_2 Flag1 Flag2 Flag2 Input0_4 Flag2 Flag3 Flag3 Input0_3 Flag3 Flag4 Flag4 Input0_1 Flag4 Flag5 Flag1 Flag3 Output0_0 Flag2 Festo Didactic Flag4 Output0_1 .

100 Solution 14 Ladder with Function Blocks SR_1 Input0_1 Input0_3 RS SET1 Q1 Flag1 Flag2 RESET SR_2 Flag1 Input0_0 RS SET1 Q1 Flag2 Flag3 RESET SR_3 Flag1 Flag2 Input0_2 RS SET1 Q1 Flag3 Flag4 RESET SR_4 Flag2 Flag3 Input0_4 RS SET1 Q1 Flag4 Flag5 RESET SR_5 Flag3 Flag4 Input0_1 RS SET1 Q1 Flag5 Flag1 RESET E311 Fundamentals and Applications of Programmable Logic Controllers .

SR_2 (SET1:=Input0_0 AND Flag1.Q1. RESET:=Flag2). SR_5 (SET1:=Input0_1 RESET:=Flag1). Flag1:=SR_1. SR_4 (SET1:=Input0_4 RESET:=Flag5). SR_3 (SET1:=Input0_2 RESET:=Flag4).Q1.Q1.Q1. Output0_0:=SR_6. RESET:=Flag3). RESET:=Flag4). . Flag4:=SR_4. Flag3:=SR_3.Q1.101 Solution 14 SR_6 Flag2 RS SET1 Q1 Output0_0 Flag4 RESET SR_7 Flag3 RS SET1 Q1 Output0_1 Flag5 RESET Structured Text SR_1 (SET1:=Input0_1 AND Input0_3.Q1. Flag2:=SR_2. AND Flag2 AND NOT Flag1. Festo Didactic Flag5:=SR_5. AND Flag3 AND NOT Flag2. AND Flag4 AND NOT Flag3. SR_6 (SET1:=Flag2.

102 Solution 14 Function Block Diagram AND SR_1 SR Input0_ 1 Input0_ 3 Flag2 AND SET1 RESET SR_2 SR Q1 Flag1 Flag1 Input0_ 0 Flag3 Flag1 Flag2 Input0_ 2 Flag4 Flag2 Flag3 Input0_ 4 Flag5 Flag3 Flag4 Input0_ 1 Flag1 SET1 Q1 SET1 RESET Q1 SET1 RESET Q1 SET1 RESET Q1 Flag2 AND SR_3 SR Flag3 AND SR_4 SR Flag4 AND SR_5 SR Flag5 RESET E311 Fundamentals and Applications of Programmable Logic Controllers .Output0_1:=SR_7.Q1.

RESET CAL SR_1 LD SR_1.SET1 LD Flag2 ST SR_1.Q1 ST Didactic Flag2 Festo .RESET CAL SR_2 LD SR_2.SET1 LD Flag3 ST SR_2.Q1 ST Flag1 LD Input0_0 AND Flag1 ST SR_2.103 Solution 14 SR_6 SR Q1 Flag2 Flag4 SET1 RESET SR_7 SR Output0_0 Flag3 Flag5 SET1 RESET Q1 Output0_1 Instruction List LD Input0_1 AND Input0_3 ST SR_1.

RESET CAL SR_4 LD SR_4.RESET CAL SR_7 ST Output0_1 .RESET CAL SR_5 LD SR_5.104 Solution 14 LD Input0_2 ANDN Flag1 AND Flag2 ST SR_3.SET1 LD Flag5 E311 Fundamentals and Applications of Programmable Logic Controllers ST SR_7.Q1 ST Flag3 LD Input0_4 ANDN Flag2 AND Flag3 ST SR_4.RESET CAL SR_3 LD SR_3.Q1 ST Flag4 LD Input0_1 ANDN Flag3 AND Flag4 ST SR_5.Q1 ST Flag5 LD Flag2 ST SR_6.SET1 LD Flag4 ST SR_3.SET1 LD Flag1 ST SR_5.SET1 LD Flag5 ST SR_4.SET1 LD Flag4 ST SR_6.RESET CAL SR_6 ST Output0_0 LD Flag3 ST SR_7.

105 Solution 14 Sequential Function Chart for Festo PLC Sequential Function Chart S001 R R Output0_0 Output0_1 Input0_0 S002 Input0_2 S003 Input0_4 S004 Input0_1 S005 S Output0_0 S Output0_1 R Output0_0 R Output0_1 Input0_3 Festo Didactic .

106 Solution 14 E311 Fundamentals and Applications of Programmable Logic Controllers .

Sequence abbreviation: A+ B+ B.0 releases the part. You should use either the Ladder Diagram or the Sequential Function Chart.107 Exercise 15 Exercise 15 Distributing Device for Boxes Problem Description Metal strips are placed manually in a fixture. • • • • Draw the electrical circuit diagram and Electropneumatic circuit diagram. Cylinder 1.AReed switches sense cylinder positions.0 completes the bending operation. Cylinder 2. Festo Didactic . Cylinder 3. Formulate the PLC program using MultiProg.0 clamps the metal strip when a push button is pressed. Cylinder 1.0 starts the bend and retracts. After Cylinder 3.C+ C.0 has returned to its initial position. Assemble the equipment.

108 Exercise 15 Electro-Pneumatic Circuit Diagram Electrical Circuit Diagram E311 Fundamentals and Applications of Programmable Logic Controllers .

109 Solution 15 Solution 15 For Festo PLC Name Input0_0 Input0_1 Input0_2 Input0_3 Input0_4 Input0_5 Input0_6 Output0_0 Output0_1 Output0_2 Flag1 Flag2 Flag3 Flag4 Flag5 Flag6 Flag7 Attrib [Input] [Input] [Input] [Input] [Input] [Input] [Input] [Output] [Output] [Output] [Internal] [Internal] [Internal] [Internal] [Internal] [Internal] [Internal] Type BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL BOOL Comment Proximity Sensor B1 Cylinder A Back B2 Cylinder A Forward B3 Cylinder B Back B4 Cylinder B Forward B5 Cylinder C Back B6 Cylinder C Forward B7 Cylinder A Solenoid Y1 Cylinder B Solenoid Y2 Cylinder C Solenoid Y3 Internal Relay 1 Internal Relay 2 Internal Relay 3 Internal Relay 4 Internal Relay 5 Internal Relay 6 Internal Relay 7 Festo Didactic .

110 Solution 15 Ladder Diagram Input0_0 Flag7 Flag1 Flag1 Input0_2 Flag1 Flag2 Flag2 Input0_4 Flag2 Flag3 Flag3 Input0_3 Flag3 Flag4 Flag4 Input0_6 Flag4 Flag5 Flag5 E311 Fundamentals and Applications of Programmable Logic Controllers .

111 Solution 15 Input0_5 Flag5 Flag6 Flag6 Input0_1 Flag6 Flag7 Flag1 Flag6 Output0_0 Flag2 Flag3 Output0_1 Flag4 Flag5 Output0_2 Festo Didactic .

112 Solution 15 Sequential Function Chart S001 R R Output0_0 Output0_1 Output0_2 Input0_0 R S002 Input0_2 S003 Input0_4 S004 Input0_3 S005 Input0_6 S006 Input0_5 S007 Input0_1 S Output0_0 S Output0_1 R Output0_1 S Output0_2 R Output0_2 R Output0_0 E311 Fundamentals and Applications of Programmable Logic Controllers .

113 Solution 15 Festo Didactic .