Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

DGC50093 – Process Instrumentation And Control Practical 4

PRACTICAL 4: BASIC PLC PROGRAMMING


(CLO2; P4, PLO4)

1.0 SECTION A: Basic Programming Language

2.0 OUTCOME:

At the end of the session, students will be able to:


i. Understand the basic programming instruction; LD, AND, OR, NOT, OUT, OUT
NOT and END in series and parallel connection.
ii. Construct the Ladder Diagram for any given condition
iii. Understand the concept of normally open and normally closed inputs

3.0 EQUIPMENT / MATERIALS:

i. PLC & SCADA Simulation Training Station

4.0 THEORY
IEC 1131-3 is the international standard for programmable controller programming
languages. The following is a list of programming languages specified by this standard:
i. Ladder Diagram (LD)
ii. Instruction List (IL)
iii. Structured Text (ST)
iv. Sequential Function Chart (SFC)
v. Function Block Diagram (FBD)

One of the primary benefits of the standard is that it allows multiple languages to be used
within the same programmable controller. This allows the program developer to select
the language best suited to each particular task.

4.1 Ladder Diagram :


Ladder Diagram is kind of graphical programming language that changed the relay
control wiring circuit diagram. Ladder Diagram contains tracks from left to right contact
diagram (see Figure below). This platform is connected to contact elements available
normally open - NO or available Normally closed - NC through the current path and loop
Process Instrumentation & Control

1
DGC50093 – Process Instrumentation And Control Practical 4

elements. Ladder diagram also shows the control circuit and the display function and a
combination of the sequence of operations for each branch of the horizontal lines
separately.

Figure 4.1: Ladder diagram

4.2 Basic Programming Instruction :LD,AND,OR,NOT OUT,OUT NOT and END:


i. LD is a starting instruction for a logic line or block.
ii. AND is used to connect two or more inputs in series.
iii. OR is used to connect two or more input in parallel.
iv. NOT is used to NOT invert its input; often used to form a Normally-Closed (NC)
input or output. NOT can be used with LD,OUT,AND or OR.

Figure 4.3: Ladder Diagram showcase series,parallel and Normally Closed input/Output condition

Process Instrumentation & Control

2
DGC50093 – Process Instrumentation And Control Practical 4

5. PROCEDURES:
5.1 For program the Ladder Diagram

a. Open the PLC Programming Click TIA Portal


b. Click Create a New Project and Click button Create

c. Click Configure a device.

d. Click Add new device and choose the right controller S71200 with CPU 1212C
DC/DC/RLY with order number 6ES7212-1HE40-0XB0 and click ADD button.

e. Click START (at top left screen)

f. Double click Program blocks

g. Double click main [OB1]

Process Instrumentation & Control

3
DGC50093 – Process Instrumentation And Control Practical 4

f. The area are available for Ladder Diagram sketch.

g. Draw and simulate the ladder diagram in the TIA Portal.


h. Continue instruction 6.1.1

6.0 Practical
6.1 Practical A Series Instruction

Diagram 2 input in series

6.1.1 Condition :
When S1 and S2 are switched to on, L1 will turn on. When S1 and S2 are switched to off, the
L1 will turn Off.
a) Determine input/output and data:

input memory Output memory


S1 M0.1 L1 M0.3
S2 M0.2

b) Draw Ladder(+)
Diagram : (-)

M0.1 M0.2 M0.3

END
d

Process Instrumentation & Control

4
DGC50093 – Process Instrumentation And Control Practical 4

i. Click icon compile

ii. Click icon download to device

iii. Click start search and click Load

iv. At stop module click stop all

v. Click Load and finish

Process Instrumentation & Control

5
DGC50093 – Process Instrumentation And Control Practical 4

c) Result :
i. click monitoring ON/OFF

ii. result from screen

Normally open means switch in OFF condition ( no current flow)


Normally close means switch ON condition (current flow)

iii. For activate the switch


Right click at M0.1 modify and modify to 1

Modify to 1 means to change N/O to N/C

Screenshot the result diagram and paste into the result form in lab sheet.

Process Instrumentation & Control

6
DGC50093 – Process Instrumentation And Control Practical 4

6.1.2 Condition

When SW1 and SW2 and SW3 switch to ‘ON’, L2 will turn ‘ON’. When SW1 and SW2
and SW3switch ‘OFF’, then L2 will turn ‘Off’

a) Determine input/output:

(2 marks)

b) Draw Ladder Diagram :

(2 marks)
c) Result :

(2 marks)
Process Instrumentation & Control

7
DGC50093 – Process Instrumentation And Control Practical 4

6.2 Practical B Parallel Instruction


(+) (-)

S1 L1

S2
Diagram 2 input in parallel

