100% found this document useful (3 votes)
504 views161 pages

PLC Training

The document provides information about PLC training. It discusses the advantages of PLCs including that they are expandable, easy to change programs for, small in size, and can provide fault diagnostics. It also lists some major PLC manufacturers like Siemens, Mitsubishi, and Omron. Finally, it details the Siemens S7 PLC family including the S7-300 and S7-400 models and their modular components.

Uploaded by

meftah.youssef08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
504 views161 pages

PLC Training

The document provides information about PLC training. It discusses the advantages of PLCs including that they are expandable, easy to change programs for, small in size, and can provide fault diagnostics. It also lists some major PLC manufacturers like Siemens, Mitsubishi, and Omron. Finally, it details the Siemens S7 PLC family including the S7-300 and S7-400 models and their modular components.

Uploaded by

meftah.youssef08
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 161

Engineering Department

PLC
Training

PLC training by Ahmed M. Salaheldin


Engineering Department

Advantages of Using PLC


(Programmable Logic Control):

• Expandable
• Easy to change the program
• Small size
• Fault diagnostics

PLC training by Ahmed M. Salaheldin


Engineering Department

PLCs Manufacturers:

• SIEMENS (I, Q)
• Mitsubishi (X, Y)
• Omron (no identifiers)


PLC training by Ahmed M. Salaheldin


Engineering Department

For SIEMENS

Micro Modular L. S.

S5 90U S5 115U S5 155U


S5 95U S5 135U .
S5 100U S5 300U .

S7 200 S7 300 S7 400

PLC training by Ahmed M. Salaheldin


Engineering Department

SIMATIC
PCS 7

SIMATIC
SIMATIC NET
Software

The SIMATIC S7 SIMATIC


SIMATIC
HMI

System Family
SIMATIC
PC

SIMATIC
WinCC

SIMATIC
DP
SIMATIC
Controller

PLC training by Ahmed M. Salaheldin


Engineering Department

SIMATIC HMI SIMATIC PG


SIMATIC PC
SIEMENS
SIMATIC
Overview
S IM A T IC O P 17

PG 740

K1 K2 K3 K4 K5 K6 K7 K8 H E LP

S H IF T

K9 K 10 K 11 K 12 K 13 K 14 K 15 K 16

ESC

7 8 9 0
D E F AC K

4 5 6 .
A B C
IN S
1 2 3 S H IF T
DE L
HELP E NT E R

MPI Network
SIMATIC NET Industrial Ethernet
SIMATIC NET
PROFIBUS

SIMATIC
Controller
SIEMENS SF I0.0 Q0.0 CPU 212
RUN I0.1 Q0.1
STOP I0.2 Q0.2
I0.3 Q0.3
I0.4 Q0.4
I0.5 Q0.5
I0.6
I0.7
SIMATIC
S7-200

PROFIBUS-DP

SIMATIC DP FM
ASI

PLC training by Ahmed M. Salaheldin


Engineering Department

S7-300

PLC training by Ahmed M. Salaheldin


Engineering Department

S7-300: Modules

PS CPU IM SM: SM: SM: SM: FM: CP:


(optional) (optional) DI DO AI AO - Counting - PROFIBUS
- Positioning - Industrial Ethernet
- Closed-loop
control

PLC training by Ahmed M. Salaheldin


Engineering Department

S7-300: CPU Design


SIEMENS CPU314 SIEMENS CPU315-2 DP
SF SF SF DP
BATF BATF BUSF
DC5V DC5V
FRCE FRCE
RUN RUN
STOP STOP
RUN-P RUN-P
RUN RUN

STOP STOP
M RES
M RES

SIMATIC SIMATIC
S7-300 S7-300
Battery MPI Battery MPI DP

PLC training by Ahmed M. Salaheldin


Engineering Department

S7-400

PLC training by Ahmed M. Salaheldin


Engineering Department

S7-400: Modules

PS CPU SM: SM: SM: SM: CP FM SM IM


DI DO AI AO

PLC training by Ahmed M. Salaheldin


Engineering Department

S7-400: CPU
Design

Mode Selector

e.g. CPU412-1
* for further CPUs please see catalog e.g. CPU416-2DP

PLC training by Ahmed M. Salaheldin


Engineering Department

S7-400: CPU
Design
Fault LEDs

Slot for Memory


Card

MP/DP Interface

DP Interface

External Battery
Supply

PLC training by Ahmed M. Salaheldin


Engineering Department

Programming
Devices PG/PC

PLC training by Ahmed M. Salaheldin


Engineering Department

Installing STEP 7 Software

SIEMENS

PG 740

PLC training by Ahmed M. Salaheldin


Engineering Department

Double-click on Icon

Activate via Start menu

PLC training by Ahmed M. Salaheldin


Engineering Department

The SIMATIC Manager

PLC training by Ahmed M. Salaheldin


Engineering Department

From Process to Project


Project Management

SIMATIC Manager

Hardware

FB21
OB1
I 1.0 I 1.1 Q4.0

Process Software

PLC training by Ahmed M. Salaheldin


Engineering Department

