TH PLC
TH PLC
TH PLC
Exercise 1
Components of a PLC
To be able to explain the basic design and mode of operation Training aim
of a PLC
To be able to configure and commission a PLC
Nowadays, programmable logic controllers form part of any automation Technical knowledge
process. Fig. A1.1 illustrates the typical configuration of an automation
solution realised by means of a PLC. The control system shown repre-
sents the simpler, non-networked group of PLC applications.
Fig. A1.1:
PC / Automation via PLC
Programming device Display/
Control unit
PLC
Sensors
Actuators
Fig. A1.2:
System components PLC-program
of a PLC
Sensors Actuators
PLC program
PLC programs consist of a logic sequence of instructions. The control
program is stored in a special, electronic readable memory, the so-called
program memory of the PLC. Special RAMs with back-up battery are
used during the program development, since its contents can always be
changed again very quickly.
After commissioning and error-free function of the controller it is a good
idea to transfer the PLC program unerasably to a read-only memory,
e.g. an EPROM. If the program is executed, it will be processed in con-
tinuous cycles.
Signals
Input signals reach the PLC via sensors. These signals contain infor-
mation about the status of the system to be controlled. It is possible to
input binary, digital and analogue signals.
A PLC can only recognise and output electrical signals. For this reason,
non-electrical signals are converted into electrical signals by the sen-
sors. Sensor examples are:
Push buttons, switches, limit switches, proximity sensors
Output signals influence the system to be controlled. The signals can be
output in the form of binary, digital or analogue signals. Output signals
are amplified into switching signals via the actuators or converted into
signals of other energy forms. Actuators examples are:
Lamps, buzzers, bells, contactors, cylinders with solenoid valves,
stepper motors
Problem description A control task is to be solved via a programmable logic controller (PLC).
Familiarise yourself with the basic design of a PLC.
Positional sketch
Implementation To carry out the exercise using the worksheets, refer to Section B of the
workbook and your PLC data sheet or manual.
WORKSHEET
Question 2:
What are the basic modules making up the central control unit of a pro-
grammable logic controller?
Question 3:
How is electrical isolation achieved between sensor/actuator signals and
the PLC?
WORKSHEET
Operating voltage
Nominal voltage
Permissible voltage range
Current consumption
Inputs
Number
Input current
Input level
Outputs
Number
Switching logic
Output voltage
Output current
Configure the PLC in accordance with the notes in the relevant data
sheet or manual.
To familiarise yourself with the basic language resources for the Training aim
configuration and structuring of a PLC program in accordance with
EN 61131 (IEC 61131).
To be able to declare variables for use in a PLC program
To be able to apply a systematic procedure for the implementation of
PLC exercises
Technical knowledge
Creating a PLC program
The practical steps for creating a PLC program are illustrated in
Fig. A2.1.
Fig. A2.1:
Description of control task
– Verbal description Procedure for creating
– Positional sketch a PLC program
PLC program Installation/process
Realisation of solution
– Configuring the PLC
– Declaration of PLC program variables Assembly installation
– Formulating the logic of the PLC program
into LD, FBD, IL, ST or SFC
Since this list forms a component part of PLC programs, it is not created
separately in the case of smaller control tasks.
Solution design
The designed solution is to give a clear representation of the function
and behaviour of the controller independent of technology. The function
table is used as a means of describing simple logic control systems. The
function chart to IEC 60848 is particularly suitable for the description of
sequence control systems.
A bell is to ring either if the bell button on the front door or the bell button Example
on the apartment door is actuated.
When commencing the production of a PLC program, the resources are
to be declared in the syntax defined by EN 61131-3 (IEC 61131-3). The
PLC inputs and outputs declared in Fig. A2.2a are local variables within
the program "Bell". The use of global variables is only required for more
complex control tasks.
Following the declaration, the program body is formulated. Functions
and function blocks are available at this point in order to create a clearly
arranged program. The example is programmed in function block dia-
gram using the OR function.
Fig. A2.2:
PROGRAM Bell CONFIGURATION example Realisation of a solution
VAR
Button_FD AT %IX1: BOOL; RESOURCE Installation
Button_AD AT %IX2: BOOL;
Bell AT %QX1: BOOL;
END_VAR TASK
T_cyclical
END_PROGRAM
Problem description PLC inputs and outputs and additional variables for storing information
are to be incorporated in a PLC program. For this, you will need to famil-
iarise yourself with the basic procedure required for PLC program gen-
eration.
Implementaion In order to carry out the exercise you will need the information from Sec-
tion B of the workbook: Chapter 6.
WORKSHEET
Question:
What activities are carried out in the step "Implementation of the solu-
tion"?
Memory 9 _________________________________________________
WORKSHEET
Each programmable logic controller has a certain number of inputs and Technical knowledge
outputs, through which it is connected with the sensors and actuators.
The program transferred to the controller contains the commands which
interconnect the individual inputs and assigns these to the correspond-
ing outputs.
Table A3.2:
The assignment function LD
%IX1 %QX2
Current rung with normally
open contact and non-stored coil.
FBD
IL
Storage of contents of
ST %QX2
accumulator to specified output.
ST
Actuation of a push button (S1) is to cause a lamp (H1) to be switched Problem description
on. The lamp is to be illuminated as long as the push button is actuated.
Positional sketch
S1
H1
1. Drawing up the electrical circuit diagram and constructing the circuit Exercise definition
2. Describing the control task by means of the function table and the
boolean equation
3. Declaration of PLC program variables
4. Formulation of the PLC program in the various programming lan-
guages
5. Testing and commissioning of the PLC program and system
Implementation 3.1 Drawing up the electrical circuit diagram and constructing the
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
3.2 Describe the control task by means of the function table and
the boolean equation
Describe the behaviour of the control system irrespective of technolo-
gy by means of the function table and the associated boolean equa-
tion.
3.4 Formulation of the PLC program into one of the PLC program-
ming languages
Select one of the programming languages supported by your PLC
system. Suitable languages for the formulation of logic control sys-
tems are LD, FBD, IL and ST.
WORKSHEET
I
24V
PLC
0V
Q
0V
3.2 Describing the control task by means of the function table and
the boolean equation
Create the function table
S1 H1 Function table
0
1
Booleam equation
3.4 Formulation of the PLC program into one of the PLC program-
ming languages
Formulate the solution of the control task in one of these languages:
Function block diagram (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
Worksheet
PLC program
Question 1:
What is the behaviour of a non-stored programmed output, if the input
signal is no longer applied?
Question 2:
Describe the basic design of an output module.
To be able to realise the logic NOT function with a PLC Training aim Training aim
Technical knowledge
The NOT function
The NOT function is used to convert binary signals into opposing
signals:
If the signal is 0, it is evaluated as 1
If the signal is 1, it is evaluated as 0
Table A4.1 illustrates an example of the behaviour of the NOT function
or an input %IX1 and an output %QX2.
Table A4.2 contains the commands for the implementation of the NOT
function in the individual programming languages.
Table A4.2:
The NOT function LD
%IX1 %QX2
Current rung with normally
/ closed contact and non-stored coil.
FBD
IL
Storage of contents of
ST %QX2
accumulator to specified output.
ST
A thin wire has been stretched behind a display window, which breaks if Problem description
a burglary is attempted. A closed circuit is interrupted as a result of this
and a buzzer is sounded.
Positional sketch
H1
S1
1. Drawing up the electrical circuit diagram and constructing the circuit Exercise definition
2. Describing the control task by means of the function table and the
boolean equation
3. Declaration of the PLC program variables
4. Formulation of the PLC program into one of the PLC programming
languages
5. Testing and commissioning of the PLC program and system
Implementation 4.1 Drawing up the electrical circuit diagram and constructing the
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted profile plate:
4.2 Describing the control task by means of the function table and
the boolean equation
Describe the behaviour of the control system irrespective of technolo-
gy by means of a function table and the associated boolean equation.
4.4 Formulation of the PLC program into one of the PLC program-
ming languages
Select one of the programming languages supported by your PLC
system. Suitable languages for the formulation of logic control sys-
tems are LD, FBD, IL and ST.
WORKSHEET
I
24V
PLC
0V
Q
0V
4.2 Describing the control task by means of the function table and
the boolean equation
Create the function table:
S1 H1 Function table
0
1
Boolean equation
4.4 Formulation of the PLC program into one of the PLC program-
ming languages
Formulate the solution of the control task in one of these languages:
Function block diagram (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
WORKSHEET
PLC-program
Question:
The output is set non-stored. What is the effect on the output signal, if
the wire is broken and has to be repaired?
Functions are part of the program organisation units and therefore Technical knowledge
represent a means for configuring PLC programs. EN 61131-3
(IEC 61131-3) provides standardised functions for the solution of basic
control technology tasks.
The function table for the AND function is illustrated below for the two
inputs %IX1 and %IX2 as well as %QX3.
Table A5.2 contains the commands for the realisation of the AND func-
tion in the individual programming languages.
Table A5.2:
The AND function LD
FBD
IL
ST
A press stamp 1A1 is to advance only if a push button S1 is actuated Problem description
and a protective guard is closed. If one of these conditions is not met,
the press tool is to return immediately.
The position of the closed protective guard B1 is monitored by a proximi-
ty switch B1. The press tool is advanced or retracted by means of a
spring return solenoid valve (coil 1Y1).
Positional sketch
1A1
S1
B1
1. Drawing up the electrical circuit diagram and constructing the circuit Exercise definition
2. Describing the control task by means of the function table and the
boolean equation
3. Declaration of the PLC program variables
4. Formulation of the PLC program into one of the PLC programming
languages
5. Testing and commissioning of the PLC program and system
Implementation 5.1 Drawing up the electrical circuit diagram and constructing the
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted profile plate:
5.2 Describing the control task by means of the function table and
the boolean equation
Describe the behaviour of the control system irrespective of technolo-
gy by means of a function table and the associated boolean equation.
5.4 Formulation of the PLC program into one of the PLC program-
ming languages
Select one of the languages supported by your PLC system for pro-
gramming. Suitable languages for the formulation of logic control sys-
tems are LD, FBD, IL and ST.
WORKSHEET
I
24V
PLC
0V
Q
0V
Circuit diagram,
electro-pneumatic 1A1
1V1 4 2
1Y1
5 3
1
5.2 Describing the control task by means of the function table and
the boolean equation
Create the function table
Function table S1 B1 1Y1
Boolean equation
WORKSHEET
5.4 Formulation of the PLC program into one of the PLC program-
ming languages
Formulate the solution of the control task into one of these languages:
Function block diagram (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
PLC-Program
Question:
Does output 1Y1 have to be set stored or non-stored?
Technical knowledge
The OR function
If at least one of the connected signals is 1, the result is also 1. Only if
all the connected signals are 0 is the result also 0.
Table A6.1 contains the function table for the OR connection of the sig-
nal from input %IX1 and input %IX2. The result is mapped to output
%QX3.
Table A6.2 contains the commands for the realisation of the OR function
in the individual programming languages.
Table A6.2:
The OR function LD
%IX1 %QX3
Rung with parallel switching
normally open contacts.
%IX2
FBD
IL
ST
An apartment bell is to ring if bell button S1 at the front door is pressed Problem description
or bell button S2 at the apartment door.
Positional sketch
S2
H1
S1
1. Drawing up the electrical circuit diagram and constructing the circuit Exercise definition
2. Describing the control task by means of the function table and the
boolean equation
3. Declaration of the PLC program variables
4. Formulation of the PLC program into one of the PLC programming
languages
5. Testing and commissioning of PLC program and system
Implementation 6.1 Drawing up the electrical circuit diagram and constructing the
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted profile plate:
6.2 Describing the control task by means of the function table and
the boolean equation
Describe the behaviour of the control system irrespective of technolo-
gy by means of a function table and the associated boolean equation.
6.4 Formulation of the PLC program into one of the PLC program-
ming languages
Select one of the programming languages supported by your PLC
system. Suitable languages for the formulation of logic control sys-
tems are LD, FBD, IL and ST.
WORKSHEET
I
24V
PLC
0V
Q
0V
6.2 Describing the control task by means of the function table and
the boolean equation
Create the function table:
Function table S1 S2 H1
Boolean equation
WORKSHEET
PLC program
Question:
In the case of the OR function, the output is set if at least one input
signal is set. With the exclusive OR unction, the output is set only if
exactly one of the connected inputs is set. Complets the function table.
Function table S1 S2 H1
0 0
0 1
1 0
1 1
Technical knowledge
Combination of logic connections
Many control tasks require the programming of a combination of logic
connections. The following are essential for drawing up a solution:
Establishing a boolean equation which describes the logic of the con-
trol task
Taking into consideration the priorities of the operators used for pro-
gramming
The example below deals with a combination of AND, OR and NOT
functions:
A lamp H1 is to illuminate if switch S1 and, in addition exactly one of the
switches S2 or S3 is actuated.
The relevant function table is as follows:
S1 S2 S3 H1 Table A7.1:
Function table
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 0
1 0 0 0
1 0 1 1
1 1 0 1
1 1 1 0
The disjunctive normal form (DNF) can be derived from this table. The
DNF describes the control task by means of a boolean equation, which
can be easily converted into one of the programming languages.
The solution method for the DNF is based on the lines in the function
table, for which the result variable (H1) has the value 1. These lines are
OR connected and lead to the boolean equation
H1 = (S1 ∧ S2 ∧ S3) ∨ (S1 ∧ S2 ∧ S3)
The realisation of the control task in the individual programming lan-
guages is listed in table A7.2.
Table A7.2:
LD
Combination of
logic operation S1 S2 S3 H1
S1 S2 S3
FBD
S1 &
S2
>=1 H1
S3
S1 &
S2
S3
IL
LD S1
ANDN S2
AND S3
OR( S1
AND S2
ANDN S3
)
ST H1
ST
H1 := S1 & NOT S2 & S3 OR S1 & S2 & NOT S3;
or
H1 := (S1 & NOT S2 & S3) OR (S1 & S2 & NOT S3);
Problem description A stamping device can be operated from three sides. A workpiece is
inserted via a guide, whereby it touches two of the three proximity
switches B1, B2 and B3. This causes a pneumatic cylinder 1A1 to ex-
tend via a solenoid valve (coil 1Y1), whereby a recess is to be stamped
into the workpiece. The stamping cycle is to be triggered only if two sig-
nal generators are addressed. For reasons of safety the cylinder must
be prevented from advancing, if all three proximity sensors are contact-
ed.
Positional sketch
1A1
B3
B1
B2
7.1 Drawing up the electrical circuit diagram and constructing the Implementation
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
7.2. Describing the control task by means of the function table and
the boolean equation
Describe the behaviour of the control system irrespective of technolo-
gy by means of a function table and the associated boolean equation.
WORKSHEET
I
24V
PLC
0V
Q
0V
Circuit diagram,
electro-pneumatic 1A1
1V1 4 2
1Y1
5 3
1
7.2 Describing the control task by means of the function table and
the boolean equation
Complete the function table:
Function table B1 B2 B3 1Y1
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Boolean equation
WORKSHEET
7.4 Formulation of the PLC program into one of the PLC program-
ming languages
Formulate the solution of the control task into one of these languages:
Function block diagram (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
PLC program
Question:
Why does the negated element have to occur in each parenthesis?
More than one final control element is addressed even in the case of Technical knowledge
simple control tasks.
This requires the PLC to actuate not just one but several outputs. In the
graphic languages this leads to the programming of several current
rungs or networks. These networks or current rungs may be optionally
provided with a network identifier. A network identifier is required if a
jump is to be executed to this network within the program.
Problem description A mixing plant permits a selection between two bulk materials per selec-
tor switch (S2). In switch position 1 (S2 = 0 signal), bulk material A
reaches a mixing container, if push button S1 is actuated
simultaneously.
Similarly, bulk material is conveyed, if selector switch S2 is in position 2
(S2 = 1 signal) and push button S1 is actuated. Silo A is opened via cy-
linder 1A1 (solenoid valve 1Y1), Silo B via cylinder 2A1 (solenoid valve
2Y1).
Positional sketch
2A1
1A1
S2
S1
Exercise definition 1. Drawing up the circuit diagram and constructing the circuit
2. Describing the control task by means of the function table and the
boolean equation
3. Declaration of the PLC program variables
4. Formulation of the PLC program into one of the PLC programming
languages
5. Testing and commissioning of PLC program and system
8.1 Drawing up the circuit diagram and constructing the circuit Implementation
Complete the electrical circuit diagram on the worksheet.
Assemble the required components on the slotted assembly board:
8.2 Describing the control task by means of the function table and
the boolean equation
Describe the behaviour of the controller irrespective of technology by
means of a function table and the associated boolean equation.
8.4 Formulation of the PLC program into one of the PLC program-
ming languages
Select one of languages supported by your PLC system for pro-
gramming. Suitable languages for the formulation of logic control sys-
tems are LD, FBD, IL and ST.
WORKSHEET
I
24V
PLC
0V
Q
0V
Circuit diagramm,
electro-pneumatic 1A1 2A1
1V1 4 2 2V1 4 2
1Y1 2Y1
5 3 5 3
1 1
8.2 Describing the control task by means of the function table and
the boolean equation
Complete the function table:
0 0
0 1
1 0
1 1
Boolean equation
WORKSHEET
8.4 Formulation of the PLC program into one of the PLC program-
ming languages
Formulate the solution of the control task into one of these languages:
Function block diagram (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
PLC program
Storage operations form part of the elementary PLC operations and ap- Technical knowledge
ply in cases where a briefly occurring signal status is permanently
stored. Typical examples of storage operations are the permanent set-
ting or resetting of output signals. The standard function blocks SR and
RS are available for the realisation of storage functions.
Fig. A9.1:
Function block SR
SR
BOOL S1 Q1 BOOL
BOOL R
FBD
SR_H2
SR flip-flop SR_H2 for storage of
SR status of variable H2.
S2 S1 Q1 H2 Direct assignment of value of Q1
R at variable H2.
LD
S2 H2
Rung with normally open contact
S
and set coil.
IL
LD S2 Reading of value of S2
S H2 Setting of the variable H2
or
CAL SR_H2 (S1 := S2) Invocation of flip-flop SR_H2 with
current transfer parameter S2.
LD SR_H2.Q1 Reading of output value Q1 of
flip-flop SR_H2.
ST H2 Assignment of read value to the
variable H2.
ST
SR_H2 (S1 := S2); Invocation of flip-flop SR_H2 using
a current transfer parameter.
H2 := SR_H2.Q1; Assignment of output value Q1 of
SR_H2 to the variable H2.
Positional sketch
H1
S1
1. Drawing up the electrical circuit diagram and constructing the circuit Exercise definition
2. Declaration of the PLC program variables
3. Formulation of the PLC program into one of the PLC programming
languages
4. Testing and commissioning of the PLC program and system
Implementation
9.1 Drawing up the electrical circuit diagram and constructing the
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
WORKSHEET
I
24V
PLC
0V
Q
0V
9.3 Formulation of the PLC program into one of the PLC program-
ming languages
Formulate the solution of the control task in one of these languages:
Function block diagram (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
WORKSHEET
PLC program
Question:
Which status information is stored in the SR function block?
Technical knowledge
Function block RS, dominant resetting flip-flop
Function block RS contains a dominant resetting flip-flop.
Fig. A10.1:
Function block RS
RS
BOOL S Q1 BOOL
BOOL R1
Table A10.1:
VAR
The storage function
S2 AT %IX5 : BOOL; (* Switch S2 at input IX5 *)
reset
H2 AT %QX6 : BOOL; (* Lamp H2 at output QX6 *)
RS_H2 : RS; (* RS flip-flop named RS_H2 *)
(* For storage of status *)
(* of H2 *)
END_VAR
FBD
RS_H2
RS flip-flop RS_H2 for storage of
RS status of the variable H2.
S Q1 H2 Direct assignment of value of
S2 R1 Q1 to the variable H2. 1 cm
LD
S2 H2
Rung with normally open contact
R
and reset coil.
Table A10.1:
The storage function
reset (continuation)
IL
LD S2 Reading of value of S2
R H2 Resetting of variable of H2
or
CAL RS_H2 (R1 := S2) Invocation of flip-flop RS_H2 using
current transfer parameter S2.
LD RS_H2.Q1 Reading of output value Q1 of
flip-flop RS_H2.
ST H2 Assignment of the read value to
the variable H2.
ST
Problem description The drill on a drilling unit is monitored by means of a drill breakage sen-
sor (B1).
If the drill is broken, the sensor interrupts the circuit. A buzzer (H1) is to
sound in this event. The buzzer can only be switched off via push button
S1.
Positional sketch
B1
H1
S1
Exercise definition 1. Drawing up the electrical circuit diagram and constructing the circuit
2. Declaration of the PLC program variables
3. Formulation of the PLC program into one of the PLC programming
languages
4. Testing and commissioning of the PLC program and system
10.1 Drawing up the electrical circuit diagram and constructing the Implementation
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
WORKSHEET
I
24V
PLC
0V
Q
0V
10.3 Formulation of the PLC program into one of the PLC pro-
gramming languages
Formulate the solution of the control task into one of these languages:
Function block diagram (FBD)
Ladder diagram (LD)
Instruction list (IL)
Structured text (ST)
WORKSHEET
PLC program
Question:
What is the resulting program sequence if a set dominant flip-flop is
used instead of a reset dominant flip-flop?
PLC applications frequently require the detection and evaluation not of a Technical knowledge
signal itself, but of the point of change of a signal. These signal changes
are described as edges.
Fig. A11.1:
rising rising Edges
edge edge
1
0
falling falling
edge edge
Rising (positive) edges mark the instant, during which a signal change
takes place from 0 to 1.
Falling (negative) edges mark the instant, during which a signal change
takes place from 1 to 0.
Function block R_TRIG for rising edge detection.This standard
function block is used for the detection of a rising edge.
Fig. A11.2:
Function block R_TRIG
R_TRIG
BOOL CLK Q BOOL
Fig. A11.3:
Function block F_TRIG
F_TRIG
BOOL CLK Q BOOL
FBD
RS_H1
R_TRIG_S1 H1 & RS
R_TRIG S Q1 H1
S1 CLK Q R1
&
H1
Examining signal S1 with function
block R_TRIG_S1 for rising edge.
Depending on the status of lamp H1,
a positive results leads to H1
being switched on or off.
Table A11.1:
LD (Continuation)
S1 H1 H1
Detection of a positive edge by
P / S means of a special edge contact.
Depending on the status of the
lamp, this may be switched on in
S1 H1 H1
the first rung and switched off in
P R the second rung.
IL
CAL R_TRIG_S1 (CLK := S1) Invocation of function
block R_TRIG_S1.
LD R_TRIG_S1.Q Depending on the result of
ANDN H1 the edge evaluation, the
lamp switched on ...
S H1
LD R_TRIG_S1.Q
AND H1
R H1 or off.
ST
R_TRIG_S1 (CLK := S1); Invocation of function block
R_TRIG_S1.
Since the conditions for switching the lamp on and off are mutually ex- Comment
clusive, a set dominant flip-flop may also be used instead of a reset
dominant one.
END_VAR
RS_S_old
RS
S_Edge S Q1 S_old
Signal R1
The program parts shown have been formulated in the language FBD as
an example.
The evaluation of a falling edge may be realised as illustrated below.
END_VAR
SR_S_old
RS
Signal S1 Q1 S_old
S_Edge R
Positional sketch
1B1
1B2
1A1
S1
Exercise definition 1. Drawing up the electrical circuit diagram and constructing the circuit
2. Declaration of the PLC program variables
3. Formulation of the PLC program into one of the PLC programming
languages
4. Testing and commissioning of the PLC program and system
11.1 Drawing up the electrical circuit diagram and constructing the Implementation
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
11.3 Formulation of the PLC program into one of the PLC pro-
gramming languages
Select one of the languages supported by your PLC system for pro-
gramming. Suitable languages for the formulation of logic control sys-
tems are LD, FBD, IL and ST.
WORKSHEET
I
24V
PLC
0V
Q
0V
Circuit diagram,
electro-pneumatic
1A1 1B1 1B2
1V1 4 2
1Y1
5 3
1
WORKSHEET
PLC program
Question 1:
What is understood by a negative edge?
Question 2:
What effect does the period of actuation have on the program
execution?
To be able to use standard function block TP for pulse time response Training aim
A large number of control tasks require the programming of time. Technical knowledge
Through EN 61131-3 (IEC 61131-3), standard function blocks are
available for timers with different time response.
Timers are available for the realisation of a pulse time response, a
switch-on signal delay and a switch-off signal delay.
Fig. A12.1:
Function block TP
TP
BOOL IN Q BOOL
TIME PT ET TIME
Table A12.1:
Use of a pulse timer VAR
S1 AT %IX1 : BOOL; (* Push button S1 *)
1Y1 AT %QX1 : BOOL; (* Coil 1Y1 for cylinder *)
TP_1Y1 : TP; (* Pulse timer named *)
(* TP_1Y1 for clamping process *)
END_VAR
FBD
TP_1Y1
Timer function block TP_1Y1,
TP
connected with the current
S1 IN Q 1Y1
parameters.
T#12s PT ET
LD
TP_1Y1
S1 1Y1
TP
Interconnecting timer function block
IN Q
TP_1Y1 into the rung.
T#12s PT ET
Table A12.1:
IL Use of a pulse timer
continuation
ST
Problem description Two components are to be bonded together with the help of a pneumatic
cylinder 1A1. To do this, the bonding surfaces are pressed together with
a defined force for 5 seconds. The time is commenced once the cylinder
advanves from its reacted end position (sensor 1B1=1). Once the 5
seconds have expired, the cylinder is to return to the initial position. The
bonding process is started by a push button S1.
Positional sketch
1A1
S1
Exercise definition 1. Drawing up the electrical circuit diagram and constructing the circuit
2. Declaration of the PLC program variables
3. Formulation of the PLC program into one of the PLC programming
languages
4. Testing and commisioning of the PLC program system
12.1 Drawing up the electrical circuit diagram and constructing the Implementation
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
WORKSHEET
I
24V
PLC
0V
Q
0V
Circuit diagram,
electro-pneumatic 1B1
1A1
1V1 4 2
1Y1
5 3
1
WORKSHEET
PLC program
Question 1:
Specify the name and the function of the parameters of the pulse timer.
Question 2:
What is the response of the timer, if a new start signal is given prior to
the timer expiring?
Complete the diagram.
Time response of
Pulse timer
IN 1
0
t0 t1 t2 t3
1
Q
0
t0 t0 + PT
5s
To be able to realise a switch-on signal delay by using the standard Training aim
function block TON
Technical knowledge
Function block TON, Switch-on signal delay
The standard function block TON is used to generate a switch-on signal
delay.
Fig. A13.1:
Function block TON
TON
BOOL IN Q BOOL
TIME PT ET TIME
Example The door of a bus will only close when the boarding area has been clear
for a specified period (5 seconds). This is monitored by means of a light
barrier.
Table A13.1:
Use of a VAR
Switch-on signal delay B1 AT %IX1 :BOOL; (* Light barrier *)
1Y1 AT %QX1 :BOOL; (* Coil 1Y1 for cylinder for closing *)
(* the door *)
TON_1Y1 :TON; (* Switch-on signal delay named *)
(* TON_1Y1 for closing of door *)
END_VAR
FBD
TON_1Y1
Connecting the inputs and outputs
TON
of function block TON_1Y1
B1 IN Q 1Y1
with current parameters.
T#5s PT ET
LD
TON_1Y1
B1 1Y1
TON
Interconnection of function block
IN Q
TON_1Y1 into the rung.
T#5s PT ET
Table A13.1:
IL Use of a Switch-on signal
delay (continuation)
ST
Positional sketch
1A1
S1
Exercise definition 1. Drawing up the electrical circuit diagram and constructing the circuit
2. Declaration of the PLC program variables
3. Formulation of the PLC program into one of the PLC programming
languages
4. Testing and commisioning of the PLC program system
13.1 Drawing up the electrical circuit diagram and constructing the Implementation
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
WORKSHEET
I
24V
PLC
0V
Q
0V
Circuit diagram,
electro-pneumatic
1A1 1B1 1B2
1V1 4 2
1Y1
5 3
1
WORKSHEET
PLC program
Question:
The embossing cycle has been initiated. However, the start button is
released before the 3 seconds have expired. What effect does this have
on the program execution?
To be able to realise a switch-off signal delay by using the standard Training aim
function block TOF
Technical knowledge
Function block TOF, switch-off signal delay
The standard function block TOF (Fig. A14.1) is used to generate a
switch-off signal delay.
Fig. A14.1:
Function block TOF
TOF
BOOL IN Q BOOL
TIME PT ET TIME
Example The door of a furnace includes a lock so that it cannot be opened in-
stantly during the burning process. If a signal is given to open the door,
this will only be unlocked after 10 minutes has expired.
Table A14.1:
Use of a VAR
switch-off signal delay Door_closed AT %MX1 : BOOL; (* Memory for latching of *)
(* furnace door *)
1Y1 AT %QX1 : BOOL; (* Coil 1Y1 for cylinder *)
(* opening of furnace door *)
TOF_Door : TOF; (* Switch-off signal delay *)
(* named TOF_Door *)
END_VAR
FBD
TOF__Door
Connection of inputs and outputs
TOF
of function block TOF_Door with
Door_closed IN Q 1Y1
current parameters.
T#10m PT ET
LD
TOF_Door
Door_closed 1Y1
TOF
Interconnection of function block
IN Q
TOF_Door into the rung.
T#10m PT ET
Table A14.1:
IL Use of a switch-off signal
delay (continuation)
ST
Problem description A workpiece is to be clamped by activating the start button S1. When the
workpiece is clamped by cylinder 1A1, cylinder 2A1 extends and em-
bosses the workpiece. Since the workpiece requires time to cool down, it
remains clamped for a period of 3 seconds. This time is started with the
advancing of cylinder 1A1.
Positional sketch
1A1
2A1
S1
Exercise definition 1. Drawing up the electrical circuit diagram and constructing the circuit
2. Declaration of the PLC program variables
3. Formulation of the PLC program into one of the PLC programming
languages
4. Testing and commisioning of the PLC program system
14.1 Drawing up the electrical circuit diagram and constructing the Implementation
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
WORKSHEET
I
24V
PLC
0V
Q
0V
Circuit diagram,
electro-pneumatic 1B1 1B2 2B1 2B2
1A1 2A1
1V1 4 2 2V1 4 2
WORKSHEET
PLC program
Question:
Through which signal is the time for the switch-off signal delay started?
To be able to design and represent simple sequence control systems Training aim
in accordance with IEC 60848.
To be able to program a sequence control system consisting of a lin-
ear sequence
To be able to use the programming language Sequential Function
Chart
Technical knowledge
Sequence control systems
Sequence control systems describe processes, which proceed in several
clearly separated steps.
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 pro-
cesses in relation to the process statuses established.
The program of a sequence control system must therefore fulfil three
basic exercises:
Fig. A15.1:
Fuctions of a
Executing actions: • Setting and resetting control program
of outputs
Step • Setting and resetting
of memories
• Setting and starting
timers and counters
Fig. A15.2:
Example of a
control program
When the PLC program is started, the step designated as initial step S1
automatically becomes active. A system is frequently moved into the
initial position as a result of the initial step. In the example shown, step
S1 is a void step. If the subsequent step enabling conditions – cylinder
1A1 and 2A1 are retracted and the magazine contains workpieces – are
met, step S2 is set and step S1 reset. It should be noted that the step
names represent names in the sense of EN 61131-3 (IEC 61131-3).
They must therefore start with a letter or an underline. In addition, inso-
far as this is possible for the process concerned, a feedback variable is
specified in the third field of each action indicating the end of the action.
In step S2, cylinder 1A1 is extended by setting coil 1Y1. When this cylin-
der has reached its forward end position and the workpiece is in the cor-
rect position (B6 = 1), step S2 is reset and step S3 activated. Cylinder
1A1 remains extended as a result of the S-qualifier. In step S3, cylinder
2A1 advances due to coil 2Y1 being set and transfers the workpiece to a
slide. Cylinder 2A1 retracts again once it has reached its forward end
position. If sensor 2B1 signals that the retracted end position of cylinder
2A1 has been reached, cylinder 1A1 also retracts. Sensor 1B1 now sig-
nals the end of the sequence and the program returns to the start. The
complete step sequence is repeated again.
Fig. A15.3:
Example of VAR
sequential function chart 1Y1 AT %QX1 : BOOL; (* Coil 1Y1 for cylinder 1A1 *)
2Y1 AT %QX2 : BOOL; (* Coil 2Y1 for cylinder 2A1 *)
B5 AT %IX1 : BOOL; (* Workpiece in magazine *)
B6 AT %IX2 : BOOL; (* Workpiece ejected *)
1B1 AT %IX3 : BOOL; (* Cylinder 1A1 retracted *)
1B2 AT %IX4 : BOOL; (* Cylinder 1A1 extended *)
2B1 AT %IX5 : BOOL; (* Cylinder 2A1 retracted *)
2B2 AT %IX6 : BOOL; (* Cylinder 2A1 extended *)
END_VAR
S1
B5 &
1B1
2B1 S2 S 1Y1 1B2
B6 &
1B2
S3 S 2Y1 2B2
2B2
S4 R 2Y1 2B1
2B1
S5 R 1Y1 1B1
1B1
Fig. A15.4:
Representation of a step
Step n-1 &
S Q Step n
Step enabling
condition for step n
Step n+1 R
As shown in Fig. A15.4, the start conditions for any step n (within a step
sequence) are:
The preceding step n-1 is set
The step enabling condition for step n is met
Each step is reset by the set subsequent step.
In this way, the individual steps of a step sequence are processed con-
secutively.
The structure of a step sequence is set out in detail in Fig. A15.5. The
language FBD is used for the programming of the control task in Fig.
A15.2. All actions occur as boolean actions.
END_VAR
RS_S1
1B1 &
2B1 RS (* Setting of *)
S Q1 (* flip-flop for *)
(* Step S1 *)
RS_S2.Q1 R1
RS_S1.Q1 &
1B1 RS_S2
2B1
B5 RS (* Setting of *)
S Q1 (* flip-flop for *)
(* Step S2 *)
RS_S3.Q1 R1
Fig. A15.5:
RS_S2.Q1 & Example of a step
RS_S3 sequence with
1B2 RS storage elements
B6 RS (* Setting of *) (continuation)
S Q1 (* flip-flop for *)
(* Step S3 *)
RS_S4.Q1 R1
RS_S4
RS_S3.Q1 &
2B2 RS (* Setting of *)
S Q1 (* flip-flop for *)
(* Step S4 *)
RS_S5.Q1 R1
RS_S5
RS_S4.Q1 &
2B1 RS (* Setting of *)
S Q1 (* flip-flop for *)
(* Step S5 *)
RS_S1.Q1 R1
RS_1Y1
RS
*)
RS_S2.Q1 S Q1 1Y1 (* Cylinder 1A1 *)
RS_S5.Q1 R1
RS_2Y1
RS
(* Coil 2Y1 for *)
RS_S3.Q1 S Q1 2Y1 (* Cylinder 2A1 *)
RS_S4.Q1 R1
Positional sketch
2A1
1A1
1. Drawing up the electrical circuit diagram and constructing the circuit Exercise definition
2. Describing the control task in function chart to IEC 60848.
3. Declaration of the PLC program variables
4. Formulation of the program into a sequential function chart
– Programming transition conditions directly in one of the languages
FBD, LD or ST
– Specifying actions as boolean actions
5. Testing and commisioning of the PLC program system.
Implementation 15.1 Drawing up the electrical circuit diagram and constructing the
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
WORKSHEET
I
24V
PLC
0V
Q
0V
Circuit diagram,
electro-pneumatic 1B1 1B2 2B1 2B2
1A1 2A1
1V1 4 2 2V1 4 2
1Y1 2Y1
5 3 5 3
1 1
WORKSHEET
PLC program
in sequential function chart
WORKSHEET
Question 1:
What is the function of a step without associated actions?
Question 2:
What is the response of the sequential function chart program if the ac-
tion of step S3: "Cylinder 2A1 to advance" is programmed as a non-
stored action?
Technical knowledge
Sequence control system with alternative branching
There are sequence control systems, where several different sequences
may occur. A sequence is selected depending on the signals originating
from the process applied.
Fig. A16.1:
Example of a sequence
control system with
alternative branching
1 Check initial position
6 S unclamp part 1
7 N eject part 1
A stamping tool, which stamps small or large parts by means of two dif-
ferent cylinders, represents an example of such a sequence control sys-
tem.
Fig. A16.1 illustrates the function chart to IEC 60848 for the above men-
tioned example.
Alternative branching is represented by as many transitions below the
horizontal line as there are different sequences possible.
In order to select one option only, the transition conditions must be mu-
tually exclusive.
Two sequences are available for selection in the example given. If a
small part is detected, only steps 1, 2, 3, 6 and 7 are processed. If a
large part is present, the program branches to step 4, 5, 6 and 7 after
step 1.
END_VAR
S1
1B2 1B2
2B2 3B2
S6 R 1Y1 1B1
1B1
S7 N 4Y1 4B2
4B2
In the above example, the actions for steps S3, S5 and S7 are pro-
grammed as non-stored. This is indicated by the qualifier N. The boole-
an variables 2Y1, 3Y1 and 4Y1 therefore only carry a 1-signal while the
associated steps are active.
If the sequential function chart is not available for programming, the step
sequences may also be generated in this instance by means of using
storage elements.
Problem description Packages are conveyed past a linear measuring device on a roller con-
veyor in order to establish their size. There are two different package
sizes: Short and long packages. The linear measuring device supplies
an 0-signal for a short package and a 1-signal for a long package.
Following this, the packages reach a lifting platform. The sequence is
started by means of START button S1. The packages are lifted by a
lifting cylinder 1A1. The packages are then sorted: Short packages are
transferred to a second conveyor via transfer cylinder 2A1, and long
packages onto a third conveyor via cylinder 3A1. Lifting cylinder 1A1 is
to retract again only after cylinders 2A1 or 3A1 have reached their end
position.
The cylinder positions are monitored by means of proximity switches
1B1 to 3B2. Cylinder 1A1 is advanced and retracted by means of a dou-
ble solenoid valve via coils 1Y1 and 1Y2. Cylinders 2A1 and 3A1 are
advanced and retracted by means of solenoid valves (coils 2Y1 and
3Y1).
Positional sketch
2A1 3A1
S1
1A1
1. Drawing up the electrical circuit diagram and constructing the circuit Exercise definition
6. Describing the control task in function chart to IEC 60848.
7. Declaration of the PLC program variables
8. Formulation of the program into a sequential function chart
– Programming transition conditions directly in one of the languages
FBD, LD or ST
– Specifying actions as boolean actions
9. Testing and commisioning of the PLC program system.
Implementation 16.1 Drawing up the electrical circuit diagram and constructing the
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
WORKSHEET
I
24V
PLC
0V
Q
0V
Question 1:
What is the sorting criteria according to which the packages are evaluat-
ed?
WORKSHEET
Question 2:
How do you ensure that just one sequence step is selected during pro-
gram execution?
PLC program
in sequential function chart
Question:
Specify the transition condition, which is always true. Why are such tran-
sition conditions formulated?
To be able to realise counting cycles by means of using the standard Training aim
function modules CTU or CTD
Counting cycles form part of the basic operations of a PLC. EN 61131-3 Technical knowledge
(IEC 61131-3) defines the three standard function blocks CTU (incre-
mental counter), CTD (decremental counter) and CTUD (incremen-
tal/decremental counter) for the realisation of these operations.
Fig. A17.1:
Function block CTU
CTU
BOOL CU Q BOOL
BOOL R
INT PV CV INT
Fig. A17.2:
Function block CTD
CTD
BOOL CD Q BOOL
BOOL LD
INT PV CV INT
Table A17.1:
VAR Application of an
B1 AT %IX1.0 : BOOL; (* detects part to be packaged *) incremental counter
M_init AT %MX1.0 : BOOL; (* detects whether counter *)
(* needs to be initialised *)
M_new AT %MX1.1 : BOOL; (* detects whether new box *)
(* is required *)
CTU_1 : CTU; (* Incremental counter named *)
(* CTU_1 for counting cycle *)
END_VAR
FBD
CTU_1
Function block CTU_1,
CTU
connected with the current
B1 CU Q M_new
parameters.
M_init R
12 PV CV
LD
CTU_1
B1 M_new
CTU
CU Q
M_init Interconnection of function block
CTU_1 in the rung.
R
12 PV CV
Table A17.1
Application of an
incremental counte IL
(continuation)
ST
10 parts at a time are stamped on a machine. The program cycle is Problem description
started by means of a push button S1. The proximity switch B4 signals
"Part in magazine". A part is fed towards the machine by means of a
cylinder 1A1 and clamped. It is then stamped via cylinder 2A1, and sub-
sequently ejected by means of an ejecting cylinder 3A1.
The clamping cylinder 1A1 operates via a double solenoid valve with two
coils 1Y1 (clamping) and 1Y2 (unclamping). Cylinders 2A1 and 3A1 are
powered by spring-return solenoid valves with the coils 2Y1 and 3Y1.
The cylinder positions are monitored by means of the proximity switches
1B1 to 3B2.
Positional sketch
2A1
3A1
1A1
S1
Exercise definition 1. Drawing up the electrical circuit diagram and constructing the circuit
2. Describing the control task in function chart to IEC 60848.
3. Declaration of the program variables
4. Formulation of the program in sequential function chart
– Programming the transition conditions in one of languages FBD,
LD or ST
– Specifying the actions
5. Testing and commisioning of the PLC program system.
Implementation
17.1 Drawing up the electrical circuit diagram and constructing the
circuit
Complete the electrical circuit diagram on the worksheet.
Assemble the required equipment on the slotted assembly board:
WORKSHEET
I
24V
PLC
0V
Q
0V
WORKSHEET
PLC program
in sequential function chart
Question:
When does the status of a counter change?