Вы находитесь на странице: 1из 289

SIMATIC S5

ST-S5SYS2
VII
AL: N

ECCN: N




.
.
,
.

.
, ,
, .

Siemens AG 1997


No.: E80850-K02-X-A7.1

STEP 5.

STEP 5,
.
:

SD

BS

AN

UN

JU

SPA

TB

TBN

PN

BEC

BEB

BEU

BEA

JC

SPB

SIMATIC S5
1

: ............................................. 1-2
................................................... 1-2
.......................................................................... 1-4
........................................................................ 1-4
.......................................................................... 1-6
PB 100 ............................ 1-8
PB 101 ......................................................... 1-10
PB 102 .................................... 1-10
PB 103............................................. 1-10
: ................................ 1-14
........................................................................................ 1-15
PG ........................................ 1-26
........................................................................ 1-26
................................................................ 1-26
..................................................................................... 1-26
................................................. 1-28
...................................... 1-28
:
........................................................... 1-32
.................................................................. 1-32
.................................................................................... 1-32
........................................................... 1-33
(Printer File) ................................................................ 1-33
............................................................ 1-36
.................................................................... 1-36
......................................................................... 1-38
.................................................................. 1-38
................................................................... 1-38
.................................................................................... 1-40
.............................................................................. 1-40
...................................................... 1-42
....................................................................... 1-42
................................................................ 1-42
PCP/M-86 ............................. 1-44
(User) PCP/M-86 ............................. 1-44
................................................................. 1-44
: ..................................... 1-48
1. .................................................................................. 1-51
........................................................... 1-52

SIMATIC S5


.
.

.

""


.
.

,
, .


1
.
( 5
).
Q 5.1
,
.
. ,
I 8.0,
. 5 , 5
. Q
5.1 . , Q 5.4,
,
5 ; .

I 8.4 .

I 0.2 I 0.3 .

Q 5.1 .

Siemens AG
Training Center

. 1-2/52

ST-S5SYS2

SIMATIC S5


I 8.0

Q 5.5

Q 5.1

Q 5.4

I 8.4

1-3

Siemens AG
Training Center

. 1-3/52

ST-S5SYS2

SIMATIC S5

1. .
2.
.
3. .
4. , , .

Siemens AG
Training Center

.
.
OB 1,
().
OB 1
.
.

. 1-4/52

ST-S5SYS2

SIMATIC S5

OB 1

1-5

Siemens AG
Training Center

. 1-5/52

ST-S5SYS2

SIMATIC S5

,
, ..
.

.
.
.
,
.


(.., ).

.
40
.


, , , , ,
" ".

.
.

,
. ,
A I 8.0 A -LB1.
"-" (
: LB1) PG,
.

Siemens AG
Training Center

. 1-6/52

ST-S5SYS2

SIMATIC S5



H3

S3

LB1

S4

H4

I 8.0
I 8.3
I 8.4
Q 5.3
Q 5.4

LB1
S3
S4
H3
H4

( 3)
(. )
( 3)
(. )
1-7

Siemens AG
Training Center

. 1-7/52

ST-S5SYS2

SIMATIC S5

,
.



PB 100


,
. ,
.

S5 (I 0.0)
S6 (I 0.1),
. H5 (Q 4.1) ,
.

, S9
(I 0.4) '0'
" " ( ) S10 (I 0.5).
H6 (Q 4.2).

,
S9 (I 0.4) '1'
" " S10 (I 0.5). H7 (Q 4.3).
,
(Q 4.1).

S9 (I 0.4).

4 + 5

Siemens AG
Training Center

. 1-8/52

ST-S5SYS2

SIMATIC S5

Siemens AG
Training Center

. 1-9/52

ST-S5SYS2

SIMATIC S5

PB 101:


. H1 (Q 5.1) :
- ,
, ..,
,

( H4 ).
- (
).

PB 102:


.

.

PB 102:

Siemens AG
Training Center

K1 (Q 5.5):

, 1 ,
,
.
LB 1 (I 8.0), ,
,
.


S7 (I 0.2).

LB 1 '1',
( ).

,
LB 1.

K2
(Q 5.6) .
, S8 (I 0.3).
, "" ""
!

:
- , LB 1 (I 8.0);
- ( C 103)
BCD- (QW 6);
- S4 (I 8.4)
, , 5
;
- "5", H4 (Q 5.4)
.

. 1-10/52

ST-S5SYS2

SIMATIC S5


INI 1, I 8.5

LB1, I 8.0

Motor

H1, A 5.1
K1, Q5.5

()

H4, Q5.4

K2, Q5.6

S5, I 0.0

S4, I 8.4

S6, I 0.1

S7, I 0.2
QW 6

S8, I 0.3

S9, I 0.4

S 10, I 0.5

0 0 0 0
QB 6 QB 7

1-11

Siemens AG
Training Center

. 1-11/52

ST-S5SYS2

Siemens AG
Training Center

. 1-12/52

ST-S5SYS2

Siemens AG
Training Center

. 1-13/52

ST-S5SYS2

SIMATIC S5

1
.
CSF
.

.

Siemens AG
Training Center

0.0

S5

( )

0.1

S6

(. )

0.2

S7

0.3

S8

0.4

S9

(0=MAN, 1=AUTO)

0.5

S10

8.0

LB1

LB1

8.1

S1

. 1

8.4

S4

8.5

INI1

. 1

4.1

H5

4.2

H6

4.3

H7

5.1

H1

. 1

5.4

H4

5.5

K1

5.6

K2

5.7

BEEP1

QW

DISPLAY

100.0

FLASH

100.1

AF-FLASH

102.0

102.0

102.1

102.1

102.2

102.2

100

T-FLASH

102

T-CONV

103

C-PARTS

LB1

. 1-14/52

LB1

ST-S5SYS2

SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 1-15/52

ST-S5SYS2

10

15

SIMATIC S5

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 1-16/52

ST-S5SYS2

SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 1-17/52

ST-S5SYS2

SIMATIC S5

, ,

SYS2A@ST.S5D.

C:\S5_DATA\S5COURSE\S5SYS2\SYS2A.
, ,
.
:
PG STEP 5.

, , ..
, SYS2
. , "Delete DOS
File(s)" , :
File
DOS File
Delete ...

SYS2????.??? "File"
() ENTER, "Files" ()
,
SYS2.
ENTER INSERT.

Siemens AG
Training Center

.
,
SYS2B@Z0.SEQ .
SYS2A@Z0.SEQ.
:

. 1-18/52

ST-S5SYS2

SIMATIC S5

"Copy DOS File(s)" ,


:
Ctrl F8 : File DOS File Copy ...

SYS2B@Z0.SEQ, "Source file"


( ),
SYS2A@Z0.SEQ , "Dest
file" ( ).

Project Settings

.
"Project Settings".
F4 : File Project

Set

6 .
"PLC":
Mode ():

Online ()

"Project Settings - PLC -"


.

Siemens AG
Training Center

. 1-19/52

ST-S5SYS2

SIMATIC S5

"Blocks" (), Alt:


Alt 2
:
DOS directory path (): C:\S5_DATA\S5COURSE\S5SYS2\SYS2A
Program file ( ):
SYS2A@ST.S5D
^Representation ():
CSF
heck ( ) [x] with comments ( )
"Blocks"
.
"Symbols", Alt:
Alt 3
:
DOS directory path (): C:\S5_DATA\S5COURSE\S5SYS2\SYS2A
Program file ( ):
SYS2A@Z0.INI
Symbol length ( ):
[8]
Comment length ( ):
[40]
heck () [x] Display symbolic ( )
[x] Operands symbolic (. )
.
, ,
SYS2A@PX.INI.
PG .
SYS2A@PX.INI
<Project ... F6>.
,
. <Select F3>
.
:
C:\S5_DATA\S5COURSE\S5SYS2\SYS2A
: [SYS2A@PX.INI].

Siemens AG
Training Center

. 1-20/52

ST-S5SYS2

SIMATIC S5

, ,
, .
.

"Edit Symbols".
Assignment List ...

F7 : Editor

.
(. )
F7 Enter Insert.

SYS2A@Z0.SEQ, .

SYS2A@Z0.INI,
SYS2A@Z1.INI

SYS2A@Z2.INI.

Siemens AG
Training Center

. 1-21/52

ST-S5SYS2

SIMATIC S5

"Operand" (),
"Symbol" () "Comment" ()
SHIFT + Cursor TAB.

, ,
F3 Cut , - F1 Line .
F8 Return
.

,
, ENTER.

:
Overwrite ()
Insert ()

(Overwrite)
.
(Insert)
.

F5 Mode.

:
G .
,
, , .

F6 Save
,

.

Siemens AG
Training Center

. 1-22/52

ST-S5SYS2

SIMATIC S5


.
,
. ,
BEEP1 Q 5.7 (.
).
"-" (
""!).
,
. -BEEP1
, , ENTER.


.
().
F1 : Editor STEP 5 block ... (x) Program file


(Overall Reset)

PLC
PLC.
,
, .
PLC.
.
1. CPU
STOP ().
"OR" ()
STOP ()
RUN () .
, PLC
F3 : File Blocks Directory ... (x) PLC

Siemens AG
Training Center

. 1-23/52

ST-S5SYS2

SIMATIC S5

2.
PLC STOP PG. (
RUN ()).
F11 : PLC Stop PLC
PLC.
:
"(x) Delete entire PLC"
/ PLC
"Confirm before deleting (x) No" / .
File
Blocks
Delete ...
PLC RUN PG
CPU:
PG:

PLC

Start PLC

( -
RUN)
CPU:


RUN STOP
RUN.

PLC
.
:
PLC STOP ().

.

PLC

PLC.
- "Block Status".
, .
"Display symbolic" ( )
, PG
. ,
(Editor) (Output)
(Edit), ,
, .
(Output) - "Block Status"
PG
- ( )
, F1 Disp Symb.
,
.

Siemens AG
Training Center

. 1-24/52

ST-S5SYS2

SIMATIC S5

Siemens AG
Training Center

. 1-25/52

ST-S5SYS2

SIMATIC S5

PG


.
(, I 8.0) (, -LB1).


. ,

STEP 5 PG.

- (assignment list
files).


, "
" ("sequential file) (. ).
,
. 8
,
LAD- CSF-.

,
(assignment list files) (... Z0.INI, ...Z1.INI,
...Z2.INI)
(sequential file) (... Z0.SEQ).

"log" -.
...ZF.SEQ
(, ).

Siemens AG
Training Center

. 1-26/52

ST-S5SYS2

PG

SIMATIC S5

SYS2A@ Z0.SEQ

PG

SYS2A@ Z0.INI

SYS2A@ Z1.INI

SYS2A@ Z2.INI


SYS2A@ ZF.SEQ

1-27

, 7- 8- .
PG
( ), ,
,
.
7- 8- .

Siemens AG
Training Center

. 1-27/52

ST-S5SYS2

SIMATIC S5

PG


:
1.
.
2. F1 Disp Symb - "Block Status"
Output.
Output -,
: "DVS-files modified, seq. file not up to date
(DVS- , ).
,
.
:

"Management" () "Assignment
lists" ( ),
-
, "Convert INI
SEQ (
INI
SEQ).
,
.

Siemens AG
Training Center

"Display symbolic" ( ) "Project


Settings - Symbols - ( --),
"Edit STEP 5 Block" ( STEP 5)
- "Block Status" "Update assignment
list?" ( ?).
,
INI-.

. 1-28/52

ST-S5SYS2


SIMATIC S5


,
, - "Block Status"

. . . Z0.INI

. . . Z1.INI

INI > SEQ

. . . Z0.SEQ

. . . Z2.INI

1-29a

1-29b

Siemens AG
Training Center

. 1-29/52

ST-S5SYS2

Siemens AG
Training Center

. 1-30/52

ST-S5SYS2

Siemens AG
Training Center

. 1-31/52

ST-S5SYS2

SIMATIC S5

PB 100 .
F1 : Editor STEP 5 Block ... (x) Program file
Output
F6 Seg Com, F7 Comment.
.
Insert.
,
(, $1@).

#PBDO.100 PB 100.
, .
.
F3 : File Blocks Directory ...
(x) Program file

PG
, .
,
F1.INI. :
(--) "Project Settings Documentation - SYS2A@F1.INI "Footer
file" ( ). ,
.
, ,
SYS2A@F1.INI.
:
Ctrl F5 : Editor Footer Editor

Siemens AG
Training Center

. 1-32/52

ST-S5SYS2

SIMATIC S5


.
, .

SHIFT+< > .
, .
.
F1 Text Inp F2 Text End.
.
F7 Enter .


. .
:
(--) "Project Settings Documentation - "Footer" ()
<Select F3>. "80" (
).
"(x) Printer"
).