STEP 7 Project Structure

PLC training by Ahmed M. Salaheldin


Engineering Department

Starting the SIMATIC Manager

or

PLC training by Ahmed M. Salaheldin


Engineering Department

SIMATIC Manager Menus and Toolbars

Titlebar

Menubar

Toolbar

Statusbar

Taskbar

PLC training by Ahmed M. Salaheldin


Engineering Department

The Toolbar
in the
SIMATIC
Manager

Windows 95 Symbols STEP 7 Symbols

Display Accessible Nodes

Download (to the PLC)

Simulate Modules (S7-PLCSIM)

PLC training by Ahmed M. Salaheldin


Engineering Department

Creating an S7 Project

Enter project
name here
and confirm
with "OK"

PLC training by Ahmed M. Salaheldin


Engineering Department

Offline /
Online

PLC training by Ahmed M. Salaheldin


Engineering Department

STEP 7 Help System

PLC training by Ahmed M. Salaheldin


Engineering Department

SIMATIC Manager Customizing Options

PLC training by Ahmed M. Salaheldin


Engineering Department

Memory Re-
set Function Manually From the PG
Memory - Mode selector
in “STOP” position
- Mode selector
in “RUN-P” position
Reset - Hold mode selector - Menu options:
in “MRES” position PLC -> Operating
Request until the “STOP” LED Mode -> Stop
Memory flashes twice (slowly)
Reset - Menu options:
- Release mode PLC -> Clear/Reset
selector (returns
automatically to the
“STOP” position)

- Switch the mode - Confirm Memory


selector quickly to the Reset by clicking the
"MRES" position and “OK” button
Perform release (fast flashing of (fast flashing of
Memory "STOP“ LED "STOP“ LED indicates
Reset indicates memory reset memory reset being
being performed) performed)

- Switch mode selector - Menu options:


Perform to "RUN" or "RUN-P" PLC -> Operating
Warm Restart position Mode -> Warm Restart

PLC training by Ahmed M. Salaheldin


Engineering Department

Hardware Configuration

PLC training by Ahmed M. Salaheldin


Engineering Department

Inserting a Station

PLC training by Ahmed M. Salaheldin


Engineering Department

Starting HW Config

PLC training by Ahmed M. Salaheldin


Engineering Department

Generating a Hardware Setpoint Configuration

PLC training by Ahmed M. Salaheldin


Engineering Department

Addressing of Modules
Slot No. 1 2 4 5 6 7 8 9 10

Modules PS CPU SM SM SM SM SM SM SM

Address 0.0
Address 0.7
Address 1.0
Address 1.7

PLC training by Ahmed M. Salaheldin


Engineering Department

DI/DO Addressing in Multi-Tier Configurations


PS IM 96.0 100.0 104.0 108.0 112.0 116.0 120.0 124.0
Rack
3 (Receive) to to to to to to to to
99.7 103.7 107.7 111.7 115.7 119.7 123.7 127.7

PS IM 64.0 68.0 72.0 76.0 80.0 84.0 88.0 92.0


Rack (Receive) to to to to to to to to
2 67.7 70.7 75.7 79.7 83.7 87.7 91.7 95.7

PS
IM 32.0 36.0 40.0 44.0 48.0 52.0 56.0 60.0
Rack to to to to to to to to
1 (Receive) 35.7 39.7 43.7 47.7 51.7 55.7 59.7 63.7

PS
CPU IM 0.0 4.0 8.0 12.0 16.0 20.0 24.0 28.0
Rack to to to to to to to to
(Send)
0 3.7 7.7 11.7 15.7 19.7 23.7 27.7 31.7

Slot 1 2 3 4 5 6 7 8 9 10 11

PLC training by Ahmed M. Salaheldin


Engineering Department

Variable Addressing

2x

PLC training by Ahmed M. Salaheldin


Engineering Department

Edit Symbols, Monitor/Modify Variables

1x right

PLC training by Ahmed M. Salaheldin


Engineering Department

CPU Properties

2x

PLC training by Ahmed M. Salaheldin


Engineering Department

CPU Properties: General

PLC training by Ahmed M. Salaheldin


Engineering Department

CPU Properties: Protection

PLC training by Ahmed M. Salaheldin


Engineering Department

CPU Propertires: Cycle / Clock Memory

Clock Memory Bit 7 6 5 4 3 2 1 0

Frequency (Hz) 0.5 0.62 1 1.25 2 2.5 5 10

Period (s) 2 1.6 1 0.8 0.5 0.4 0.2 0.1

PLC training by Ahmed M. Salaheldin


Engineering Department

Saving the HW Configuration and


Downloading it in Module

Download
(only when CPU
is in STOP mode)

PLC training by Ahmed M. Salaheldin


Engineering Department

Uploading the HW Configuration to the PG

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise
• Create a new project named “training3”.

• Insert S7 400 station.

• Modify hardware configuration as given in the

assignment.

• Assign byte 20 to be clock memory byte.

• Protect writing PLC program with a password “1234”.

• Download station to PLC using PLC simulator.

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise
• Create a new project named “Group3”.

