Course and Example
Course and Example
October 2004
Introduction Hardware Software
Table of contents
Introduction
Hardware
Design
Manufacturer
Function
Software
Mode of operation
Variables
Program structures
2
Introduction Hardware Software
General description
Features:
Data capture
Collection of analogue values (flow rate, temperatures,
positions as well as e.g. speeds of drives, frequency
converters)
Collection of digital signals (e.g. pressure switch or
feedback signals from drives)
Control
frequency converters / positioning drives / rolls etc.
Visualization
OPs (e.g. OP170 with Pro-Tool)
PCs (e.g. standard PC with WinCC, LabView, Intouch)
3
Introduction Hardware Software
General description
PLC tasks:
Measuring
Controlling
Feedback controlling
4
Introduction Hardware Software
General description
Definition PLC: Small computers with automation functions in
industrial environments
5
Introduction Hardware Software
HPC PLC
Hardwired programmed vs. Programmable logic controller
S1 S4 K1 K1 S1 S4 S2 S3
S2
Automation unit
S3
K1 H1 H1
Table of contents
Introduction
Hardware
Design
Function
Software
Mode of operation
Variables
Program structures
7
Introduction Hardware Software
8
Introduction Hardware Software
- processor speed
- addressability
- memory
- plant size
9
Introduction Hardware Software
Design
Power supply
CPU modules
Input modules
Output modules
Communication modules
Function modules
Operating units
10
Introduction Hardware Software
Power supply
11
Introduction Hardware Software
CPU modules
• processor
• memory
12
Introduction Hardware Software
Input modules
• digital inputs
• analogue inputs
13
Introduction Hardware Software
output modules
• digital outputs
• analogue outputs
• relais outputs
14
Introduction Hardware Software
Communication modules
• programming interfaces
15
Introduction Hardware Software
Function modules
• positioning units
• control units
• counter units
• timepiece units
• etc.
16
Introduction Hardware Software
Operating units
• Operator Panels
• Touch Screens
• Text Displays
• Keyboards
17
Introduction Hardware Software
SPC SPC
COM
COM
CPU
CPU
COM
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
I/O
field bus
COM
COM
COM
CPU
CPU
I/O
I/O
I/O
I/O
I/O
I/O
I/O
input and output
decentral periphery
Data flow
Power supply
19
Introduction Hardware Software
Design of PLC
Programmable controller
Signal
generator Inputs Central unit Outputs Positioner
Program memory
Control unit
Timing
Flag
elements
Process Counter
image
20
Introduction Hardware Software
Table of contents
Introduction
Hardware
Design
Manufacturer
Function
Software
Mode of operation
Variables
Program structures
21
Introduction Hardware Software
22
Introduction Hardware Software
23
Introduction Hardware Software
Inputs
0 1 PII 1
Read inputs
Times
Counters
Flags
Process
program Alarm
program
e.g.
time,
process
alarm
Write outputs
Processor Program memory
0 1 PIO 1
Outputs
24
Introduction Hardware Software
1 BIT
7 6 5 4 3 2 1 0
1 BYTE = 8 Bits
15 8 7 0
1 word = 16 Bits = 2 Bytes
Byte Byte
25
Introduction Hardware Software
7 6 5 4 3 2 1 0
7 6 5 4 3 2 1 0
EW1
26
Introduction Hardware Software
Number formats
binary
decimal
hexadecimal
27
Introduction Hardware Software
Decimal numbers
base = 10
figures: 0 . . . 9
e.g.: 234510
= 2 • 10 3 + 3 • 10 2 + 4 • 10 + 5
= 2 • 1000 + 3 • 100 + 4 • 10 + 5
= 2000 + 300 + 40 + 5
28
Introduction Hardware Software
Binary numbers
base = 2
figures: 0 . . 1
e.g.: 1001012
=1•25+0•24+0•23+1•22+0•2+1
= 1 • 32 + 0 • 16 + 0 • 8 + 1 • 4 + 0 • 2 + 1
= 32 + 4 + 1
= 3710
29
Introduction Hardware Software
Hexadecimal numbers
base = 16
figures: 0 . . . 9 A B C D E F
A=10, B=11, C=12, D=13, E=14, F=15
e.g.: FEDC16
= 15 • 16 3 + 14 • 16 2 + 13 • 16 + 12
= 15 • 4096 + 14 • 256 + 13 • 16 + 12
= 61440 + 3584 + 208 + 12
= 6524410
30
Introduction Hardware Software
Control instruction
Control instruction
(smallest unit in the user program)
U E 1.0
Operand Parameter
characteristic
E 1.0
31
Introduction Hardware Software
Variable declaration
A 7.3 address of variable
single-bit value
I Input B Byte (8 Bit)-value
O Output W Word (16 Bit)-value
F Flag D Double word (32 Bit)-value
DM Data module
32
Introduction Hardware Software
Programming languages
IEC 1131 basically states 5 programming languages,
which can be divided into 2 groups:
1.Text-based 2.Graphical
Instruction Set (IS) Contact Plan (COP)
33
Introduction Hardware Software
34
Introduction Hardware Software
S2 = E1.1
H1 = A2.0
35
Introduction Hardware Software
36
Introduction Hardware Software
S1 = E1.0 U E 1 0
U E 1 1
= A 2 0
S2 = E1.1
H1 = A2.0
37
Introduction Hardware Software
Example for IS
One instruction is composed as follows:
38
Introduction Hardware Software
39
Introduction Hardware Software
Examples for ST
Example 1:
Q1.1:=(I0.1 OR I0.2 OR Q1.1) AND I0.3 AND I0.4;
Example 2:
IF (I0.1 OR I0.2 OR Q1.1) THEN
IF (I0.3 AND I0.4) THEN
Q1.1:=1;
ELSE
Q1.0:=0;
END_IF;
END_IF;
40
Introduction Hardware Software
41
Introduction Hardware Software
Example for SC
I0.1 Step 0
S0
R Q1.1
I0.2 I0.3 I0.4
T0
I0.3 Step 1
S1
S Q1.1
I0.4
T1
S0
42
Introduction Hardware Software
43
Introduction Hardware Software
S2 = E1.1
H1 = A2.0
44
Introduction Hardware Software
45
Introduction Hardware Software
OB1 OB1 FB FB FC
FB FB FB
FB FC FC
46
Introduction Hardware Software
Program Program
processing processing
47