You are on page 1of 80

Contact: ( ) www.icgst.com, www.icgst-amc.com editor@icgst.com Tel.: 0020-122-1804952 Fax.

: 0020-2-24115475
Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

List of items required when working with PLCs:


Programming Terminal - laptop or desktop PC.
PLC Software. PLC manufacturers have their own specific software and license key. Communication cable for connection from Laptop to PLC. Backup copy of the ladder program (on diskette, CDROM, hard disk, flash memory). If none, upload it from the PLC. Documentation- (PLC manual, Software manual, drawings, ladder program printout, and Seq. of Operations manual.)
Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Examples of PLC Programming Software:


Allen-Bradley Rockwell Software RSLogix500 Modicon - Modsoft Omron - Syswin GE-Fanuc Series 6 LogicMaster6 Square D- PowerLogic Texas Instruments Simatic Telemecanique Modicon TSX Micro Siemens- S7

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

PLC Programming Languages


IEC 1131-3 is the international standard for programmable controller programming languages. The following is a list of programming languages specified by this standard:
o o o o o Ladder diagram (LD) Sequential Function Charts (SFC) Function Block Diagram (FBD) Structured Text (ST) Instruction List (IL)

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.
SBO/ PMM/ EJ501/ Jun2011Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

Program Elements
Address:
o a number indicating the location, instructions, or data in the memory.

Instruction :
o a command that should be implemented PLC

Operand:
o The value in the numbers specified as the data used for a given instruction

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Ladder Diagram
Ladder diagram is the main programming method used for PLC's. As mentioned before, ladder logic has been developed to mimic relay logic. The decision to use the relay logic diagrams was a strategic one. By selecting ladder logic as the main programming method, the amount of retraining needed for engineers and trades people was greatly reduced.
The first PLC was programmed with a technique that was based on relay logic wiring schematics. This eliminated the need to teach the electricians, technicians and engineers how to program - so this programming method has stuck and it is the most common technique for programming in today's PLC.
Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Mnemonic Instruction

There are other methods to program PLCs. One of the earliest techniques involved mnemonic instructions. These instructions can be derived directly from the ladder logic diagrams and entered into the PLC through a simple programming terminal.

SBO/ PMM/ EJ501/ Jun2011Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

Sequential Function Charts (SFC)

SFC have been developed to accommodate the programming of more advanced systems. These are similar to flowcharts, but much more powerful. This method is much different from flowcharts because it does not have to follow a single path through the flowchart.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Structured Text (ST)

Programming has been developed as a more modern programming language. It is quite similar to languages such as BASIC and Pascal. Structured Text (ST) is a high level textual language that is a Pascal like language. It is very flexible and intuitive for writing control algorithms.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Function Block Diagram (FBD)

FBD is another graphical programming language. The main concept is the data flow that start from inputs and passes in block(s) and generate the output.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Ladder Diagram Instructions


Instructions ladder diagram consists of six instructions ladder and two logic block instructions. Logic block instruction is instruction that is used to connect the more complex parts.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

LD and LD NOT
A prefix contacts at the bus bar. If at the prefix of the bus bar is the NO(normaly open) contacts, then the instruction is LOAD or LD. For the NC(normaly closed) contacts, then the instruction is LOAD NOT or LD NOT.

Mneumonic Code
Address 000.00 000.01 Instruction LD LD NOT Operand 0.00 0.01

Operation Key

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

AND Instruction
AND instructions used to make the program a series contacts circuit.

Truth table of And gate


Input 1 (1) 0 0 Input 2 (2) 0 1 Output (Q) 0 0

1
1

0
1

0
1

Ladder diagram

Mneumonic Code
Address 000.00 Instruction LD Operand 0.00

000.01

AND

0.01

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

OR Instruction
OR instructions used to make the program a parallel contacts circuit. Truth table of And gate
Input 1 (1) 0 0 1 1 Input 2 (2) 0 1 0 1 Output (Q) 0 1 1 1

Ladder diagram

Mneumonic Code
Address Instruction Operand

000.00
000.01

LD
OR

0.00
0.01

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

AND LD Instruction
ANDLD instruction is used to connect two or more circuit series that began with the LD instruction.

Ladder diagram

Mneumonic Code
Address 000.00 000.01 000.02 000.03 Instruction LD LD OR AND LD Operand 0.00 0.01 0.02 -

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

OR LD Instruction
OR LD instruction is used to connect two or more parallel circuit that began with the LD instruction. Ladder diagram

Mneumonic Code
Address 000.00 000.01 000.02 000.03 000.04 Instruction LD AND LD AND OR LD Operand 0.00 0.01 0.02 0.03 -

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

OR LD and AND LD
The union between a series connection which is connected into one, so if there are two series circuits are combined into one, then the instruction is OR LOAD. The union between a parallel connection which is connected into one, so if there are two parallel circuits are combined into one, then the instruction is AND LOAD.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

NOT Instruction
Instructions NOT be used prior to entering the input address to declare that normally closed contacts. Truth table of And gate
Input 1 (1) 0 1 Output (Q) 1 0

Ladder diagram

Mneumonic Code
Address 000.00 000.01
Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Instruction LD NOT

Operand 0.00

AND and AND NOT


The instruction for series connection in the ladder. For NO(normaly open) contacts, then the instruction is AND. For NC(normaly closed) contacts, then the instruction is AND NOT.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

OR and OR NOT
The instruction for parallel connection in the ladder. For NO(normaly open) contacts, then the instruction is OR. For NC(normaly closed) contacts, then the instruction is OR NOT

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

XOR

A xor B: (A is ON AND B is OFF) OR (A is OFF AND B is ON)

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

Special Sequential Function


KEEP instruction is used to store the status of a bit operand based on two execution conditions. For this purpose, KEEP instruction is connected to two lines of instructions. The first instruction line is used to enable a operand bit, while the second instruction line is used to disable a operand bit , it will happen if conditions on the execution of instruction line associated is ON. To activate KEEP press FUN 11.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

JUMP (JMP) and JUMP END (JME)


JUMP instruction (JMP), same as the interlock instructions, coupled with the JUMP END (JME). If the execution condition and a JUMP instruction is ON, the program worked normally as if nothing JUMP instruction. However, if the condition executed and a JUMP instruction is OFF, then execution of the program directly to the JUMP END instruction without making any changes in status between JUMP and JUMP END instruction.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

JUMP (JMP) and JUMP END (JME)


All JUMP and JUMP END instruction was given the number 01 to 99. This number is only used once, meaning that, in the ladder diagram can not exist JUMP numbers double or more and one, except for number 00. JUMP instruction is done with a certain number, then the execution will go directly to JUMP END with the same number. To activate JUMP press FUN 04 and JUMP END press FUN 05.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

INTERLOCK (IL) and INTERLOCK CLEAR (ILC)


These instructions can also be used to overcome the branching points encountered on the ladder diagrams. Instruction IL - ILC is always used together. Instruction interlock if the execution condition is OFF (all instructions between interlock and interlock clear will not be done). To activate IL press FUN 02 and ILC press FUN 03.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

DIFFERENTIATE UP (DIFU) and DIFFERENTIATE DOWN (DIFD)


DIFU instruction used to enable bit operand instantaneous (only one cycle) during transition of the execution condition from OFF to ON. While DIFD instruction used for the same purpose with DIFU, only when there is a transition state of the execution from ON to OFF (reverse transition DIFU). To activate press DIFU FUN 13 and DIFD press FUN 14.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

SHIFT REGISTER (SFT)


Function of Shift Registers (SFT) is to shift the data by using the clock pulse. Data which can be shifted are IR, AR, HR, LR. Shift Registers has three inputs; data input (I), clock input (P) and reset (R). Data Input is used to enter data into location of data channel. Clock input is used to enter the clock to shift the data that has been incorporated into the input data through location of data channel . Reset input have function to create the initial conditions (0) all bits in the locations of data channel. The other is the initial of data lines (St) occupied bits start bit is shifted and the final of the data channel (E) which serves as the final borders of the bits are bits that are shifted. St must be greater or equal than E and must be on the same data area. To operate SFT press FUN 10.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

MOVE (MOV)
Move instruction is a function to move or transfer or to copy data from source (S) to destination (D). To operate MOV press FUN 21.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

ADD
Have function to add three pieces of parameters: data 1 (Au), data 2 (Ad) and carry (CY), then the results are placed on data 3 (R). carry will be set to 1 if the sum is greater than 9999.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

SUB
Have function to subtract three pieces of parameters: data 1 (Mi), data 2 (Su) and carry (CY), then the results are placed on data 3 (R). If the result is negative then carry will be set to 1.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

SET & RSET Instruction


SET RESET Turns OFF B for an ON execution condition; does not affect B for an OFF execution condition.

Turns ON B for an ON execution condition; does not affect B for an OFF execution condition

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

SET & RSET Instruction


SET and RSET instructions used to activate or reset the output and internal relay.

Ladder diagram

Mneumonic Code
Address 000.00 000.01 000.02 000.03 Instruction LD SET LD RSET Operand 0.00 0.04 0.02 0.04

Timing Chart

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

TIM (TIMER) Instruction

A timer is activated when its execution condition goes ON and is reset (to SV) when the execution condition goes OFF. Once activated, TIM measures in units of 0.1 second from the SV. If the execution condition remains ON long enough for TIM to time down to zero, the Completion Flag for the TC number used will turn ON and will remain ON until TIM is reset (that is, until its execution condition goes OFF).
N : Timer Number --> 000 - 511 SV : Set value (#0050) 5 sec (50 x 0.1sec)

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

TIM (TIMER) Instruction


Timers are devices that count increments of time.

Ladder diagram

Mneumonic Code
Address 000.00 000.01 Instruction LD TIM Operand 0.01 000

#100

Timing Chart

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Timer On Delay

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Timer Off Delay

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 Timers
There are 5 S7 timers available (STL) 1. S_PULSE Pulse Timer (SP) 2. S_PEXT Extended Pulse Timer (SE) 3. S_ODT On-Delay Timer (SD) 4. S_ODTS Retentive On-DelayTimer (SS) 5. S_OFFDT Off-Delay Timer (SF)

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 Timers

o o o

Each timer uses one 16 bit word. Bits 0 11 contain the time value in BCD. The time value has the format
5T#aH_bM_cS_dMS where H = hours, M = minutes, S = seconds, and MS = milliseconds and a, b, c, d are defined by the user.

For example: S5TIME#4S = 4 seconds s5t#2h_15m = 2 hours and 15 minutes S5T#1H_12M_18S = 1 hour, 12 minutes, and 18 seconds The maximum value is 2H_46M_30S
Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 Pulse Timer (SP)

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

STL Timers
Other Timer Commands FR - Enable (restart) a Timer L - Load Current Timer Value into ACCU 1 as Integer LC - Load Current Timer Value into ACCU 1 as BCD R - Reset Timer stops and clears values

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

CNT (COUNTER) Instruction

Counter

is used for count the setting value (SV) towards 0 when the pulse counter (CP) changes from OFF to ON. After the counter value changes to 0 then the counter output status will change from OFF to ON and will persist as long as the reset button (R) has not been pressed. When the reset button is pressed, status of the output counter will be OFF and the counter value back to the original setting value. The number of counter that can be used up to 511. Do not give the same number on counter Timer.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

CNT (COUNTER) Instruction


Ladder diagram Mneumonic Code
Address 000.00 000.01 000.02 Instruction LD LD CNT Operand 0.00 0.01 001 10

Timing Chart

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

CNT (COUNTER) Instruction


There

are two counter instructions available on the

PLC.
o
o

CTU counts up CTD counts down

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

CTU Counter

Each time the input rung logic goes from false to true, the counter counts up over a range of -32768 to 32767. When the accumulated value reaches the preset value, the .DN bit becomes 1. The accumulated value is retained until the RES instruction is used to reset the counter.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

CTU Counter

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

CTD Counter

Each time the input rung logic goes from false to true, the counter counts down over a range of -32768 to 32767. When the accumulated value reaches the preset value (usually 0), the .DN bit becomes 1. The accumulated value is retained until the RES instruction is used to reset the counter.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 Counters
Siemens
o o o

S7 provides 3 counter instructions.


Down Counter Up Counter Up-Down Counter

S_CD S_CU S_CUD

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 Counter Memory
You provide a counter with a preset value by entering a number from 0 to 999, for example 127, in the following format: C#127. The C# stands for binary coded decimal format (BCD format: each set of four bits contains the binary code for one decimal value).

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 S_CD Counter
C no. - Counter identification number CD - Count down input S - Set input for presetting counter PV - Enter counter value as C#<value> in the range from 0 to 999 R - Reset counter input CV - Current counter value, hexadecimal number CV_BCD - Current counter value, BCD Q Status of the counter

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 S_CD Counter
S_CD (Down Counter) is set with the value at input PV if there is a positive edge at input S. The counter is reset if there is a 1 at input R and the count value is then set to zero. The counter is decremented by one if the signal state at input CD changes from "0 to "1" and the value of the counter is greater than zero. If the counter is set and if RLO = 1 at the inputs CD, the counter will count accordingly in the next scan cycle, even if there was no change from a positive to a negative edge or vice versa. The signal state at output Q is "1" if the count is greater than zero and "0" if the count is equal to zero.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 S_CD Counter

If I0.2 changes from "0" to "1", the counter is preset with the value of MW10. If the signal state of I0.0 changes from "0" to "1", the value of counter C10 will be decremented by one - unless the value of C10 is equal to "0". Q4.0 is "1" if C10 is not equal to zero.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 S_CU Counter
If I0.2 changes from "0" to "1", the counter is preset with the value of MW10. If the signal state of I0.0 changes from "0" to "1", the value of counter C10 will be incremented by one - unless the value of C10 is equal to "999". Q4.0 is "1" if C10 is not equal to zero.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

S7 S_CUD Counter
If I0.2 changes from "0" to "1", the counter is preset with the value of MW10. If the signal state of I0.0 changes from "0" to "1", the value of counter C10 will be incremented by one - except when the value of C10 is equal than "999". If I0.1 changes from "0" to "1", C10 is decremented by one - except when the value of C10 is equal to "0". Q4.0 is "1" if C10 is not equal to zero.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Other S7 Counter Commands


(SC) set counter value transfers a preset value to a counter.

The counter C5 is preset with the value of 100 if there is a positive edge at input I0.0 (change from "0" to "1"). If there is no positive edge, the value of counter C5 remains unchanged.

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Other S7 Counter Commands


(SC) set counter value transfers a preset value to a counter. (CU) count up counts up 1 (CD) count down counts down 1 (R) reset resets the counter If the signal state of input I0.0 changes from "0" to "1", the preset value of 100 is loaded to counter C10. If the signal state of input I0.1 changes from "0" to "1", counter C10 count value will be incremented by one unless the value of C10 is equal to "999". If there is no positive edge in RLO, the value of C10 will be unchanged. If the signal state of I0.2 is "1", the counter C10 is reset to "0".

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

STL Counters
FR

Enable Counter (Free) L Load Current Counter Value into ACCU 1 LC Load Current Counter Value into ACCU 1 as BCD R Reset Counter to 0 S Set Counter Preset Value CU Counter Up CD Counter Down

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

OUT & OUT NOT Instruction


Ladder diagram Mneumonic Code
Address 000.00 000.01 000.02 000.03 Instruction LD OUT LD OUT NOT Operand 0.00 10.00 0.01 10.01

Timing Chart

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Summary

SBO/ PMM/ EJ501/ Jun2011Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

Summary

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Summary

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Summary

Table : Instruction code mnemonics


Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Logic Solution and Ladder Diagram Representation

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Hardwired Logic and Ladder

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

Hardwired Logic and Ladder

(a)&(b) Alternative ways of drawing an electric circuit, (c) comparable rung in a ladder program

Ashraf Aboshosha, Aboshosha,www.icgst.com, www.icgst.com,editor@icgst.com editor@icgst.com Ashraf

PLC: example 1

Pressure_Switch is ON Warning_Light ON

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 1
STEP 1:
Write this logic into a PROGRAM STEP 2: Load program into PLC STEP 3: Connect the sensor output to External Input terminal. STEP 4: Connect the PLC External Output Terminal to Warning Light STEP 5: EXECUTE the logic program on the PLC.
Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 1

Programming language: LADDER LOGIC

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 1

Programming language: LADDER LOGIC

IF

THEN

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 2

Outer mat ON warning light ON Inner mat ON warning light ON AND Robot OFF

Stepping away from inner mat Manually switch robot ON


Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 2
Two actuators: Warning light, Robot master switch
LOGIC for Warning light External Input 1: outer mat

External Input 2: inner mat

External output: light

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 2

LOGIC for Warning Light

LOGIC for Robot

PROBLEM ?

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 2
LOGIC for Robot Robot must STAY OFF until manual reset to ON Solution: LATCH
External Input 2: inner mat Internal (logical) relay

latch

External output: robot


Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 2
LOGIC for Robot Robot must STAY OFF until manual reset to ON

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 3-Timers


Solenoid actuated door-lock

Solenoid ON Door unlocked

Solenoid actuated when: (i) ON signal from number-pad outside door (ii) ON signal from door-open switch inside door Solenoid ON for 5 sec, then OFF While O:0/1 remains ON, Timer COUNTS DOWN from PRESET

COUNT DOWN = 0 ( T4:1) set to ON

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 4-Timers


Solenoid actuated door-lock Solenoid ON Door unlocked Solenoid actuated when: (i) ON signal from number-pad outside door (ii) ON signal from door-open switch inside door Solenoid ON for 5 sec, then OFF

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 5-Timers


Solenoid actuated when: (i) ON signal from number pad outside door (ii) ON signal from door-open switch inside door

Solenoid ON for 5 sec, then OFF

During ON, if button is pressed, Timer resets to PRESET


During ON, light indicator is ON

LEGEND: I:0/1 door-open I:O/2 card-reader


O:0/1 solenoid O:0/2 light indicator
Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 6-Counter


Pallet loading in factory After 4 parts arrive on conveyor:

STOP conveyor belt turn ON the indicator light

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

PLC: example 7-Car wash

Car arrives limit switch ON


Limit switch ON Washer ON Washer ON: (i) Soapy water SPRAY ON (30 secs) (ii) Rinse: clean water SPRAY ON (30 secs) (iii) Automatic scrubber brushes car (15 secs) (iv) After washing 50 cars, the scrubber brush Auto-change
Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

I:0/1

I:0/2

B1

B1 T4: 0 EN Base: Preset: Accum : B1 T4: 1 EN Base: Preset: Accum : 0.01 6000 0 T4: 2 EN Base: Preset: Accum : B1 T4:0 T4:1 0.01 7500 0 T4:2 DN T4:2 DN T4:2 DN C5: 0 EN Preset: Accum : C5: 0 DN I:0/3 50 0 O:0/3 O:0/0 0.01 3000 0

I:0/1 : System On I:0/2 : Em ergency Stop I:0/3 : Lim it Switch O:0/0 O:0/1 O:0/2 O:0/3 : : : : Soa p Water On Rinse On Scrubber On Ac tivate Scrubber Change

B1

Notice how B1 and the time r outputs are used to c ontrol the logic according to the required timing.

B1

DN DN T4:0 T4:1 DN DN T4:0 T4:1 DN DN

O:0/1

B1

O:0/2

O:0/2 CTU

Car arrives limit switch ON Limit switch ON Washer ON Washer ON: (i) Soapy water SPRAY ON (30 secs) (ii) Rinse: clean water SPRAY ON (30 secs) (iii) Automatic scrubber brushes car (15 secs) (iv) After washing 50 cars, the scrubber brush Auto-change

T4:0 RES

I:0/3

T4:1 RES

I:0/3

T4:2 RES C5:0 RES

O:0/3

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

Ashraf Aboshosha, www.icgst.com, editor@icgst.com Ashraf Aboshosha, www.icgst.com, editor@icgst.com

You might also like