You are on page 1of 11

3.

0 Theory
The instructions from a ladder diagram, mnemonic, or SFC are translated to machine
code that can be stored in the PLC memory. The logic in a ladder diagram typically flows
from left to right. The diagram can be divided into sections called rungs, which are
roughly analogous to the rungs on a ladder. Each rung typically consists of a combination
of input instructions. These instructions lead to a single output instruction; however,
rungs containing function block instructions may be more complicated. There are three
basic symbols used in ladder logic.
The first one is NO - NC contacts. NO contact is an instruction that tells the processor to
look at a specific bit in its RAM memory. If the bit is 1, the instruction is true. and if it is
0, the instruction is false.

Normally Open Contact


NC contact plays the same role as the previous one, except that if the bit addressed is 1,
the instruction is false and if it is 0, the instruction is true.

Normally Closed Contact


The second symbol is output. It is use for outputting to output module. If the instructions
to the left on its rung have a true path, then the PLC will set the bit to which it is
referenced via the address to 1. If no complete true path is available, the bit is set to 0.

Device Output
The third symbol is special instruction boxes: Along with the basic logic instructions
addressed in the previous part, PLCs are microprocessor-based and they facilitate a wide
area of useful built in functions like timers, counters, comparators.
IN
PT
Counter

TON

3.1 Procedure
1. Three PLC instructions are given hereunder. Each of them is run using the
available S7-200 CPU and Input Simulator.
2. For Exercise 1a: Controlling lamps by toggle switcher is created using simulation
interface. Figure 3.1 shows the circuit for exercise 1a.
3. After the circuit simulation is downloaded and played, switch 1 is activated and
the result is observed and recorded.
4. Switch 1 & switch 2 are both activated and the result is recorded.
5. The difference between rung 1 and rung 2 is discussed and recorded.
6. The input I0.3 is replace by Q0.0, the condition for the second lamp to light up is
observed and the result is recorded.

7. For Exercise 1b: Controlling an electrical motor by push buttons and overload
relay is created using simulation interface. Figure 3.2 shows the circuit for
exercise 1b.
8. After the circuit simulation is downloaded and played, Start Pushbutton is
activated and the result is recorded.
9. Stop Pushbutton is activated and the result is discussed and recorded.
10. The input elements I0.0 and I0.1 are interchanged, the result is recorded and
discussed.
11. The effect of having an overload relay is discussed and recorded.

12. For Exercise 1c: Controlling a pilot light by Timers is created using simulation
interface. Figure 3.3 shows the circuit for exercise 1c.
13. After the circuit simulation is downloaded and played, Start Pushbutton is
activated and the result is recorded.
14. Stop Pushbutton is activated and the result is discussed and recorded.
15. The input elements I0.0 and I0.1 are inter-changed, the result is recorded and
discussed.

16. For Exercise 2: Traffic Light Simulation is created using simulation interface.
17. The sequence of traffic light is set up as the condition given: Red
5 seconds later
Red and Amber
5 seconds later
Green
5 seconds delay

18. A ladder diagram is developed based on the conditions given.


19. The results is observed and discussed.

4.0 Observation and Data Collection


Exercise 1(a) Controlling lamp by toggle switches
Element
Toggle switch 1
Toggle switch 2
Toggle switch 3
Toggle switch 4
Indicator light 1
Indicator light 2

Address
I0.0
I0.1
I0.3
I0.4
Q0.0
Q0.1

Remarks
Input of rung 1
Input of rung 1
Input of rung 2
Input of rung 2
Output of rung 1
Output of rung 2

In rung 1, when the switch 1 is activated, the output lamp has no response. There is no
output when the switch 1 is activated. However when both the switch 1 and switch 2 are
both activated, the lamp (Q0.0) is lighted up.
In rung 2, either the switch 3 (I0.3) or switch 4 (I0.4) is activated, the output lamp Q0.1 is
lighted up. In another word, only one switch is needed to give the output.
After the input I0.3 is replaced by the rung 1 output Q0.0, the output lamp Q0.1 is only
lighted up when both the I0.0 and I0.1 is activated or when I0.4 is activated.