"Documentation to" (

"Printer file" (
), - <Select F3>.

(Printer file)

,
. ,
.

<Enter>.

"Project Settings Documentation - .
<Project ...
F6>, <Save>.
Esc.
, ,
(STEP 5)
.

Siemens AG
Training Center

. 1-33/52

ST-S5SYS2

SIMATIC S5

.
Documentation
STEP 5 Blocks ...
(x) Program file

Siemens AG
Training Center

. 1-34/52

ST-S5SYS2

Siemens AG
Training Center

. 1-35/52

ST-S5SYS2


,
.
,
. SIMATIC S5
, :
-


(Segment Comments)

SIMATIC S5

Segment titles
Segment comments
Statement comments
Plant comments
Assignment list
Footer

( )
( )
( )
( )
( )
()


,
STEP :
STEP 5:

OBn
PBn
SBn
FBn
DBn

#OBDO.n
#PBDO.n
#SBDO.n
#FBDO.n
#DBDO.n



STEP 5.
STEP 5
F6 Seg Com, F7 Comment.

,
(, #PBDO.100) STEP 5
.
F1 : Editor STEP 5 Block ... (x) Program file

Siemens AG
Training Center

. 1-36/52

ST-S5SYS2

PG

SIMATIC S5

Segment 4

TIMER for synch. Pulse generator

/ /

Generation of a 250ms clock pulse with SE timer T100. The pulse is

/ . 250 SE- T100/

assigned to F 100.1, which has status 1 whilst the timer is running

/ . F 100.1. =1 T100/

an status 0 for a whole cycle when it expires (every 250 ms).

/F 100.1 =0 T100 ( 250 )/

T 100
+-----+
F 100.1 -O!1_-_V!
KT 025.0 --!TV BI!!
DE!!
!
+------+
--!R
Q!-+-! =
! F 100.1
+-----+
+------+
F
T

100.1 = AF-FLASH
100
= T-BLINK

Aux. Fl. Frequ. flag


Flash. Frequ. timer

/. /
/ /

+----------------------------------------------------------------------+
! S I E M E N S
A G
! Configuring exercise
!
!
!
!
+----------------------------------------------------------------------+
! JOB IDENTIFIER:
!DATE :

!
! PLANT:

!CHANGE:
V7.x
.!
! PLANT POS. NUMBER:
!Author:

4 !
+----------------------------------------------------------------------+

(Footer)

,
(--)
"Project Settings - Documentation -".
:
Ctrl F5 : Editor Footer Editor

Siemens AG
Training Center

. 1-37/52

ST-S5SYS2


(Segment Header)

SIMATIC S5

,
(comment block).
STEP 5
.
STEP 5 :

OB n
PB n
SB n
FB n
DB n

OC n
PC n
SC n
FC n
DC n


Editor STEP 5,
.
F1 : Editor STEP 5 Block ... (x) Program file


(Statement Comments)

STL-
. ,
SHIFT + cursor.
,
.
STEP 5,
.
F1 : Editor STEP 5 Block ... (x) Program file


(Plant Comments)



.

. #,
8 , , #CONVEYOR.
.
F1 : Editor STEP 5 Block ... (x) Program file

Siemens AG
Training Center

. 1-38/52

ST-S5SYS2

PG

SIMATIC S5

PB 100

C:SYS2A@ST.S5D

Segment 5

Flashing frequency flag

Evaluation of the clock pulse in segment 4


(checking the auxiliary flashing frequency flag)
and generation of the flashing frequency flag.

F
F

:STL
:A
:BEC
:AN
:=
:BE
100.1 =
100.0 =

100.1

F
F

100.0
100.0

AF-FLASH
FLASH

LEN=24
/ /
/ 4/
/ ( ) /
/ /

Flashing frequency flag


Flashing frequency flag

/ /
/ /

+---------------------------------------------------------------------+
! S I E M E N S
A G
! Configuring Exercise
!
!
!
!
+---------------------------------------------------------------------+
! JOB IDENTIFIER:
CONVEYOR
!DATE:
April 1997
!
! PLANT:
!CHANGE:
V7.x
PAGE!
! PLANT POS. NUMBER:
V1
!AUTHOR
: AUT 951
5!
+---------------------------------------------------------------------+

1-39

Siemens AG
Training Center

. 1-39/52

ST-S5SYS2

SIMATIC S5

(Footer)


(footer), .
80- 132- .
,

. .

:
-

(program file)
(symbols files)
(footer file)

("Project Settings").
(LAD/CSF/STL-,
, )
.

:
- ;
- ; (
Documentation: (x) to file,
() );
- (printer file), "",
,
STEP 5
( (rinter files)
).
STEP 5
(PLC).
Documentation
STEP 5 Blocks ...

Siemens AG
Training Center

. 1-40/52

ST-S5SYS2

PG

SIMATIC S5

.
8 - 24

1 - 40

32

32

2 KB

2 KB

Symbols Editor


(6 )
...........................ST.S5D

LAD, CSF, STL


, .,
PC 52, Segment 1 Final Assembly /. /


OC, PC, SC, FC, DC

STL
, .,
PC 52, Line 4, Flag for bay 1 / 1/


#ODBO.nnn, #PBDO.nnn,
#SBDO.nnn, #FBDO.nnn,
#DBDO.nnn

LAD, CSF, STL


, ., #PBDO.052,
Move conveyor FORWARD / . /
i n AUTO and MANUAL
/ . . ./

(max. 8 )

, .,
#CONVEYOR
This STEP5 program performs / STEP5/
the following functions:
/ . /


(6 )
................... F1.INI

(Footer Editor)

Siemens AG
Training Center

80
or 132


(6 )
...... Z0.SEQ
...... Z0.INI
...... Z1.INI
...... Z2.INI

,
., Q 5.5

. 1-41/52

,
., K1

, .,
Conveyor motor

1-41

ST-S5SYS2

SIMATIC S5

PG
, .
, ,
. , ,
, ,
. 6 :

(Program file)
...... ST.S5D: - STEP 5-
-
-


(Symbols files)
...... Z0.SEQ:
...... Z0.INI
...... Z1.INI
...... Z2.INI

- (Input list)
- (Assignment )
- .
- .


(Footer file)
...... F1.INI:

- (Footer)

"Copy File(s)" STEP 5:

Ctrl F8 : File

DOS File

Copy ...

MS-DOS
"COPY" , Explorer Windows'95.

.
.
,
.
, ,
. PG MS-DOS
Windows'95 . PG
PCP/M (, PG 685)
"DD"- ( 720 ).
STEP 5 .
STEP 5 ,
.
MS-DOS "FORMAT",
Windows'95.

Siemens AG
Training Center

. 1-42/52

ST-S5SYS2

SIMATIC S5

PG

1-43a

1-43b

Siemens AG
Training Center

. 1-43/52

ST-S5SYS2

SIMATIC S5

PCP/M-86

, MS-DOS
Windows'95, , PG 685,
PCP/M-86.

(User) PCP/M-86

PCP/M-86
, .
16
( 0 15). MS-DOS
Windows'95
,
, PCP/M

.

PCP/M-86 MS-DOS Windows'95


.
STEP 5, PG
PCP/M-86 (, PG 685),
PCP/M MS-DOS ,
PG MS-DOS Windows'95.
STEP 5 VII
MS-DOS PCP/M-86 .

Siemens AG
Training Center

STEP 5
,
PCP/M-86.
MS-DOS
PCP/M ,
.
PCP/M
MS-DOS ( MS-DOS Windows'95)
"PFORMAT".
, ,
.

. 1-44/52

ST-S5SYS2

SIMATIC S5

PCP/M-86

1-45a

1-45b

Siemens AG
Training Center

. 1-45/52

ST-S5SYS2

Siemens AG
Training Center

. 1-46/52

ST-S5SYS2

Siemens AG
Training Center

. 1-47/52

ST-S5SYS2

SIMATIC S5


MS-DOS

,
:
.
Ctrl F8 : File DOS File Copy ...
.


PCP/M

,
, PG 685 ( PCP/M-86),
5 PCP/M.
, 3
. 5
(, PG 750). :
STEP 5.
5 , PCP/M,
.

Siemens AG
Training Center

. 1-48/52

ST-S5SYS2

SIMATIC S5

: PCP/M

MSDOS PCP/M.
File PCP/M File
Copy DOS -> PCP/M ...
.
,
MS-DOS ( PG),
PCP/M (),
(directory) "Source dr/dir.".
"Source files"
. "Drive:" ,
"User:" .

, PCP/M
.
, .1-45
.
,
<Cancel ESC >.
, .
User 3.
File
PCP/M File Directory ...
, :

Siemens AG
Training Center

. 1-49/52

ST-S5SYS2

Siemens AG
Training Center

. 1-50/52

ST-S5SYS2

- 1

SIMATIC S5

PLC
, ,
.
SIMATIC S5
, :
- ,
;
- , ;
-
;
-
;
-

,
;



.
PLC!


.


.

MS-DOS, PCP/M
.

- ,
.

Siemens AG
Training Center

. 1-51/52

ST-S5SYS2

SIMATIC S5

.
.
.
.
.

.
.
.
.

.
SEQ INI .
PLC ( CPU PG).
.
PCP/M.

Siemens AG
Training Center

.SEQ .INI.

. 1-52/52

ST-S5SYS2

SIMATIC S5
1
2
3

2
1
2

: ............................................ 2-2
: ............................................ 2-4
.................................................................. 2-6
Stop () ............................................................................. 2-6
Run () .......................................................................... 2-6
"" (Cold Restart).............................................. 2-8
(L PW, L PY)............................ 2-8
"" "" PLC,
(High-End PLC)......... 2-10
High-End PLC .................................................... 2-10
"" .................................................................. 2-12
"" ....................................................................... 2-12
................... 2-14
............................................................................... 2-14
............................................ 2-14
.... 2-16
: ............................ 2-20
....................................................................... 2-24
.......................................................... 2-24
........................................................................................ 2-26

(Fixed Slot) ................................ 2-26

(Variable Slot) ................................. 2-28
(CPU) ............................... 2-30
: ................................ 2-34
2. ................................................................................... 2-35
........................................................... 2-36

SIMATIC S5



PLC RUN () STOP ().
PLC

STOP RUN.

. (,
..) ,
.
1
.

Siemens AG
Training Center

. 2-2/36

ST-S5SYS2

Siemens AG
Training Center

. 2-3/36

ST-S5SYS2

SIMATIC S5

SYS2B@ST.S5D.
SYS2A@ST.S5D.
.
:
PB 100PB 103 OB 1
[SYS2B@ST.S5D]
C:\S5_DATA\S5COURSE\S5SYS2\SYS2B

2 [SYS2A@ST.S5D]
C:\S5_DATA\S5COURSE\S5SYS2\SYS2A

F5 : File

Blocks
(X) Block list (PB100 - PB103, OB1)

Transfer ...

PLC
CPU "RE.

PLC.
F5 : File Blocks
Transfer ...
(X) Block list (B
)

:
- PLC
( ).
- PLC CPU STOP RUN
( STOP RUN).

:
- ?
- ?
- ?
( )
, .
.

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Siemens AG
Training Center

. 2-4/36

ST-S5SYS2

Siemens AG
Training Center

. 2-5/36

ST-S5SYS2

SIMATIC S5


,
() .
, ,
.
, ,
STOP () RUN
(), PLC.
STOP ()

STOP, :
-

STOP ,
PG "STOP",
,
PG, .

PLC,
. PLC STOP,
, 0
() : BASP.

RUN ()

Run ()
( RUN-STOP, "Start" PG)
.
PLC :
COLD RESTART ("" ) WARM RESTART
("" ).

.

Siemens AG
Training Center

. 2-6/36

ST-S5SYS2

SIMATIC S5

"" S5-115U
STOP
()

RUN
START
PG

Restart
()

""

""

RUN
()

STOP / STOP- PG
/
:
BASP = ON ()
STOP = ON ()
RUN = OFF ()

:
BASP = ON ()
STOP = ON ()
RUN = ON ()

:
BASP = OFF ()
STOP = OFF ()
RUN = ON ()

2-7

Siemens AG
Training Center

. 2-7/36

ST-S5SYS2

""

SIMATIC S5

S5-115U "" .
STOP
RUN (). ,
:
-


(PII, PIQ);
, ,
;

(checklist);
DB 0 (
PLC).

OB 21
OB 22
OB ,
.



(L PW, L PY)


.
:
L PY 8
T IB 8 / 8

L PW 8
T IW 8 / 8.

T PY ... T PW ... OB ,
PIQ.
.
PII.
S5-115U ""
S5-90U, S5-95U S5-100U.

Siemens AG
Training Center

. 2-8/36

ST-S5SYS2

SIMATIC S5

S5-115U

(BASP ON)

" "
( STOP)

" "

( )

PIQ, PII
, .

(DB 0).

PIQ, PII
, .

(DB 0).

OB 21

OB 22

(BASP OFF)

(BASP OFF)

PII
OB 1

PLC
STOP

PIQ

2-9

Siemens AG
Training Center

. 2-9/36

ST-S5SYS2

SIMATIC S5

"" "" High-End PLC PLC,



High-End PLC

S5-135U S5-155U 3
:
""
3 "" :
1. CPU Reset (),
STOP () RUN ().
2. PG "Start PLC" "PLC".
, : ""
"" .
3. ""
, (DX0).
PLC ""
.
""
1. STOP RUN ().
2. PG "Start PLC" "PLC",
"Warm restart" ("" ).
""

, PLC RUN (),


.

Siemens AG
Training Center

. 2-10/36

ST-S5SYS2

"" "" High-End PLC

SIMATIC S5

"" "" S5-135U S5-155U


STOP
()

. RESET
()
. .
STOP RUN

DX0
. .

STOP RUN

Restart
()

RUN
()

/ .
""

/ .
""

STOP / STOP- PG
/
:

BASP = ON ()
STOP = ON ()
RUN = OFF ()

BASP = ON ()
STOP = OFF ()
RUN = OFF ()

BASP = OFF ()
STOP = OFF ()
RUN = ON ()
2-11

Siemens AG
Training Center

. 2-11/36

ST-S5SYS2

""

"" :
-

""

SIMATIC S5

,
.
DB1 ( ).
, , .
OB 20.
(BASP off).
.

"" :
-


, .
:
DB 0.
:
OB 22 "" .
:
OB 21 "" .
,
( STOP).
""
PII ().
PIQ.
.
PII.

S5-135U PLC.

Siemens AG
Training Center

. 2-12/36

ST-S5SYS2

"" "" High-End PLC

SIMATIC S5

S5-135U S5-155U

(BASP ON)

""

""

""

:
PIQ, PII, ,


PIQ, PII, ,


PIQ, PII, ,

OB 20

OB 21

OB 22

(BASP OFF)

PII
STOP

OB 1,

PII
STOP

OB 1,

PIQ
PIQ,

(BASP OFF)

PIQ
2-13

Siemens AG
Training Center

. 2-13/36

ST-S5SYS2

SIMATIC S5

OB
OB

"" "" PLC .


"OB ",
PLC, .
.
, ,
(CP)
() /
(IP).
,
PLC. ,
, , PLC
STOP .

().

, ,
PLC,
, PLC
STOP.
, "Conveyor forward" (
) (F 102.0) "1" PLC,
.
, S5-115U
STOP (o) RUN ()
RE/NR.
"NR" (), .

. , -
,
NR RE (). ,
PLC,
High-End PLC.
,
"conveyor forward" ( ) PLC.

.
'1'
"" "" .
,
PLC, .

Siemens AG
Training Center

. 2-14/36

ST-S5SYS2

OB

SIMATIC S5

F0.2

F0.3

?
t

?
t
1-

2-

..

OB 1
2-15

Siemens AG
Training Center

. 2-15/36

ST-S5SYS2

SIMATIC S5

:
.
,
MB 200 MB 255 (
).
,
.

,
PLC. OB 1
,
.
1
, PLC.
'1'
PLC "" ""
.

Siemens AG
Training Center

. 2-16/36

ST-S5SYS2

OB

SIMATIC S5

: STL


OB 20 ( S5-135U, 150U, 155U)
OB 21 OB 22
:AN
:S
:AN
:S
:
:
:BE

F
F
F
F

0.2
0.2
0.3
0.3


OB 1

:AN
:R
:A
:R
:
:
:BE

F
F
F
F

0.3
0.2
0.2
0.3

2-17

Siemens AG
Training Center

. 2-17/36

ST-S5SYS2

Siemens AG
Training Center

. 2-18/36

ST-S5SYS2

Siemens AG
Training Center

. 2-19/36

ST-S5SYS2

SIMATIC S5

1

.
,
- PLC
( "RE),
-
PLC STOP.
F 0.2 , F 0.3
.

!

:
OB21/22

OB

Cold Restart MAN/AUTO / /

Segment 1
AN F

0.2

0.2

AN F

0.3

0.3

OB 22 OB 21.
, "Copy
Segment".
OB 1 :
Cyclic Program /

OB1
Segment 1
AN

0.3

0.2

0.2

0.3
:

JU

PB

100

etc.
"Vertical Expansion"
.
Edit Editor
F7 Extras , F7 Vert Exp .

Siemens AG
Training Center

. 2-20/36

ST-S5SYS2

SIMATIC S5

1 PB 102,
"Conveyor forward" (" ") F 0.2.

I 8.5
Q 4.3
Q 5.4

&
# Q 5.7

T 102
T
0

KT 010.1

TV
R

F 102.1
I 0.4
F 0.2

BI
DE
Q

F 102.0
S

>=1
R
I 0.2
Q 4.2
I 0.3

>=1

&
=

Q 5.5

CPU STOP:
PB 103 ,
.
,
.

Set (S) (CV)


, ,
,
"?.
PLC STOP OB
, PB 100, PB 102, PB 103 OB 1 PLC.
.

Siemens AG
Training Center

. 2-21/36

ST-S5SYS2

Siemens AG
Training Center

. 2-22/36

ST-S5SYS2

Siemens AG
Training Center

. 2-23/36

ST-S5SYS2

SIMATIC S5


PLC
.
S5-115U
.
PLC .
,
PLC ( = 5 ). S5-115U .

.
, ,
, "= 5 "
( = 24
~ 220 ),
.
"" PLC
(CPU - central processing unit).


.
S5-135U S5-155U
, CPU ( ).

() CPU ,
,

.
PLC
(). /
.
,
(CP) ( ),
().
() /
(IP) CPU,
.
,
.

,

( ).
, , .

Siemens AG
Training Center

. 2-24/36

ST-S5SYS2

SIMATIC S5

Siemens AG
Training Center

. 2-25/36

ST-S5SYS2

SIMATIC S5

PLC ,
.
CPU S5-115U :
-

,
.


. S5-115U (32 )
.
, .

, 32, .

(IM) (terminator).
S5-90U, S5-95U S5-100U
.

Siemens AG
Training Center

. 2-26/36

ST-S5SYS2

SIMATIC S5

(S5-115U)

PS

CPU

IM

24.0 ... 27.7


20.0 ... 23.7
16.0 ... 19.7
12.0 ... 15.7
8.0 ... 11.7
4.0 ... 7.7
0.0 ... 3.7

Siemens AG
Training Center

. 2-27/36


2-27

ST-S5SYS2

SIMATIC S5

S5-115U.
IM306
(IM),
. /
IM306,

(DIP-) .
(16 32)

.

.
, DIP IM 306
0
2 .

:

- 32-
:
0, 4, 8, 12 ..
- 16-
:
0, 2, 4 ..

Siemens AG
Training Center

S5-135U S5-155U ""


. ,
.

. 2-28/36

ST-S5SYS2

SIMATIC S5

Siemens AG
Training Center

. 2-29/36

ST-S5SYS2

SIMATIC S5

PLC CPU.
CPU S5-100U, S5-115U
S5-135U.

S5-115U.
:

?
?
?
?
,
?

,
CPU 951 CPU 945 -
, DO Load Transfer.
CPU,
, , , .., ,
S5-115U .
, CPU 941/942 ,
CPU 943/944/945 .
, , "point-topoint", PLC L1 L2 ,
(OP).

Siemens AG
Training Center

. 2-30/36

ST-S5SYS2

SIMATIC S5

CPU PLC S5-115U



CPU 941B CPU 942B CPU 943B CPU 944B CPU 945
/
10

(2 ) int./ max.
- 2

10

PG

512 ()
2/18
~ 10
1

1024 .

1024 .

1024 .

1024 .

10/42

16/48

96

256/384

~5

~ 1.5

~ 0.2

1 2

1 2

1 2

~ 10
1

- s
CPU 941B CPU 942B CPU 943B CPU 944B CPU 945

1.6

1.6

0.8

0.8

0.1

Load Transfer (I,Q,F,C,T)

1.6

1.6

0.8

0.8

0.1

2.2 3.9

2.2 3.9

1.1 2

1.1 2

0.2

/-

1.6

1.6

0.8

0.8

0.1

1.6

1.6

0.8

0.8

0.1

3.7
1.7 / 6.7

3.7
1.7 / 6.7

1.9
0.9 / 3.4

1.9
0.9 / 3.4

0.1
0.1 / 1.0

Load Transfer (word)


RLO=0/1
. ( )
. Load Transfer (LIR/TIR)
DO (DO FW/DO DW)

~ 160

~ 160

~ 4.4

~ 0.65

105 130

105 130

105 130

~ 160

4.5

0.25

134 / 162

134 / 162

134 / 162

2.6 / 3.6

0.25

2-31

Siemens AG
Training Center

. 2-31/36

ST-S5SYS2

Siemens AG
Training Center

. 2-32/36

ST-S5SYS2

Siemens AG
Training Center

. 2-33/36

ST-S5SYS2

SIMATIC S5

2
,
.

!
PLC , Q 4.6
1.
PLC RUN ()
, Q 4.7.

-----------------

Siemens AG
Training Center

. 2-34/36

-----------------Q 4.6
Q 4.7

ST-S5SYS2

SIMATIC S5

STOP RUN
SIMATIC S5
(Restart organization blocks (OB 20,
OB 21, OB 22).

RUN : ( RUN / STOP)
(
).
PLC.
S5-90U/95U/100U/115U
""
(COLD RESTART),
S5-135U S5-155U
"" (WARM RESTART).

Siemens AG
Training Center

OB
, ,
, ,
,

.
PLC
,
CPU.


PLC. PLC S5-115U

IM306.

. 2-35/36

ST-S5SYS2

SIMATIC S5

OB
.
S5-115U "" .
.
.
IM 306 S5-115U.
S5-115U.

S5-115U IM 306.
CPU, S5-115U.

Siemens AG
Training Center

. 2-36/36

ST-S5SYS2

SIMATIC S5

Data Blocks ( )

: .................. 3-2
....................................................................... 3-4
.................................................................... 3-4
"Status Variable "Force Variables" .................................... 3-6
(Data Word) .................................................. 3-6
: .................................... 3-10
(Data Word) ........................................ 3-10
() .................................................... 3-10
(Data Word) ................................................... 3-11
................................... 3-16
............................................................ 3-18
(Data Bits) ................................................. 3-20
..................................... 3-22
................................................................... 3-22
......................................................................... 3-24
.......................................................................... 3-26
() ................................ 3-28
..................... 3-28
............................................................................................. 3-28
................................................................................ 3-30
...................................... 3-30
: ..................................................... 3-34
3. .................................................................................. 3-35
........................................................... 3-36

Data Blocks ( )

SIMATIC S5



NR/RE,
.
, ,
5 .

,
NR/RE.
,

. .

Siemens AG
Training Center

.3-2/36

ST-S5SYS2

Siemens AG
Training Center

.3-3/36

ST-S5SYS2

Data Blocks ( )

SIMATIC S5

(Data blocks) ,
- .
16- .
" " ("data words" "DW").
, . PLC
, 256 (DW 0 255).
,
. , DW 5 DL 5 (DW 5,
), DW 5 DR 5 (DW 5,
).

.

:
KM
KH (HEX) (: 0000 FFFF),
KY , ,
(: 0 255 10 ),
KF (: -32768 +32767),
KT (: 001.0 999.3),
KC (: 000 999),
KS S ( ASCII).
STEP 5.
() (max. 255)
.
.
"Data word number"
( ).
"Data word comment" ( )
( 32 ).

Siemens AG
Training Center

"DB" 0
255. PLC (S5-135U )
, "DX" (0 255).

.3-4/36

ST-S5SYS2

SIMATIC S5

(Data Block)

DB
DB 136

DW

0: KH =

6F2A

(Index register)

DW

1:

+ 30 132

DW

2: KM =

00110101 10011001

DW

3:

005.2

DW

4: KC =

263

DW

5: KS =

'MESSAGE TEXTS'

()

DW 10

10: KY =

DW 255

KF =
KT =

255

255:


()

16-


3-5


(Special Functions)

DB 0 CPU
. DB 1
DX 0, .
, DB 2 ( DX 1),
.

Siemens AG
Training Center

.3-5/36

ST-S5SYS2

Data Blocks ( )

"Status Variable"
"Force Variables"

SIMATIC S5

,
.
- "Status"
Variable" ( ) "Force Variables" (
). ,
"Force Variables"
. STEP 5
, ,
,
.

(variables blocks = VB ..)

Siemens AG
Training Center

, ,

"C DB ..".
Load "L DW .."
Transfer "T DW ..".
,
, .
, PLC (transfer error)
STOP.

.3-6/36

ST-S5SYS2

SIMATIC S5

:STL
:C
:
:L
:
:
:
:
:C
:
:T

DB

104

DW

Accu. 1

DB 104

DW 1
Status Variable/Force Variables

DB

105

DW

Accu. 1

DB 105

DB 104
DW 1

DW 2

DB 105
DW 2

3-7

Siemens AG
Training Center

.3-7/36

ST-S5SYS2

Siemens AG
Training Center

.3-8/36

ST-S5SYS2

Siemens AG
Training Center

.3-9/36

ST-S5SYS2

SIMATIC S5

2
DB104,

.
DB-Editor
"Source" () DB 104 "Block list"
.
F2 : Editor Data Block ... (x) Program file.
DB,
, .
: DB,
, (0:).

DB 104 "Production Data"


( ).

F6 Title , ,
Enter.
"KH" DW 0
.
Enter.

DW 1: KF= +00000.

"Total production" (
).
, SHIFT +
< > .
Enter.
.
,
() .


(Repetition Factor)

0:
KH=0000
1: 50 < KF = 0

Siemens AG
Training Center

SHIFT +
< > . "50"
Enter.
"KF" , , "0".
Enter.
.
255.

.3-10/36

ST-S5SYS2

SIMATIC S5

,
, :

0: KH=
0000
1: KF= +00000


.
!
,
, .
DB 104 Insert.
:
DB 104

Production Data

0:
1:
2:

/ /

KH=
KF=
KF=

0000
+00000 Total production
+00000

KF=

+00000

/ /

.
.
.
50:

PB 104 .
.
F1 : Editor STEP 5 Block ... (x) Program file
PB104
Segment 1

Siemens AG
Training Center

Production Data Backup

:C
:L
:L

DB
DW
C

104
1
103

:+F
:T
:BE

DW

.3-11/36

/. . /

Open data block 104


/ /
Load old total from DW 1 / /
Load counter reading of C 103 /
103/
Add
//
Store new total in DW 1 / /

ST-S5SYS2

SIMATIC S5

PB 104 ,
4 PB 103
JC PB 104. ,
"1" (RLO=1), ..,
, .
PB103
:
F1 : Editor STEP 5 Block ... (x) Program file
Segment 4

Cond. Call of Data Backup /.


/

:A
:A
:A
:JC
:

Q
Q
F
PB

5.4
5.5
102.1
104

If max. count (5) reached,


/ 5/
and conv. moving FORWARD
/ . /
and LB1 passed,
/ /
then call Data Backup. / . /

PLC
PB 104 - "Block Status".
?

------------------------------------------------------------------------------------------- .
, C103 5?
?

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 1 DB 104
, "Status
Variable", "Force Variables".
"Status Variable",
VB 104
F5 Save As .
DB104

Siemens AG
Training Center

DW 0

KH=

DW 1

KF=

DW 2

KH=

.3-12/36

ST-S5SYS2

SIMATIC S5

(Project Settings Symbols-),


,
.
DW 1 ,
5.
DB 104 PLC .
F5 : File Blocks Transfer ...
"Confirm before overwriting" (
) .
PG : 'Yes'.
?
--------------------------------------------------------------------------------------------

DB 104 .
F2 : Editor Data Block ...(x) Program file
,
?
1- --------------------------------------------------------------------------- Insert. DB 104?
--------------------------------------------------------------------------------------------

DW 1 "KF
DB 104.

Siemens AG
Training Center

.3-13/36

ST-S5SYS2

Siemens AG
Training Center

.3-14/36

ST-S5SYS2

Siemens AG
Training Center

.3-15/36

ST-S5SYS2

Data Blocks ( )

SIMATIC S5

PG
:
- (DB),
;
- ( )
(DV), ;
- (DC), DB
DW.
PLC DB,
.

.

Siemens AG
Training Center

.3-16/36

ST-S5SYS2

SIMATIC S5

PG

DB 10
0:
1:
2:
3:
4:
5:

KH = 0000

KM = 00100110 00111111
KH = 263F
KY = 38,63
KS = '&?'
KF = +9791
QA

PLC

DB 10

DB 10

0: 00000000 00000000
1: 00100110 00111111
2: 00100110 00111111
3: 00100110 00111111
4: 00100110 00111111
5: 00100110 00111111

0: 00000000 00000000
1: 00100110 00111111
2: 00100110 00111111
3: 00100110 00111111
4: 00100110 00111111
5: 00100110 00111111

DV 10

0: KH
1: KM
2: KH
3: KY
4: KS
5: KF

DK 10
WOR 0
WOR 1
WOR 5 QA

3-17

Siemens AG
Training Center

.3-17/36

ST-S5SYS2

Data Blocks ( )

SIMATIC S5

PG
. ,
, DV DC ,
, .
PLC ,
, PG.
(DV), PG "Preheader
for this block does not exist" ("
")
. DB
.
.
""
.
,
PLC
"Delete data preheader?"
( ?).

.

Siemens AG
Training Center

.3-18/36

ST-S5SYS2

SIMATIC S5


PLC
(, DD)
DB 10

HDD

0: 00000000 00000000
1: 00100110 00111111
2: 00100110 00111111
3: 00100110 00111111
4: 00100110 00111111
5: 00100110 00111111

+
DV 10

PG

0: KH
1: KM
2: KH
3: KY
4: KS
5: KF

DB 10

DK 10
WOR 0 INDEX REGISTER
WOR 1 STATUS BITS
WOR 5 SETPOINT QA

Siemens AG
Training Center

.3-19/36

0: KH = 0000
INDEX REGISTER
1: KM = 00100110 00111111 STATUS BITS
2: KH = 263F
3: KY = 38,63
4: KS = '&?'
5: KF = 9791
SETPOINT QA

3-19

ST-S5SYS2

Data Blocks ( )

SIMATIC S5

(16-
) , ,
.
,
.
S5-95U; S5-100U ( CPU 103) S5-115U
:
"TB D 10.3 RLO 1, 3 DW 10
1.
0 "TBN D ...


.
,
.
, 140 ,
.
PLC ,
(, A D 10.3).
PLC
.

Siemens AG
Training Center

.3-20/36

ST-S5SYS2

SIMATIC S5


DW 9
15 14 13 12 11 10 9
DW 10

TB

D 10.3

RLO ='1'

TB

D 10.7

RLO ='0'

TBN D 10.14
DW 10

RLO ='1'

L DW 10
T FW 200

FW 200

Siemens AG
Training Center

.3-21/36

F 201.3

RLO ='1'

F 201.7

RLO ='0'

AN F 200.6

RLO ='1'

3-21

ST-S5SYS2

Data Blocks ( )

SIMATIC S5

, DB ,
DB. DB
,
: "BE, "BEC "BEU.

JU JC, DB ""
.

: DB 2 ( DB 2 2)
DB 3 ( DB 3 3).
, 2
DB 2,
PB 3, ,
DB 3. 2
( 3)
"" DB 2.
, "" (
"BEC "BEU)
DB, DB
.
L DW 2 OB 1
DB
OB 1.

Siemens AG
Training Center

.3-22/36

ST-S5SYS2

SIMATIC S5


OB 1

PB 2

:
:
:
:
:JU PB
:
:
:L
DW
:
:
:
:
:
:BE

:C
:
:
:L
:
:
:
:JU
:
:
:T
:
:
:BE

2
2

DB

PB 3
2
DB 2

DW

PB

DW

DB 2

:
:
:L
:
:C
:
:T
:
:
:
:
:L
:
:BE

DB 2

DB 2

DW

DB

DW

DW

DB 2

DB 2

DB 3

DB 3

DB 3

DB 3

3-23

Siemens AG
Training Center

.3-23/36

ST-S5SYS2

Data Blocks ( )

SIMATIC S5

PB 104
PB 103
.
. (JC)
, RLO =1.
,
, RLO.
(JC ...) RLO,
RLO.
RLO "JC" 0, ,
RLO 1.
RLO "JC" 1,
RLO "" .
(JU ...) ,
RLO "" RLO.

.

Siemens AG
Training Center

.3-24/36

ST-S5SYS2

SIMATIC S5

JU JC
=

JU PB xxx
PB xxx

RLO .

A I 0.3
JC PB xxx

RLO = '1'?

PB xxx

RLO

RLO '0' '1'.

RLO 3-25

Siemens AG
Training Center

.3-25/36

ST-S5SYS2

Data Blocks ( )

SIMATIC S5

Block End ("BE)


"" RLO .
"BEC , RLO
1.
RLO = '1' "" . RLO
0, , RLO
'1'.
"BEU"
.
"BE,
.

RLO, , ,
,
(" ").

Siemens AG
Training Center

.3-26/36

ST-S5SYS2

SIMATIC S5

RLO BE BEC
BE, BEU


RLO

A I
BEB

0.4

RLO = '1'?

RLO

RLO '0' '1'

RLO

Siemens AG
Training Center

.3-27/36

3-27

ST-S5SYS2

Data Blocks ( )

SIMATIC S5


.
PLC .
,
.
,
PG PLC.
F3 : File Blocks Directory ... (x) PLC

PLC ,
, "PLC Memory
Configuration.
PLC
PLC Memory Conf.
PLC,
, "" ,
. ,
"Delete Block(s) ( PLC " ()").
" ", ,
, PLC
.

"Compress PLC Memory (" PLC")


Ctrl F2 : PLC Compress PLC Memory
,
"" ""
.
, ,
PLC
STOP ( ,
).
S5-155U
.

Siemens AG
Training Center

.3-28/36

ST-S5SYS2

SIMATIC S5

PB 100 PB 102

PLC

B00A

PB

100

PB

100

B070

PB

101

PB

101

B00A

PB

101

B02C

PB

103

B072

PB

104

B092

PB

102

PB

102

B0EC

PB

103

PB

103

B08A

OB

B132

PB

104

PB

104

B0A8

OB

21

B14A

OB

OB

B0C4

OB

22

B16A

OB

21

OB

21

B0E0

DB

104

B184

OB

22

OB

22

B0EE

PB

100

B1A0

DB

104

DB

104

B154

PB

102

B1AE

PB

100

B214

PB

102
3-29

Siemens AG
Training Center

.3-29/36

ST-S5SYS2

Data Blocks ( )


()

SIMATIC S5


:
-

RAM:

EPROM:

EEPROM:

Random Access Memory (/)


.
Erasable Programmable Read Only Memory
,
( ).
Electrically Erasable Programmable Read Only
Memory

(
).

RAM, PLC, PG
, .

. , , DB
"T DW ... ,
DB RAM.
RAM, RAM

, .
EPROM EEPROM
. ,
, . ,
"" PG.

.

Siemens AG
Training Center

EEPROM PG. EPROM


,
-
30 .
EPROM
EEPROM, , .
,
, ,
. "/" DB,
RAM CPU. CPU
RAM .

.3-30/36

ST-S5SYS2

SIMATIC S5

Load Transfer

RAM

E(E)PROM

PB

100

PB

100

OB

OB

PB

104

PB

104

DB

104

DB

104

DW 1
DW 2

Accu 1

:
:C DB 104
:L DW
1
:T DW
2
:
:

DW 1
DW 2

Accu 1

:
:C DB 104
:L DW
1
:
:
:

3-31

Siemens AG
Training Center

, EPROM
.
"G DB ...

1, , L KF+50.
,
.
S5-135U , ,
STOP, .
PLC.

.3-31/36

ST-S5SYS2

Siemens AG
Training Center

.3-32/36

ST-S5SYS2

Siemens AG
Training Center

.3-33/36

ST-S5SYS2

SIMATIC S5

3
,

. DW 1 DB 104
, Q 4.0.
PB 104.
:

Siemens AG
Training Center

,
,
?
FW 254
.

.3-34/36

ST-S5SYS2

- 3

SIMATIC S5

,
,
(Data
Blocks).
,
.
DB 2 DB 255

S5-135U


DX 1 DX 255.
(data
words),
(, ) (DW 0 DW 255).
16-
.
E(E)PROM,

.

, RAM .

,
(DB),
(DV),
(DC),

.
.

( ) .

Siemens AG
Training Center


Load Transfer
( ).

(C DB).
,

"Status Variable"
"Force Variables". "Force Variables"

, .., .

PLC
.
JU ..
BE BEU

(RLO).
RLO .
C (
) ,
RLO 1. ,
RLO;
(..,
RLO 0), RLO
1,
;

(.., RLO 1),
, RLO
(RLO =1).

.3-35/36

ST-S5SYS2

SIMATIC S5

.
.
.
.
.

.
.
.
RLO.
"".

.
() .
.
.

Siemens AG
Training Center

.3-36/36

ST-S5SYS2

SIMATIC S5
1
2
3
4

4
1

:
.................................................... 4-2
......................................... 4-2
..................................... 4-4
............................ 4-6
.................... 4-8
............. 4-8
PLC ........................................... 4-10
............... 4-10
:
............................................. 4-14
.................... 4-22
....................................... 4-22
........................................................ 4-24
............................................ 4-26
:
........................................... 4-28
................................................. 4-30

.............................................................. 4-30
PLC,

(High-End PLC) ......................................... 4-30
......................................... 4-30
:
................................. 4-34
4. .................................................................................. 4-37
........................................................... 4-38

Siemens AG
Training Center

. 4-1/38

ST-S5SYS2

SIMATIC S5


,

.
, ,

(. )
.

.
,
, PB 104,
.

:
, 1, DW 1,
, 2, DW 2,
, 3, DW 3.

.

Siemens AG
Training Center

(IW

2)


,
.
(FB). ,
,
, . ,

.
.

. 4-2/38

ST-S5SYS2

SIMATIC S5

PB 104
Segment 1
:
:JU FB 204
:
Segment 2
:
:JU FB
204
:
Segment 3
:
:JU FB
204
:
:BE

FB 204
NAME:
:
:
:
:
:
: BE

4-3

Siemens AG
Training Center

. 4-3/38

ST-S5SYS2

SIMATIC S5

, "" ,
(FB)
, .
( FB
) .
:
,
, .
.
PB 104
:
:L DW
1
:L C
103
:+F
:T DW
1

.
.
.
DW 1 "",
..,
. DW 1
,
. 4 ,
.

"DWNO".
,

:
:L =DWNO
:L C
103
:+F
:T =DWNO

.
.
.

Siemens AG
Training Center

"T =" "L =" ,


.
Transfer (T) Load (L).
LW = (Load value).

(
()).
"=",
.
, ,

PLC.

. 4-4/38

ST-S5SYS2

SIMATIC S5




NAME : SHIFT
:
:LW
:L
:><F
:BEC
:L
:L
:+F
:T
:T
:T
:AN
:=
:BE

= SNO
IW
2
= DWNO
C
103

= DWNO
FW 254
QW
6
F
255.0
Q
4.0

:
:L
:L
:><F
:BEC
:L
:L
:+F
:T
:T
:T
:AN
:=
:BE

KH
IW

0001
2

DW
C

1
103

DW
FW
QW
F
Q

1
254
6
255.0
4.0

4-5

Siemens AG
Training Center

. 4-5/38

ST-S5SYS2

SIMATIC S5


, ,
.

:
-

(. 4 , );
;
;
, .

:

I (FB input
/
)
Q (FB output
/
)
D (/
)


BI ()
BY ()
W ()
D (.,
CPU S5-135U )

B ()
T ()
C ()

KM/KH/KY/
KS/KF/KT/
KC/KG

I 8.0, Q 5.5, F 1.0


IB 8, QB 5, FY 10
IW 8, AW 6,
FD 10

KF +100, KH 006A
KT 100.0, KY 0,8
DB 104, PB 100,
FB 204
T 100, T 65
C 100, C 65


.
, .
,
.

,
.
,
.

Siemens AG
Training Center

. 4-6/38

ST-S5SYS2

SIMATIC S5


FB
FB 204
Segment 1
Name :

SHIFT

Decl
Decl

I/Q/D/B/T/C
I/Q/D/B/T/C

:
:

:D
:I

KM/KH/KY/KS/KF/KT/KC/KG: KH
BI/BY/W/D : W

FB
PB 104
Segment 1
: STL
:C
DB 104
: JU FB 204
NAME : SHIFT
SNO :
KH 0001
DWNO :
DW
1
4-7

Siemens AG
Training Center

. 4-7/38

ST-S5SYS2

SIMATIC S5

FB

FB .
8 ,
. FB
, FB.
,
, .


JU, JC.
STL,
, .
()
.
CSF LAD
FB , . FB
, FB
. PG
(
).

Siemens AG
Training Center


STL
,
"Bit": , F 0.0.

. 4-8/38

ST-S5SYS2

SIMATIC S5



PB 104

FB 204
NAME
DECL
DECL

: SHIFT
: SNO
: DWNO
: LW
:L
: ><F
: BEC
:L
:L
: +F
:T
:T
:T
: AN
:=
: BE

Siemens AG
Training Center

D
I

Segment 1
: STL
:C
: JU
NAME : SHIFT
SNO
:
DWNO :
: ***

KH
W

=SNO
IW 2

=DWNO
C
103

DB 104
FB 204
KH 0001
DW
1

Segment 2
FB 204
SHIFT
0002
SNO
DW 2
DWNO

=DWNO
FW 254
QW
6
F
255.0
Q
4.0

Segment 3
FB 204
SHIFT
0003
SNO
DW 3
DWNO

. 4-9/38

4-9

ST-S5SYS2

PLC

SIMATIC S5


FB
.
.
,
,
(. ).

FB

Siemens AG
Training Center


FB . ,

. FB
. ,
, .

. 4-10/38

ST-S5SYS2

SIMATIC S5

PLC
PB 104
Segment 1
: STL
:C
: JU
NAME : SHIFT
SNO
:
DWNO :
: ***

DB 104
FB 204
KH
DW

0001
1

FB 204

SNO = 0001
DWNO = DW1
SNO = 0002
DWNO = DW2

Segment 2
FB 204
SHIFT
0002
SNO
DW 2
DWNO
Segment 3
FB 204
SHIFT
0003
SNO
DW 3
DWNO

NAME
DECL
DECL

: SHIFT
: SNO
: DWNO
:
:
:
:
:
:
:
:
:
:
:
:
:

LW
L
><F
BEC
L
L
+F
T
T
T
AN
=
BE

D
I

KH
W

=SNO
IW
2

=DWNO
C
103
=DWNO
FW 254
QW
6
F
255.0
Q
4.0

4-11

Siemens AG
Training Center

. 4-11/38

ST-S5SYS2

Siemens AG
Training Center

. 4-12/38

ST-S5SYS2

Siemens AG
Training Center

. 4-13/38

ST-S5SYS2

:
SIMATIC S5

:
PB 104
.
.
PB 104 ,
, :
L
L
><F
BEC
L
L
+F
T
T
T
AN
=
BE

KH 0001
IW
2

DW
1
C
103
DW
1
FW 254
QW
6
F 255.0
Q
4.0

Load shift No. 1


\ 1
Load shift No. set on pushweel buttons \
If a shift No. other than +1 is set, \ 1,
execution of the block terminates. \
Old number of parts for shift 1 \ 1
Counter reading of C103
\
Add
\
New number of parts for shift 1 \ 1
Store new No. of parts in aux. flag word \ .
New No. of parts for shift 1 to BCD display \.
Odd/even number

PB
104 FB 204. ,
2 3:

-------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------


. .
"SHIFT" (" ").

Siemens AG
Training Center

Decl:
Decl:

D (Data)
I (FB input)

KH
W

SNO
DWNO

. 4-14/38

(Format: Hex.)
(Word)

ST-S5SYS2

SIMATIC S5

FB 204, , ,
:
FB 204
Segment 1
NAME : SHIFT
Decl
: SNO
Decl
: DWNO
: LW
:L
:
: ><F
: BEC
:
:L
:L
: +F
:
:T
:T
:T
: AN
:=
:
: BE
FB

I/Q/D/B/T/C: D
I/Q/D/B/T/C: I

KM/KH/KY/KS/KF/KT/KC/KG: KH
BI/BY/W/D: W

=SNO
IW
2

Load shift No. x.


\
Load shift set on pushwheel \
buttons.
If a shift No. other than x is set, \ ,
exit block.
\

=DWNO
C
103

ld of parts (shift x) \ (. )
and counter reading of C 103. \
Add together.
\

=DWNO
FW 254
QW 6
F
255.0
Q
4.0

Store total (new of parts for \ (. )


shift x) in DW x and aux. flag word. \ DW x
Check for
even number.

\
\

FB 204 .
F1 : Editor STEP 5 Block ...

(x) Program file

FB: "SHIFT" .
Enter,
(Decl).
"SNO" Enter.
PG 6 : I/Q/D/B/T/C.
"SNO Data, "D".
:
KM/KH/KY/KS/KF/KT/KC/KG:

Siemens AG
Training Center

. 4-15/38

ST-S5SYS2

:
SIMATIC S5

FB "SNO"
.
"KH.

, .

"DWNO. DWNO FB
Input, "I" .
PG
:
BI/BY/W/D (Bit / Byte / Word / Doubleword).
DWNO
FB, "W" Word.
Enter
.

Siemens AG
Training Center

,
, . .

(JU FB 204 JC FB 204). PG ( STL)
( CSF).

. FB
.

: FB
, .
, FB
, FB
.

. 4-16/38

ST-S5SYS2

SIMATIC S5

PB 104

FB 204 .
PB 104.
PB 104. :
PB 104 .
File
Blocks
Delete ...
(x) Program file

FB

FB STL
. .
:
,
"Project Settings -Blocks -.
F4 : File Project Set
PB 104.
F1 : Editor STEP 5 Block ...

CSF

(x) Program file

":STL 1
STL.
"C
DB 104.

DB 104,

FB 204
"JU FB 204
Enter.
FB: "SHIFT" .
Enter.
PG
.
Enter.
PB 104
Segment 1
Shift 1
:STL
:C
DB 104
:JU
FB 204
NAME :SHIFT
SNO :
KH 0001
DWNO :
DW
1
FB 204 2.
CSF.
F2 Blocks FB F1 JU FB
.

Siemens AG
Training Center

. 4-17/38

ST-S5SYS2

:
SIMATIC S5
:

"FB 204.
CSF- FB 204:

FB 204 3
PB 104 FB.
PLC
.
IW 2.

Siemens AG
Training Center

. 4-18/38

ST-S5SYS2

SIMATIC S5

FB 204
,
QW 6.
, , ?

------------------------------------------------------------------------------------------------ ?

-------------------------------------------------------------------------------------------------

------------------------------------------------------------------------------------------------ ?

-------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------

.
3 .
, 10
"". ?

------------------------------------------------------------------------------------------------ ?

-------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------------

Siemens AG
Training Center

. 4-19/38

ST-S5SYS2

Siemens AG
Training Center

. 4-20/38

ST-S5SYS2

Siemens AG
Training Center

. 4-21/38

ST-S5SYS2

SIMATIC S5


:
1. FB .
2. :
, ..
, ,
, .
3. : "", .e.,

.

Siemens AG
Training Center

. 4-22/38

ST-S5SYS2

SIMATIC S5

STEP 5

,

4-23

Siemens AG
Training Center

. 4-23/38

ST-S5SYS2

FB

SIMATIC S5

,
-

FB

FB (user function blocks).




. ,

.
,
,
.

FB

, FB (standard function blocks),

. :
-

"" ( ,
).
().

(signal functions).
(Sequential controls).
(Closed-loop control).
/ (Intelligent I/O modules).


.
ST 57 ST50, 7.

S5-95U, S5-100U (CPU 103)


S5-115U. ( BCD
), (,
),
(, )
.

PLC.


(FB 238 FB 251 PLC S5-115U).
(S5-135U ) FX-
( FX 0
FX 255).

Siemens AG
Training Center

. 4-24/38

ST-S5SYS2

SIMATIC S5

4-25

Siemens AG
Training Center

. 4-25/38

ST-S5SYS2

SIMATIC S5


.
,
.
- .

BINARY
BCD

0010
10

=
=

00000000 00001010 = A (Hex.)


00000000 00010000

.
BCD- ,
QW 6 (. ). CPU S5-115U
BCD-
.
.

:
FB 240
FB 241

Siemens AG
Training Center

BCD
BINARY

. 4-26/38

BINARY
BCD

(BCD
(.

.)
BCD)

ST-S5SYS2

Siemens AG
Training Center

. 4-27/38

ST-S5SYS2

SIMATIC S5


QW 6.
( )
BCD- QW 6.
FB 241,
CPU. ,

QW 6. , FB 241
FB 204.
:
:

FB 241 FB 204
,
FB 241 PLC.

FB 241
FB 204.
F1 : Editor STEP 5 Block ... (x)Program file

:
DUAL: , (FW 254).
SBCD: ("1=; "0=). ""
, (
),
. F 200.0 (
F).
BCD2:
, S5-115U
BCD-. 4
.
. FY 200
"" ("scratchpad" ).
BCD1: ( 0 3) BCD,
, QW 6.

, "T QW 6
FB 241!
FB 204 PLC .

Siemens AG
Training Center

. 4-28/38

ST-S5SYS2

Siemens AG
Training Center

. 4-29/38

ST-S5SYS2

SIMATIC S5


FB

, CPU
.

,
. CPU
:
FB 240 BCD- ,
FB 241 BCD-.

.
S5-115U 11
PLC.

PLC FB , . .

:
High-End PLC
:DUF ( BCD-)
:DEF ( BCD- )
S5-115U (FB 242 FB 243
) PLC
:

:X F

()

: F

()



,
.
PLC
.
(0 1)
.


OB 1. F 0.0 0, F 0.1
1. :
OB1
:A
F 0.0
:R
F 0.0
:AN F 0.1
:S
F 0.1
:.....

Siemens AG
Training Center

Status always 0

/ 0

Status always 1

/ 1

. 4-30/38

ST-S5SYS2

SIMATIC S5


. COD:B4, FB 240

BCD

0...+9999

BCD-

SBCD

BI

1 -
0 +

BCD-

DUAL

16

(STL)
:JU FB 240
NAME :COD : B4
BCD :
SBCD :
DUAL :

. COD:16, FB 241

-32768 ... +32767 .

DUAL

SBCD

BI

1 -
0 +

BCD-

BCD2

BY

BCD-
4

BCD1

(STL)
:JU FB 241
NAME :COD : 16
DUAL :
SBCD :
BCD2 :
BCD1 :

BCD-
0 ... 3

4-31

Siemens AG
Training Center


(FY 200 FY 255).
,
.

. 4-31/38

ST-S5SYS2

Siemens AG
Training Center

. 4-32/38

ST-S5SYS2

Siemens AG
Training Center

. 4-33/38

ST-S5SYS2

:
SIMATIC S5


.
, , ,
, - "", "" ,
I 1.0 ".".
DW W 100
DB 105.

IW 2 (, 500 ).
,
QW 6.
, "FFFF"
QW 6.
PB 105
"JC PB 105.
PB 105 ("" "."
"." (OFF), I 1.0 -
ON) PB 103.

""
PB
105.
PB 105 PB 103 PLC.
.

Siemens AG
Training Center

. 4-34/38

ST-S5SYS2

:
SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 4-35/38

ST-S5SYS2

:
SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 4-36/38

ST-S5SYS2

- 4

SIMATIC S5


:
1. .
2. STEP
.

3.

"".
2 :
FB FB.
FB
"" "".

(, )
/

,
.

Siemens AG
Training Center

FB

"".

PLC,
.
""

. ,

.
FB , FB ,

.


,
.

. 4-37/38

ST-S5SYS2

SIMATIC S5

"" .
.
.
.
"" FB CSF.
.
CPU.


.
.
.

Siemens AG
Training Center

. 4-38/38

ST-S5SYS2

SIMATIC S5
1
2

5
1
2
3

................................................ 5-2
........................................................................ 5-2
,
RUN ........................................ 5-2
,
STOP ............................................. 5-4
CPU ............................................................... 5-6
PG ................................................................. 5-8
"PLC Info ISTACK ............................................................... 5-8
ISTACK.................................................................................. 5-8
1 ............................................................. 5-8
2 ............................................................. 5-8
(Interrupt STACK, ISTACK).................................. 5-10
ISTACK .................................................... 5-10
....................................................................... 5-12
....................................... 5-12
(Block Stack, BSTACK) ................................................ 5-14
"PLC Info BSTACK ............................................................ 5-14
, RUN.................... 5-16
RUN ......................... 5-16
-
"Block Status" .............................................. 5-16

"Status Variable" ............................................ 5-18
...................................................................... 5-20
,
.................................................... 5-20
................................................................. 5-22
.................................................. 5-22
.............................................. 5-22
................................ 5-24
: .......................................... 5-28
............................................................................................... 5-32
5. .................................................................................. 5-33
........................................................... 5-34

Siemens AG
Training Center

. 5-1/34

ST-S5SYS2

SIMATIC S5


,
PG.
, ,
S5-90U S5-115U.

, ,
:
- , PLC STOP,
;
- ,
,
(RUN).

() .


RUN


,
/.
/ ,
, .

PG
, :
-

Siemens AG
Training Center

Block Status . . .
Status Variable
Force Variables
Force Outputs
I/Q/F List
Search
Cross Reference List

. 5-2/34





//

ST-S5SYS2

SIMATIC S5

RUN

CPU ...

/
- ()

-

RN

/
/

ST

5-3

Siemens AG
Training Center

. 5-3/34

ST-S5SYS2

STOP-

CPU STOP
,
:
-

Siemens AG
Training Center

SIMATIC S5

,
CPU,
CPU,
"PLC info ISTACK,
"PLC info BSTACK.

. 5-4/34

ST-S5SYS2

SIMATIC S5

, STOP

CPU ...


- ,
- .

RN

RUN

ST

ST (STOP)
- CPU
- PG PLC INFO:
ISTACK
BSTACK

RN
ST

5-5

Siemens AG
Training Center

. 5-5/34

ST-S5SYS2

SIMATIC S5

CPU CPU S5-115U


. :
QVZ [No Acknowledgement (NAK)]
STOP RUN S5-115U
.
CPU PII
PIQ. /

Ready
(),

.
, /
.
, ,
, ,
"L PY .., "L PW .., "T PY .. "T PW ...
ZYK [Scan Time Exceeded (STE)]
CPU
. CPU S5-115U
500 .
( ) , CPU
STOP "ZYK
.
,
.

.
PLC.
BASP [Command Output Disable]
PLC STOP, , ..
.
"BASP.
CPU
. ,
, .

Siemens AG
Training Center

. 5-6/34

ST-S5SYS2

SIMATIC S5

CPU
115 U
CPU
941

RN
ST

RN
ST
QVZ
ZYK
BASP
NR
RE
OR

5-7

Siemens AG
Training Center

. 5-7/34

ST-S5SYS2

SIMATIC S5

PG

"PLC Info ISTACK"

CPU STOP-, PG
PLC,
"PLC Info
ISTACK.
CPU STOP-
, , "
" [interrupt STACK (ISTACK)].
F9 : PLC PLC Info ISTACK

ISTACK

S5-90US5-115U
ISTACK:
-

" " ["Control bits"]


" ISTACK".

Insert.
" " ,
PLC RUN-. "X"
-.
PG PLC.
( SHIFT:
; SHIFT: , "X").
:
1
[Control Bits, Group 1]

CPU.
.

2
[Control Bits, Group 2]


,
.

Siemens AG
Training Center

. 5-8/34

ST-S5SYS2

PG

SIMATIC S5

ISTACK (S5-115U, 1- )

5-9

Siemens AG
Training Center

. 5-9/34

ST-S5SYS2

SIMATIC S5


(Interrupt STACK)

" " ["Control


bits"] " " ["Interrupt stack"]
Insert. " "
PLC STOP;
.
.
,
. "CC0, CC1 "OVFL
.
.


ISTACK

(. ) , :
- (TRAF);
- (OP-REG) MC-5 - "3364;
- MC-5 - "T DW 100;
- PB 105;
- (REL-SAC) 0010;
- DB 105.

Siemens AG
Training Center

. 5-10/34

ST-S5SYS2

PG

SIMATIC S5

ISTACK (S5-115U, 2- )

5-11

Siemens AG
Training Center

. 5-11/34

ST-S5SYS2

SIMATIC S5


.
PB 105,
STL PLC. ,
,
F1 Addresses.
0000,
.
S5-90US5-115U .
, "".
, , ,

,
ISTACK,
,
. PB 105 ,
0010 : "T DW 100. ISTACK
, , .e.
. DB 105
(. ISTACK),
, DW 100
. DB 105.
PLC.
CPU STOP,
ISTACK !
: SUF (substitution error) -
, STUEB (block stack overflow) -
ZYK (scan time exceeded, "timeout")
, BSTACK.

Siemens AG
Training Center


.
,
, F1 Addresses.

STEP 5 7
:
F2
ISTACK ( 2),
PB 105;

(. ).

. 5-12/34

ST-S5SYS2

PG

SIMATIC S5

PB 105

C:SYS2A@ST.S5D

Segment 1
0000
:C
DB
0002
:L
DW
0004
:L
DW
0006
:+F
0008
:L
DW
000A
:+F
000C
:C
DB
000E
:T
DW
0010
:
0012
:JU FB
0014 Name:COD:B4
0016 BCD :
IW
0018 SBCD:
F
001A DUAL:
DW
001C
:
001E
:L
DW
0020
:L
DW
0022
:>F
0024
:L
KH
0028
:T
QW
002A
:BEC
002C
:
002E
:JU FB
0030 Name:COD:16
0032 DUAL:
DW
0034 SBCD:
F
0036 BCD2:
FY
0038 BCD1:
QW
003A
:BE

LEN=35

Specified number of parts reached?


/ ?
Call data block DB104
/ DB 104
104
Calculate total production /
1
2
of all three shifts
/
3
105
100

Call data block DB 105


/ DB 105
Store total production in DW 100 / DW 100

240

Convert setpoint to binary number/


/

2
200.0
99
99
100
FFFF
6
241
100
200.0
200
6

Compare setpoint with


/
total production
/
If setpoint > total production, / ,
display FFFF
/ FFFF
and
/
exit block.
/
Otherwise, call FB for conversion / FB -
from binary to BCD
/ BCD
Display total production
/

5-13

Siemens AG
Training Center

. 5-13/34

ST-S5SYS2


(Block Stack, "BSTACK")

SIMATIC S5

("BSTACK")
. ,
.

,
:
- ;
- , ,
.., . , CPU
,
"" .

F10 : PLC

PLC Info BSTACK

"
- " ["last-in-first-out" (LIFO)], "
". () .
,
.
( " ") BSTACK
PLC. , 32 BSTACK
S5-115U, STOP
STUEB ( ).
PLC S5-90US5-115U ,
BSTACK,
, .
S5-135U PLC
BSTACK,
, , .
PLC
, PLC STOP !

"PLC Info BSTACK"

Siemens AG
Training Center

BSTACK PG.
PG ,
, .

. 5-14/34

ST-S5SYS2

PG

SIMATIC S5

BSTACK

. .

DB

. DB

9032
901C
9006
906A

9040
9026
9010
9070

000E
000A
000A
0006

15
12
12

905A
904C
904C

PB 30
PB 23
PB 21
OB 1

OB1

PB21
A DB 12
9006

906A

JU PB 21
9070

BSTACK PB 33

PB23
A DB 15
901C

JU PB 23
9010

PB30
9032

JU PB 30
9026

PB33

DB 12
904C

JU PB 33
9040

DB15
905A

BE

BE

BE

BE

BE

5-15

Siemens AG
Training Center

. 5-15/34

ST-S5SYS2

SIMATIC S5

RUN

RUN


, :
-

Block Status ...


Status Variable
Cross Reference List
Search

" "
" "


,
.


-
(Block Status)

- - Block Status

. PG
CSF, LAD STL.
, ,
.
F6 : Test Block Status . . .


,
" " (CSF), CSF LAD,
" " (LAD)
:

CSF:
=====
........

1 ( '1')
'0' ( 0)
CSF-
RLO.

LAD:
=====
........

1
0
RLO .

Block Status STL


.
Load, Transfer
.

Siemens AG
Training Center

. 5-16/34

ST-S5SYS2

(RUN Mode)

SIMATIC S5

"Block Status"
(CSF)

(LAD)

Segment 1

Segment 1

I 0.6

I 0.5

Q 4.3

+===] [===+===] / [ ========+==( ) =

==== &

I 0.3

I 0.5

I 0.6

=== >=1

I 0.3

+= =

Q 4.3

] [

(STL)
Segment 1

STL-STATUS

:A(
:O
:O
:)
:AN
:=
:***

I 0.6
I 0.3
I 0.5
Q 4.3

STATUS/ACCU1 --- ACCU2 --- CODE


00000111
1
00000110
0
00000010
00000110
0
00000010
1
00000011

RLO
1
1
1
1
1
1


(RLO)

Siemens AG
Training Center


ACCU 1

. 5-17/34

SAC
70B8
70BA
70BC
70BE
70C0
70C2

C ACCU 1

5-17

ST-S5SYS2

SIMATIC S5



.
(" ") .
,
.
F7 : Test Status Variable
20 :
-

F/Q/I
FY / QB / IB
FW / QW / IW
T
C
DW / DL / DR

KM
KH; KM; KY; KS; KF
KH; KM; KY; KS KF
KT; KM; KH
KC; KM; KH
KH; KM; KY; KS; KF


.
,
"Status Variable",
.

Siemens AG
Training Center

. 5-18/34

ST-S5SYS2

SIMATIC S5

(RUN Mode)

" " ["Status Variable"]

PII
()

, ,
,


,

( )
PIQ
()

:
I
1.0
IB
1
IW
2
F
60.2
FY
60
FW 60
T
6
C
61
DB
60
DW
1
DW
2
Q
4.4
QB
4
QW
6

. ()
KM=0
KM=01011010
KH=0603
KM=1
KM=00000110
KM=00000110 00010100
KT=Stopped
KC= 34
KF=+1143
KH=47AD
KM=0
KM=00001101
KH=6482

5-19

Siemens AG
Training Center

. 5-19/34

ST-S5SYS2

SIMATIC S5

,
,

(XREF). T . 5-21a
, Q 5.5 -K1
- PB101, 1, AN.
- PB101, 1, O.
- PB102, 1, "=".
..


Output Editor "Block Status",
F2 Reference , F2 Disp XREF .
,
().
.

F Addresses F Lib No

F Symb SYM F .No Comm F -> STL

F Seg Com

F Save

F Help

1 Disp Symb 2 Reference 3 Search

5 Seg Fct

6 Edit

7 Enter

8 Cancel

F Help

4 Dest Blk

5 Orig Blk

8 Return

1 Gen XREF 2 Disp XREF 3

Output
Editor "Block Status", F2
Reference , F1 Gen XREF :
F11 : Management Generate XREF
:
T
PLC!


,
.
:
- (. )

- "[X] Update XREF Edit


() (. . 5-21b).

Siemens AG
Training Center

. 5-20/34

ST-S5SYS2

SIMATIC S5

(RUN Mode)

5-21a

5-21b

Siemens AG
Training Center

. 5-21/34

ST-S5SYS2

SIMATIC S5

Output Editor "Block Status"


,
, F2 Reference .
F4 Dest Blk
.
, ,
, F4 Dest Blk
F5 Orig Blk
.


, ,
. , F 101.7
, FY
101, FW 100 FD 98.
, F4 Single .


.
,
(, AND
),
.
, ,
F5 No Dupl .

Siemens AG
Training Center

. 5-22/34

ST-S5SYS2

(RUN Mode)

SIMATIC S5


F Addresses F

Lib No

F SymbSYM F

STL

Seg Fct

1 Gen XREF 2 Disp XREF 3

1 Disp Symb 2 Reference 3

Search

No Comm

Dest Blk

Orig Blk

F Seg Com

Save

Help

Enter

Cancel

Edit

Help

Return


,


5-23

Siemens AG
Training Center

. 5-23/34

ST-S5SYS2

SIMATIC S5

(Search),
"Search key" (" ")
"Edit Block(s)" ( PLC )
"Block Status".

"Search key" , F7 Info.

"Block list" , F7 Info .
(Search),
Output "Edit Block(s)" ( PLC
) - "Block Status", F3 Search .
, ,
( !).
F3 Search
F2 From seg1 , 1 .
F3 Continue,
(
).

Siemens AG
Training Center

. 5-24/34

ST-S5SYS2

SIMATIC S5

(RUN Mode)

5-25

Siemens AG
Training Center

. 5-25/34

ST-S5SYS2

Siemens AG
Training Center

. 5-26/34

ST-S5SYS2

Siemens AG
Training Center

. 5-27/34

ST-S5SYS2

SIMATIC S5

4
PG,
, .
, :
PLC Info ISTACK
PLC Info BSTACK
Block Status...
Status Variable
Cross reference list
Search

, ("")
, .
-

PB
PB
PB
PB

150
151
152
153

PB 154
PB 155
FB 254

.
.
.
,
, PB 154 PB 155.
FB 254.
, .
DB104.

. PLC
STOP RUN.
:
PLC
PB 150PB 155,
OB 21, OB 22, FB 254, DB 154 DB 155.

1 [SYS2B@ST.S5D]
C:\S5_DATA\S5COURSE\S5SYS2\SYS2B

2 [SYS2A@ST.S5D]
C:\S5_DATA\S5COURSE\S5SYS2\SYS2A

F5 : File

Siemens AG
Training Center

. 5-28/34

Blocks

Transfer ....

ST-S5SYS2

SIMATIC S5

OB1
PLC:
Segment 1
:STL
:A

0.0

:R

0.0

:AN

0.1

:S

0.1

:AN

0.3

:R

0.2

:A

0.2

:R

0.3

:
:JU

PB 150

:JU

PB 151

:JU

PB 152

:JU

PB 153

:
:BE

OFF
PLC.
,
.
.

Siemens AG
Training Center

,
.
: F1 Addresses.
, PLC
STOP, PLC!

. 5-29/34

ST-S5SYS2

SIMATIC S5

1-
?

ISTACK?
?

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

2-
"",
: 1, 2 3. .
?
- ?
,
5-205-24.

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

Siemens AG
Training Center

. 5-30/34

ST-S5SYS2

SIMATIC S5

3-
.
.
?

ISTACK?
?

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

4-
.
.
?

ISTACK?
BSTACK!
?

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

--------------------------------------------------------------------------------------------

Siemens AG
Training Center

. 5-31/34

ST-S5SYS2

SIMATIC S5

, ,
"".
1. ?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------2. , PLC
STOP ?
?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------3. ISTACK ,
, CPU S5-115U?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------4. , ,
STOP?

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------5. ?

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Siemens AG
Training Center

. 5-32/34

ST-S5SYS2

- 5

SIMATIC S5

,
,
PLC STOP,

. CPU STOP ,
ISTACK BSTACK

CPU .
ISTACK :
1- , Control bits (" "),

PLC.
2- , Int STACK (" "),

.

Siemens AG
Training Center

,
RUN,

.

:
Block Status
Status Variable
Cross reference list
Search.
"" ""
S5SERV.

. 5-33/34

ST-S5SYS2

SIMATIC S5

CPU STOP .
"BASP".
"QVZ" (NAK).
"ZYK" (STE).
ISTACK.

ISTACK.
.
, "Reference" (" ").

ISTACK

ISTACK.
BSTACK.
.

.
.
"Search"- ( ).

Siemens AG
Training Center

. 5-34/34

ST-S5SYS2

SIMATIC S5
1
2

6
1
2
3

..................................................................................................... 6-2
........................................................ 6-2
........................ 6-4
................................................................................ 6-4
............................................................................ 6-4
................................................................. 6-5
................................... 6-5
....................................................... 6-6
............................................................................. 6-6
/ (Step Flags) ............................. 6-6
........................................... 6-8
.................................................................. 6-10
................................................................... 6-10
( - transition)..... 6-10
................................................................................................... 6-10
"" DIN 40 719 ............................ 6-11

" " ............................................ 6-12
PB 100 ................................................................................ 6-12
PB 106 ............................................................. 6-12
SB 106 ............................................................................ 6-14
SB 106.............................................................. 6-14
: ..... 6-18
............................................................................................... 6-21
................................................................ 6-22
GRAPH 5 ........................ 6-26
GRAPH 5 .......................................................................................... 6-26
................................................................................ 6-26
..................................................................................... 6-26
6. .................................................................................. 6-29
........................................................... 6-30

Siemens AG
Training Center

. 6-1/30

ST-S5SYS2

SIMATIC S5



4 - ,
, .
( 1).
1:

,
( 2).

2:

4 .

3:

,
( 3).

4:

6 .

5:

,
(4, ).

6:

,
.
,
.

,
,
.

Siemens AG
Training Center

, , ,
.
,
.
.
:
, , ,
, .. ,

.

. 6-2/30

ST-S5SYS2

SIMATIC S5

S1

S2

Siemens AG
Training Center

S3

S4

S5

. 6-3/30

S6

S7

6-3

ST-S5SYS2

SIMATIC S5


4-
:
-
- ()
- (Command output)
- .
,
-.


.
()
.

,
. :
(automatic) ,
, ,
.
(Single step)

-.
.
(setup). ()
, PLC ("" ).

/ .

Siemens AG
Training Center

""
.

("" - "transitions").

(ON delay)
.
.

. 6-4/30

ST-S5SYS2

SIMATIC S5

.
.

,
"Transitions"

6-5

,
, ,


. , , .

Siemens AG
Training Center

. 6-5/30

ST-S5SYS2

SIMATIC S5


(Initial State)

"" , ,
, .
, "".


, -
.
.

,
(AND)
.
.
,

. ,
. , , ,
" ".

Siemens AG
Training Center

. 6-6/30

ST-S5SYS2

SIMATIC S5


(ON)
-.

(OFF)

&

-.

&

-SF0

-SF1

-SF7

-. .

-SF7

-SF1

-SF7

/
-SF2

&

-
S2 S3

SF.. =

Siemens AG
Training Center


-SF6

-SF3

-SF2

S.. =

&
S

-SF7

-SF6

6-7

. 6-7/30

ST-S5SYS2

Siemens AG
Training Center

SIMATIC S5

.

.

. 6-8/30

ST-S5SYS2

SIMATIC S5

-SFx

&
>=1

-.

-><

&
&

6-9

Siemens AG
Training Center

. 6-9/30

ST-S5SYS2

SIMATIC S5


.

:
1. DIN 40 719, 6 (.
).

STL, CSF LAD.
2. IEC 848.
GRAPH 5
()
(. . 6-27).

(transition) ,
.
. ,
: , ,
, .. .
(AND), ( AND)
,
, DIN 40719. () ,
,
- .

,
, , , ..
, (., ),
, ..
.

.

,

.

Siemens AG
Training Center

. 6-10/30

ST-S5SYS2

DIN 40 719

SIMATIC S5

:
:


DIN 40 719, 6
.
7 ( )
I 1.7 (Start)
Q 5.1

.
1

NS

Q 5.5

NSD

NS

I 8.6

NS

NSD

R
1

2
R

T 108 .
3
R

NS

Q 5.5

NSD

I 8.1

NS

NSD

R
4

T 109 .
5
R

6
R

NS

Q 5.5

NSD

I 8.0

NS

I 8.4

NS

S
7

6-11

Siemens AG
Training Center

. 6-11/30

ST-S5SYS2

SIMATIC S5


" "

,
,
. PB 100
, . PB 106
, .
SB 106,
,
. .
.
PB 100,

(ON), "" (Manual),


"" (Automatic)
PB 100.
(Q 4.3) "".

PB 106,

,
,
:
1. : , :
-
(I 8.6
I 8.7 = "0")
-
(I 8.0 = "0" )
-
(Q5.5 Q5.6 = "0")

-
(F107.0="0")

Q 5.1.
2. SB 106.
3. : :
1, 3, 5:
(Q 5.5)
2:
, 4 (T 108, SD)
4:
, 6 (T 109, SD)
6:

( Q 5.4)

(I 0.2)
(I 0.3) "" (Q 4.2).
4. : QW 6 (QB 6 7)
(
17). , QB 7
.

Siemens AG
Training Center

. 6-12/30

ST-S5SYS2

SIMATIC S5


PB 100

OB 1
:JU

:JU

PB

PB

100

106

:BE

( .)
:
:
:BE
PB 106 . .

SB 106

.
,
:JU SB 106
,

,
,
,

:BE

:BE
6-13

Siemens AG
Training Center

. 6-13/30

ST-S5SYS2

SIMATIC S5

SB 106

SB 106

T1 ( )

START .= 1 (I 1.7)
AND . - (Q 5.1)
AND . "." (Q 4.3)
AND (F 106.6)

S1, SF1 (F 106.0)

"" (Q 5.5)
7 (F 106.6)

T2

2 (I 8.6)

S2, SF2 (F 106.1)

, 4 (T 108)

T3

T 108

S3, SF3 (F 106.2)

"" (Q 5.5)

T4

3 (I 8.7)

S4, SF4 (F 106.3)

, 6 (T 109)

T5

T 109

S5, SF5 (F 106.4)

"" (Q 5.5)

T6

(I 8.0)

S6, SF6 (F 106.5)

(Q 5.4)

T7

.
( S4, I 8.4)

S7, SF7 (F 106.6)

:
. . "." (Q 4.3=0)

F 106.0F 106.5
AND . , F 106.6

T = T . .

Siemens AG
Training Center

. 6-14/30

ST-S5SYS2

SIMATIC S5

SB 106

T1
S1
T2
T3
T4
T5
T6
T7

S2
S3
S4
S5
S6
S7

S =
T = T

6-15

Siemens AG
Training Center

. 6-15/30

ST-S5SYS2

Siemens AG
Training Center

. 6-16/30

ST-S5SYS2

Siemens AG
Training Center

. 6-17/30

ST-S5SYS2

SIMATIC S5

5
SB 106
, .
CSF/LAD "="
"S", "R", , ,
"=" SHIFT+<
>. , (
1, ), , ,
F3
2- .

F3

SB 106
1

&

&

R
2

&

Siemens AG
Training Center

&

. 6-18/30

ST-S5SYS2

SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 6-19/30

ST-S5SYS2

10

15

20

SIMATIC S5

25

10

15

20

25

30

35

Siemens AG
Training Center

. 6-20/30

ST-S5SYS2

SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 6-21/30

ST-S5SYS2

SIMATIC S5

PLC.
, OB 1 .
OB 1
: JU PB 100
: JU PB 106
: BE

.
:
( Q 4.1),
( Q 4.3),
INI 1 (Q 5.1 = . -),
1 I 1.7 (START). ....

:
, ""

. ""?

-------------------------------------------------------------------------------------------
.

.
, .
, 1, 3
5, .
, .
:

F 106.0
F 106.2
F 106.4

>=1

T 106
T

KT 050.1

TV

0
BI
DE

I 1.6

#F 107.0
F 100.0

Siemens AG
Training Center

. 6-22/30

&

Q 4.0
: BE

ST-S5SYS2

SIMATIC S5

Siemens AG
Training Center

. 6-23/30

ST-S5SYS2

SIMATIC S5

SB 106 (
PB 106!)
. ,
, ,
F 107.0

.


"
" " " :

- ,
- .

Siemens AG
Training Center

. 6-24/30

ST-S5SYS2

Siemens AG
Training Center

. 6-25/30

ST-S5SYS2

Siemens AG
Training Center

. 6-26/30

ST-S5SYS2

SIMATIC S5

GRAPH 5

GRAPH 5

GRAPH 5 o
SIMATIC S5
. GRAPH 5

IEC 848.
GRAPH 5 ,
() STEP 5
CSF, LD SL. GRAPH
5
S5.

GRAPH 5
.
.

. ,
GRAPH 5,
STEP 5 PG.

GRAPH 5 :

Siemens AG
Training Center

. 6-27/30

ST-S5SYS2

GRAPH 5

SIMATIC S5

GRAPH 5
IEC 484

1
()

S1

T1

(
S2)

2
()

(
S3)


(CSF, LAD STL)
S1
F 233.0

8.2

F
I
Q

233.0 =
8.2 =
4.2 =

Q 4.2

T1 ( )

S2
T2

&

8.7

1.7

I
I
F

&
=

F 233.0

8.7 = 1-
1.7 = 2-
233.0 = RLO -

6-27

Siemens AG
Training Center

. 6-28/30

ST-S5SYS2

Siemens AG
Training Center

. 6-29/30

ST-S5SYS2

SIMATIC S5


,
.
.

- Mode section
( )
- Sequencer
( )
- Command output
(
)
""
.
( ),

,
.

Siemens AG
Training Center

:
1.
,
.
2.
FB.

. 6-30/30

GRAPH

ST-S5SYS2

SIMATIC S5

.
" " (transition).
.

.

"Graph 5".

Siemens AG
Training Center

. 6-31/30

ST-S5SYS2

SIMATIC S5
1
2
3
4

7
1

........................................ 7-2
....................................................................................... 7-2
OB .................................................. 7-4
S5-95U/100U (CPU 103) ..................................................................... 7-4
S5-135U/155U..................................................................................... 7-4
S5-115U .............................................................................................. 7-6
: OB 13 .............................. 7-10
: ................... 7-11
......................................................... 7-14
.......................................................................... 7-14
............................................................................. 7-14
........................................................................... 7-14
.................................................... 7-16
(Analog Module) ............................... 7-18
..................................... 7-18
..................................................... 7-20
S5-95U .............................................................................................. 7-20
S5-100U ............................................................................................ 7-20
S5-135U ............................................................................................ 7-20
S5-115U ............................................................................................ 7-22
.......................................................................... 7-22
........... 7-24
, ...................................................... 7-24
, ............................. 7-24
:
....................................................................... 7-28
............................................ 7-32
: .......................................... 7-36
.......................................................................... 7-36
............................................................. 7-36
STEP5 ........................................................................ 7-36
....................................................................... 7-37
7. .................................................................................. 7-39
............................................................. 7-40

Siemens AG
Training Center

. 7-1/40

ST-S5SYS2


SIMATIC S5

,
, ,

.
- " ,
"
OB.

OB, "" (
)
-
OB.
,
.

PLC. PLC S5-95U, S5-100U S5-115U
STEP 5,
S5-135U ( DX 0) ,
.
,
.

, ,
OB , .
,
"" ,
,
. "" OB,
, , ,
. , PLC
STOP. "" ,
, CPU S5-135U .

Siemens AG
Training Center


,
. ,
, (
), ,
.

. 7-2/40

ST-S5SYS2

SIMATIC S5

,
S5-95U, S5-100U, S5-115U

OB 1
"" OB

S5-135U, S5-155U

OB 1
"" OB

:
:A

I 0.7

:
:JU

PB

:A

F 12.0

:JC

FB ...

:S
:

F 10.1

:JU
:

SB ...

PB.., FB ..

PB.., FB ..

...

PB.., FB ..

: . = 300 ;
100
200

PB.., FB ..

. = 20 ; = 100
300
400
500
600
700
t

20
100

20

80

20

80

20

40

40

. = 360

20

80

20

80

20

80

20

. = 380

7-3

Siemens AG
Training Center

. 7-3/40

ST-S5SYS2


SIMATIC S5

"" - OB OB 10OB 18
.
PLC. OB 13
OB, PLC S5-95U .

S5-95U/100U (CPU103)

PLC OB 13,

.
CPU 103 10
10 10 "SD97".
"0", OB 13 .
S5-95U DB 1.
.

S5-135U/155U

Siemens AG
Training Center

PLC S5-135U c R- (CPU 922) OB 13,


100 , .
.
PLC S5-135U CPU 928 PLC S5-155U
OB 10OB 18. ,
.
OB 10 OB 18, OB 10
, OB 18 .
PLC S5-155U "T",
() .

. 7-4/40

ST-S5SYS2

SIMATIC S5

"" OB

S5-95U
S5-100U

S5-115U

T=n 10
n=1 ... 65535

Tx=n 10
n=1 ... 65535

S5-135U

922

OB 10
OB 11
OB 12
OB 13
OB 14
OB 15
OB 16
OB 17
OB 18

928
**)

T
-

T1
T2
T3
T4
-

100
-

10
20
50
100
200
500
1
2
5

S5-155U
T=n 10 *)
n=1 ... 255
***)
1
2
4
8
16
32
64
128
256

T
T
T
T
T
T
T
T
T

1
2
5
10
20
50
100
200
500

T
T
T
T
T
T
T
T
T

*) S5-155U: T 10 2550 .
OB.
**) S5-135U: CPU 928 9
***) () DX0.