6.2.1 Condition
When S1 or S2 is switched to ON, L1 will turn ON. When S1 and S2 are switched to OFF
then L1 will turn OFF.
a) Determine input/output:

(2 marks)

b) Draw Ladder Diagram :

(2 marks)
c) Result :

Process Instrumentation & Control

8
DGC50093 – Process Instrumentation And Control Practical 4

6.3 Practical C Normally Closed Instruction


(+) (-)

L1

Diagram 1 input in normally closed

6.3.1 Condition
When the PLC program is RUN, L2 will turn on first. When S1 is switched to ON, L1 will
turn ON hence L2 will turn OFF.
a) Determine input/output:

(2 marks)

b) Draw Ladder Diagram :

(2 marks)
c) Result :

(2 marks)

Process Instrumentation & Control

9
DGC50093 – Process Instrumentation And Control Practical 4

6.4 Practical D: TIMER instruction as ON-Delay circuit

TON
IN Q
TIM001
T#5s
PT ET

TON is the on-delay timer’s similar to an “up” counter,


IN – for input connection
PT – preset time for set the time needed in ms value
Q – for output connection
ET – elapsed time

6.4.1 Condition
When the Push Button, PB1 is push to ON, the L1 will be turn ON after delay 5 seconds.
PB2 is used to reset the Timer.
a) Determine input/output:

(2 marks)

b) Draw Ladder Diagram :


%DB1
(+) TIM1 (-)
TON
IN Q
S
PB1 PB2
t L1

T#5s i
PT
h
ET

m e
END il o
a n
r -
t d
o el
a a
n y
“ ti
Process Instrumentation & Control u m
p e 1
” r’ 0

c s
DGC50093 – Process Instrumentation And Control Practical 4

c) Result :

(2 marks)

6.5 Practical E: TIMER instruction as ON-FF circuit (flashing light)


6.5.1 Condition
When PB1 is ON, L1 will turn ON after delay for 5 second. Upon L1 is ON, Timer 2
(TIM2) will also ON and delays for 5 seconds. The normally closed contact for TIM2 will
reset Timer 1 and L1 will be OFF. When L1 OFF, the TIM2 will also OFF, hence activate
the normally close contact after delay for 5 seconds and L1 will be ON again. The
process is continuous until PB1 is OFF.
a) Determine input/output:

(2 marks)

Process Instrumentation & Control

1
1
DGC50093 – Process Instrumentation And Control Practical 4

b) Draw Ladder Diagram : %DB1


TIM1
(+) (-)
IN Q
PB1 L2
L1
T#5s PT ET

%DB4
TIM2

IN Q L1
L1 L2
T#5s PT ET

END

c) Result :

(2 marks)

Process Instrumentation & Control

1
2
DGC50093 – Process Instrumentation And Control Practical 4

6.6 Practical F: COUNTER instruction

A counter is a PLC instruction that either increments (counts up) or decrements (counts
down) an integer number value when prompted by the transition of a bit from 0 to 1
(“false” to “true”).

CTU
PB1
i0.1
CU Motor 1 CTU – counter UP
D0.0 CU – counter up input
PB2
R – reset input
R Q PV – preset value for set the count value needed
i0.2 Q - output
CV - counter current value
5 PV CV

PLC panel:

Panel PLC Input PLC address Output address

PB101 i0.0 q0.0

PB102 i0.1 q0.1

PB201 i0.2 q0.2

PB202 i0.3 q0.3

SW103 i0.4 q0.4

Process Instrumentation & Control

1
3
DGC50093 – Process Instrumentation And Control Practical 4

6.6.1 Packaging Control System

Packaging Control System where 10 tinned foods be packed in a box. Sensor 1(SE1) is
used to sense the presence of tin on a running Tin Conveyor. When SE1 is On, a counter
used in the system will start to count. Upon 10 counts, Tin Conveyor controlled by Motor
(M1) will stop. The PB is used to reset the counter.

a) Determine input/output:

(2 marks)
b) Draw Ladder Diagram

Process Instrumentation & Control

1
4
DGC50093 – Process Instrumentation And Control Practical 4

c) Screenshot the result from TIA program

(2 marks)

7.0 DISCUSSION

Figure: Traffic light control system for road maintenance

Vehicles can only move in one direction at a time. When start push button is pressed, vehicle
from south L1 is MOVING and vehicle from north L4 will STOP at the same time. After 10
seconds, vehicle from north L3 is MOVING and vehicle from south L2 will STOP, This process
is continuous until the reset push button is pressed.

Process Instrumentation & Control

1
5
DGC50093 – Process Instrumentation And Control Practical 4

a) Determine input/output:

(2 marks)
b) Draw Ladder Diagram

(5 marks)

c) Screenshot the result from TIA program

(5 marks)

Process Instrumentation & Control

1
6

You might also like