• Insert S7 400 station.

• Modify hardware configuration as given in the

assignment.

• Assign byte 20 to be clock memory byte.

• Protect writing PLC program with a password “1234”.

• Modify CPU startup after power on to be cold restart.

• Download station to PLC using PLC simulator.

PLC training by Ahmed M. Salaheldin


Engineering Department

Block Architecture
OB 1 FB FB FC

FB FB FB

FB FC FC

PLC training by Ahmed M. Salaheldin


Engineering Department

Types of Program Blocks


Operating System
DB DB

Cycle

Time OB
FC FB SFC
Organization
Process Blocks

Error FB FC SFB

OB = Organization Block
FB = Function Block
FC = Function
SFB = System Function Block
SFC = System Function FB FB with instance
DB = Data Block
data block

PLC training by Ahmed M. Salaheldin


Engineering Department

Program Structure

Linear Program Program Partitioned into Areas Structured Program

Recipe A
Pump
OB 1 OB 1 Recipe B OB 1

Mixer
Outlet

Outlet

All instructions are The instructions for the indi- Reuseable functions are loaded
found in one block vidual functions are found in into individual blocks.
(normally in the individual blocks. OB 1 calls the OB 1 (or other blocks) call
organization block individual blocks one after the these blocks and pass on the
OB 1) other. pertinent data.

PLC training by Ahmed M. Salaheldin


Engineering Department

Process Images

PII PIQ

User
Byte 0 Program Byte 0
Byte 1 Byte 1
Byte 2 Byte 2
: 1 :
: : :
: : : 1
A I
2.0
= Q
4.3
:
:
:
:
CPU Memory Area CPU Memory Area

PLC training by Ahmed M. Salaheldin


Engineering Department

Program Execution
Start-up block (OB 100)
Execution once after e.g. power on

Input
Start of the cycle monitoring time
Module

Reading the signal states from the modules


and saving the data in the process image (PII)
CPU Cycle

Execution of the program in OB1 Block A I 0.1


(cyclical execution) OB 1 A I 0.2
Events (time-of-day interrupt, hardware interrupts etc.) = Q8.0
call other OBs, FBs, FCs, etc.

Writing the process-image output table Output


(PIQ) to the output modules Module

PLC training by Ahmed M. Salaheldin


Engineering Department

Inserting an S7 Block

PLC training by Ahmed M. Salaheldin


Engineering Department

Starting the LAD/STL/FBD Editor

2x

PLC training by Ahmed M. Salaheldin


Engineering Department

Components of the LAD/STL/FBD Editor

Declaration
Table

Code Section

Browser

PLC training by Ahmed M. Salaheldin


Engineering Department

The STEP7 Programming Languages


STL

A I 0.0
A I 0.1
= Q8.0
FBD

&
I 0.0
Q8.0
I 0.1 =

LAD

I 0.0 I 0.1 Q8.0

PLC training by Ahmed M. Salaheldin


Engineering Department

Selecting the Programming Language

PLC training by Ahmed M. Salaheldin


Engineering Department

Programming in LAD/FBD

PLC training by Ahmed M. Salaheldin


Engineering Department

Programming in STL

PLC training by Ahmed M. Salaheldin


Engineering Department

Saving a Block
Current project directory with name of block

PLC training by Ahmed M. Salaheldin


Engineering Department

Calling a Block in OB1

PLC training by Ahmed M. Salaheldin


Engineering Department

Downloading Blocks into the PLC

PLC training by Ahmed M. Salaheldin


Engineering Department

Simple Program Debugging

PLC training by Ahmed M. Salaheldin


Engineering Department

Downloading and Saving Modified Blocks

Open offline

Save

Open online

Download

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise: Pump Start Stop

Write the PLC program for pump start stop:

• Start Pump with push button.

• Stop with the same push button.

• Download the program to PLC.

• Simulate and monitor the program.

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise: Discontinuous horn

Write the PLC program for a discontinuous horn:

• Start horn with push button.

• Upon start one second on and one second off.

• Stop with the same push button.

• Download the program to PLC

• Simulate and monitor the program

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise: Crane on off


Write the PLC program in FC11 for Crane on/off relay:

• Emergency stop message will be active if the emergency stop push button is

active (I12.0 normally closed).

• Emergency stop message may be reset by reset push button (I12.1 normally

open).

• Crane on relay will be on if:

• Crane on push button pressed (I12.2 normally open).

• There is no emergency stop message active.

• Master switch in zero position (I12.3 normally closed).

• Crane on relay will be off if:

• Crane off push button pressed (I12.4 normally closed).

PLC training by Ahmed M. Salaheldin


Engineering Department

Symbols

PLC training by Ahmed M. Salaheldin


Engineering Department

Absolute and Symbolic Addressing

A
A I 0.0 "SYSTEM_ON"
= Q8.0 = "ON_INDIC"
A I 0.4 A "M_FORW"
= Q20.5 =
Call FC18 "MOTOR_FORW"
Call "COUNT"

Symbol Address Data Type Comment

MOTOR_FORW Q20.5 BOOL Motor forwards


