Académique Documents
Professionnel Documents
Culture Documents
https://www.facebook.com/groups/722593891132335/
ENG.ABDELKAWY MOUBARAK | 01014871075 2
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 2
تحتوي علي Instructions & Data تحتوي فقط علي Dataخاصة بالبرنامج
SIMATIC Manager Blocks Right Click Insert New Object
Organization Block
Function
Function Block
Data Block
Data Type
Variable Table
هي Blocksيقوم الـ PLCبعمل Callلها دون تدخل من المبرمج
لن يتم تنفيذ اي امر لم يتم كتابته او Functionلم يتم استدعائها من داخل OBبشكل
مبارشر او غير مباشر
بشكل مباشر :يتم كتابته داخل الـ OBمباشرة
بشكل غير مباشر :يتم كتابته داخل Functionيتم استدعائها من داخل OB
Where The program that is to be continuously
executed is stored
مختلفين دون برمجتها اكثر من مرةI/Ps & O/Ps الواحدة لعدد من الـFunction تكرار الـ
SIMATIC Manager > Blocks > Right Click > Insert New Object > Function
Function Program
I/Ps Which Executed when O/Ps
Data To the the Function Called Data From the
Function Function
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 20
Bit data types This Classification is depends on the Area of Storage
Memory
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 22
Bit
Byte = 8 Bit
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 23
What is the first bit in this byte ?
What is it Called ?
7 6 5 4 3 2 1 0
Byte
Bit 7 Bit 0
MSB LSB
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 24
7 6 5 4 3 2 1 0
Byte 0
W0
Byte 1
Byte 2
W2
Byte 3
Byte 4
W4
Byte 5
Byte 6
W6
Byte 7
Byte 8
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 25
W0
215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20
Byte 0 Byte 1
Bit 7 Bit 0
MSB W54 LSB
Byte 54 Byte 55
Bit 7 Bit 0
MSB LSB
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 26
D0
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 27
This Classification is depends on the Mathematical Properties .
Variables of these data types represent numbers that can be used in mathematical
operations.
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 28
عدد صحيح موجب او سالب
Storage Area of integer : 16 Bit
Positive Integer
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 29
Negative Integer:
Arithmetic Operations:
such as + I, * I, <I, ==I
E N G . A B DEENLG K
. AAB W
D EYL KM
AWOYU M
B OAURBAA K | |0 011001144 88771
RAK 1 007
75 5 30
30
عدد صحيح موجب او سالب
Storage Area of Double integer : 32 Bit
Positive Double Integer
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 31
Negative Double Integer
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 32
Floating Point Number ,32 Bit
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 33
ENG.ABDELKAWY MOUBARAK | 01014871075 34
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 34
Decimal Binary Hexadecimal
0 0 0
1 1 1
2 1 0 2
3 1 1 3
4 1 0 0 4
5 1 0 1 5
6 1 1 0 6
7 1 1 1 7
8 1 0 0 0 8
9 1 0 0 1 9
1 0 1 0 1 0 A
1 1 1 0 1 1 B
1 2 1 1 0 E N G0. A B D E L K A W Y M O U B A R A K | 0 1 0 1 4C8 7 1 0 7 5 35
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 35
27 26 25 24 23 22 21 20
Binary Number:
1 0 1 0 0 1 1 1
= 1+2+4+0+0+32+128 = 167
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 36
Decimal Number: 167
Remainder
167 2 1
83 2 1
41 2 1
20 2 0
10 2 0
5 2 1
2 2 0
1 2 1
0
27 26 25 24 23 22 21 20
Binary Number: 1 0 1 0 0 1 1 1
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 37
Decimal Number: 167
27 26 25 24 23 22 21 20
Binary Number: 1 0 1 0 0 1 1 1
Decimal To BCD:
1 6 7
0 0 0 1 0 1 1 0 0 1 1 1
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 38
•Counter UP
CU
•Counter Down
CD
•Counter UP/Down
CUD
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 39
S7-300 Instruction
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 40
Counting Diagram
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 41
S7-300 Instruction
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 42
Counting Diagram
E N G . A B D E L K A W Y M O U B A R A K | 0 1 0 1 4 8 71 07 5 45
Full
SR
E N G . A B DEENLG K
. AAB W
D EYL KM
AWOYU M
B OAURBAA K
RAK
| |0 011001144 88771
1 007
75 5 46
46
You can use comparison
instructions to compare the
following pairs of numerical values:
<>
•IN1 is not equal to IN2
>
•IN1 is greater than IN2
E N G . A B DEENLG K
. AAB W
D EYL KM
AWOYU M
B OAURBAA K
RAK
| |0 011001144 88771
1 007
75 5 49
49
S1 S2 Right
Lamp
Start Reset
30
Stop
Alarm
E N G . A B DEENLG K
. AAB W
D EYL KM
AWOYU M
B OAURBAA K
RAK
| |0 011001144 88771
1 007
75 5 50
50
ADD_I : ADD Type of math Operation
I For Integer Numbers
•ADD_I - SUB_I
Integers (I)
•MUL_I - DIV_I
•ADD_DI - SUB_DI
Double •MUL_DI - DIV_DI
integers (DI)
•ADD_R - SUB_R
Real (R)
•MUL_R - DIV_R
S1 S2 Right
Lamp
Start Reset
30
Stop
Alarm
E N G . A B DEENLG K
. AAB W
D EYL KM
AWOYU M
B OAURBAA K
RAK
| |0 011001144 88771
1 007
75 5 53
53
𝐴2 : 4𝐴 : 5
𝑋=
5𝐵:2