PLC Programming
PLC Programming
PLC Programming
Programming Concepts
BY
HAFIZ RAHIM
2011608005
PLC Operation
PLC SCAN
Field Input Output Devices
Devices
Selector Switch Alarms
Pushbuttons Control Relays
Limit Switches Fans
Circuit Breakers Hooters (horn)
Proximity Switches Valves
Motor Starter Contacts Motor Starters
Relay Contacts Solenoids
INPUTS CONTACTOR
MOTOR
LAMP
PLC
Push Button Relays
evel Detection
?
???
? ? ? ??
4- 20 ??
??
? ?
mA
PLC -------- > SIEMENS
S7-300
S5-100
Configuration of PLC :
Siemens
CPU
LED
Timer
Processor Counters
ALU
Flags
I/O
Inputs Outputs
I/O bus
External
Counters
S5 - 100U PC
The
program can be loading in two
ways :
1. Online ( Direct to internal RAM
)
2. Off-line ( EEPROM or
EPROM )
Ladder logic
Statements ( lists form)
I/O Numbering
I designate a discrete input
Q designates a discrete
output
I0.0 = Byte 0, Bit 0
I0.1 = Byte 0, Bit 1
I1.0 = Byte 1, Bit 0
I1.1 = Byte 1, Bit 1
– 3 Types
1. Standard Instructions
( timer, counter, math, logical ( increment/decrement/invert), move,
and block instructions )
2. Special Instructions
(used to manipulate data, table, find, conversion, for/next, and real-
time instructions )
3. High-Speed Instructions
( events , interrupts which occur independent of the PLC scan
time.
They are high-speed counters, interrupts, output, and
transmit instructions)
Symbols
Contacts
Coils
Boxes
IO.O
QO.O
AND
IO.1
th e
s ee
et n g
L k i
Analog Inputs and
Outputs
Typical analog signals are 0 - 10 VDC or 4 - 20 mA
Analog module
Timers
Three types
1. On- Delay (TON)
2. Retentive On-Delay (TONR)
3. Off-Delay (TOF).
see
t’ s
Le a
mo
e
On-Delay (TON):
Programs
Programming Steps
1. 1st Pump On for L1
level
2. 2nd Pump On for L2
level
Let 3. Mixer runs for T1
’s s seconds
wo ee th 4. 3rd pump on till L0
& P rkin e level
rog g 5. Open drain valve till
ram L0 level
Counters
Programming Steps
High-Speed Counters
Each counter has dedicated inputs
for clocks, direction control, reset,
Positioning
Eg : Motor – encoder positioning system
Priority order
1. Communications
2. I/O Interrupts
3. Time-Based Interrupts
Eg : if the output has a 10% duty cycle (on 10% & off 90% ).
for
Listening