COUNT FC18 FC18 Count bottles
SYSTEM_ON I 0.0 BOOL Switch on system
ON_INDIC Q8.0 BOOL Indicator: System is “On”
M_FORW I 0.4 BOOL M.-con.switch: Motor
forwards

(max. 24 (max. 80
characters) characters)

PLC training by Ahmed M. Salaheldin


Engineering Department

Opening the Symbol Table

PLC training by Ahmed M. Salaheldin


Engineering Department

Edit: Find and Replace

PLC training by Ahmed M. Salaheldin


Engineering Department

View: Filter

PLC training by Ahmed M. Salaheldin


Engineering Department

View: Sort

PLC training by Ahmed M. Salaheldin


Engineering Department

Symbol Table: Export

Where do you want to store the


table?

In which format do you want to


store the table?

PLC training by Ahmed M. Salaheldin


Engineering Department

Symbol Table: Import

Select directory path


here

Enter file
name

Select file
format

PLC training by Ahmed M. Salaheldin


Engineering Department

Editing Symbols (in the LAD/STL/FBD Editor)

PLC training by Ahmed M. Salaheldin


Engineering Department

Symbol Selection (in the LAD/STL/FBD Editor)

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise: Creating a Symbol Table

Create symbol table for the created plc program

PLC training by Ahmed M. Salaheldin


Engineering Department

Data Storage in Data Blocks

PLC training by Ahmed M. Salaheldin


Engineering Department

Storage Areas for Data

Bit memories
DBz
PIQ
. .
DBy
PII .
DBx
I/O area

L stack Data
blocks

PLC training by Ahmed M. Salaheldin


Engineering Department

Data Blocks (DBs)


Accessible to all blocks

Function
OB1
FC10
Global data
(Shared)

Function DB20
FC20

Instance DB for FB1

Function Instance data


block
FB1 DB5

PLC training by Ahmed M. Salaheldin


Engineering Department

Elementary Data Types in STEP 7


Keyword Length (in Example of a constant of this type
bits)

BOOL 1 1 or 0
BYTE 8 B#16#A9
WORD 16 W#16#12AF
DWORD 32
DW#16#ADAC1EF5
CHAR 8 'w'

S5TIME 16 S5T#5s_200ms

INT 16 123
DINT 32 65539
REAL 32 1.2 or 34.5E-12

TIME 32
T#2D_1H_3M_45S_12MS
DATE 16 D#1993-01-20
TIME_OF_DAY 32 TOD#12:23:45.12
PLC training by Ahmed M. Salaheldin
Engineering Department

Creating a New Data Block

PLC training by Ahmed M. Salaheldin


Engineering Department

Entering, Saving, Downloading and


Monitoring a Data Block

PLC training by Ahmed M. Salaheldin


Engineering Department

Addressing Data Elements


8 Bits
7 0
Data Byte 0 DBB 0
DBW 0

DBD 0

DBX 4.1

DBD 8188

DBW 8190
Data Byte 8191 DBB 8191

PLC training by Ahmed M. Salaheldin


Engineering Department

Accessing Data Elements


DB 99 "Values" Traditional Fully-qualified Access
Access
Add. Name Type absolute symbolic

0.0 Status BOOL


OPN "Values"
or ADB99.DBX0.0 or A "Values".Status
A DBX 0.0
1.0 States BYTE

2.0 Number INT


OPN DB 99
or L DB99.DBB1 or L "Values".States
L DBB 1
4.0 Weight[1] REAL

OPN "Values"
or L DB99.DBW2
or L "Values".Number
T DBW 2

OPN DB 99
8.0 Weight[2] REAL or L DB99.DBD8
or L "Values".Weight[1]
L DBD 8

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise

Create DB3 and add these data to it:


• Byte for hoist master switch input.
• Integer for hoist position.
• Integer for hoist position offset.
• Real for load cell 1 reading.
• Spare Real.
• 8 spare bits.

Write the program to move IB11


(hoist master switch input) into DB3

Write the program to move IW200


(hoist position input) into DB3

PLC training by Ahmed M. Salaheldin


Engineering Department

Functions and Function Blocks

PLC training by Ahmed M. Salaheldin


Engineering Department

Introduction

PLC training by Ahmed M. Salaheldin


Engineering Department

Temporary Variables

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise: Use of Temporary Variables

#Setpoint

Replace with the


temporary variable
Setpoint

#Setpoint

PLC training by Ahmed M. Salaheldin


Engineering Department

Declaring the Formal Parameters in FCs


Formal parameters
Type of parameter Declaration Use Graphic Display

Input parameter in Read only To the left of the block


Output parameter out Write only To the right of the block
In/out parameter In_out Read / write To the left of the block

PLC training by Ahmed M. Salaheldin


Engineering Department

Calling a Parameter-assignable Block

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise: Editing a Parameter-


assignable FC Block

Use the same pump start stop function to control four


pumps at the same time with the same push button.

Use the same discontinuous horn function to control


