0% found this document useful (0 votes)
78 views40 pages

Lab02-Basic Logic Operations

The document describes an exercise involving programming a PLC to control a lamp circuit. It includes details about the circuit components, programming languages that can be used, and steps to describe the control task, declare variables, write the program, test it and document the solution.

Uploaded by

Nguyen Pham Khoi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views40 pages

Lab02-Basic Logic Operations

The document describes an exercise involving programming a PLC to control a lamp circuit. It includes details about the circuit components, programming languages that can be used, and steps to describe the control task, declare variables, write the program, test it and document the solution.

Uploaded by

Nguyen Pham Khoi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

A-19

Exercise 3

Programmable logic controllers Subject Subject

Lamp circuit Title


The assignment function

 To understand the actuation of a PLC output Training aim


 To be able to realise the logic assignment function with a PLC
 To be able to create a PLC program in accordance with EN 61131-3
(IEC 61131-3)

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.

The assignment function


The assignment function permits a PLC input signal to be directly trans-
mitted to a PLC output. The behaviour can be clearly described with the
help of a function table, which represents this for an input %IX1 and an
output %QX2 in table A3.1.

%IX1 %QX2 Table A3.1:


Function table for the
0 0 assignement function
1 1

© Festo Didactic 093314


A-20
Exercise 3

In order to realise the assignment function in the individual programming


languages, you will need the commands shown in table A3.2.

Table A3.2:
The assignment function LD

%IX1 %QX2
Current rung with normally
open contact and non-stored coil.

FBD

Direct connection of specified


%IX1 %QX2
input and output.

IL

Reading of value of specified


LD %IX1
input to accumulator.

Storage of contents of
ST %QX2
accumulator to specified output.

ST

%QX2 := %IX1; Assignment of value of specified


input to the right of " := " to
the specified output on the left
of " := ".

© Festo Didactic 093314


A-21
Exercise 3

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

© Festo Didactic 093314


A-22
Exercise 3

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:

Components list Quantity Description

1 Programmable logic controller


1 Interconnecting cable for connection unit
1 Connection unit
1 Signal input, electrical
1 Signalling device

 Prior to wiring: Switch off power supply!

 Establish the electrical connections.

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.3 Declaration of the PLC program variables


 All variables are to be created as program-local variables.
 Specify only those parts of the declaration required for your PLC ap-
plication. These are: Designation, data type, address – only if directly
addressed variables are used – and variables comment.

The component parts of the declaration of variables in this exercise sec-


tion are represented in tabular form. If actual PLC systems are used, the
input and representation of the variables declaration is dependent on the
PLC programming system used.

© Festo Didactic 093314


A-23
Exercise 3

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.

3.5 Testing and commissioning of PLC program and system


 Prior to commissioning of the installation:
Check the assembled circuit with the help of the circuit diagrams!
 Commissioning of the installation:
Switch on power supply using a standard voltage of 24 V DC!

 Load the program to the PLC.


 Carry out a function check.
 Correct any errors occurring in the PLC program.
 Document your solution.

© Festo Didactic 093314


A-24
Exercise 3

© Festo Didactic 093314


A-25
Exercise 3

WORKSHEET

3.1 Drawing up the electrical circuit diagram and constructing the


circuit
Complete the electrical circuit diagram and enter the available input and
output addresses of your PLC.

+24V Circuit diagram, electrical


0V

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

Derive the boolean equation from this:

Booleam equation

© Festo Didactic 093314


A-26
Exercise 3

3.3 Declaration of PLC program variables


Declare the variables required in the PLC program:

Declaration of variables Designation Data type Address Comment

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)

© Festo Didactic 093314


A-27
Exercise 3

Worksheet

PLC program

© Festo Didactic 093314


A-28
Exercise 3

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.

© Festo Didactic 093314


A-29
Exercise 4

Programmable logic controllers Subject

Burglar alarm Title


The NOT function

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

%IX1 %QX2 Table 4.1:


Function table for NOT
0 1 function
1 0

© Festo Didactic 093314


A-30
Exercise 4

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

Use NOT function at


%IX1 NOT %QX2
specified input.

IL

Reading of negated value of


LDN %IX1
specified input to accumulator.

Storage of contents of
ST %QX2
accumulator to specified output.

ST

%QX2 := NOT %IX1; Assignment of negated value of


specified input to the output on
the left of " := ".

© Festo Didactic 093314