7-5

Siemens AG
Training Center

. 7-5/40

ST-S5SYS2


SIMATIC S5

S5-115U

CPU S5-115U OB 12, OB 11 OB 10


OB 13.

OB, , +1 +65535
10
.
OB
, OB 13 .
.

Transfer.
,

.
,

. ,

.

Siemens AG
Training Center

. 7-6/40

ST-S5SYS2

SIMATIC S5

OB S5-115U

=n 10

0 < n < 65535

SD 97

EAC2

OB

13 (0-FFFFH

10 )

10 (= 100 )

SD 98

EAC4

OB

12 (0-FFFFH

10 )

0 (= )

SD 99

EAC6

OB

11 (0-FFFFH

10 )

0 (= )

SD 100

EAC8

OB

10 (0-FFFFH

10 )

0 (= )

7-7

Siemens AG
Training Center

. 7-7/40

ST-S5SYS2

Siemens AG
Training Center

. 7-8/40

ST-S5SYS2

Siemens AG
Training Center

. 7-9/40

ST-S5SYS2

: OB 13
SIMATIC S5

OB 13

OB 13
.
Q 4.4 2 .
FB 13 ( !)
. FB 13
OB 13.
FB13
Name: INTERVAL
:L

KF +25

Setting the call interval

:T

DS 97