four horns at the same time with the same push
button:
Horn 1 frequency 0.5 Hz
Horn 2 frequency 0.62 Hz
Horn 3 frequency 1 Hz
Horn 4 frequency 1.25Hz

PLC training by Ahmed M. Salaheldin


Engineering Department

Function Blocks (FBs)


OB 1

DB 2
FB 2
EN
Disturb. Input
Acknowledge Display
Flash freq. ENO

Declaration table of the


function block

PLC training by Ahmed M. Salaheldin


Engineering Department

Example for Function Block

Declaration table
of the function
block

Instance
data block

PLC training by Ahmed M. Salaheldin


Engineering Department

Generating Instance Data Blocks


1. Generate instance DB with FB call 2. Create new instance DB

PLC training by Ahmed M. Salaheldin


Engineering Department

Inserting/Deleting Block Parameters

ave
S

PLC training by Ahmed M. Salaheldin


Engineering Department

Summary: Block Calls


FC FB
Lan-
guage Without parameters With parameters W/o param., w/o inst. DB With param., with inst.DB

• CALL FC1 • CALL FC2 • CALL FB2 • CALL FB2, DB3


STL • UC FC1 Par1: ... • UC FB1 Par1: ...
Par2: ... Par2: ...
• CC FC1 • CC FB1
Par3: ... Par3: ...

FC1
( CALL )
DB3
FC2 FB1 FB2
FC1
LAD EN ENO EN ENO EN ENO
EN ENO
Par1 Par1
Par2 Par3 Par2 Par3

FC1
CALL DB3
FC2 FB1 FB2
FC1 EN Par3 EN EN Par3
FBD
EN Par1 Par1
ENO
Par2 ENO ENO Par2
ENO

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise
Create FB2 with instance data block DB2

FB2 contains the following parameters:


• Input bit enable.
• Input real for load cell.
• Temp real for scaled load cell.
• Static real variable for load cell scaled.
• Output real for scaled load cell.
• Output bit load cell out of range.

Program FB2 to move the input real for load cell into
the static real for load cell scaled and then move the
static real into the output real for scaled load cell.

Call FB2 in OB1 and give it any addresses.

Create DB2 instance data block for FB2

Open DB2 and monitor its data values.


PLC training by Ahmed M. Salaheldin
Engineering Department

Binary Operations
I 0.0 I 0.1 Q 8.0

Q 8.1 I 1.0 &


M1.0 M8.0
I 1.1 P =

I 1.0 &
M1.1 M8.1
I 1.1 N =

M0.0
I 1.2 Q 9.3
SR
S Q

I 1.3
R

PLC training by Ahmed M. Salaheldin


Engineering Department

Binary Logic Operations: AND, OR


Circuit Diag. LAD FBD STL

S1 (I 0.0)
I0.0 I0.1 Q 8.0A I0.0
Q 8.0 I 0.0 &
= A I0.1
AND S2 (I 0.1) I 0.1 = Q 8.0
Q 8.1= Q 8.1
Q 8.1
=

L1 L2
(Q 8.0) (Q 8.1)

S3
(I 0.2) I0.2
Q 8.2
I 0.2 Q 8.2 O I0.2
S4 >=1 O I0.3
OR =
(I 0.3) I 0.3 = Q 8.2
I0.3

L3 (Q 8.2)

PLC training by Ahmed M. Salaheldin


Engineering Department

Binary Logic Operations: Exclusive OR (XOR)


LAD FBD STL

I 0.4 & A I 0.4


I 0.4 I 0.5 AN I 0.5
Q 8.0 I 0.5 Q 8.0
>=1 O
= AN I 0.4
I 0.4 & A I 0.5
I 0.4 I 0.5 = Q8.0
I 0.5

X I 0.4
I 0.4 Q 8.0
XOR X I 0.5
= = Q8.0
I 0.5

PLC training by Ahmed M. Salaheldin


Engineering Department

Assignment, Setting, Resetting


LAD FBD STL

I 1.0 I 1.1 A I 1.0


Q 8.0 I 1.0
( ) & Q 8.0 A I 1.1
Assignment
= Q 8.0
I 1.1 =

I 1.2 I 1.3 A I 1.2


Q 8.1 I 1.2
Set (S) & Q 8.1 A I 1.3
I 1.3 S S Q 8.1

I 1.4 Q 8.1
(R) O I 1.4
I 1.4 >=1 Q 8.1 O I 1.5
Reset
I 1.5 I 1.5 R R Q 8.1

PLC training by Ahmed M. Salaheldin


Engineering Department

Setting / Resetting a Flip Flop


LAD FBD STL

M0.0 M0.0
I 1.2 Q 9.3 A I 1.2
SR SR
Dominant S Q I 1.2 S S M 0.0
Reset A I 1.3
Q9.3
I 1.3 R M 0.0
I 1.3 R Q = A M 0.0
R
= Q 9.3

M0.0 M0.0
I 1.3 Q 9.3 A I 1.3
Dominant RS RS
R Q I 1.3 R R M 0.0
Set A I 1.2
Q9.3
I 1.2 S M 0.0
I 1.2 Q = A M 0.0
S S
= Q 9.3