A-31
Exercise 4

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

© Festo Didactic 093314


A-32
Exercise 4

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:

Components list Quantity Description

1 Programmable logic controller


1 Interconnecting cable for connection unit
1 Connection unit
1 Signal input, electrical
1 Signalling device

 Prior to wiring: Switch of power supply!

 Establish the electrical connections.

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.3 Declaration of PLC program variables


 All variables must be created as program-local variables.
 Specify only those parts of the declaration required for your PLC
application. These are: Designation, data type, address – only if
directly addressed variables are used – and variables comment.

The component parts of the declaration of variables in this exercise sec-


tion are represented in tabular form. If actual PLC systems are used, the
input and representation of the variables declaration is dependent on the
PLC programming system used.

© Festo Didactic 093314


A-33
Exercise 4

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.

4.5 Testing and commissioning of the PLC program and system


 Prior to commissioning of the installation:
Check assembled circuit with the help of the circuit diagrams!
 Commissioning of the installation:
Switch on power supply using a standard voltage of 24 V DC!

 Load the program to the PLC.


 Carry out a function check.
 Correct any errors occurring in the PLC program.
 Document your solution.

© Festo Didactic 093314


A-34
Exercise 4

© Festo Didactic 093314


A-35
Exercise 4

WORKSHEET

4.1 Drawing up the electrical circuit diagram and constructing the


circuit
Complete the electrical circuit diagram and enter the available input and
output addresses for your PLC.

+24V Circuit diagram, electrical


0V

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

Derive the boolean equation from this:

Boolean equation

© Festo Didactic 093314


A-36
Exercise 4

4.3 Declaration of the PLC program variables


Declare the variables required in the PLC program:

Declaration of variables Designation Data type Address Comment

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)

© Festo Didactic 093314


A-37
Exercise 4

WORKSHEET

PLC-program

© Festo Didactic 093314


A-38
Exercise 4

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?

© Festo Didactic 093314


A-39
Exercise 5

Programmable logic controllers Subject

Press with protective guard Title


The AND function

 To be able to realise a logic AND function with a PLC Training aim


 To understand the term ’function’ according to EN 61131-3
(IEC 61131-3)
 To be able to use standard functions to EN 61131-3 (IEC 61131-3)

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 AND function


Only when all AND connected signals are 1, is the result 1. If one of the
connected signals is 0, then the result is also 0.

The function table for the AND function is illustrated below for the two
inputs %IX1 and %IX2 as well as %QX3.

%IX1 %IX2 %QX3 Table A5.1:


Function table
0 0 0 for the AND function
0 1 0
1 0 0
1 1 1

© Festo Didactic 093314


A-40
Exercise 5

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

%IX1 %IX2 %QX3


Rung with consecutively switching
normally open contacts

FBD

%IX1 & %QX3


%IX2
The inputs and the output of the
AND function are connected with
oder
the specified current parameters.
%IX1 AND %QX3
%IX2

IL

Reading the value of the specified


LD %IX1 input to the accumulator.
AND connection of current result
AND %IX2
with second input.
ST %QX3 Storage of contents of accumulator
to specified output.

ST

%QX3 := %IX1 & %IX2; The two specified inputs are


connected with the "&" operator.
The result is assigned to the
or
specified output.

%QX3 := AND(%IX1, %IX2); Invocation of AND function with


specified inputs as current
transfer parameters.

© Festo Didactic 093314


A-41
Exercise 5

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

© Festo Didactic 093314


A-42
Exercise 5

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:

Components list Quantity Description

1 Programmable logic controller


1 Interconnecting cable for connection unit
1 Connection unit
1 Service unit
1 Manifold
1 Double-acting cylinder
1 5/2-way single solenoid valve
1 Signal input, electrical
1 Proximity switch
Plastic tubing

 Prior to wiring and tubing:


Switch off power supply!
Switch off air supply at service!

 Establish the electrical and pneumatic connections.

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.

© Festo Didactic 093314


A-43
Exercise 5

5.3 Declaration of the PLC program variables


 All variables are to be created as program-local variables.
 Specify only those parts of the declaration, which are required for
your PLC application. These are: Designation, data type, address –
only if directly addressed variables are used – and variables
comment.

The component parts of the declaration of variables in this exercise sec-


tion are represented in tabular form. If actual PLC systems are used, the
input and representation of the variables declaration is dependent on the
PLC program system used.

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.