Exercise 1(b) Controlling an electrical motor by push buttons and overload relay
Element
Start Pushbutton (NO)
Stop Pushbutton (NC)
Overload Relay
Motor starter

Address
I0.0
I0.1
I0.2
Q0.0

Remarks
Input
Reverse of input
Reverse of input
Output

When Start Pushbutton (I0.0) is activated, the lamp (Q0.0) lighted up. The lamp Q0.0
continued to light up although the input I0.0 is deactivated sooner. When either the Stop
Pushbutton (NC) I0.1 or I0.2 is activated, the lamp is turn off.
After the input I0.0 and I0.1 are interchanged, the output results changed. The output
lamp (Q0.0) is lighted up when input I0.0 is activated, however when it is released, the
lamp turn off. It cannot sustain continuous output as before interchange the input I0.0 and
I0.1.

Exercise 1(c) Controlling a pilot light by Timers


Element
Start Pushbutton (NO)
Stop Pushbutton (NC)
On-Delay Timer (TON)

Address
I0.0
I0.1
T37

Remarks
Input
Reverse of input
Delay of input

When the Start Pushbutton I0.0 is activated, the pre-set timer 150ms started to run. When
the timer reached 150ms, the on-delay timer (T37) is activated and the lamp lighted up.
When the Stop Pushbutton I0.1 is activated, the timer stop running and the lamp turn off.
When the input elements I0.0 and I0.1 are interchanged, the lamp sustain the continuous
output. The lamp lighted up as long as the input I0.0 is activated and the lamp turn off
when the Stop Pushbutton I0.1 is activated. It can sustain continuous output as before
interchange the input I0.0 and I0.1.

5.0 Discussion
Exercise 1(a) Controlling lamp by toggle switches
The obvious difference between the rung 1 and rung 2 is the connection of the switches.
In rung 1 the toggle switches are connected in series whereas rung 2 toggle switches are
arranged in parallel. In the series connection (rung 1), both the two switches I0.0 and I0.1
are needed to activate to give output on the lamp. This is because both the switches are
needed to activate to form a closed connection. However, in the parallel connection (rung
2), only one of the switches, either I0.3 or I0.4 are required to activate to form a closed
connection and give output.
After replacing the input I0.3 with Q0.0, the output lamp (Q0.1) become dependent on
I0.0, I0.1 and I0.4. This is because Q0.0 is depend on both the I0.0 and I0.1. Q0.0 is
activated when both the I0.0 and I0.1 are activated. In order to give output lamp Q0.1,
either the Q0.0 or I0.4 are required to activate.

Exercise 1(b) Controlling an electrical motor by push buttons and overload relay
The output lamp (Q0.0) continued lighting up although the input I0.0 is deactivate
afterward. This is because of the input I0.0 is connected parallel with the energized
output Q0.0. Even if the normally open input I0.0 is released, the energized output Q0.0
will complete the circuit connection, hence the lamp continuing on.
The Stop Pushbutton is a normally closed switch, which mean that no activation is
needed to complete the connection. It gives reverse effect of Start Pushbutton. The
function of the Stop Pushbutton I0.1 and I0.2 in this connection are functioned to cut off
the circuit if necessary.
When the input I0.0 and I0.1 are interchanged, the output lamp (Q0.0) only light up when
the Start Pushbutton I0.0 is activated, but it failed to light up after the I0.0 is released.
This is due to the termination of the circuit at I0.0 when I0.0 is released. The normally
open switch I0.0 is now connected in series manner with the normally closed switch I0.2.
I0.0 must be activated in order to make a closed connection. Without activate I0.0, the
connection is open, the circuit is cut off and hence no output light.
For the overload relay, the application in the real system circuit will be a huge
contribution in order to increase the safety measurement and prolong the component
lifespan. This is because the overload relay acts as a cutter to the circuit whenever there is
excessive current flow maybe in the real world, the current from the lightning during a