to 25 x 10 ms = 250 ms

/
/ 2510 = 250

:BE

FB 13 OB 21/OB 22.
FB 13 OB, ..
OB 13 .
OB21, OB22
:JU FB 13
:Name: INTERVAL

Q 4.4
OB 13.
OB13
:AN Q

4.4

:=

4.4

:BE

Siemens AG
Training Center

PLC .

?
1. -------------------------------------------------------------------------------------------2. --------------------------------------------------------------------------------------------

. 7-10/40

ST-S5SYS2

SIMATIC S5



.
OB 13 :
OB13-
:AN
Q
:=
Q
:AN
Q
:=
Q

4.4
4.4
4.4
4.5

()
() , .
"0" OB 13.
1-
: AN
:=
: AN
:=

Q
Q
Q
Q

4.4
4.4
4.4
4.5

2-
: AN
:=
: AN
:=

Q
Q
Q
Q

4.4
4.4
4.4
4.5

3-
: AN
:=
: AN
:=

Q
Q
Q
Q

4.4
4.4
4.4
4.5

PLC.

Siemens AG
Training Center

. 7-11/40

ST-S5SYS2

:
SIMATIC S5

OB 13
"BEC".
OB 13, Q 4.4
2, , Q 4.5
1.
.

10

15

20

25