PLC training by Ahmed M. Salaheldin


Engineering Department

Connector
LAD STL

I 1.0 I 1.1 M0.0 I 2.0 I 2.1 M 1.1 Q 4.0


( ) NOT ( ) ( ) A I 1.0
A I 1.1
= M 0.0
A M 0.0
A I 2.0
FBD A I 2.1
NOT
= M 1.1
I 1.0 & A M 1.1
M0.0 = Q 4.0
I 1.1 &
I 2.0 M1.1 Q 4.0
I 2.1 =

PLC training by Ahmed M. Salaheldin


Engineering Department

RLO - Edge Detection


LAD FBD STL

I 1.0 I 1.1 M1.0 M8.0 A I 1.0


I 1.0 &
M1.0 M8.0 A I 1.1
P FP M1.0
I 1.1 P = = M8.0

I 1.0 I 1.1 M1.1 M8.1 I 1.0 & A I 1.0


M1.1 M8.1 A I 1.1
N FN M1.1
I 1.1 N =
= M8.1

OB1-
I 1.0 Cycle

I 1.1

RLO
Example
M1.0

M1.1

M8.0
M8.1

PLC training by Ahmed M. Salaheldin


Engineering Department

Unconditional Jump (Independent of RLO)


LAD FBD STL

Network 1 Network 1 Network 1


NEW1 NEW1
( JMP ) .... JMP JU NEW1

Network 2 Network 2 Network 2


: : :
: : :
: : :
: : :
Network x Network x Network x
NEW1 NEW1

M5.5 I 4.7 M69.0 & NEW1:AN M5.5


M5.5 M69.0
( ) AN I
I 4.7 = 4.7
=
M69.0

PLC training by Ahmed M. Salaheldin


Engineering Department

Conditional Jump (Dependent on RLO)

LAD FBD STL

I 0.0 I 0.1 NEW1 I 0.0 & A I 0.0


Jump if NEW1 A I 0.1
(JMP)
RLO=1 I 0.1 JMP JC NEW1

Jump if I 0.2 I 0.3 I 0.2 & A I 0.2


NEW2 NEW2
RLO=0 A I 0.3
(JMPN) I 0.3 JMPN JCN NEW2

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise: Motor start stop

Write PLC program to start stop motor using two push


buttons. (use FC15).

A fault will be active if there is no feedback from the


motor contactor after activating the output from PLC for
500 msec. or vise versa.

Motor cannot be started with fault active.

There is a Reset push button to reset the fault.

PLC training by Ahmed M. Salaheldin


Engineering Department

Analog Value Processing

High level

Level
transmitter
Low level

PLC training by Ahmed M. Salaheldin


Engineering Department

Use of Analog Modules


Process Analog input module CPU

Physical Standard :
quantity analog signal Result :
memory :
:
PIW ... :
MR PIW ... :
ADC
module ::: L PIW 352
Sensor Transducer ..
PIW ... ..
..
..
• Pressure ± 500mV ..
• Temperature± 1V ..
• Flow ± 5V ..
• Speed ± 10V
..
..
• pH value ± 20mA ..
• Viscosity 4...20mA Analog output module ..
• etc. etc. ..
..
..
..
..
..
..
PQW ...
..
Physical Analog PQW ...
DAC
quantity actuator :::
PQW ...
T PQW 368
:
PLC training by Ahmed M. Salaheldin
Engineering Department

Analog Module SM335 (Inputs)

PLC training by Ahmed M. Salaheldin


Engineering Department

Analog Input Module SM331

PLC training by Ahmed M. Salaheldin


Engineering Department

Analog Module SM335 (Outputs)

PLC training by Ahmed M. Salaheldin


Engineering Department

Analog Module Addresses with S7-300

Rack 3 Power IM 640 656 672 688 704 720 736 752
Supply to to to to to to to to
(Receive) 654 670 686 702 718 734 750 766

IM 512 528 544 560 576 592 608 624


Rack 2 Power
Supply (Receive) to to to to to to to to
526 542 558 574 590 606 622 638

IM
Rack 1 Power 384 400 416 432 448 464 480 496
Supply (Receive) to to to to to to to to
398 414 430 446 462 478 494 510

IM 256 272 288 304 320 336 352 368


R Power
to to to to to to to to
0 Supply CPU (Send)
270 286 302 318 334 350 366 382

Slot 2 3 4 5 6 7 8 9 10 11

PLC training by Ahmed M. Salaheldin


Engineering Department

Scaling Analog Input Values

500,0

0,0
0 27648
PLC training by Ahmed M. Salaheldin
Engineering Department

Unscaling a Real Number for Analog Output

27648

0
0,0 100,0

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise:Load cell scaling

Write plc program in FC25 to scale load cell analog


input as follows:

scaled  multiplicator input  offset 


Modify FC25 with local variables to be called in the
plc program FC26 to scale four different load cells

Store the scaled load cell value in DB9

PLC training by Ahmed M. Salaheldin


Engineering Department

Organization Blocks

FC FB
OB1
Operating
system
FB FC

SFC

