Académique Documents
Professionnel Documents
Culture Documents
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
09.01.2015
PRO2_01E.1
32 Bit
Load Memory
ACCU3
32 Bit
ACCU2
32 Bit
ACCU1
32 Bit
Work Memory
L, A, O,...
Address Register
AR1
32 Bit
AR2
32 Bit
T, S, =,...
open DB
DB Length
open DI
DI Length
16 Bit
Status Word
Status Bits
16 Bit
Logic Blocks
Data Blocks
I/O Area
S7-CPU Register
SIMATIC S7
System Memory
16 Bit
Logic Blocks
Data Blocks
Date:
File:
09.01.2015
PRO2_01E.2
Assignment
Value
Meaning
/FC
20
RLO
21
STA
22
Status
OR
23
Or
OS
24
Stored overflow
OV
25
Overflow
CC 0
26
Condition code
CC 1
27
Condition code
BR
28
Binary result
9...15
Unassigned
29 ..210
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
09.01.2015
PRO2_01E.3
A OV
A OS
A BR
Scan BR flag
A == 0 Result equal to 0
A UO
Instruction is unordered
SIMATIC S7
Siemens AG 2001. All rights reserved.
M 4.0
S
>0
Date:
File:
09.01.2015
PRO2_01E.4
M 4.0
S
Meaning
Example
SET
SET
= M 0.1
//RLO-1
CLR
CLR
//RLO-0
NOT
Invert RLO
O Manual mode;
O Automatic mode;
NOT;
= Operating modes
= M0.0
SAVE
A BR
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
09.01.2015
PRO2_01E.5
I 1.0
I 1.1
I 1.2
||
||
||
BR
Q 4.2
||
||
(SAVE)
Q 5.0
()
STL
I0.0
MW10
M100.0
ENO
EN
Step_bit Step_dis
_memory play
( )
QW12
Network 2: ???
MUL_I
I0.1
M100.1
EN
ENO
( )
345
IN1
OUT
MW10
987
IN2
SIMATIC S7
Siemens AG 2001. All rights reserved.
Network 2: ???
A
I
0.1
JNB
_002
L
345
L
987
*I
T
MW 10
AN
OV
SAVE
CLR
_002: A
BR
=
M
100.1
Date:
File:
09.01.2015
PRO2_01E.6
:=M
JU Label1)
Jump unconditional
JC Label1)
JCN Label1)
JCB Label1)
JNB Label1)
JBI Label1)
JNBI Label1)
JO Label1)
JOS Label1)
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
09.01.2015
PRO2_01E.7
JZ Label1)
Jump if in the status word bit "CC 1"=0 and "CC 0"=0
(Result = 0)
JN Label1)
Jump if in the status word bit "CC 1" is not equal to "CC 0"
(Result <> 0)
JP Label1)
Jump if in the status word bit "CC 1"=1 and "CC 0"=0
(Result > 0)
JM Label1)
Jump if in the status word bit "CC 1"=0 and "CC 0"=1
(REsult < 0)
JPZ Label1)
JMZ Label1)
JUO Label1)
characters
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
09.01.2015
PRO2_01E.8
OVER:
M_0:
Load jump
number
L Recipe no
JL OVER
JL OVER
JU M_0
JU Rec0
..
.
JU Rec1
JU M_n
JU Rec2
Instructions if
ACCU1 > n
OVER: JU ERROR
Instructions if
ACCU1 = 0
Rec0: L DBW4
...
...
..
.
Rec1: L DBW6
...
M_n:
Instructions if
ACCU1 = n
Rec2: L DBW8
...
ERROR:
CLR
...
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
09.01.2015
PRO2_01E.9
Initialize
loop counter
Transfer
to loop counter
NEXT:
L +4
NEXT: T MW10
Code section to be
executed several
times
// Code
// Code
// Code
L MW10
LOOP NEXT
Yes
LOOP NEXT
decrement ACCU1,
ACCU1 <> 0 ?
No
Continue
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
09.01.2015
PRO2_01E.10
BE
Block End
BEU
BEC
SIMATIC S7
Siemens AG 2001. All rights reserved.
(RET)
RET
Date:
File:
09.01.2015
PRO2_01E.11
Pushwheel button
1
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0
215
convert to BTD
DINT
27
BTD
20
convert to
DINT
-D
Pos. result (>=0)
Neg. result
[JM Label]
Write the value of IW 0
in the display
Delete display
Decade switch:
Toggle switch:
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
Display:
09.01.2015
PRO2_01E.12
S
S
Pushwheel button
1
0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0
215
convert to BTD
DINT
BTD
27
20
DTB
Convert result
to BCD
convert to
DINT
*I
No overflow
Overflow
[JO Label]
Output result
to the display
Delete display
Decade switch:
Toggle switch:
SIMATIC S7
Siemens AG 2001. All rights reserved.
Date:
File:
Display:
09.01.2015
PRO2_01E.13
S
S
[ JL Label]
1
2
3
4
5
Addresses:
Motor_right:
Motor_left:
Horn:
SIMATIC S7
Siemens AG 2001. All rights reserved.
S7-300 (16-Bit)
Q20.5
Q20.6
Q20.7
S7-300 (32-Bit)
Q8.5
Q8.6
Q8.7
Date:
File:
09.01.2015
PRO2_01E.14
S7-400
Q40.5
Q40.6
Q40.7
SITRAIN Training for
Automation and Drives