10

15

20

25

Siemens AG
Training Center

. 7-12/40

ST-S5SYS2

Siemens AG
Training Center

. 7-13/40

ST-S5SYS2


SIMATIC S5

.

,
.
, .

.

. ,
.
,
,
. ,
.


. ,
PLC
/ .
PLC
.
STEP 5 CPU ,

.


, ,

.

, -.
.

Siemens AG
Training Center

. 7-14/40

ST-S5SYS2

SIMATIC S5

CPU

U (t)

00101011 01010000

Siemens AG
Training Center

. 7-15/40

7-15

ST-S5SYS2


SIMATIC S5


. :
(= 1)
(= 0).

. ,
, .
, , , ,
, .
.

( / ) ,
.
, ,
.

,
.
SIMATIC

.

PLC,
.

:
,
.

Siemens AG
Training Center

. 7-16/40

ST-S5SYS2

SIMATIC S5

RL

U
1

20 mA

24 V

0
0

Siemens AG
Training Center

7-17

. 7-17/40

ST-S5SYS2


SIMATIC S5

.
/
4- . (ADC)
-
. CPU
Load
.
.

4, 8 16 ,
,
.
. .

. 50
(.., )
60 .
,
.
.
8- 8 x 0.06 = 0.48
. .
STEP 5,
0.48 .
- ,

