PLC Training
PLC Training
PLC
Training
• Expandable
• Easy to change the program
• Small size
• Fault diagnostics
PLCs Manufacturers:
• SIEMENS (I, Q)
• Mitsubishi (X, Y)
• Omron (no identifiers)
•
•
•
For SIEMENS
Micro Modular L. S.
SIMATIC
PCS 7
SIMATIC
SIMATIC NET
Software
System Family
SIMATIC
PC
SIMATIC
WinCC
SIMATIC
DP
SIMATIC
Controller
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
S7-300
S7-300: Modules
STOP STOP
M RES
M RES
SIMATIC SIMATIC
S7-300 S7-300
Battery MPI Battery MPI DP
S7-400
S7-400: Modules
S7-400: CPU
Design
Mode Selector
e.g. CPU412-1
* for further CPUs please see catalog e.g. CPU416-2DP
S7-400: CPU
Design
Fault LEDs
MP/DP Interface
DP Interface
External Battery
Supply
Programming
Devices PG/PC
SIEMENS
PG 740
Double-click on Icon
SIMATIC Manager
Hardware
FB21
OB1
I 1.0 I 1.1 Q4.0
Process Software
or
Titlebar
Menubar
Toolbar
Statusbar
Taskbar
The Toolbar
in the
SIMATIC
Manager
Creating an S7 Project
Enter project
name here
and confirm
with "OK"
Offline /
Online
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)
Hardware Configuration
Inserting a Station
Starting HW Config
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
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
Variable Addressing
2x
1x right
CPU Properties
2x
Download
(only when CPU
is in STOP mode)
Exercise
• Create a new project named “training3”.
assignment.
Exercise
• Create a new project named “Group3”.
assignment.
Block Architecture
OB 1 FB FB FC
FB FB FB
FB FC FC
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
Program Structure
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.
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
Program Execution
Start-up block (OB 100)
Execution once after e.g. power on
Input
Start of the cycle monitoring time
Module
Inserting an S7 Block
2x
Declaration
Table
Code Section
Browser
A I 0.0
A I 0.1
= Q8.0
FBD
&
I 0.0
Q8.0
I 0.1 =
LAD
Programming in LAD/FBD
Programming in STL
Saving a Block
Current project directory with name of block
Open offline
Save
Open online
Download
• Emergency stop message will be active if the emergency stop push button is
• Emergency stop message may be reset by reset push button (I12.1 normally
open).
Symbols
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"
(max. 24 (max. 80
characters) characters)
View: Filter
View: Sort
Enter file
name
Select file
format
Bit memories
DBz
PIQ
. .
DBy
PII .
DBx
I/O area
L stack Data
blocks
Function
OB1
FC10
Global data
(Shared)
Function DB20
FC20
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
DBD 0
DBX 4.1
DBD 8188
DBW 8190
Data Byte 8191 DBB 8191
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
Exercise
Introduction
Temporary Variables
#Setpoint
#Setpoint
DB 2
FB 2
EN
Disturb. Input
Acknowledge Display
Flash freq. ENO
Declaration table
of the function
block
Instance
data block
ave
S
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
Exercise
Create FB2 with instance data block DB2
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.
Binary Operations
I 0.0 I 0.1 Q 8.0
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
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)
X I 0.4
I 0.4 Q 8.0
XOR X I 0.5
= = Q8.0
I 0.5
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
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
Connector
LAD STL
OB1-
I 1.0 Cycle
I 1.1
RLO
Example
M1.0
M1.1
M8.0
M8.1
High level
Level
transmitter
Low level
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
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
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
Slot 2 3 4 5 6 7 8 9 10 11
500,0
0,0
0 27648
PLC training by Ahmed M. Salaheldin
Engineering Department
27648
0
0,0 100,0
Organization Blocks
FC FB
OB1
Operating
system
FB FC
SFC
SFB
Other
OBs
OB 100
OB 101
OB 102
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
+27648
Upper limit
value
Lower limit
0 value
Properties of the
Properties
analog input module of the CPU
Analog input module
Wire break
+27648
Synchronous Errors
Type of error Example OB Priority
Troubleshooting
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
Module Information
Point of interruption
twice
Exercise
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
twice
Assignment of I, Q, M, T, C
Go To Location
1xright
Exercise
Monitor and modify variable (all inputs IB10 and outputs QB10 )
Comparing Blocks
...see
next page
Profibus
Rack2
Profibus troubleshooting
• Check PLC hardware configuration and find missing nodes.
termination resistors).
Thanks
Ahmed Mohamed Salaheldin Mahmoud
+20 18 9967704
+212 656155260
First Electrical Engineer
Scctportsaid
ahmed.salaheldin@scctportsaid.com
http://www.scctportsaid.com