SFB

Other
OBs

PLC training by Ahmed M. Salaheldin


Engineering Department

Overview of the Organization Blocks


Startup

OB 100

OB 101
OB 102

Cyclic Periodic Event-driven


program program program
execution execution execution

OB 10...17 OB 20...23 OB 80...87


OB 1
(Time-of-day (Time-delay interrupts) (Asynchronous errors)
interrupts)

OB 30...38 OB 40...47 OB 121, 122


(Cyclic interrupts) (Hardware interrupts) (Synchronous errors)

Interrupt OBs Error OBs

PLC training by Ahmed M. Salaheldin


Engineering Department

Startup OBs Restart (manual)

• only for S7-400


Complete restart (according to setting in HW Config):
STOP -> RUN + WRST
automatic manual

S7-300 / 400 S7-300 S7-400 Execution of OB 101


STOP->RUN
Power ON STOP->RUN
+ CRST Process residual scan cycle

Deleting the process images,


Delete PIQ (parameter-assignable)
non-retentive M, T, C

Monitoring time
Execution of OB 100
for restart exceeded ? STOP
yes
no
Enable outputs
Enable outputs

Read in PII
C
Y C Read in PII
C Y
Execute OB1
L C
Execute OB1
E L
E
Output PIQ
Output PIQ

PLC training by Ahmed M. Salaheldin


Engineering Department

Interrupting the Cyclic Program


E.g. OB82 (Prio.26) =
Error handling. E.g. OB10 (Prio.2) =
Executed in event of Time-of-day interrupt.
wire break at analog Executed once a
input PIW 352 minute from 9:30
OB1
is
execute
d
continu- ...... until it is interrupted
E.g. OB20 by another OB
ously ...
(Prio.3) =
Time-delay
..
interrupt. OB No. OB Type Priority
Execution starts OB 1 Cyclic program 1
3.25s after a part OB 10 Time-of-day interrupt 2
is detected. OB 20 Time-delay interrupt 3
OB 35 Cyclic interrupt 12
OB 40 Hardware interrupt 16
OB 82 Error handling 26 / 28

PLC training by Ahmed M. Salaheldin


Engineering Department

Time-of-Day Interrupt (OB10)

PLC training by Ahmed M. Salaheldin


Engineering Department

Cyclic Interrupt (OB35)

RUN OB35 OB35 OB35


Interval Interval Interval Prio 12

OB1 OB1 O B1 OB1 OB1 OB1 OB1 O B1 Prio 1

PLC training by Ahmed M. Salaheldin


Engineering Department

Hardware Interrupt (OB40)


HW Config:

Properties of the Properties


analog input module of the CPU

Analog input module

+27648
Upper limit
value
Lower limit
0 value

PLC training by Ahmed M. Salaheldin


Engineering Department

Diagnostic Interrupt, Asynchronous Error Interrupt


(OB81...87) HW Config:

Properties of the
Properties
analog input module of the CPU
Analog input module

Wire break

+27648

PLC training by Ahmed M. Salaheldin


Engineering Department

Asynchronous Error OBs


Type of error Example OB Priority

Time error Maximum scan cycle time exceeded OB80 26


Power supply fault Backup battery failure OB81
Wire break at input of diagnostics-capable
Diagnostic interrupt OB82
module
Insert / remove Removal of a signal module during
OB83
interrupt operation of an S7-400
CPU hardware fault Incorrect signal level at the
OB84
MPI interface
Program execution Error in updating the process image
OB85
error (module defective)
Rack fault Failure of an expansion device or a
OB86
DP slave
Communication 26 / 28
Error in reading message frame OB87
error

PLC training by Ahmed M. Salaheldin


Engineering Department

Synchronous Errors
Type of error Example OB Priority

A block that is not present in


The CPU is called in the
Programming error OB121
program
Same as that
of the OB
A module which is either interrupted
Defective or not present is as a result of
Access error addressed in the program OB122 the error
(e.g. direct access to a
non-existent I/O module)

PLC training by Ahmed M. Salaheldin


Engineering Department

Troubleshooting

PLC training by Ahmed M. Salaheldin


Engineering Department

Categories of Errors
Errors Detected by the System
• Recording, evaluating and indicating
errors within a PLC
(as a rule: CPU STOP)
• Module failure
• Short-circuit in signal cables
• Scan time overrun
• Programming error (accessing a
non-existent block)
Functional Errors
• Desired function is either not executed
at all or is not correctly executed
• Process fault (Sensor/Actuator, cable
defective)
• Logical programming error (not detected

during creation and startup)


PLC training by Ahmed M. Salaheldin
Engineering Department

STEP7 - Debugging Tools, Overview


Error

Error detected by the System: Functional fault:


General Rule: CPU in STOP General Rule: CPU in RUN
(e.g. accessing a non-existent DB) (process fault, e.g. wire break)
(Diagnostic interrupt of a signal module) (logical programming error, e.g. double
assignment)
Debugging Tools:
Debugging Tools:
• Enable Peripheral Outputs
• Module Information
(modify outputs)
- Diagnostic buffer
• Monitor / Modify Variable
- I STACK
• Monitor Blocks (Block Status)
- B STACK
• Reference Data
- L STACK
- Cross References
• Hardware Diagnostics
- Assignment of I/Q/M/T/C
- Program Structure
- Addresses without Symbols
- Unused Symbols
Regardless of the cause of the error you could use:
• Force
• Set Breakpoints
PLC training by Ahmed M. Salaheldin
Engineering Department

Calling the "Module Information" Tool


SIMATIC Manager LAD/STL/FBD
Editor

Module Information

PLC training by Ahmed M. Salaheldin


Engineering Department

Module Information Tab: "Diagnostic Buffer"

PLC training by Ahmed M. Salaheldin


Engineering Department

Interpreting Error Messages in the Diagnostic Buffer

PLC training by Ahmed M. Salaheldin


Engineering Department

Opening a Block Containing an Error

PLC training by Ahmed M. Salaheldin


Engineering Department

Diagnostics with I Stack, B Stack, L Stack


Program structure Block containing error

Point of interruption

The B stack shows a list of the


blocks that were executed up
Point of interruption
to the point of interruption.
You can see the
contents of the
accumulators,
registers, status word You can see the values of the
etc. at the time of temporary variables at the
interruption in the I time of interruption in the L stack.
stack.
PLC training by Ahmed M. Salaheldin
Engineering Department

Contents of the B Stack

PLC training by Ahmed M. Salaheldin


Engineering Department

Contents of the I Stack

PLC training by Ahmed M. Salaheldin


Engineering Department

Contents of the L Stack

PLC training by Ahmed M. Salaheldin


Engineering Department

Displaying the Hardware Diagnostics

twice

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise

Find the PLC stop cause and solve it

PLC training by Ahmed M. Salaheldin


Engineering Department

Calling the "Monitor/Modify Variables" Tool

PLC training by Ahmed M. Salaheldin


Engineering Department

Establishing Trigger Points for "Monitor/Modify Variable"

PII
Trigger point
"Beginning of Scan
Cycle"
Monitor / Modify Update Status / Modify
Set
depending on Values (one time
Trigger
Trigger setting monitor / modify)

Cyclic
program
execution
Trigger point
"Transition to STOP"

Trigger point
"End of Scan Cycle"

PIQ

PLC training by Ahmed M. Salaheldin


Engineering Department

Modifying Outputs in the Stop State

PLC training by Ahmed M. Salaheldin


Engineering Department

Saving / Opening a Variable Table

PLC training by Ahmed M. Salaheldin


Engineering Department

Testing (Debugging) Blocks using "Monitor" (Block Status)

PLC training by Ahmed M. Salaheldin


Engineering Department

Displaying Reference Data

PLC training by Ahmed M. Salaheldin


Engineering Department

Displaying the Program Structure

PLC training by Ahmed M. Salaheldin


Engineering Department

Displaying Cross References

PLC training by Ahmed M. Salaheldin


Engineering Department

Filtering Cross References

PLC training by Ahmed M. Salaheldin


Engineering Department

Block Correction using Cross


References

twice

PLC training by Ahmed M. Salaheldin


Engineering Department

"Find" In Reference Data

PLC training by Ahmed M. Salaheldin


Engineering Department

Assignment of I, Q, M, T, C

PLC training by Ahmed M. Salaheldin


Engineering Department

Go To Location

1xright

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise

Monitor and modify variable (all inputs IB10 and outputs QB10 )

Save the variable table.

Use go to location function.

PLC training by Ahmed M. Salaheldin


Engineering Department

Comparing Blocks

...see
next page

PLC training by Ahmed M. Salaheldin


Engineering Department

PLC training by Ahmed M. Salaheldin


Engineering Department

Overwriting Variables using "Force"

PLC training by Ahmed M. Salaheldin


Engineering Department

Exercise on force job

Force on the following identifiers:


• I10.0 true.
• I10.1 false.
• Q10.4 true.
• M20.1 true.

Remove the force on I10.1

Display force values.

Delete all forces.

PLC training by Ahmed M. Salaheldin


Engineering Department

Profibus
Rack2

PLC training by Ahmed M. Salaheldin


Engineering Department

Profibus Cable Connectors

PLC training by Ahmed M. Salaheldin


Engineering Department

Bus termination 220Ω

PLC training by Ahmed M. Salaheldin


Engineering Department

Profibus troubleshooting
• Check PLC hardware configuration and find missing nodes.

• Check bus termination.

• Disconnect all bus connectors.

• Check cables connectivity.

• Check for short circuit with earth.

• Measure the full bus resistance (should be 110 Ω if using 220Ω

termination resistors).

• Check OLMs LEDs and fiber optics cables.

PLC training by Ahmed M. Salaheldin


Engineering Department

Thanks
Ahmed Mohamed Salaheldin Mahmoud
+20 18 9967704
+212 656155260
First Electrical Engineer
Scctportsaid
ahmed.salaheldin@scctportsaid.com
http://www.scctportsaid.com

PLC training by Ahmed M. Salaheldin

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy