PLC Introduction Lab Manual V5 (1)
PLC Introduction Lab Manual V5 (1)
INTRODUCTION TO PLCs
May, 2021
1 / 11
Contents
OBJECTIVES 3
BACKGROUND READING 3
BASIC LOGIC FUNCTIONS 4
INTRODUCTION USING A CONTROL UNIT 5
TRAFFIC LIGHT CONTROL 7
Objective 7
Equipment Description 7
Work Schedule 7
Functional description and problem definition 8
Assignment list 9
APPENDIX A: USE OF TIMERS 11
APPENDIX B: SOFTWARE AND SIMULATOR DOWNLOAD 11
2 / 11
1 OBJECTIVES
1. To acquire an overview of PLCs and the Basic PLC architecture.
2. To appreciate the differences between PLC, relay and PC-based control.
3. To understand basic ladder logic symbols.
4. To write PLC ladder logic for simple applications.
5. To download and run PLC programs.
6. To design and implement a PLC control program in Ladder Logic to control traffic lights at a
cross junction.
The objectives are to be met through the actual lab work as well as through the pre-lab
preparation and reading of the recommended and other material.
2 BACKGROUND READING
Ensure you go through the following material. The first two can be found on the eLearning
platform and the last one on the internet (Google “S7-200 manual”):
● Chapter 1: Introduction to PLCs
● Chapter 2: Basic Ladder Logic Programming (NB: the PLCs in this document are based
on Allen-Bradley PLCs but the concepts are also applicable to Siemens PLCs, which we
use in the lab).
● S7-200 Manual. Specifically, go through the following sections:
o Creating a Simple Program (Pg. 10 – 14).
o Understanding how the S7-200 executes your control logic (Pg. 24).
o Accessing the data of the S7-200 (Pg. 27 – 28).
o Bit Logic Instructions (Pg. 70 & 72 – 74).
o Compare Instructions (Pg. 96 – 97).
o Timer Instructions (Pg. 196 – 200).
3 / 11
3 BASIC LOGIC FUNCTIONS
The diagrams below show some logic functions that can be achieved using ladder diagrams.
4 / 11
4 INTRODUCTION USING A CONTROL UNIT
NB: for the exercises below, follow the simple steps outlined below:
1. Based on the Functional Description (design requirement) given, identify all the inputs and
outputs needed and write up an assignment list (illustrated in Appendix A) that specifies the
memory addresses for each of those inputs and outputs.
2. Design the control task using LADDER diagrams. This should be done using pen and paper
and discussed in the group.
3. In the STEP 7-Micro/WIN, populate the symbol table using the assignment list you came up
with in no. 1 above. In the symbol table ensure you include meaningful comments for all the
memory addresses you are using.
4. Enter the control program in the Program Block editor of the STEP 7-Micro/WIN.
5. Download and run the program entered and correct existing errors. For troubleshooting, the
Program Status view is useful for seeing the status of various elements in the ladder diagram.
6. If your program is running satisfactorily, export/print the program to a pdf. Ensure you select
the check boxes for Program Block and Symbol Table as you are printing to pdf. This pdf
will be required in the final report.
5 / 11
1. Based on an understanding of the basic logic functions and in conjunction with the Control
Unit of the TSM-700/EV implement and test ladder logic to achieve the following:
i. When S1 is pressed once, the lamp for S1 comes on and stays on until S2 is pressed once.
ii. When S1 and S3 are pressed simultaneously they both come on and stay on until S2 and
S4 are both pressed simultaneously i.e. for S1 and S3 to come on, they both have to be
pressed; similarly, for S1 and S3 to go off once turned on, both S2 and S4 have to be
pressed.
In both cases, pressing the emergency stop (S0) should turn of any lamp that is on.
2. Design and implement a ladder diagrams that result in the following operations:
i. The lamps for S1 and S3 flash on and off (simultaneously) at a frequency of 0.5 Hz.
ii. The lamps for S2 and S4 flash on and off (simultaneously) at frequency 0.5 Hz. This
should be at the same time as S1 and S3 are flashing on and off; the operation should be
such that when the green lamps (S1 and S3) are on, the red lamps (S2 and S4) are off, and
vice versa.
iii. A running light. The lamps turn and off in the following infinite sequence:
S1-S2-S3-S4-S1-S2-S3-S4-…
There should only be one lamp on at a time and each lamp comes on for 0.5s.
Hint: for no. 2 above, you will need to use Timer and Compare Instructions (see Appendix
B). See also the simple example given in the S7-200 Manual, pg. 12. Note that Compare
Instructions can be connected in series, if necessary, to achieve different results.
6 / 11
5 TRAFFIC LIGHT CONTROL
5.1 Objective
To design and implement a PLC control program in Ladder Logic to control traffic lights at a
cross junction.
7 / 11
5. Read the program entered and correct existing errors.
6. Function-test the control with the simulators.
7. Save the function-tested control program on the programming device
8. Document the function-tested control program.
8 / 11
5.5 Assignment list
OPERAND
(MEMORY SYMBOL COMMENT
ADDRESS)
To initialize the system; to confirm a change
I_RESET_TRAFFIC_LIGHT
from day to night and vice versa
I_DAY_NIGHT day/night switch
Q_RED1 Output for red light of Traffic Light 1
Q_YELLOW1 Output for yellow light of Traffic Light 1
Q_GREEN1 Output for green light of Traffic Light 1
Q_RED2 Output of red light of Traffic Light 2
Q_YELLOW2 Output of yellow light of Traffic Light 2
Q_GREEN2 Output of green light of Traffic Light 2
9 / 11
Fig. 2: Day and Night operation
10 / 11
APPENDIX A: USE OF TIMERS
To learn more about timers and compare instructions read the following material
● Timers (especially TON): pg. 196 – 200 of S7-200 Manual
● Compare Instructions: pg 96-97 of S7-200 Manual
These are the Instruction Sets for those commands. The manual can be found on the elearning
portal or easily be downloaded from the internet. If you search for “S7-200 manual” the first
result is a pdf of the manual. Be sure to read through those pages, including the given examples
and timing diagrams of the timers.
Feel free to read other parts of the Instruction Set (chapter 6) or of the manual. It is always a
good point of reference whenever in doubt.
● S7-200 simulator
11 / 11