Académique Documents
Professionnel Documents
Culture Documents
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.1
Load Memory
32 Bit 32 Bit 32 Bit Logic Blocks Data Blocks
Work Memory
L, A, O,...
Logic Blocks Data Blocks
Address Register
AR1 AR2
32 Bit 32 Bit
T, S, =,...
DB Length DI Length
16 Bit
Status Word
Status Bits
16 Bit
Assignment
/FC RLO STA OR OS OV CC 0 CC 1 BR Unassigned
Value
20 21 22 23 24 25 26 27 28 29 ..210
Meaning
First check bit Result of logic operation Status Or Stored overflow Overflow Condition code Condition code Binary result
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.3
A OV A OS A BR
A == 0 Result equal to 0 A > 0 Result greater than 0 A <> 0 Result not equal to 0
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.4
Meaning
Set RLO to "1" Set RLO to "0" Invert RLO
Example
SET = M 0.1 CLR //RLO-1 //RLO-0
I 1.0
I 1.1
I 1.2
SAVE
||
BR
||
Q 4.2
||
(SAVE)
Q 5.0
A BR
||
||
()
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.5
STL
Network 1: Cyclic Program A I 0.0 JNB _001 CALL FC 23 Step_bit_memory Step_display :=QW12 _001: A BR = M 10.0
( )
QW12
:=M
MW10
Network 2: ??? I0.1 EN 345 987 IN1 IN2 MUL_I ENO M10.1
( )
MW100
OUT
Network 2: ??? A I 0.1 JNB _002 L 345 L 987 *I T MW 100 AN OV SAVE CLR _002: A BR = M 10.1
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.6
JCB Label1)
JNB Label1) JBI Label1) JNBI Label1) JO Label1) JOS Label1)
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.7
JZ Label1)
Jump if in the status word bit "CC 1"=0 and "CC 0"=0 (Result = 0)
JN Label1)
JP Label1) JM Label1) JPZ Label1) JMZ Label1) JUO Label1)
Jump if in the status word bit "CC 1" is not equal to "CC 0" (Result <> 0)
Jump if in the status word bit "CC 1"=1 and "CC 0"=0 (Result > 0) Jump if in the status word bit "CC 1"=0 and "CC 0"=1 (REsult < 0) Combines the jumps JZ and JP (Result >= 0) Combines the jumps JM and JZ (Result <= 0) Jump if: invalid Real number or division by zero
1) Label
characters
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.8
. . .
. . .
M_n: Instructions if ACCU1 = n
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.9
.
. . L MW10
// Code
// Code // Code // Load loop counter again // Loop counter -1 and // jump to jump label // NEXT if Accu 1> 0
Yes
LOOP NEXT
decrement ACCU1, ACCU1 <> 0 ?
LOOP NEXT
No Continue
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.10
BE
Block End
BEU
BEC
RET
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.11
BTD
convert to DINT
-D
Pos. result (>=0) Neg. result [JM Label] Delete display Write the value of IW 0 in the display Display:
S7-300: IW4 (IW2, 32-Bit Mod.) S7-400: IW 30 S7-300: IW0 (IW0) S7-400: IW28
S S
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.12
BTD
convert to DINT
*I
No overflow Overflow [JO Label] Delete display DTB Convert result to BCD
S7-300: IW4 (IW2, 32-Bit Mod.) S7-400: IW30 S7-300: IW0 (IW0) S7-400: IW28
S S
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
04.03.2014 PRO2_01E.13
1
1 2 3 4 5
[ JL Label]
SIMATIC S7
Siemens AG 1999. All rights reserved.