.

, ,
. ,
, .

Siemens AG
Training Center

. 7-18/40

ST-S5SYS2

SIMATIC S5

+
+
10 V

+
+
+
+

0 ... 20 mA

+
+
-

MUX

PW ...

PW ...

PW ...

PW...
n

PW...

PW...

PW ...

S5 bus

PW ...

7-19

Siemens AG
Training Center

. 7-19/40

ST-S5SYS2


SIMATIC S5


PLC.

S5-95U

S5-95U 8 1
. . PII
(IW 4054), PIQ
(QW 40).
, S5-100U,
PLC.
.

S5-100U


PLC.
, ,
. 8 . 16
.
, 2 . 8
(. 4 ).
PII.
Load Transfer (., L IW 120, . . 7-21).

S5-135U

PLC 4-, 8- 16- .


.
128.
Load Transfer: L PW ... T PW ....

Siemens AG
Training Center

. 7-20/40

ST-S5SYS2

SIMATIC S5

(S5-100U)

CPU

64

72

80

88

96

104

112

120

66

68

70

78

86

94

102

110

118

125

7-21

Siemens AG
Training Center

. 7-21/40

ST-S5SYS2


SIMATIC S5

S5-115U

S5-115U ,
IM306. 8
16 (), 16
32 .
PII , 128.
"L PW.." "L
PY..".
IM306
03
. 32 .
8 ,
.