storm or in some cases the overshoot amount of current after recovering from blackouts.
The overload relay will prevent the overflow current and thus, it will prevent a bad
accident and also save the important component from severe damage.

Exercise 1(c) Controlling a pilot light by Timers


When the input I0.0 is activated, the circuit is complete, therefore the timer started
running. The on-delay timer (T37) is activated only when it reached the pre-set time.
Since in this setup, the pre-set time is 150ms, therefore the lamp is lighted up after
150ms.
The Stop Pushbutton is a normally closed switch, which mean that no activation is
needed to complete the connection. The function of the Stop Pushbutton I0.1 in this
circuit used to cut off the circuit if necessary.
There is no significant change when the input elements I0.0 and I0.1 are interchanged, it
function as before. This is due to both the input I0.0 and I0.1 remain connected in series
manner.

Exercise 2: Traffic Light Simulation

Figure above shows the ladder diagram for traffic light. Initially all the switches
are turned off. All the lights are off. When input I0.4 is activated on the first line, the
circuit is energized and current passes through Q0.2. Q0.2 is in off condition since Q0.2
has no output at that time. Q0.2 acts as a normally closed switch, which mean that no
activation is needed to complete the connection, thus current can pass through Q0.2 and
flow to Q0.0. Output Q0.0 represents Red light and it is on in the simulator. In second
line, Q0.0 then activate timer T37 of 50 ticks. After 5 seconds, output Q0.1 which
represents Amber light is energized and on in the simulator. Both of the Red light and
Amber light are lighted up in this state. In the fourth line, Q0.1 then activate T38 which is
set to 50.

After 5 seconds, on fifth line, signal passes through T39 which is off at that time.
Since T39 acts as a normally closed switch, signal can flow through T39 at off state and
flow to output Q0.2. Q0.2 which represent Green light is now energized and light up on
the simulator. Since Q0.2 is also an input which act as reverse switch in the first line of
programme, when Q0.2 is activated, input for reverse switch Q0.2 in the first line is
turned on, resulting the current being cut off at input Q0.2 since the connection is cut off
and signal could not pass through it. This causes output Q0.0 is turned off since current
cannot flow to Q0.0, resulting Red light being turned off on the simulator. Since Amber
light depends on the signal from Red light, when Red light is turned off, Amber light is
also off. Thus, both Red light and Amber light are turned off when Green light is turned
on.
On the fifth line, Q0.2 is added parallel to the circuit as an input. It ensure
continuous flow of current to light up Green light even when T38 is turned off. In the
sixth line, Q0.2 then acts as the input and activates timer T39 which is set to 50. After 5
seconds, T39 sends signal to input T39 in fifth line which is then turned on. Since input
T39 acts as normally closed switch, when the input receive signal, it is turned on,
resulting in cut-off of current at input T39. Connection is cut off and current stop flowing
at T39 and cannot flow to Q0.2. Hence, Green light (Q0.2) is turned off. Since Q0.2 is off
now, the normally closed switch Q0.2 at the first line is turned off. Current can flow
through input Q0.2 in the first line, resulting light up of the Red light (Q0.0). The whole
cycle will keep on repeating itself.

6.0 Conclusion
From this lab session we had learnt the basics of Programmable Logic Controller. Many
different types of simulations can be made using various configurations by PLC
programming. The combination of simple switches of different types can produce various
complex outputs and commands that fulfill the users needs. PLC programming is indeed
a useful invention and it has high potential to be a user-friendly problem solver
application.
In conclusion, PLC is a system designed to multiple inputs and output arrangements. The
combination of some simple switch can produce various complex outputs and commands.
PLCs are used in many industries and machines. No doubt, the PLC system is one of the
greatest inventions in the engineering field.

You might also like