5.5 Testing and commissioning of PLC program and system


 Prior to commissioning of the installation:
Check the assembled circuit with the help of the circuit diagrams!
 Commissioning of the installation:
Switch on power supply using a standard voltage of 24 V DC!
Increase air supply at the service unit to operating pressure (see data
sheets for pneumatic components)!
 Operation of the installation:
Keep clear of the operational parts of the installation!

 Load the program to the PLC.


 Carry out a function check.
 Correct any errors occurring in the PLC program.
 Document your solution.

© Festo Didactic 093314


A-44
Exercise 5

© Festo Didactic 093314


A-45
Exercise 5

WORKSHEET

5.1 Drawing up the electro-pneumatic and the electrical circuit dia-


gram and constructing the circuit
Complete the electrical circuit diagram and enter the available input and
output addresses for your PLC.

+24V Circuit diagram, electrical


0V

I
24V
PLC
0V
Q

0V

© Festo Didactic 093314


A-46
Exercise 5

Configure the control system.

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

Derive the boolean equation from this:

Boolean equation

© Festo Didactic 093314


A-47
Exercise 5

WORKSHEET

5.3 Declaration of the PLC program variables


Declare the variables required in the PLC program:

Designation Data type Address Comment Declaration of variables

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)

© Festo Didactic 093314


A-48
Exercise 5

PLC-Program

Question:
Does output 1Y1 have to be set stored or non-stored?

© Festo Didactic 093314


A-49
Exercise 6

Programmable logic controllers Subject

Bell system Title


The OR function

 Realising the logic OR function with a PLC. Training aim

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.

%IX1 %IX2 %QX3 Table A6.1:


Function table
0 0 0 for the OR function
0 1 1
1 0 1
1 1 1

© Festo Didactic 093314


A-50
Exercise 6

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

%IX1 >=1 %QX3


%IX2
The inputs and the output of the
OR function are connected with
or
the current parameters specified.
%IX1 OR %QX3
%IX2

IL

Reading the value of the specified


LD %IX1 input to the accumulator.
OR connection of current result
OR %IX2
withsecond input.
ST %QX3 Storage of contents of accumulator
to specified output.

ST

%QX3 := %IX1 OR %IX2; The two specified outputs are


connected with the operator "OR".
The result is assigned to the
specified output.

© Festo Didactic 093314


A-51
Exercise 6

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

© Festo Didactic 093314


A-52
Exercise 6

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:

Components list Quantity Description

1 Programmable logic controller


1 Interconnecting cable for connection unit
1 Connection unit
1 Signal input, electrical
1 Signalling device

 Prior to wiring the installation:


Switch off power supply!

 Establish the electrical connection.

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.

© Festo Didactic 093314


A-53
Exercise 6

6.3 Declaration of PLC program variables


 All variables must be created as program-local variables.
 Specify only those parts of the declaration required for your PLC ap-
plication. These are: Designation, data type, address – only if directly
addressed variables are used – and variables comment.

The component parts of the declaration of variables in this exercise sec-


tion are represented in tabular form. If actual PLC systems are used, the
input and representation of the variables declaration is dependent on the
PLC programming system used.

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.

6.5 Testing and commissioning of the PLC program and system


 Prior to commissioning of the installation:
Check assembled circuit with the help of the circuit diagrams!
 Commissioning of the installation:
Switch on power supply using a standard voltage of 24 V DC!

 Load the program to the PLC.


 Carry out a function check.
 Correct any errors occurring in the PLC program.
 Document your solution.

© Festo Didactic 093314


A-54
Exercise 6

© Festo Didactic 093314


A-55
Exercise 6

WORKSHEET

6.1 Drawing up the electrical circuit diagram and constructing the


circuit
Complete the electrical circuit diagram and enter the available input and
output addresses for your PLC.

+24V Circuit diagram, electrical


0V

I
24V
PLC
0V
Q

0V

© Festo Didactic 093314


A-56
Exercise 6

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

Derive the boolean equation from this:

Boolean equation

6.3 Declaration of the PLC program variables


Declare the variables required in the PLC program:

Declaration of variables Designation Data type Address Comment

6.4 Formulation of the PLC program into one of the PLC


programming 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)

© Festo Didactic 093314


A-57
Exercise 6

WORKSHEET

PLC program

© Festo Didactic 093314


A-58
Exercise 6

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

© Festo Didactic 093314

You might also like