IM306,
128 .
, 16-
128, 160, 192 224,
8-
128, 144, 160 . . . 240.
( IM306 8 16 .)


(.,
0 - 10 V) (., 500 mV).
:
1)
(2 4).
2) 498-1AA11,

( M-) (
).

Siemens AG
Training Center

. 7-22/40

ST-S5SYS2

SIMATIC S5

(S5-115U)
IM 306
PS

CPU

0.0
...
3.7

4.0
...
7.7

8.0
...
11.7

12.0
...
15.7

16.0
...
19.7

20.0
...
23.7

24.0
...
27.7

128
...
159

160
...
191

192
...
223

224
...
255

128
144
160
176
192
208
224
240

Siemens AG
Training Center

IM 306

IM

16

7 6 5 4 3 2 1
1
1
1
1
1
1
1
1

0
0
0
0
1
1
1
1

0
0
1
1
0
0
1
1

0
1
0
1
0
1
0
1

0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0

0
0
0
0
0
0
0
0

ON
1

ON
7

32

7-23

. 7-23/40

ST-S5SYS2


SIMATIC S5

2
.

,
.
:
1 " " (0 = , 1 = )
12
3 " "

" "


, , (-10V+10V) [-2048+ 2048],
.
(overflow bit) "OV" '1',
(> 4095).
,
"OV":
"A" "1" "
", ,
.
"F"

.

" "

, PLC, .
, "
" .
STEP 5
. "SRW 3" 1
,
.

Siemens AG
Training Center

. 7-24/40

ST-S5SYS2

SIMATIC S5

""

211 210

29

28

27

26

25

24

23

22

21

20

F OV

. (0...2047)
. (> 2047...4095)
(> 4095);
OV
'1'

S = :
0
1 .

OV = " "
F = " "
A = " " (: )
7-25

Siemens AG
Training Center

. 7-25/40

ST-S5SYS2

Siemens AG
Training Center

. 7-26/40

ST-S5SYS2

Siemens AG
Training Center

. 7-27/40

ST-S5SYS2

:
SIMATIC S5


.
0 V 24 V.
(
AI).
-10V +10V.

. ( 0)
"PW 224".
FW 224. " " , ""
FW 226.

FB 207
.
FB207
Name : ANALOG
:L
PW
:T
FW
:SRW
:T
FW

224
224
3
226

Address of channel 0

/ 0

Mask out event bits /

FB 207 PLC
OB 1 .

PLC - "Status Variable"


FW 224 KM , FW 226 KF .

.
" "
"OV"?

------------------------------------------------------------------------------------------- ,
?

--------------------------------------------------------------------------------------------

Siemens AG
Training Center

. 7-28/40

ST-S5SYS2

SIMATIC S5

>

in V

0
7

5
11

3
9

2
8

0
6

7
5

6
4

4
2

3
1

2
0

1
F

4095

20.00

0/1 0/1

4095

19.9952

0/1 0/1

2049

10.0048

0/1 0/1

2048

10.0000

0/1 0/1

2047

9.9952

0/1 0/1

1024

5.0000

0/1 0/1

1023

4.9952

0/1 0/1

0.0048

0/1 0/1

0.0

4
10

OV

0/1 0/1

-1

-0.0048

0/1 0/1

-1023

-4.9952

0/1 0/1

-1024

-5.0000

0/1 0/1

-2047

-9.9952

0/1 0/1

-2048

-10.0000

0/1 0/1

-2049

-10.0048

0/1 0/1

-4095

-19.9952

0/1 0/1

20.00

0/1 0/1

< -4095

.
.

7-29

Siemens AG
Training Center

. 7-29/40

ST-S5SYS2

Siemens AG
Training Center

. 7-30/40

ST-S5SYS2

Siemens AG
Training Center

. 7-31/40

ST-S5SYS2


SIMATIC S5

, ,
.
,
.

. :
1. , ..,
"0" "1" .
.
2.
.
(215) 1
0 .

+ 3280

+1

- 3280

CPU
.

.

Siemens AG
Training Center

. 7-32/40

ST-S5SYS2

SIMATIC S5


-7 1001

-8
1000

0111 +7
0110 +6

-6 1010
-5 1011

0101 +5

-4 1100

0100 +4

-3 1101

0011 +3

-2 1110
-1 1111
-32 768

0010 +2

0000
0
0

10000000 00000000

Siemens AG
Training Center

0001 +1
+32 767
01111111 11111111

. 7-33/40

7-33

ST-S5SYS2

Siemens AG
Training Center

. 7-34/40

ST-S5SYS2

Siemens AG
Training Center

. 7-35/40

ST-S5SYS2

:
SIMATIC S5


. 50 3.
,
.
3
, 5 ,
().
.
,
.

, ,
-,
0 V 10 V .

( 50 3 10 V),
.

.

STEP 5

FB 207.
,
( 3- )
- .
FB 13
OB 13.
:
60 .
FB 207 OB 13.

PB 107.


. Q 5.0
" " ( 10 3),
Q 4.0 "
3
3
" ( 40 ). " " ( 40 )
3
, 5 , Q 5.7 .
( I 0.7) ("ACK"
""), " "
Q 4.0 ,
40 3.

Siemens AG
Training Center

. 7-36/40

ST-S5SYS2

SIMATIC S5

PLC PB 107
OB 1.
.
QW 6?

--------------------------------------------------------------------------------------------

-------------------------------------------------------------------------------------------
.
1600 40 3 , 2000
50 3. 3
QW 6.
FB 243
( CPU).
FB 243 S5-115U.
FB 243 FB 207.

Siemens AG
Training Center

. 7-37/40

ST-S5SYS2

Siemens AG
Training Center

. 7-38/40

ST-S5SYS2

- 7

SIMATIC S5


,
.

, .

O, , ,
,
PLC.
OB - OB 13.
S5-115U 4
,
.


.
, ,

.

Siemens AG
Training Center

,


.
( )



.

,

-
().

,
,
CPU

Load (L PW).

,

.

STEP 5.



.
S5PRG1 S5SERV.

. 7-39/40

ST-S5SYS2

SIMATIC S5

OB .

.

OB

.

.
.
" ".


.
.
.

.

Siemens AG
Training Center

. 7-40/40

ST-S5SYS2

SIMATIC S5
1
2

8
1
2
3
4

, ............................ 8-2
.......................................................................................... 8-4
: .......................... 8-8
....................................................................... 8-13
, , .......................... 8-16
....................................................................................... 8-17
1 ................................................................................................ 8-17
2 ................................................................................................ 8-17
......................................................................... 8-18
1 ................................................................................................ 8-18
2 ................................................................................................ 8-18
3 ................................................................................................ 8-18
4 ................................................................................................ 8-18
5 ................................................................................................ 8-19
6 ................................................................................................ 8-19
7 ................................................................................................ 8-19
,
................................................... 8-20

Siemens AG
Training Center

. 8-1/20

ST-S5SYS2

SIMATIC S5

,

.
.
.
,
. , 1.
:

:

""

5 .
,
H1, ,
.

, ,
.
LB1,
. 5 ,
5 .
H1 .

H4

, 5
.
,
S4 .
""
, S7 S8
.
, H1 ,
.

Siemens AG
Training Center

. 8-2/20

ST-S5SYS2

SIMATIC S5



OB 1
:JU PB 100

PB 100
Seg1: /
Seg2:
Seg3:
Seg 4+5:

:JU

PB 101

PB 101
Seg1:

:JU

PB 102

PB 102

Seg1:
LB1
Seg2:

Seg3:

:JU

PB 103

PB 103
Seg1:
Seg2: 5

:BE

8-3

Siemens AG
Training Center

. 8-3/20

ST-S5SYS2

SIMATIC S5



:
1. H1
H1 :
- 2 ,
- 1 .
.
OB 13.
2.
:
,
. ,
, ,
.
3 ( - 5)
, ,

.
,
, .
(H2 H3)
, H1 1.

Siemens AG
Training Center

. 8-4/20

ST-S5SYS2

SIMATIC S5



OB 21

OB 22

Segment 1:
: JU FB 106
Name: INTERVAL

Segment 1:
: JU FB 106
Name: INTERVAL

,

OB 13

FB 106

Segment 1:
2

Segment 1:
OB 13

Segment 2:
1

8-5a



OB 1
:JU

PB 100

PB 100
Seg1: /
Seg2:
Seg3:

:JU

PB 101

PB 101
Seg1: , 1,2 3:

:JU

PB 102

PB 102
Seg1:
Seg2:
Seg3:
Seg4:

:JU

PB 103

PB 103
Seg1:
Seg2: 3 .
Seg3: H4

:BE



LB 1

8-5b

Siemens AG
Training Center

. 8-5/20

ST-S5SYS2

Siemens AG
Training Center

. 8-6/20

ST-S5SYS2

Siemens AG
Training Center

. 8-7/20

ST-S5SYS2

SIMATIC S5

7
,
SYS2B@ST.S5D .
SYS2B@ST.S5D
,
MODELST.S5D.
PB 100 ... PB 103 OB 1

[SYS2B@ST.S5D]
C:\S5_DATA\S5COURSE\S5SYS2\SYS2B

2 [MODELST.S5D]
C:\S5_DATA\S5COURSE\S5SYS2\SYS2A
F5 : File Blocks Transfer ...
. ,
,

MODELST.S5D PLC.
1. H1
H1 (Q 5.1) ( 1)
.
2 ,
1 , .
OB 13.
, :
F 100.0 FLASH 2 2
F 100.1 FLASH 1 1 .
OB 13
RS97 FB 106 (name: INTERVAL / :
). T
OB 13, : f =1 f =2 ,
: T = 1 .
2f

FB 106 OB 21/22
OB 13.
PB 100,
.

Siemens AG
Training Center

. 8-8/20

ST-S5SYS2

SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 8-9/20

ST-S5SYS2

10

15

20

SIMATIC S5

25

10

15

20

25

30

35

Siemens AG
Training Center

. 8-10/20

ST-S5SYS2

SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 8-11/20

ST-S5SYS2

SIMATIC S5

2.
PB 102: "Conveyor FORWARD"
(" ")

.
, ,
.
,
.
, ,
.
F 4.0

Bay-F

: .

PB 101: "Indicator Light, Pre-Assembly"


(", ")
,
,
(H1: Q 5.1, H2: Q 5.2 H3: Q 5.3)
.

, . 2
1
( ""
).
PB 103: "Count Parts"
(" ")
3 ( - 5)
, (H4: Q 5.4)
, ,
.
(S4: I 8.4)
.

(QW6).

.
I 1.7
.

Siemens AG
Training Center

. 8-12/20

ST-S5SYS2

SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 8-13/20

ST-S5SYS2

10

15

20

SIMATIC S5

25

10

15

20

25

30

35

Siemens AG
Training Center

. 8-14/20

ST-S5SYS2

SIMATIC S5

10

15

20

25

10

15

20

25

30

35

Siemens AG
Training Center

. 8-15/20

ST-S5SYS2

: , ,

SIMATIC S5

, ,
"" ""
, , .
/ ,
, PLC.

.

Siemens AG
Training Center

. 8-16/20

ST-S5SYS2

SIMATIC S5

"" . ""
: Q 4.1, Q 4.2

;
I 0.2 :
I 0.3 :
Q 5.1:
: 2 , : 1 .

:
2

Siemens AG
Training Center

-------------------------------------------------------------------------

""

,
.

-------------------------------------------------------------------------

. 8-17/20

ST-S5SYS2

SIMATIC S5

"" (Q 4.1), "." (Q 4.3)

""
.

,
.

--------------------------------------------------------------------------

/ CPU STOP/START
.
:

= "0"

--------------------------------------------------------------------------

"" . (Q 4.1), "." . (Q 4.3),


(Q 5.1Q 5.3).

2.

(Q 5.1Q 5.3) , ,
, .

--------------------------------------------------------------------------

:

.

Siemens AG
Training Center

2 3

(Q 5.1Q 5.3) , ,
,

--------------------------------------------------------------------------

. 8-18/20

ST-S5SYS2

SIMATIC S5

.
:

(Q 5.4)
,
(Q 5.1Q 5.3) - .

--------------------------------------------------------------------------

(I 8.4)

(Q 5.4)
,
(Q 5.1Q 5.3) .

--------------------------------------------------------------------------

.
:


(Q 5.1Q 5.3) : 2

--------------------------------------------------------------------------

( , (Q 5.1Q 5.3) 1 .
.)

Siemens AG
Training Center

(, 3).
(
).
:

--------------------------------------------------------------------------

. 8-19/20

ST-S5SYS2

:
,
SIMATIC S5

,
,
,
.
:
"Project Settings"
( , ,
). ,
CSF
.
"Project Settings - Documentation -"
.
Editor ,
.
.
MODELF1.INI.
:
Documentation
Assignment List ...
:
Documentation
STEP 5 Blocks ...
(x) Program file
, , ,
.
:

Ctrl F8 : File

DOS File

Copy ...

, .
:

Ctrl F7 : File

DOS File

Directory ....

, .
!

Siemens AG
Training Center

. 8-20/20

ST-S5SYS2