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

SIMATIC S7 S7-1200 Programmable controller

1
____________

2
____________

SIMATIC
S7

S7-1200

3
____________

4
____________

5
____________


6
____________

7
____________
PROFINET

8
____________
(Point-to-Point, PtP)

____________

9

____________A

____________

B

____________C

11/2009
A5E02669003-02



,
. ,
, , ,
, .
.

, ,
.

, ,
.

,
, .

,
, .

, ,
.
,
.

.


/, , ,

, , .
,
/.

Siemens
:

Siemens ,
.
, Siemens.
, , ,
, , .
. ,
.


, ,
Siemens AG. ,

.



. ,
. , ,
, .
Siemens AG

/ 48 48
90026

: 6ES7298-8FA30-8BH0
07/2010

Copyright Siemens AG 2009.




S7-1200
(),
. ,
S7-1200
. S7-1200
Windows ,
.

S7-1200, ,
, .


STEP 7 Basic V10.5
S7-1200. S7-1200, ,
(. 329).

, CE, C-Tick
(. 329).



: http://www.siemens.com/automation/support-request
, ,
S7, Siemens.
Siemens
,
Siemens,
, .

S7-1200
System Manual, 11/2009, A5E02669003-02

S7-1200

System Manual, 11/2009, A5E02669003-02


..............................................................................................................................................3
1

........................................................................................................................................11
1.1

S7-1200 ...........................................................................................................11

1.2

.....................................................................................................................13

1.3

...................................................................................................................14

1.4

......................................................................................................14

1.5
1.5.1
1.5.2

STEP 7 Basic ...............................................................................................................................15


...............................................................16
..........................................................................17

1.6

...............................................................................................................20

.......................................................................................................................................................21
2.2
2.2.1
2.2.2
2.2.3
2.2.4
2.2.5

............................................................................................24
CPU .......................................................................................................26
.............................................................................28
................................................................30
................................................................................32
S7-1200.................................................33

2.3

.........................................................................................................34

..............................................................................................................................................39
3.1
3.1.1
3.1.2
3.1.3
3.1.4
3.1.5

....................................................................................39
CPU .................................................................................................................42
...................................................................46
CPU ................................................................................................................................52
CPU S7-1200 .........................................................................................57
.........................................................................................58

3.2

, ........................................................................58

3.3

...............................................................................................................................64

3.4
3.4.1
3.4.2
3.4.3
3.4.4

...................................................................................................68
CPU ....................................................................................................69
CPU ...........70
...................................................................................................................70
....................................................................................................................73

S7-1200
System Manual, 11/2009, A5E02669003-02

...................................................................................................................... 77
4.1

CPU .............................................................................................................................. 78

4.2

CPU................................................... 79

4.3

CPU .............................................................................................. 80

4.4

..................................................................................... 81

4.5

............................................................................... 82

4.6

............................................................................................... 83

4.7

IP- ..................................................................... 84

................................................................................................................. 87
5.1

......................................................................... 87

5.2

......................................................................... 88

5.3
5.3.1
5.3.2
5.3.3
5.3.4

....................................... 90
(OB) .................................................................................................... 92
(FC) .............................................................................................................................. 93
(FB)....................................................................................................... 94
(DB) ...................................................................................................................... 95

5.4

.......................................................................................................... 96

5.5

............................................................................................. 97

5.6

............................................................................................................ 99

5.7

CPU ..................................................................... 100

5.8

CPU.................................................................... 101

5.9

..................................................................................... 102

................................................................................................ 103
6.1
6.1.1
6.1.1.1
6.1.1.2
6.1.2
6.1.3
6.1.3.1
6.1.3.2
6.1.3.3
6.1.3.4
6.1.4
6.1.5
6.1.5.1
6.1.6
6.1.6.1
6.1.7
6.1.7.1
6.1.8
6.1.9
6.1.10

................................................................................................................. 103
...................................................................................................................... 103
................................................................................................. 106
......................................................................... 109
................................................................................................................................... 112
................................................................................................................................... 116
................................................................................................................................... 116
CTRL_HSC................................................................................................................ 119
............................................................................. 121
............................................................................. 124
................................................................................................................................ 125
...................................................................................................... 127
MOD ( ) ................................................................... 128
Move.......................................................................................................................... 136
Swap ( )............................................................................................... 140
...................................................................................................................... 141
....................................................................... 143
......................................................................................................... 144
.............................................................................................................. 146
............................................................................... 150

S7-1200

System Manual, 11/2009, A5E02669003-02

6.2
6.2.1
6.2.2
6.2.3
6.2.3.1
6.2.3.2
6.2.3.3
6.2.4
6.2.4.1
6.2.4.2
6.2.4.3
6.2.5
6.2.5.1
6.2.5.2
6.2.6
6.2.6.1
6.2.6.2
6.2.6.3
6.2.7
6.2.8
6.2.9
6.2.9.1
6.3
6.3.1
6.3.1.1
6.3.1.2
6.3.1.3
6.3.1.4
6.3.1.5
6.3.1.6
6.3.2
6.3.2.1
6.3.2.2
6.3.2.3
7

............................................................................................................152
.........................................................152
............................................................................................153
....................................................................................156
...............................................................................................................156
...........................................................................................157
.............................................................................................................168
..........................................................................................176
..............................................................................................176
........................................................................................................177
Get Error ....................................................................................................................178
.................................................................................................181
Ethernet .............................................................................181
..............................................................................196
..............................................................................................................197
Attach Detach .........................................................................................................197
..........................................................200
...........................................................203
PID-...................................................................................................................203
....................................................................................204
.......................................................................................206
CTRL_PWM ...............................................................................................................206
.....................................................................................210
USS............................................................................................................................................210
USS ................................................................210
USS_DRV ..................................................................................................................213
USS_PORT ................................................................................................................216
USS_RPM ..................................................................................................................217
USS_WPM .................................................................................................................219
USS................................................................................................................221
MODBUS ...................................................................................................................................222
MB_COMM_LOAD ....................................................................................................................222
MB_MASTER.............................................................................................................................225
MB_SLAVE ................................................................................................................................237

PROFINET ................................................................................................................................................249
7.1
.............................................................251
7.1.1
.....................................................251
7.1.2
.................................................................................................252
7.1.3
IP- ...........................................................................................................252
7.1.3.1 IP- ..............252
7.1.3.2 IP- online................................................................................255
7.1.3.3 IP- ....................................................................257
7.1.4
PROFINET................................................................................................259
7.2
- ..............262
7.2.1
CPU ...............................................................................................264
7.3
....................................................................................................265
7.3.1
CPU............................266
7.3.2
............................................................267
7.3.2.1 TSEND_C....................................................267
7.3.2.2 TRCV_C..........................................................271
7.4
................................................................................................................275
7.4.1
Ethernet (MAC-) CPU.............................................................275

S7-1200
System Manual, 11/2009, A5E02669003-02

7.4.2
8

(NTP) .................................. 277

(PtP).................................................................................................................... 279
8.1

RS232 RS485 ........................................... 280

8.2

.................................................................... 281

8.3

............................................................................................................. 282

8.4

........................................................... 284

8.5
8.5.1

PtP .................................................................. 290


................................................................................................................. 291

8.6
8.6.1
8.6.2
8.6.3
8.6.4
8.6.5
8.6.6
8.6.7
8.6.8
8.6.9

............................................................................. 292
................................................ 292
PORT_CFG ............................................................................................................... 294
SEND_CFG ............................................................................................................... 296
RCV_CFG ................................................................................................................. 298
SEND_PTP................................................................................................................ 305
RCV_PTP .................................................................................................................. 308
RCV_RST.................................................................................................................. 309
SGN_GET ................................................................................................................. 310
SGN_SET.................................................................................................................. 311

8.7

..................................................................................................................................... 312

........................................... 317
9.1

........................................................................................................... 317

9.2

CPU ........................................................................... 319

9.3

IP- ................................................................................... 320

9.4

CPU............................................................................. 320

9.5

.............................................................. 321

9.6

CPU ................................................................... 322

9.7

......................................... 323

............................................................................................................................ 329
A.1

................................................................................................... 329

A.2
A.2.1
A.2.2
A.2.3

CPU........................................................................................................................................... 335
CPU 1211C ........................................................................................... 335
CPU 1212C ........................................................................................... 340
CPU 1214C ........................................................................................... 345

A.3
A.3.1
A.3.2
A.3.3

(SM) ..................................................................................... 351


SM 1221.................................................... 351
SM 1222 ................................................. 353
/ SM 1223 ...................................... 355

A.4
A.4.1

(SM)................................................................................... 358
SM 1231, SM 1232, SM 1234...... 358

A.5
A.5.1
A.5.2

(SB) .......................................................................................................... 364


SB 1223 2 X 24 VDC Input / 2 X 24 VDC Output ................................. 364
SB 1232 1 ..................................................... 367

S7-1200

System Manual, 11/2009, A5E02669003-02

A.6
A.6.1
A.6.2

(CM) ...........................................................................................369
CM 1241 RS485 ....................................................................................369
CM 1241 RS232 ....................................................................................370

A.7

SIMATIC ............................................................................................................370

A.8

...................................................................................................................371

A.9

/ .................................................................................372

.................................................................................................................373
B.2

.............................................................................375

B.3

................................................................................376

.................................................................................................................................377
.........................................................................................................................381

S7-1200
System Manual, 11/2009, A5E02669003-02

S7-1200

10

System Manual, 11/2009, A5E02669003-02


1.1

S7-1200
() S7-1200
,
. ,
, S7-1200
.
CPU , ,
, .
CPU ,
. CPU
,
, , ,
.
CPU,
:
CPU ,
CPU .
" -",
. " "
(. 99).
CPU PROFINET PROFINET.
RS485 RS232
.


(
)



/
PROFINET (
CPU)
CPU

,

.
CPU
(. 329).

S7-1200
, 11/2009, A5E02669003-02

11


1.1 S7-1200

()





/



(M)

90





PROFINET


CPU 1211C
90 x 100 x 75

25
1
2

6 /4
2

CPU 1212C

CPU 1214C
110 x 100 x 75

8 /6
2

1024 (I) 1024 (Q)


4096

50
2
2

14 /10
2

8192
8

1
3 ( )
3
4
6
3 100
3 100

1 30
3 80
3 80

1 20
2
SIMATIC ()
. 10 / 6 40 C.

3 100
3 30
3 80
3 20

1 Ethernet
18 /
0,1 /

S7-1200

12

, 11/2009, A5E02669003-02


1.2
S7-1200
CPU.
.
(. 329).

(SM)

8 .

8 .

16 .

16

16 .


(SB)

8 . /
8 .
8 . /
8
16 . /
16 .
16 . /
16
4 /
2
2 . /
2 .
-

(CM)
RS485
RS232

1.2


(SB) /
CPU. SB
/. SB CPU.
SB 4 / (2 . 2 . )
SB 1

SB

S7-1200
, 11/2009, A5E02669003-02

13


1.3

1.3


CPU
. CPU.

1.4


S7-1200 (CM)
.
: RS232 RS485.
CPU 3
CM CPU ( CM)

S7-1200

14

, 11/2009, A5E02669003-02


1.5 STEP 7 Basic

1.5

STEP 7 Basic
STEP 7 Basic
, ,
,
,
- .
STEP 7 Basic
(LAD FBD),

- .
, STEP 7 Basic
.
STEP 7 Basic - CD-ROM
.
.
Readme.

STEP 7 Basic
Windows 2000, Windows XP Windows Vista
.

S7-1200
, 11/2009, A5E02669003-02

15


1.5 STEP 7 Basic

1.5.1



(Totally Integrated Automation Portal)
: -
( ) ( ).
,
.
.





,
, ,

.
,

.



.

,

.


.

S7-1200

16

, 11/2009, A5E02669003-02


1.5 STEP 7 Basic

1.5.2


, STEP 7 Basic
, :

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

( ).
, STEP 7 Basic ,

SIMATIC.




,

.
,
.
, , "Open []" "Save []",
.
.
.
( ,
.)
,

.


.


.

.

S7-1200
, 11/2009, A5E02669003-02

17


1.5 STEP 7 Basic


STEP 7 Basic
, SIMATIC, .
.
:

"Help []".
"Help []" "Show help
[ ]".
,
.
, .
"Show/hide contents [/
]", .
.
"Contents []"
"Index [ ]".
(
)

STEP 7 Basic , "Show/hide contents"


. ,
"Restore down [ ]".
.

S7-1200

18

, 11/2009, A5E02669003-02


1.5 STEP 7 Basic


"Print []"
.


"Print
[]" .

"Print
[]"
.
,

- .

.
"Print
[]",

.

S7-1200
, 11/2009, A5E02669003-02

19


1.6

1.6



, - SIMATIC

. IP65
CE, UL, cULus NEMA 4x.
KTP 400 Basic PN
(STN,
)
4"
4

: 3.8"
: 320 x 240
KTP 600 Basic PN
(TFT, 256 )
(STN,
)
6"
6

: 5.7"
: 320 x 240
KTP1000 Basic PN
(TFT, 256 )
10"
8

: 10.4"
: 640 x 480

TP1500 Basic PN
(TFT, 256
)
15"
: 15.1"
: 1024 x
768

128
50

200
25
32 KB

5 ,
20 ,
20
128
50

200
25
32 KB

5 ,
20 ,
20
256
50

200
25
32 KB

5 ,
20 ,
20
256
50

200
25
32 KB
(
-)
5 ,
20 ,
20

S7-1200

20

, 11/2009, A5E02669003-02

S7-1200 , .
S7-1200
, S7-1200 .
S7-1200 .

SIMATIC S7-1200 .
, .
, ,
.
,
/ .
S7-1200.

S7-1200 ,

,
,
, , ,
S7-1200.
S7-1200
, ,
.
, .

.

,
.

S7-1200
, 11/2009, A5E02669003-02

21


S7-1200
. 25
. ,
25 .


10 C.
S7-1200 , CPU .
S7-1200
.

S7-1200

22

, 11/2009, A5E02669003-02


CPU , CPU,
, ,
24 . .
(. 329)
5 . CPU 5
. , .
" " (. 373)
, ( ) CPU .
CPU 24 . ,
24 . ,
. 24 .
,
24 . . (. 329)
24 .
CPU S7-1200.
24 . ,
,
CPU.
(M)
.

24 .
24 .
,
.


.
, /
.

.
24 . S7-1200 ,
M.
, ,
" (not isolated)": 24
. CPU, ,
.
M
.

M
,

.

,
/ .
M
S7-1200 .

S7-1200
, 11/2009, A5E02669003-02

23


2.2

2.2

()

S7-1200
CPU:
:

CPU 1211C CPU 1212C

90

45

CPU 1214C

110

55

8 16 /, . (8I,
16I, 8Q, 16Q, 8I/8Q)
(4AI, 8AI, 4AI/4AQ, 2AQ, 4AQ)

45

22,5

16I/16Q (16I/16Q)

70

35

CM 1241 RS232 CM 1241 RS485

30

15

CPU,
.
.
,
.
4,3 .

25 .

S7-1200

24

, 11/2009, A5E02669003-02


2.2

S7-1200
CPU
. .
,
.


. , ,
.

S7-1200

.
S7-1200
, -

, / .

, CPU S7-1200 .
S7-1200 ,
.

S7-1200
S7-1200.
S7-1200 ,
, -
/
.
S7-1200 ,
.

S7-1200
, 11/2009, A5E02669003-02

25


2.2

2.2.1

CPU

CPU .

CPU .
, , CPU .
CPU :
1. (M4)
.
2. . ,
CPU .
3. , .

,
, S7-1200
.

CPU
:

1. .
75 .
2. CPU .
3. CPU, CPU
.
4. CPU .
5. , CPU .

S7-1200

26

, 11/2009, A5E02669003-02


2.2

CPU CPU
/, CPU. CPU
.
.

CPU , :
1. .
2. , CPU .
3. .
CPU:
1. , CPU .
2. CPU CPU .

S7-1200
, 11/2009, A5E02669003-02

27


2.2

2.2.2

SM CPU.

CPU.
.
,
. .
SM CPU.
1. SM .
2. , SM
.
3. SM ,
CPU , SM
.
.
1.
SM.
2. ,
CPU.
,
SM.

,
.

S7-1200

28

, 11/2009, A5E02669003-02


2.2

SM, CPU SM. SM


CPU / SM.

.
1.

SM.
2. ,

CPU.
3.
.
SM, SM.
SM:
1. ,
SM .
2. SM .
SM .
3. ,
CPU ,
.

.

S7-1200
, 11/2009, A5E02669003-02

29


2.2

2.2.3

CM CPU
.
CPU:
1.

.
2.
,

.
. .
:
1.

CM
CPU
2.
,

.
.
1. ,
CPU CM
(), .
2. CPU CM,
CPU (. 26).
3.
, .
, .

S7-1200

30

, 11/2009, A5E02669003-02


2.2

CPU CM ,
.
CM.
1. CPU.
2. /,
CPU CM.
3.
CPU CM.
4. CPU CM
.
CM.
1. CPU CM.
2. .

, .

S7-1200
, 11/2009, A5E02669003-02

31


2.2

2.2.4

CPU SB, CPU


CPU.
SB
:
1.
CPU
.
2. ,

CPU.
3.


CPU.
4. SB,
.
5.
.

CPU SB, CPU


CPU.
SB
:
1.
SB.
2.
,
SB CPU.
3.

CPU.
4. SB.
5.
.

S7-1200

32

, 11/2009, A5E02669003-02


2.2

2.2.5

S7-1200
CPU, SB SM , .
:
CPU.
.
:
1.

.
2. .
3.
,

CPU.

.
4.
CPU.


:
1. ,
CPU
.
2.
.
3. ,
,
.
4. ,
, .
,
.

S7-1200
, 11/2009, A5E02669003-02

33


2.3

2.3




S7-1200.
(. 329) S71200.


, . ,
, .
S7-1200
.

. ,
,
.

S7-1200

. S7-1200

, ,
/ -
.

S7-1200 ,
S7-1200 .

S7-1200.
, , S7-1200,
.
, S7-1200,
, .


- .

, / .
,
, S7-1200.

S7-1200

34

, 11/2009, A5E02669003-02


2.3


S7-1200

,
.
,
. , ,
, , , ,
,
. ,
, S7-1200
1500 .
(2Ue + 1000 . )
.
S7-1200 4242
. .
,
S7-1200
EN 61131-2 (SELV,
safety extra-low voltage).
S7-1200
,
24 ,
/
, SELV, PELV
(Protective Extra Low Voltage ), 2,
.

,
,
,
, ,
.
,
, /
.
,

.

S7-1200
,
S7-1200 .
.

, , 2 2.


.

S7-1200
, 11/2009, A5E02669003-02

35


2.3

S7-1200
S7-1200
,
CPU S7-1200, .
, , ,
.

.
, ,
.

, ,
.
: , .
,
.
2 2 0,3 2.
.
S7-1200.
, ,
.
, 24
. S7-1200, .
S7-1200 .
,

.
.
0,56 .
S7-1200 , ,
.
.

.
1500 .
.

S7-1200

36

, 11/2009, A5E02669003-02


2.3



.
-
. ,
, .


.

,
.
.

S7-1200 DC
,

.

, ,
.

l1N4001
.


8,2 (
(A)
,
),
,
36 (

)
(B).

.



115 /230 . ,


,
.

(MOV).
,
MOV , , 20%
.

0,1
100 120


-
. 10 15
.

.

S7-1200
, 11/2009, A5E02669003-02

37


2.3

S7-1200

38

, 11/2009, A5E02669003-02


3.1


CPU ,
:
(OB) . OB
,
OB .
(FC) (FB) ,
.


. FB
( DB)
, .
(DB) ,
.

(OB),
RUN , OB
, . OB
,
-; ,
.
(FC) (FB) ,
OB .
:
16 OB OB
4 OB , OB , OB
, OB OB
FC (DB), FB
DB DB
.
,
CPU.
.
, ,

.
.
,
.

S7-1200
, 11/2009, A5E02669003-02

39


3.1

,
.
SIMATIC, CPU.

,
.
( / CPU,
).
CPU :
CPU
.
CPU
.
,
.
CPU
,
.


, -
.
, /
. ,
CPU S7-1200 ( ). CPU

.
,
, Properties
[], , , ,
"IO addresses/HW identifier [ //
]". "Process image:"
"Cyclic PI [ ]" "---".
,
"Cyclic PI".

,
.
.
, ,
.
(
), . ":P"
, , /
, .

S7-1200

40

, 11/2009, A5E02669003-02


3.1


CPU CPU
.

(STOP, RUN

),
CPU

.
: Startup ; Startup mode ; Warm restart ; No restart
(stay in STOP mode) ( STOP); Warm restart Operating mode before
POWER OFF .

CPU RUN.
,
.

CPU
CPU - (.,
, ) CPU
RUN . ,

.
, ,
STOP RUN (
).

S7-1200
, 11/2009, A5E02669003-02

41


3.1

3.1.1

CPU
CPU : STOP, STARTUP RUN.
CPU .
STOP CPU , .
STARTUP OB ( ). ,
, RUN .
RUN . ,
,
.
RUN .
CPU RUN.
.
.
.
,
, .
IP.
CPU
.
CPU Startup []. CPU
, . CPU
. ,
CPU RUN. CPU :
STOP
RUN

: Startup ; Startup mode ; Warm restart ; No restart


(stay in STOP mode) ( STOP); Warm restart Operating mode before
POWER OFF .

"STOP" "RUN"
.
STP CPU STOP.
.
STOP CPU

( ) .
STOP CPU ,
.

S7-1200

42

, 11/2009, A5E02669003-02


3.1
, CPU
STOP.
RUN CPU , .

STARTUP []
A
(I)
B
C
D
E

OB


(I)
,
,

RUN

(Q)

RUN
Q


I
OB


(STARTUP)
, STOP RUN, CPU
,
OB .
OB ,
. ,
, . OB
FC FB. OB ,
, OB
.
OB ,
.
OB
. OB
:

LostRetentive

BOOL

LostRTC

BOOL

S7-1200
, 11/2009, A5E02669003-02

43


3.1
CPU .
,

(highspeed counter, HSC), - (pulse-width modulation, PWM)
(point-to-point communication, PtP)
HSC, PWM PtP
RUN
OB CPU RUN
.

RUN
CPU , ,
, ,
,
, .
.
( , )
. ,
,
, .
, ,
; .

CPU, SB
SM, /
( ). ,
, .

CPU, SB SM,
/ ( ),
. ,
,
.

. OB
FC FB. OB
OB, OB .
, ,
, .

/.
, .
, CPU OB,
. OB
, CPU ,
.

S7-1200

44

, 11/2009, A5E02669003-02


3.1

(OB)
OB . OB
. 200
OB. OB 200.

CPU. OB FC FB.
, , ,
OB. CPU OB
, OB
. 1 (
), 27 ( ,
).
OB :
OB , CPU
RUN. OB .
,
. OB ,
. OB 1 . OB
OB 200 .
OB , CPU STOP
RUN, RUN STOP RUN.
OB . OB
. OB 100. OB
, 200.
OB
, (SRT_DINT).
SRT_DINT. OB

, .
4 " " ,
OB. OB
200 .
OB
. OB
, , , 2
. 4 "
", OB.
OB 200 .
OB ,
, ,
, HSC. OB

.
.
OB. OB 200 .
OB . OB
,
.
. OB 80.
, , OB 80 :
STOP.
OB ,
, . OB
,
, , (
).
OB 82. OB 82,
CPU, STOP.
S7-1200
, 11/2009, A5E02669003-02

45


3.1

3.1.2


CPU .
OB . OB
, ATTACH DETACH.
, ,
. , , "
" . ,
, , ,
" ". , "
" " ", .
,
OB .
" "
( ). CPU
, .
" " .
OB
OB. " " OB
( OB1). OB

.
" "
OB .
OB OB
.
OB (
, " ").
OB
. CPU " ". OB
,

.
"" STOP RUN
OB . OB. OB
.
" "
OB .
SRT_DINT. " "
OB . " "
OB . CPU
" ".
" " ,
, , "
" (High Speed Counter, HSC). "
" OB .
. OB
ATTACH
. CPU " ".
CPU .
" " " " ,
CPU .
, , ,
" ",
. OB
.
S7-1200

46

, 11/2009, A5E02669003-02


3.1



.
, .
"
".
CPU ,
. ,
, CPU.

.
(
). , ,
.
(OB)

1 "
"
OB
1 "" 1
OB

OB
1 (
)
200
100 (
)
200
200

1
1

1
1

4 "
8
2
3
"
1 OB

4
200 8
4
1 OB
200 32
5

16
16
1 OB
HSC
6 CV = PV
200 16
6
6

1 OB
1
82
8
9
80
8
3
26
1 "
/
"

1

"
"
OB
3
27

1 "



"
1
""
"" " " ,
, ( ).

. , ,
.

S7-1200
, 11/2009, A5E02669003-02

47


3.1
OB
.
, OB.
OB, CPU
OB .
OB CPU OB
,
, .
, , CPU
OB ,
.


(.. CPU
OB,
) 210 ,
OB .

" "
, , "
". :

OB

" " ,
.
" ",

" (. 50)".
" OB " , OB
, OB
.
" " , ,
. , ,
.
, ,
" ".
" " OB 80,
. OB 80 , CPU .
" "
, CPU STOP,
, OB 80. . " "
(. 50).

S7-1200

48

, 11/2009, A5E02669003-02


3.1
OB 80 , ,
OB .
OB 80,
. OB 80 :

fault_id

BYTE

16#01 -
16#02 - OB
16#07 16#09

csg_OBnr OB_ANY

OB, ,

csg_prio

OB,

UINT

, OB 80 . ,
OB 80 , "Program blocks
[ ]" "Add new block [ ]",
"Organization block [ ]", "Time error interrupt [
]".

" "

.
" ".
:





" " OB 82,
. OB 82 , CPU .
OB 82 . OB 82
, "Program blocks [ ]"
"Add new block [ ]", "Organization block
[ ]", "Diagnostic error interrupt [
]".
OB 82 , ,
, ,
.
OB 82,
. OB 82 :

IOstate
laddr

WORD
HW_ANY

channel
UINT
multierror BOOL

/
,


TRUE, (
)

S7-1200
, 11/2009, A5E02669003-02

49


3.1
4 IO_state .
4 1, (: ) 0,
.
(HW ID)
, . HW ID
,
Constants [] .
HW ID .
Constants .
0 ( ) 64
( ).
, , , .
, ,
,
( 32768).


, CPU
RUN. CPU
:


.
CPU "Device Configuration > Cycle time [
> ]".
CPU ,
. ,
, :
OB 80 , CPU

OB 80 , CPU OB 80
RE_TRIGR ( )
, . ,
OB ; RE_TRIGR ,
OB 80.
, RE_TRIGR
, CPU STOP.
RE_TRIGR
.
, ,
.
.
CPU
( ).
, , CPU
1 .
CPU , ,
CPU
/ . , CPU
.

S7-1200

50

, 11/2009, A5E02669003-02


3.1
,
( ),

.
.

()

1 6000

150

. 1 6000 .
150 .
.
, 1 .


CPU
:
: .
.

: Cycle time ; Maximum cycle time ;


Enabke a fixed minimum cycle time for cyclic OBs
OB

: ,
.

: Communication load ; Cycle load due to communication


" "
(. 50).

S7-1200
, 11/2009, A5E02669003-02

51


3.1

3.1.3

CPU


CPU
, :
,
. CPU
. ( ),
CPU.
. , ,
CPU.

. CPU
.
,
CPU .

.
.
CPU
.
.
,
CPU ( ) "Resources []"
. CPU
"Online and diagnostics [ ]",
"Diagnostics" "Memory []".

S7-1200

52

, 11/2009, A5E02669003-02


3.1


,
.
:
() (M):
.
MB0
.
, "Retain []"
. ,
, MB0.
(FB): FB
"Symbolic access only [ ]",
FB "Retain []".
"Retain []" "Non-Retain [ ]"
. DB,
FB , ,
;
DB FB, "Symbolic
access only".
FB "Symbolic access only [
]", FB
"Retain []". DB,
FB , "Retain []",
. "Retain"
. ,

. FB,
"Symbolic access only [ ]",
DB,
.
FB "
". FB.
, FB
, FB ,
"Properties []", "Attributes []".
: DB
FB.

,
.
"Symbolic access only [ ]" DB
,
.
"Symbolic access only" DB ,
DB;
, .
2048 . ,
,
"Retain []".
,
M DB .
S7-1200
, 11/2009, A5E02669003-02

53


3.1


CPU ,
. ,
, .
,
. CPU , 50 .
, .
10 .
:
; , CPU
CPU ( , STOP RUN)
.
"Online & diagnostics / Diagnostics / Diagnostics buffer
[ / / ]".

" ".


CPU . CPU ,
. , CPU .
CPU 2 ,
10 .
,
(Coordinated Universal Time, UTC).
STEP 7 Basic.
(RD_SYS_T) (RD_LOC_T) .

, CPU
.
CPU "Time of day [
]". ,
.
"Online & diagnostics [ ]"
CPU. "Set time of day [ ]".

S7-1200

54

, 11/2009, A5E02669003-02


3.1


CPU " "
" ( )".
.
(M)
.
, :
"Always 0 (low) [ 0 ()]" 0.
"Always 1 (high) [ 1 ()]" 1.
"Diagnostic graph changed [ ]"
1 , CPU
. CPU
OB ,
,
OB
OB .
"First scan [ ]" 1
OB . (
0.)
(M)
. ,
, .
8 , 0.5 () 10 ().
,
,
.
CPU STOP STARTUP
(). STARTUP RUN
CPU.



,
.

(M) ,
.
,
,
.

S7-1200
, 11/2009, A5E02669003-02

55


3.1

: System memory bits


; Enable the use of system memory byte
;
Location of system memory byte
.


,
.
(First cycle):

RUN

(Diagnostic graph
changed)
1 () (Always 1
(high)):
0 () (Always 0
(low)):

(
) ,


.

.
,

,

.
: Clock memory bits
; Enable the use of clock memory byte
; Location of clock memory byte
; 10 Hz clock
10

STOP CPU
, CPU
STOP. CPU, SB SM
:
( ):
() CPU, SB SM.

, 0.
:
RUN STOP.
.
.
"Properties []",
.
RUN STOP CPU

.

S7-1200

56

, 11/2009, A5E02669003-02


3.1

3.1.4

CPU S7-1200
CPU 3
. CPU,
, .

[ ]
[ ]
[ ]

[ /]
[]
[ ]


:
1. "Device configuration
[ ]"
CPU.
2.
"Properties
[]".
3. "Protection
[]",
.
.


. CPU .
CPU, CPU
.
CPU. CPU,
,
.
, .
.
( )
CPU. -
.

-
.
( ) CPU
CPU (RUN/STOP).

-
.
CPU, (
) CPU CPU (RUN/STOP).

S7-1200
, 11/2009, A5E02669003-02

57


3.2 ,

3.1.5


CPU, ,
.
CPU.
CPU STEP 7 Basic.

(. 70).

CPU, CPU
STOP.
.

/ .
CPU RUN.

3.2

,
CPU
:
: CPU
, (I), (Q) () (M).

(DB): DB
.
. "" DB
, ,
DB FB,
FB.
: CPU
, , (L)
. , CPU

.
,
.

I


I_:P
(
)
Q


Q_:P
(
)


CPU, SB
SM


CPU, SB,
SM

S7-1200

58

, 11/2009, A5E02669003-02


3.2 ,

DB

,
FB

.
,
.
( ".").
(I = , 3 = 3) ("."),
( 4).
A
B
C
D
E
F


: 3
(".")
( 4 8)

.,
(I, Q, M, DB L) ,
. ,
, .
, ,
. B (), W () D
( ), , IB0, MW20 QD8. , I0.3 Q1.7
.
":P" (, I0.3:P, Q1.7:P "Stop:P").

S7-1200
, 11/2009, A5E02669003-02

59


3.2 ,

CPU
STEP 7 Basic .
, ,
OB, FC FB. , ,
. , .
,
.
( , ).
, .

%.
: ,
.
I ( ): CPU ()
OB
.
, , .
, ,
.

I[ ].[ ]

I0.1

I[][
]

IB4, IW5 ID12

":P",
CPU, SB SM. I_:P I
, ,
, . I_:P
,
, ,
.

, . I_:P
, I,
, .
I_:P , CPU, SB
SM, . , SB 2 DI / 2 DQ
, I4.0,
I4.0:P I4.1:P IB4:P. I4.2:P I4.7:P
, , .
IW4:P ID4:P , SB.
I_:P ,
.

I[ ].[ ]:P

I0.1:P

I[][
]:P

IB4:P, IW5:P, ID12:P

S7-1200

60

, 11/2009, A5E02669003-02


3.2 ,
Q ( ): CPU ,
.
, , .
, .

Q[ ].[ ]

Q1.1

Q[][
]

QB5, QW10, QD40

":P",
CPU, SB SM. Q_:P
Q ,
, , , ,
( ). Q_:P
, ,
.
,
, . ..
Q_:P , Q,
, .
Q_:P , CPU, SB,
SM ( ). , SB 2 DI / 2
DQ , Q4.0,
Q4.0:P Q4.1:P QB4:P. Q4.2:P Q4.7:P
, , .
QW4:P QD4:P ,
SB.
Q_:P ,
, .

Q[ ].[ ]:P

Q1.1:P

Q[][
]:P

QB5:P, QW10:P
QD40:P

M ( , M-):
,
.
, ,
. , .

M[ ].[ ]

M26.7

M[][
]

MB20, MW30, MD50

S7-1200
, 11/2009, A5E02669003-02

61


3.2 ,
Temp ( ): CPU
. CPU
( OB) ( FC FB).
,
OB, FC FB. CPU
,
.
M- :
M- "", "":
M-: OB, FB FC M-, ..

.
: OB, FB
FC, .

, .
: OB FC, FC
OB, .
CPU ()
OB:
16 , FB FC
4 , , FB FC
4 , , FB
FC

.
DB ( ): ,

FB, , , ,
.
. , ,
. , ,
, . ,
, .

DB[ ].DBX
[ ].[ ]

DB1.DBX2.3

DB[ ].DB
[][
]

DB1.DBB4, DB10.DBW2,
DB20.DBD8

S7-1200

62

, 11/2009, A5E02669003-02


3.2 ,

/ CPU /
CPU /
,
I Q .
,
,

.

( 8 ), ,

.
2
(4 ).
6 DI16
2..3 8..9.
, ,

.
CPU 1214C
SM.

S7-1200
, 11/2009, A5E02669003-02

63


3.3

3.3


, ,
. ,
, ,
. , ,
.
,
, (: IN1 ADD).
, ,
(: %MD400 "Number_of_Widgets").
, ,
, .
()
. ( )
, , ,
(OB,
FC, FB DB). ,
, ,
, .
.

. , String [],
, .
String .
.

(
)

Bool

0 1

TRUE, FALSE, 0, 1

Byte

16#00 16#FF

16#12, 16#AB

Word

16

16#0000 16#FFFF

16#ABCD, 16#0001

DWord

32

16#00000000 16#FFFFFFFF

16#02468ACE

Char

16#00 16#FF

'A', 't', '@'

Sint

-128 127

123, -123

Int

16

-32768 32767

123, -123

Dint

32

-2147483648 2147483647

123, -123

USInt

0 255

123

UInt

16

0 65,535

123

UDInt

32

0 4294967295

123

Real

32

+/-1,18 x 10 -38 +/-3,40 x 10 38

123.456, -3.4, -1.2E+12,


3.4E-3

LReal

64

+/-2,23 x 10-308 +/-1,79 x 10308

12345.123456789
-1.2E+40

Time

32

T#-24d_20h_31m_23s_648ms
T#24d_20h_31m_23s_647ms
: -2,147,483,648
+2,147,483,647

T#5m_30s
5#-2d
T#1d_2h_15m_30x_45ms

String

0 254

'ABC'

S7-1200

64

, 11/2009, A5E02669003-02


3.3
, BCD,
.
(
)

BCD16

16

-999 999

123, -123

BCD32

32

-9999999 9999999

1234567, -1234567


( ) 32-
(Real) 64- (LReal)
ANSI/IEEE 754-1985.
6 ,
15 .
6 (Real) 15 (LReal) .
, ,
, . ,
10 x , x > 6 (Real) 15 (LReal).
(Real): 100 000 000 + 1 = 100 000 000.

STRING
CPU STRING
. STRING (
) . STRING
256 (1 ),
(1 ) 254 ,
1 .
()
IN, . , ABC
, IN
S_CONV. ,
"String" OB, FC, FB DB.
.
; ,
"MyString[10]" 10 MyString.
,
254.
STRING
10 3. , STRING
3 , 10
.

...

10

10

'C' (16#43)

'A' (16#41)

'T' (16#54)

...

Byte 0

Byte 1

Byte 2

Byte 3

Byte 4

...

Byte 11

S7-1200
, 11/2009, A5E02669003-02

65


3.3

,
. OB, FC, FB DB.
.
"Array [lo..
hi] of type", "lo", "hi" "type" :
lo - ()
hi - ()
type , , BOOL, SINT, UDINT
.
Name .
, :

My_Bits

Array [1.. 10] of BOOL

10

My_Data

Array [-5.. 5] of SINT

11 SINT,
0

,
:
Array_name[i ], i .
:
#My_Bits[3] "My_Bits"
#My_Data[-2] - SINT "My_Data"
# .

S7-1200

66

, 11/2009, A5E02669003-02


3.3

DTL (Data and Time Long)


DTL 12 ,
. DTL
DB.

()

12


(---:
:.)

.: DTL#1970-01-0100:00:00.0
.: DTL#2554-12-3123:59:59.999 999 999

DTL#2008-12-1620:30:20.250

DTL .

.

UINT

1970 2554

USINT

1 12

USINT

1 31

USINT

1() 7()

.

USINT

0 23

USINT

0 59

USINT

0 59

UDINT

0 999 999 999

9
10
11

S7-1200
, 11/2009, A5E02669003-02

67


3.4

3.4

CPU
SIMATIC (. 370). SIMATIC
Windows, CPU .

.

. , ,
, 4
. .

CPU STEP 7 Basic.
, CPU
,
.
, .
CPU,
, (. 58).
, ,
CPU. CPU
.
CPU.
CPU
CPU ( ).
CPU , (
). CPU
( ).
CPU
, CPU.
, CPU STOP. ( ,
, .)
, ,
.
.
, ,
CPU ( ).
CPU, STEP 7 Basic
.

S7-1200

68

, 11/2009, A5E02669003-02


3.4

3.4.1

CPU

( ,
) CPU, CPU
STOP.
-
.
,
/ .
.


CPU.

/ .
.
, CPU
. .
,
.
,
.


"Lock []".

CPU, STOP,
, .
, , .
, CPU RUN,
CPU MRES , CPU.

S7-1200
, 11/2009, A5E02669003-02

69


3.4

3.4.2

CPU

,
CPU.
, CPU
.
(STOP, RUN ),
CPU .

: Startup ; Startup mode ; Warm restart ; No restart


(stay in STOP mode) ( STOP); Warm restart Operating mode before
POWER OFF .

3.4.3


CPU.

/ .
.

S7-1200

70

, 11/2009, A5E02669003-02


3.4


CPU (. 70)
.
:
1. ,
.
( , "SIMATIC.S7S" "S7_JOB.S7S",
, , , Windows.)
2. ( ) "SIMATIC Card
Reader [ SIMATIC]" .
3. "Memory Card [ ]",

"Properties []".
4. "Memory Card [ ]"
"Transfer []".
STEP 7 Basic .
, , CPU
(. 58), .

5. , CPU (, _1 [CPU 1214 DC/DC/DC])


CPU . ( -
CPU .) CPU
"Load preview [ ]".
6. "Load preview" "Load []",
CPU .
7. , CPU
() , "Finish []".

S7-1200
, 11/2009, A5E02669003-02

71


3.4


CPU :
1. CPU (. 69). CPU RUN,
STOP. ( ,
, .)
2. :
CPU .
STOP RUN.
(MRES).
3. CPU
CPU. ,
CPU , ,
.
4. CPU.
5. ,
, :
CPU .
STOP RUN.
(MRES).
CPU (RUN STOP),
.

CPU RUN .

S7-1200

72

, 11/2009, A5E02669003-02


3.4

3.4.4


CPU.

/ .
.

, .
"Lock
[]".

.



CPU. ,
CPU .

CPU ,
CPU, STOP RUN (MRES),

CPU . (
.)
CPU . CPU ,
(RUN STOP).
CPU (. 70)
.
STEP 7 Basic :
1. ,
.
( , "SIMATIC.S7S" "S7_JOB.S7S",
, , , Windows.)
2. ( ) "SIMATIC Card
Reader [ SIMATIC]" .
3. "Memory Card [ ]",

"Properties []".

S7-1200
, 11/2009, A5E02669003-02

73


3.4

4. "Memory Card [ ]"


"Program []".

5. , CPU (, _1 [CPU 1214 DC/DC/DC])


CPU . ( -
CPU .) CPU
"Load preview [ ]".
6. "Load preview" "Load []",
CPU .
7. , CPU
() , "Finish []".

S7-1200

74

, 11/2009, A5E02669003-02


3.4

CPU

CPU, CPU STOP.


CPU, CPU STOP
RUN CPU (MRES), CPU
(
)
. ,
CPU .
CPU,
:
1. CPU. CPU RUN,
STOP. , ,

2. :
CPU .
STOP RUN.
(MRES).
3. CPU . CPU
.
CPU (RUN STOP),
.
CPU.
CPU .

, CPU
. CPU STOP, .

- .

, / .

S7-1200
, 11/2009, A5E02669003-02

75


3.4

S7-1200

76

, 11/2009, A5E02669003-02

CPU
.

(CM): 3, 101, 102, 103


CPU: 1
Ethernet CPU
(SB): . 1, CPU
(SM) /: 8,
2 9
(CPU 1214C 8, CPU 1212C 2, CPU 1211C )



.

"Devices &
Networks [ ]"
"Add device
[ ]".


"Add new device
[ ]".

S7-1200
, 11/2009, A5E02669003-02

77


4.1 CPU

4.1

CPU
CPU. CPU
"Add a new device [ ]"
CPU.
"Add a new
device"

CPU

CPU
.

CPU IP-.
IP- CPU . CPU
, IP- .

S7-1200

78

, 11/2009, A5E02669003-02


4.2 CPU

4.2

CPU


CPU,
CPU,
, .
CPU "unspecified
CPU [ CPU]". (
, "Create a
PLC program [ ]" "First steps
[ ]", STEP 7 Basic
CPU.)
"Online"
"Hardware detection [ ]".


CPU , ,

CPU Online, STEP 7 Basic


CPU, (SM, SB CM).
CPU .

S7-1200
, 11/2009, A5E02669003-02

79


4.3 CPU

4.3

CPU
CPU CPU
( CPU) "Properties
[]" .

:
PROFINET: IP- CPU
DI, DO, AI: ()

:
(HSC) ,
(pulse-train operations, PTO) (pulse-width modulation, PWM)
CPU
( PWM
), (Q0.0, Q0.1, Q4.0
Q4.1) (Q)
.
- ,
, CPU .
: CPU ,
, STOP RUN

: ,

: / CPU
( ):
" " ( " ", " " "
") " " (
).
:

: CPU

S7-1200

80

, 11/2009, A5E02669003-02


4.4

4.4


CPU .
:
(SM)
. CPU.
(SB)
CPU. SB CPU.
(CM)
(RS232 RS485) CPU.
CPU.

.

SM

SB

CM

S7-1200
, 11/2009, A5E02669003-02

81


4.5

4.5



"Properties []"
.

(SM) (SB)
:


(
), "
" (
)
.

.
:
,
, ( ),
,

.
, ,
, ( )
, ,
( )

.
:

(CM)
:
, ,
, ,
, , ,
XON XOFF
:
,

:


.

S7-1200

82

, 11/2009, A5E02669003-02


4.6

4.6



"Network view [ ]" .
"Properties []"
.

"Network view
[ ]"
,
.

S7-1200
, 11/2009, A5E02669003-02

83


4.7 IP-

4.7

IP-

PROFINET
CPU (. 80) ,
PROFINET.
PROFINET CPU, PROFINET. "Properties
[]" PROFINET.

PROFINET

IP-
Ethernet (MAC-): PROFINET

(MAC-, Media Access Control address). MAC-
,
(-) (:) (, 01-23-45-67-89-AB
01:23:45:67:89:AB).
IP-:
(Internet Protocol address, IP-).
, .
IP- 8
(, 211.154.184.16).
IP- ID ( ?),
(
). IP- 192.168.x.y ,
, .
:
. ()
(Local Area Network, LAN). (
) IP.
255.255.255.0 . ,
IP- 3 ,
(8- ).
255.255.255.0 IP-
192.168.2.0 192.168.2.255 .

. , IP.

S7-1200

84

, 11/2009, A5E02669003-02


4.7 IP-
IP-:
.
, , , .
,
,
.
IP-.
IP-:
(Properties)
"Ethernet
address [ Ethernet]".

(TIA)


Ethernet,


IP-
CPU,
.

CPU IP-. IP-


CPU . CPU
, IP-
. IP- .
" IP (.
252)".
IP-:

Subnet
[]

, . ,
"Add new subnet [ ]".
"Not connected [ ]".
:
"Not connected"
.
, .

IP protocol

IP address

IP- CPU

Subnet mask [ ]

Use IP router [ IP]

,
IP-

Router address [
]

IP- ,

S7-1200
, 11/2009, A5E02669003-02

85


4.7 IP-

S7-1200

86

, 11/2009, A5E02669003-02


5.1



. . ,
,
.

, .

.

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

,
- . ,
,
. ,

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

.
" ".
,
.

,
.

.

, ,
:

,
.

, , ,
.

S7-1200
, 11/2009, A5E02669003-02

87


5.2

, ,
:

5.2

,
.

/,
.

/,
, .

.
, (, ),
.



:
(OB) CPU
.
(OB 1)
,
. OB
, OB OB 1. OB
, , ,

.
(FB) ,
(OB, FB FC).
FB, (DB),
FB. DB
FB . , FB

DB,
.
(FC) ,
(OB, FB FC). FC
DB. FC. FC
DB.

S7-1200

88

, 11/2009, A5E02669003-02


5.2



:

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

,
, .
:

, , .
,
.
,
,
, .
,
.
.
,

.
,
, .

S7-1200
, 11/2009, A5E02669003-02

89


5.3

5.3


. ,
.
.
A
B


( )

,

(
)

, CPU
. , CPU
.

,
.

,

.

S7-1200

90

, 11/2009, A5E02669003-02


5.3


OB, FB, FC
DB
"Add new block
[ ]",
"Program
blocks [ ]"
.

,

.
DB,
.

S7-1200
, 11/2009, A5E02669003-02

91


5.3

5.3.1

(OB)
.
. OB
. , ,
, CPU OB. OB
.
OB .
OB .
RUN OB
. OB
OB , CPU OB
RUN.
OB CPU OB .
""
.
OB .
OB , ,
,
. OB
OB .
OB
"Add new block [ ]".

OB
OB.

.
, CPU


OB,

.
OB
CPU

.

CPU ,
OB.
.
.
(. 39).

S7-1200

92

, 11/2009, A5E02669003-02


5.3

OB OB
OB ,
OB OB . OB
"Add new block [ ]". OB
OB, 200.
OB
, CPU OB
, OB (
OB 1). : OB (OB1) CPU
OB (, OB 200).

OB

OB. ,

OB
OB.

5.3.2

(FC)
(FC) ,
. FC
.
FC :
, ,
.
, ,
, .
FC .
.
FC (DB). FC
, .
.
, , M-
DB.

S7-1200
, 11/2009, A5E02669003-02

93


5.3

5.3.3

(FB)
(FB) ,
. FB
, (DB) "" DB.
DB , (
) FB, FB.
FB DB. DB
FB .
, FB
DB. CPU FB
DB.
FB , CPU ,
FB. DB FB.

.


FB
, .
,
, FB
DB. FB, DB,

"" FB. DB
FB.
FB ,
FB , DB
FB.
FB DB (IN), (OUT)
(IN_OUT) .


, (FB)
, ,
(DB). .
FB.
DB.
, ,
DB.

S7-1200

94

, 11/2009, A5E02669003-02


5.3

FB DB
OB, FB,
. FB
, , ,
.
DB (, ,
) . FB 22
, DB 201
, DB 202 ,
DB 203 .

5.3.4

(DB)
(DB)
.
DB, DB
(FB).
DB .
, DB, ,
. DB:
DB .
OB, FB FC DB.
DB FB.
DB (Input, Output InOut)
FB. ( FB DB .)

DB FB,
DB.

S7-1200
, 11/2009, A5E02669003-02

95


5.4

5.4


CPU
(, Word DWord) (,
IEC_TIMERS DTL).
. (, CPU DWord,
DWord .)
OB
OB , CPU OB ,
OB .

OB OB ,
,
.
, OB
DIS_AIRT EN_AIRT.
DIS_AIRT, OB
.
, 4 OB
.
EN_AIRT ,
DIS_AIRT OB .
-
CPU OB .

. CPU ,
.
,
, CPU
- . , ,
- ,
CPU.
(Point-to-Point, PtP) PROFINET (,
TSEND_C TRCV_C) , .
,
OB , OB .
OB ,
DIS_AIRT, (OB
-
CPU), EN_AIRT.

DIS_AIRT OB ,
EN_AIRT,
( OB
) .

S7-1200

96

, 11/2009, A5E02669003-02


5.5

5.5



(ladder logic, LAD), , (Function Block Diagram, FBD), .

LAD
LAD .
.
,
,
,

.


.
.
.
LAD , ,
, , .
LAD :
LAD .
,
( ).
,
.

, .

S7-1200
, 11/2009, A5E02669003-02

97


5.5

FBD
LAD, FBD .
,
.



.
,
.

EN ENO
LAD, FBD, "
" (EN ENO). (,
) EN ENO.
, .
EN (Enable In = ) LAD
FBD. (EN = 1) ,
. EN LAD
, .
ENO (Enable Out = )
LAD FBD. EN
, ENO (ENO = 1)
. ,
(ENO = 0) ,
.

LAD

EN, ENO

BOOL

FBD

EN

I, I:P, Q, M, DB, Temp,

BOOL

ENO

BOOL

S7-1200

98

, 11/2009, A5E02669003-02


5.6

5.6



"-"

(OB, FB
FC)
.


.

"-",

.


"Know how protection
[ -]" "Edit
[]".
,
.

.
:
,
(IN, OUT, IN_OUT, Return)

(
),

S7-1200
, 11/2009, A5E02669003-02

99


5.7 CPU

5.7

CPU

CPU. CPU (OB, FC, FB DB)
.


CPU
:
" ":

,


"Download []".
"Online":
"Download to device
[ ]".
:

" ".

S7-1200

100

, 11/2009, A5E02669003-02


5.8 CPU

5.8

CPU

CPU ,
.
CPU ; CPU,
. ;
. CPU, CPU
"" (
). ;
, ,
.
CPU :
.


1. .
2. CPU, CPU, .
3. CPU , "Program blocks [
]".
4. "Online access [ ]",
"Update accessible devices
[ ]".
5. CPU,
CPU.
6. "Online access [ ]"
"Program blocks [ ]",
"Program blocks" ,
. +,
.
7. "Upload preview [
]". "Continue []", "Upload
from device [ ]".
8. .
, .
9. CPU,
CPU , IP, .

"Program blocks [ ]" . ..
.
.

S7-1200
, 11/2009, A5E02669003-02

101


5.9


1. , .
2. CPU .
3. "Compare []",
CPU, "Compare offline/online [
offline/online]" "Tools []".
4. "Program blocks [
]". "Action []".
CPU, "Upload from device [ ]".
5. "Synchronize online and offline [ online
offline]", CPU CPU.

5.9


, CPU,
, " ".

.
.
, CPU
, .
,
CPU, (I Q),
(I:P Q:P), (M) (DB).

(Q:P) CPU, STOP. ,
CPU.
""
.
("")
(. 323) "
".

S7-1200

102

, 11/2009, A5E02669003-02


6.1


6.1

6.1.1

LAD
,
.
I () Q (),
.

I . CPU

.

":P", (: "%I3.4:P").


, .
.

IN

Bool

( ) (ON),
1.
( ) (ON),
0.
, ,
(AND).
, ,
(OR).

S7-1200
, 11/2009, A5E02669003-02

103


6.1

FBD, AND, OR XOR


FBD LAD-
(AND, &), (OR, >=1) (XOR, x),
.
,
. ,
"Insert binary input [ ]"
"Favorites []" ,
.
"Insert input [ ]".
,
.

, ,
.


(AND)


(OR)


(XOR)

IN1, IN2

Bool

(AND) ,
.
(OR) ,
.
(XOR) ,
.

NOT
FBD
"Negate binary input [ ]"
"Favorites []" ,
.

LAD:

NOT

FBD: (AND)

FBD: (AND)

LAD NOT .
NOT ,
.
NOT , .

S7-1200

104

, 11/2009, A5E02669003-02


6.1

LAD


.
Q, CPU
,
.

S7-1200. RUN CPU
,
,
,
.
CPU

.

":P"
Q (: "%Q3.4:P").
.

OUT

Bool

,
1.
,
0.
,
0.
,
1.

S7-1200
, 11/2009, A5E02669003-02

105


6.1

FBD
FBD LAD
(= /=), .
,
.

OUT

Bool

1, OUT 1.
0, OUT 0.
1, OUT
0.
0, OUT
1.

6.1.1.1

S R: 1
S (Set []) , OUT
1. S , OUT .
R (Reset []) , OUT
0. R , OUT .
.
LAD:

LAD:

FBD:

FBD:

IN (

)

Bool

OUT

Bool

S7-1200

106

, 11/2009, A5E02669003-02


6.1

SET_BF RESET_BF:
LAD: SET_BF

LAD: RESET_BF

FBD: SET_BF

FBD: RESET_BF

OUT

,

: #MyArray[3]

SET_BF , 1 "n" ,
OUT. SET_BF , OUT .
RESET_BF 0 "n" , OUT.
RESET_BF , OUT .
.

S7-1200
, 11/2009, A5E02669003-02

107


6.1

RS SR:
RS .
(S1) (R) ,
OUT 1.
SR . (S)
(R1) ,
OUT 0.
OUT ,
. Q
"OUT".

S, S1

BOOL

; 1

R, R1

BOOL

; 1

OUT

BOOL

"OUT"

BOOL

"OUT"

RS

SR

S1
0
0
1
1
S
0
0
1
1

R
0
1
0
1
R1
0
1
0
1

"OUT"

0
1
1

0
1
0

S7-1200

108

, 11/2009, A5E02669003-02


6.1

6.1.1.2


P: LAD

N: LAD

P: FBD

N: FBD

P: LAD

N: LAD

P=: FBD

N=: FBD

P_TRIG: LAD\FBD

N_TRIG: LAD\FBD

M_BIT

Bool

IN

Bool

OUT

Bool

, ,

CLK

Bool

Bool

, ,

P:
LAD

,
"IN" ( ).

,
. P
, .
,
(
).
,
. N
, .
,
(
). P .

N:
LAD

P:
FBD

S7-1200
, 11/2009, A5E02669003-02

109


6.1

N:
FBD
P:
LAD

N:
LAD

P=:
FBD

N=:
FBD

P_TRIG:
LAD/FBD

N_TRIG
(LAD/FBD)

,
(
). N .
"OUT" ,
( )
, .
.
P .
"OUT" ,
( ) ,
.
.
N .
"OUT" ,
( )
,
.
.
P= .
"OUT" ,
( )
,
.
. N=
.
Q
, (
) CLK (FBD)
CLK (LAD). LAD P_TRIG
. FBD P_TRIG
.
Q
, ( )
CLK (FBD)
CLK (LAD). LAD N_TRIG
. FBD N_TRIG
.

(M_BIT)
.
.

,
. .

S7-1200

110

, 11/2009, A5E02669003-02


6.1


, .
,
.

,
,
. ,
, , ,
. M_BIT
(M) , DB ( DB).

S7-1200
, 11/2009, A5E02669003-02

111


6.1

6.1.2

:
TP: .
TON: Q
.
TOF: Q
.
TONR:

.
, R
.
RT: , ,
.
, ,
. ,
.
,
.
,

. ,
.
.
TP, TON TOF
.

TONR R
.
("Timer name")

.
" "
----[ RT ]----

RT .

IN

Bool

Bool

TONR

PT

Bool

Bool

ET

Time

DB

,
RT

S7-1200

112

, 11/2009, A5E02669003-02


6.1
IN
0 1 IN TP, TON TONR.
1 0 IN TOF.
PT IN.

PT IN

TP

PT .

IN .

PT .

IN , ,
.

PT .

IN , ,
.

PT ,
, .

IN , , ,
. IN
, .

TON

TOF

TONR

S7-1200
, 11/2009, A5E02669003-02

113


6.1

TIME
PT (preset time [ ]) ET (elapsed time [
]) ,
. TIME T#
"T#200ms"
"T#2s_200ms".

TIME

T#-24d_20h_31m_23s_648ms T#24d_20h_31m_23s_647ms
32
-2 147 483 648 +2 147 483 647

TIME, ,
. PT
( ) .
ET ( ) .

TP:

TON:

S7-1200

114

, 11/2009, A5E02669003-02


6.1

TOF:

TONR:

S7-1200
, 11/2009, A5E02669003-02

115


6.1

6.1.3

6.1.3.1


:
CTU .
CTD .
CTUD .
, ,
. , .
,
OB, . OB,
, ,
CU CD.
CTRL_HSC.
,
.
,

. ,
.
.

.

("Counter name")

.

S7-1200

116

, 11/2009, A5E02669003-02


6.1

CU, CD


Bool

R (CTU, CTUD)
LOAD (CTD, CTUD)

Bool
Bool

PV

SInt, Int, DInt, USInt, UInt,


UDInt
Bool
Bool
SInt, Int, DInt, USInt, UInt,
UDInt

Q, QU
QD
CV

,





, CV >= PV
, CV <= 0

.
,
, .
, ,
.
CTU: CTU 1, CU 0
1. CV ( )
PV ( ),

Q = 1. R 0 1,
0.
CTU ( PV = 3).

S7-1200
, 11/2009, A5E02669003-02

117


6.1
CTD: CTD 1, CD 0
1. CV ( ) 0,
Q = 1. LOAD 0
1, PV ( )
CV ( ).
CTD ( PV = 3).

CTUD: CTUD 1, 0
1 (CU) (CD) .
CV ( ) PV
( ), QU = 1.
CV , QD = 1.
LOAD 0 1, PV
( ) CV (
). R 0 1,
0.
CTUD ( PV = 4).

S7-1200

118

, 11/2009, A5E02669003-02


6.1

6.1.3.2

CTRL_HSC
CTRL_HSC ,
, , OB.
CTU, CTD CTUD OB,
. HSC
CPU (. 335).
,
.
CTRL_HSC
, .
, CTRL_HSC
.
("Counter
name")
.

HSC

IN

HW_HSC

HSC

DIR

IN

Bool

1 =

CV

IN

Bool

1 =

RV

IN

Bool

1=

PERIOD

IN

Bool

1 =
( )

NEW_DIR

IN

Int

:
1=
-1=

NEW_CV

IN

DInt

NEW_RV

IN

DInt

NEW_PERIOD IN

Int

:0,01;
0,1 1 ( )

BUSY

OUT

Bool

STATUS

OUT

Word

,
.
HSC ,
/,
.
.

S7-1200
, 11/2009, A5E02669003-02

119


6.1

.
,
.
CTRL_HSC
:
NEW_DIR
NEW_CV
NEW_RV
( )
NEW_PERIOD
CTRL_HSC 1,
NEW_xxx .
( )
CTRL_HSC.
DIR = 1 NEW_DIR, 0 =
CV = 1 NEW_CV, 0 =
RV = 1 NEW_RV, 0 =
PERIOD = 1 NEW_PERIOD, 0 =
CTRL_HSC OB ,
, , .
, CV=RV , ,
OB CTRL_HSC
, NEW_RV.
CTRL_HSC.
, ,
.
, ,
, ,
. .
,
.
CTRL_HSC:
,
.
DIR ,
"User program (internal direction
control [ ( )])".
HSC.
HSC S7-1200 CPU BUSY
0.

S7-1200

120

, 11/2009, A5E02669003-02


6.1
: ENO 0, STATUS
.
STATUS
(W#16#...)
0

6.1.3.3

80A1

HSC HSC

80B1

NEW_DIR

80B2

NEW_CV

80B3

NEW_RV

80B4

NEW_PERIOD


(HSC)
. ,
.

HSC.
HSC ,
,
. HSC ,
, ,
.
,
, ,
.
,
, .
HSC,

CPU.
,
. (
.)

HSC
HSC .
:


2
A/B-

S7-1200
, 11/2009, A5E02669003-02

121


6.1
HSC .
( , . )
.
: HSC HSC
(Type of counting [ ]),
. : 0,01; 0,1
1,0 .
, HSC
. ,
.
,
.
( )
.
: ,
, ,
HSC.
,
, HSC,
. , HSC1 ,
, (I0.3), I0.3
HSC2.

HSC

HSC1

I0.0
I4.0
PTO 01 PTO 0

I0.1
I4.1
PTO 0

I0.3
I4.3
-

HSC:

I0.2
I4.2
PTO 11 PTO 1

I0.3
I4.3
PTO 1

I0.1
I4.1
-

HSC32

I0.4

I0.5

I0.7

HSC43

I0.6

I0.7

I0.5

I1.0
I4.0

I1.1
I4.1

I1.2
I4.3

I1.3
I4.2

I1.4
I4.3

I1.5
I4.1

HSC5

HSC6

S7-1200

122

, 11/2009, A5E02669003-02


6.1

2
3
4

A/B-


1
(PTO)
1


. PTO , ,
, .
HSC3 CPU 1211C, 6 .
HSC4 CPU 1211C, 6 .
HSC5 HSC6 CPU 1211C CPU 1212C .

HSC
CPU HSC (I).
,
HSC. I- , CPU
.

HSC1

DInt

ID1000

HSC2

DInt

ID1004

HSC3

DInt

ID1008

HSC4

DInt

ID1012

HSC5

DInt

ID1016

HSC6

DInt

ID1020

/, HSC,

, ,
. /
,
.

S7-1200
, 11/2009, A5E02669003-02

123


6.1

6.1.3.4


CPU 6
.
HSC
("Properties") CPU.
HSC
, , ,
,
.
HSC
CTRL_HSC
HSC .
: High speed counters
;

[]
[ ]

[ ]

[]

[]

[]

[ ] [ CPU]
[ ] [ ( )]
[ ] [ ]

[ ]
[ ]
[ ]
[ ]
[ HSC . ]
[ ] [ ]

S7-1200

124

, 11/2009, A5E02669003-02


6.1

" "

[ :

[ ]

[ " "]
[ :]
[ ]

[ " "]
[ :]
[ ]

6.1.4

LAD

FBD


, .
LAD
, .
FBD ,
.

,
.
, :
==

IN1 IN2

<>

IN1 IN2

>=

IN1 IN2

<=

IN1 IN2

>

IN1 , IN2

<

IN1 , IN2

IN1, IN2

SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal,


String, Char, Time, DTL, Constant

S7-1200
, 11/2009, A5E02669003-02

125


6.1

IN_RANGE OUT_RANGE
IN_RANGE OUT_RANGE
,

.
,
.
MIN, VAL MAX
.

,
.
LAD

FBD

, :

IN_RANGE

MIN <= VAL <= MAX

OUT_RANGE

VAL < MIN VAL > MAX

MIN, VAL, MAX

SInt, Int, DInt, USInt, UInt, UDInt, Real,


Constant

OK Not OK

LAD

FBD

OK NOT_OK ,


IEEE 754. LAD
,
. FBD
,
.

Real LReal , +/- INF


(), NaN (Not a Number [ ]), .
, . CPU
.

, ,
, :

OK

NOT_OK

IN

Real, LReal

S7-1200

126

, 11/2009, A5E02669003-02


6.1

6.1.5

, ,

:
ADD: (IN1 + IN2 = OUT)
SUB: (IN1 - IN2 = OUT)
MUL: (IN1 * IN2 = OUT)
DIV: (IN1 / IN2 = OUT)

,
.
.

IN1, IN2 OUT


.

IN1, IN2

SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Constant

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal

(EN = 1),
(IN1 IN2) ,
(OUT).
ENO = 1.

ENO


.
, .

0 (IN2 = 0): , .

Real/LReal: NaN ( ),
NaN.

ADD Real/LReal: (IN) (INF)


, , NaN.

SUB Real/LReal: (IN) (INF)


, , NaN.

MUL Real/LReal: (IN) , INF,


NaN.

DIV Real/LReal: (IN) INF,


NaN.

S7-1200
, 11/2009, A5E02669003-02

127


6.1

6.1.5.1

MOD ( )
MOD (modulo)
IN1 modulo IN2.
IN1 MOD IN2 = IN1 - (IN1 / IN2)*IN2 = OUT.

.

IN1, IN2 OUT .

IN1 IN2

Int, DInt, USInt, UInt, UDInt, Constant

OUT

Int, DInt, USInt, UInt, UDInt

ENO

IN2 = 0, OUT

S7-1200

128

, 11/2009, A5E02669003-02


6.1

NEG
NEG ()
IN OUT.

.

IN OUT .

IN

SInt, Int, DInt, Real, LReal, Constant

OUT

SInt, Int, DInt, Real, LReal

ENO


.
SInt: NEG (-128) +128,
.

S7-1200
, 11/2009, A5E02669003-02

129


6.1

1
INC DEC :
1
INC ( 1): IN/OUT
IN/OUT + 1
1
DEC ( 1): IN/OUT
IN/OUT 1

.

IN/OUT

SInt, Int, DInt, USInt, UInt, UDInt

ENO


.
SInt: INC (127) -128,
.

S7-1200

130

, 11/2009, A5E02669003-02


6.1


ABS
IN
OUT.

.

IN OUT .

IN

SInt, Int, DInt, Real, LReal

OUT

SInt, Int, DInt, Real, LReal

ENO


.
SInt: ABS (-128) +128,
.

S7-1200
, 11/2009, A5E02669003-02

131


6.1

MIN MAX
MIN () MAX ()
:
MIN IN1 IN2
() OUT.
MAX IN1 IN2
() OUT.

.

IN1, IN2 OUT .

IN1, IN2

SInt, Int, DInt, USInt, UInt, UDInt, Real,


Constant

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real

ENO

Real:

(NaN).

OUT +/- INF ().

S7-1200

132

, 11/2009, A5E02669003-02


6.1


LIMIT ,
IN , MIN MAX.
OUT MIN MAX, IN
.
IN ,
IN OUT.
IN ,
OUT MIN (
IN , MIN)
MAX ( IN , MAX).
.

MIN, IN, MAX OUT .

MIN, IN MAX

SInt, Int, DInt, USInt, UInt, UDInt, Real, Constant

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real

ENO

Real: MIN, IN MAX NaN (


), NaN.

MIN , MAX, IN OUT.

S7-1200
, 11/2009, A5E02669003-02

133


6.1



Real LReal:
SQR: (IN 2 = OUT)
SQRT: (IN = OUT)
LN: (LN(IN) = OUT)
EXP: (e IN =OUT),
e = 2.71828182845904523536
SIN: (sin(IN ) = OUT)
COS: Cosine (cos(IN ) = OUT)
TAN: (tg(IN ) = OUT)
ASIN: (arcsin(IN) = OUT ), sin(OUT ) = IN
ACOS: (arccos(IN) = OUT ), cos(OUT ) = IN
ATAN: (arctg(IN) = OUT ), tg(OUT ) = IN
FRAC: (
IN = OUT)
EXPT: (IN1 IN2 = OUT)

. EXPT IN1 OUT
. IN2
.

IN, IN1

Real, LReal, Constant

IN2

SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal,


Constant

EXPT

OUT

Real, LReal

S7-1200

134

, 11/2009, A5E02669003-02


6.1

ENO

SQR


Real/LReal

+INF

IN +/- NaN ( )

+NaN

SQRT

LN

EXP

(OUT)

IN

-NaN

IN +/- INF () +/NaN

+/- INF +/- NaN

IN 0.0, , -INF NaN

-NaN

IN +INF +NaN

+INF +NaN


Real/LReal

+INF

IN +/- NaN

+/- NaN

SIN, COS,
TAN

IN +/- INF +/- NaN

+/- INF +/- NaN

ASIN,
ACOS

IN
-1.0 +1.0

+NaN

IN +/- NaN

+/- NaN

ATAN

IN +/- NaN

+/- NaN

FRAC

IN +/- INF +/- NaN

+NaN

EXPT

IN1 +INF, IN2 -INF

+INF

IN1 -INF

+NaN, IN2
Real/LReal,
-INF

IN1 IN2 +/- NaN

+NaN

IN1 0.0, IN2 Real/LReal +NaN


()

S7-1200
, 11/2009, A5E02669003-02

135


6.1

6.1.6

Move


.
.
MOVE: ,

MOVE_BLK: ,

UMOVE_BLK: ,

MOVE

IN

SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte,


Word, DWord, Char, Array, Struct, DTL, Time

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal, Byte,


Word, DWord, Char, Array, Struct, DTL, Time

IN

SInt, Int, DInt, USInt, UInt, UDInt, Real,


Byte, Word, DWord

COUNT

UInt

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real,


Byte, Word, DWord

MOVE_BLK, UMOVE_BLK

S7-1200

136

, 11/2009, A5E02669003-02


6.1


Bool SET_BF, RESET_BF, R, S
(LAD)
MOVE
MOVE_BLK
UMOVE_BLK
MOVE
S_CONV
MOVE
MOVE_BLK UMOVE_BLK
I, Q M.
MOVE ,
IN, , OUT.
MOVE_BLK UMOVE_BLK COUNT.
COUNT , .
,
IN OUT .
MOVE_BLK UMOVE_BLK
:
MOVE_BLK
. MOVE_BLK,
OB ,
,
. MOVE_BLK ,

. MOVE_BLK OB
.
, ,
UMOVE_BLK. UMOVE_BLK,
, ,
OB .
(. 96).
MOVE ENO
.

ENO

COUNT

(IN)
(OUT)



.
.

S7-1200
, 11/2009, A5E02669003-02

137


6.1


FILL_BLK UFILL_BLK :
FILL_BLK:

.
UFILL_BLK:

.

IN

SInt, Int, DIntT, USInt, UInt, UDInt, Real, BYTE,


Word, DWord

COUNT

USInt, UInt

OUT

SInt, Int, DIntT, USInt, UInt, UDInt, Real, BYTE,


Word, DWord


BOOL SET_BF, RESET_BF, R, S
(LAD)
MOVE
FILL_BLK
UFILL_BLK
MOVE
FILL_BLK UFILL_BLK
I, Q M.

S7-1200

138

, 11/2009, A5E02669003-02


6.1
FILL_BLK UFILL_BLK IN
,
OUT. ,
COUNT.
FILL_BLK UFILL_BLK
:
FILL_BLK
. FILL_BLK,
OB ,
, .
, ,
UFILL_BLK. UFILL_BLK,
, ,
OB .

ENO

IN
COUNT

(OUT)


.
.

S7-1200
, 11/2009, A5E02669003-02

139


6.1

6.1.6.1

Swap ( )
SWAP
2- 4- .
. SWAP
ENO .

.

IN

Word, DWord


IN

OUT

Word, DWord


OUT

: IN = MB0
SWAP

: OUT = MB4,
SWAP

W#16#1234
WORD

MB0
12
MSB

MB1
34
LSB

MB4 MB5
34
12
MSB LSB

DW#16#
12345678
DWORD

MB0
12

MB1 MB2 MB3


34
56
78

MB4 MB5 MB6 MB7


78
56
34
12

MSB

LSB

MSB

LSB

S7-1200

140

, 11/2009, A5E02669003-02


6.1

6.1.7


CONVERT
. ,
IN OUT .
( )
( ).
BCD16 Int. BCD32
DInt.
.

IN
OUT


SInt, Int, DInt, USInt, UInt, UDInt, Byte, Word, DWord,
Real, LReal, Bcd16, Bcd32
SInt, Int, DInt, USInt, UInt, UDInt, Byte, Word, DWord,
Real, LReal, Bcd16, Bcd32

ENO
1
0
0

IN
IN,

OUT


IN +/- INF +/- NaN


OUT


+/- INF +/- NaN
OUT
,
IN

S7-1200
, 11/2009, A5E02669003-02

141


6.1

Round Truncate
ROUND .
(IEEE
).
(., 10.5),
. , ROUND (10.5) = 10
ROUND (11.5) = 12.
TRUNC .
(IEEE ).

IN


Real, LReal

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal

ENO
1
0

OUT


IN +/- INF +/- NaN


+/- INF +/- NaN



CEIL ( ceiling )
,
(IEEE + ).
FLOOR (floor = )
, (IEEE
).

IN


Real, LReal

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real, LReal

ENO
1
0

OUT


IN +/- INF +/- NaN


+/- INF +/- NaN

S7-1200

142

, 11/2009, A5E02669003-02


6.1

6.1.7.1


SCALE_X
VALUE, (0,0 <= VALUE <= 1,0), ,
MIN MAX:
OUT = VALUE (MAX MIN) + MIN
SCALE_X MIN, MAX OUT
.
NORM_X VALUE ,
MIN MAX:
OUT = (VALUE MIN) / (MAX MIN), (0,0 <= OUT <= 1,0)
NORM_X MIN, VALUE MAX
.
.

MIN
VALUE
MAX
OUT


SInt, Int, DInt, USInt, UInt, UDInt, Real



SCALE_X: Real

NORM_X: SInt, Int, DInt, USInt, UInt, UDInt, Real

SInt, Int, DInt, USInt, UInt, UDInt, Real




SCALE_X: SInt, Int, DInt, USInt, UInt, UDInt,

Real

NORM_X: Real

VALUE SCALE_X
(0,0 <= VALUE <= 1,0)
VALUE , :
OUT,
MIN MAX OUT,
OUT.
SCALE_X ENO = .
,
OUT. OUT
,

OUT. SCALE_X
ENO = .
VALUE NORM_X
(MIN <= VALUE <= MAX)
VALUE , MIN, , MAX,
OUT,
0.0 1.0. NORM_X
ENO = .

S7-1200
, 11/2009, A5E02669003-02

143


6.1

ENO

6.1.8

OUT




OUT

MAX <= MIN

:


OUT.
SCALE_X:
VALUE,
,
OUT.
NORM_X: VALUE VALUE,

.

VALUE = +/- INF


+/- NaN

VALUE OUT



:
JMP: JMP (LAD),
JMP
(FBD),
.
JMPN: JMP
(LAD), JMP
(FBD),
.
LABEL []:
JMP JMPN.
LAD

FBD

Label_name

LABEL.
JMP JMPN
.
JMP JMPN.

S7-1200

144

, 11/2009, A5E02669003-02


6.1

Return_Value [ ]
(RET)
LAD

FBD
RET
.

Return_Value

Bool

"Return_value" RET ENO


.

RET
. , RET
(LAD) RET (FBD),
,
RET, . OB,
"Return_Value" . FC FB,
"Return_Value "
ENO .
RET ;
. RET
.
RET FC:
1. FC:
2. FC:
.
RET,
"Return_Value":
TRUE (), FALSE () ,
.
.
3. FC MAIN [OB1].
EN FC MAIN ,
FC.
, RET FC, ENO
FC MAIN FC,
RET .

S7-1200
, 11/2009, A5E02669003-02

145


6.1

6.1.9

AND (), OR () XOR ( )


AND: BYTE, WORD DWORD
OR: BYTE, WORD DWORD
XOR: BYTE, WORD
DWORD

.

IN1, IN2

Byte, Word, DWord

OUT

Byte, Word, DWord

IN1, IN2 OUT


. IN1 IN2 ,
OUT.
ENO .


INV
IN.
IN (
0 1 1 0).
ENO .
.

IN

SInt, Int, DInt, USInt, UInt, UDInt, Byte, Word, DWord

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Byte, Word, DWord

S7-1200

146

, 11/2009, A5E02669003-02


6.1


ENCO ()
.
DECO ()
.

.

IN
ENCO: Byte, Word, DWord
DECO: UInt
OUT
ENCO: Int
DECO: Byte, Word, DWord

ENCO:
DECO:
ENCO:
DECO:

ENCO IN ,
IN,
OUT. IN 0000 0001 0000 0000,
OUT 0. IN 0000 0000, ENO
.
DECO IN,
OUT 1 (
0). DECO ENO
.
Byte, Word DWord OUT DECO
IN. IN
, modulo
, .
IN DECO:
3 ( 0-7) IN 1
OUT
4 ( 0-15) IN 1
OUT
5 ( 0-31) IN 1
OUT
IN DECO

OUT DECO (
)

0
7

Byte OUT (8 ):
00000001
10000000

. IN
. IN

0
15

Word OUT (16 ):


0000000000000001
1000000000000000

. IN
. IN

0
31

DWord OUT: (32 ):


00000000000000000000000000000001
10000000000000000000000000000000

. IN
. IN

ENO

(OUT)

IN

OUT

S7-1200
, 11/2009, A5E02669003-02

147


6.1

(SEL) (MUX)
SEL
OUT, G.
MUX
OUT, K.
K
, OUT
ELSE.

.

SEL

Bool

IN0

IN1

IN0, IN1

SInt, Int, DInt, USInt, UInt, UDInt, Real, Byte, Word,


DWord, Time, Char

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real, Byte, Word,


DWord, Time, Char

MUX

UInt

0 IN0

1 IN1

...

IN0, IN1,....

SInt, Int, DInt, USInt, UInt, UDInt, Real, Byte, Word,


DWord, Time, Char

ELSE

SInt, Int, DInt, USInt, UInt, UDInt, Real, Byte, Word,


DWord, Time, Char

()

OUT

SInt, Int, DInt, USInt, UInt, UDInt, Real, Byte, Word,


DWord, Time, Char

S7-1200

148

, 11/2009, A5E02669003-02


6.1

.
SEL IN.
MUX
IN,
IN.
MUX
:

IN "Insert input [ ]".

IN ( )
"Delete []".
: ENO
SEL.
ENO
(MUX)

MUX

MUX OUT

IN
OUT

K
IN

ELSE :
OUT
ELSE :
ELSE
OUT

S7-1200
, 11/2009, A5E02669003-02

149


6.1

6.1.10



IN. OUT. N
, :
SHR:
SHL:
.

IN

Byte, Word, DWord

UInt

OUT

Byte, Word, DWord

N=0 , IN OUT.
, , .
, , (N)
(8 , 16 , 32 ),
(
OUT ).
ENO .
SHL Word:
IN

1110 0010 1010 1101

OUT
:

1110 0010 1010 1101

1100 0101 0101 1010

1000 1010 1011 0100

0001 0101 0110 1000

S7-1200

150

, 11/2009, A5E02669003-02


6.1



IN.
OUT. N ,
.
ROR:
ROL:
.

IN

Byte, Word, DWord

UInt

OUT

Byte, Word, DWord

N=0 , IN
OUT.
, ,
,
.
, , (N)
(8 , 16 , 32
), .
ENO
.
ROR WORD : , ,

IN

0100 0000 0000 0001

OUT
:

0100 0000 0000 0001

1010 0000 0000 0000

0101 0000 0000 0000

S7-1200
, 11/2009, A5E02669003-02

151


6.2

6.2

6.2.1


,
. ,
, .
, CPU STOP,
GetError GetErrorID
.

(W#16#....)

8022

8023

8024

8025

8028

8029

8030

DB,

803A

DB

S7-1200

152

, 11/2009, A5E02669003-02


6.2

6.2.2


,
.
T_CONV : (Time to DInt [
]) (DInt to Time [ ])
T_ADD Time DTL: (Time + Time = Time) (DTL + Time =
DTL)
T_SUB Time DTL: (Time - Time = Time) (DTL - Time = DTL)
T_DIFF DTL Time: DTL DTL = Time

(
)

Time []

32


T#-24d_20h_31m_23s_648ms
T#24d_20h_31m_23s_647ms
-2 147 483 648 +2 147 483 647

DTL
: UInt

16

1970 2554

: USInt

1 12

: USInt

1 31

: USInt

1= 7=

: USInt

0 23

: USInt

0 59

: USInt

0 59

: UDInt

32

0 999,999,999

T_CONV ( ) Time
DInt,
DInt Time.

IN

IN

DInt, Time

Time Dint

OUT

OUT

DInt, Time

DInt Time

IN OUT .

T_ADD ( ) IN1 (
DTL Time) IN2 ( Time).
OUT DTL Time.

S7-1200
, 11/2009, A5E02669003-02

153


6.2
:
Time + Time = Time
DTL + Time = DTL

IN1
IN2
OUT

IN
IN
OUT

DTL, Time
Time
DTL, Time

DTL Time
Time,
DTL Time

IN1 .
IN1 OUT.

T_SUB ( ) Time IN2 IN1


( DTL Time). OUT
, DTL Time.
:
Time - Time = Time
DTL - Time = DTL

IN1
IN2
OUT

IN
IN
OUT

DTL, Time
Time
DTL, Time

DTL Time
Time,
DTL Time

IN1 .
IN1 OUT.

T_DIFF ( ) DTL IN2


DTL IN1. OUT ,
Time.
DTL - DTL = Time

IN1
IN2
OUT

IN
IN
OUT

DTL
DTL
Time

DTL
DTL,
Time

: ENO = 1 , . ENO = 0
OUT = 0 :
DTL
Time

S7-1200

154

, 11/2009, A5E02669003-02


6.2



. DTL.
DTL
: UInt
: USInt
: USInt
: USInt
: USInt
: USInt
: USInt
: UDInt

16
8
8
8
8
8
8
32


1970 2554
1 12
1 31
1=Sunday 7=Saturday
0 23
0 59
0 59
0 999,999,999

WR_SYS_T ( )
DTL IN.
,
.

IN

IN

DTL

RET_VAL

OUT

Int

RD_SYS_T ( )
.
, .

RET_VAL
OUT

OUT
OUT

Int
DTL

RD_LOC_T ( )
DTL.

RET_VAL
OUT

OUT
OUT

Int
DTL

S7-1200
, 11/2009, A5E02669003-02

155


6.2


,
CPU.

(Universal Time Coordinated, UTC).
, , ,
.
, ,
, .
.
,
.
: ENO = 1 , . ENO = 0 ,
, RET_VAL .
RET_VAL (W#16#....)

0000

8080

8081

8082

8083

8084

8085

8086

8087

80B0

6.2.3

6.2.3.1

String
String 2- , 254
ASCII. String
. ,
, 254
. ,
. .
, String 2 ,
.

S7-1200

156

, 11/2009, A5E02669003-02


6.2

String
String
.

String
,
, 255. .
(I) (Q).
" STRING"
(. 65)

6.2.3.2



:
S_CONV

STRG_VAL

VAL_STRG

S_CONV ( )

. S_CONV
. S_CONV ,
, STRG_VAL VAL_STRG.
.

S7-1200
, 11/2009, A5E02669003-02

157


6.2

S_CONV ( )

IN

IN

String

OUT

OUT

String, SInt, Int, DInt, USInt, UInt,


UDInt, Real

IN
, ,
"0" "9", "+", "-", ".". ,
OUT.
OUT, OUT 0, ENO
. OUT
, ENO .
:
IN , ,
".".
","
, , .
.
. "e"
"E" .

S7-1200

158

, 11/2009, A5E02669003-02


6.2

S_CONV ( )

IN

IN

String, SInt, Int, DInt, USInt, UInt,


UDInt, Real

OUT

OUT

String

, IN
OUT. OUT
.
,
.
OUT, ,
OUT. OUT
.
IN
.
OUT. ( ) OUT
.
,
.


IN
OUT

USInt

255

SInt

-128

UInt

65535

Int

-32768

UDInt

10

4294967295

12

DInt

11

-2147483648

13

:
, OUT, "+".
(
).
IN Real,
".".

S7-1200
, 11/2009, A5E02669003-02

159


6.2

STRG_VAL
STRG_VAL ( )

.
IN , P,
,
, "+", "-", ".", ",",
"e", "E" "0" "9".
, OUT.
P
, .
.

IN

IN

String

ASCII,

FORMAT

IN

Word

IN_OUT

UInt

IN: ,
(
= 1)
OUT:

OUT

OUT

SInt, Int, DInt, USInt,


UInt, UDInt, Real

S7-1200

160

, 11/2009, A5E02669003-02


6.2

FORMAT STRG_VAL
FORMAT STRG_VAL .
.

16
0

f =
r =

0
0

1=
0 =
1 = "," ()
0 = "." ()

FORMAT (W#16#)

0000 ( )

"."

0001
0002

","

0003
0004 FFFF

"."
","

STRG_VAL:
".",
","
. , .
","
"." .
, .
.

S7-1200
, 11/2009, A5E02669003-02

161


6.2

VAL_STRG
VAL_STRG ( ) ,

. ,
IN, ,
OUT.
OUT
.
OUT,
P , SIZE.
SIZE OUT, P.
. ,
"120" " = 120 /.".

IN

IN

SInt, Int, DInt, USInt, UInt, ,


UDInt, Real

SIZE

IN

USInt

,
OUT

PREC

IN

USInt

.
.

FORMAT

IN

Word

IN_OUT

UInt

IN:
OUT, (
= 1)
OUT:
OUT

OUT

OUT

String

PREC
. IN , PREC
. , 123 PREC = 1,
"12.3".
REAL 7 .
P , OUT, P
, .
, OUT.

S7-1200

162

, 11/2009, A5E02669003-02


6.2

FORMAT VAL_STRG
FORMAT VAL_STRG .
.

16
0

s =
f =
r =

FORMAT (WORD)
W#16#0000
W#16#0001
W#16#0002
W#16#0003
W#16#0004
W#16#0005
W#16#0006
W#16#0007
W#16#0008
W#16#FFFF

8
0

7
0

1= "+" "-"
0 = "-"
1=
0 =
1 = "," ()
0 = "." ()

"-"

"+" "-"

0
r


"."
","
"."
","
"."
","
"."
","

OUT:
,
.
FORMAT ,
"+".
"-".
< >< >'.'< PREC>
,
.
< ><>< >'.'< PREC>
FORMAT
, , REAL,
:
< ><><> '.' < PREC>'E' ><><
>

S7-1200
, 11/2009, A5E02669003-02

163


6.2

FORMAT
, ,
:
< ><>< >'.'< PREC>
( ,
) .
,
, PREC.
, ,
.
.

, ENO
, :
ENO 0.
OUT 0, ,
.
OUT ,
, OUT .

ENO

; ,
DB

0 255

, ,


OUT

OUT
, , SIZE,
, P

P, P=0 P ,

SIZE PREC

S7-1200

164

, 11/2009, A5E02669003-02


6.2

S_CONV
IN

OUT

OUT

ENO

"123"

Int/DInt

123

"-00456"

Int/DInt

-456

"123.45"

Int/DInt

123

"+2345"

Int/DInt

2345

"00123AB"

Int/DInt

123

"123"

Real

123.0

"123.45"

Real

123.45

"1.23e-4"

Real

1.23

"1.23E-4"

Real

1.23

"12,345.67"

Real

12345.67

"3.4e39"

Real

3.4

"-3.4e39"

Real

-3.4

"1.17549e-38"

Real

1.17549

"12345"

SInt

"A123"

N/A

""

N/A

"++123"

N/A

"+-123"

N/A

S_CONV

IN

OUT

ENO

UInt

123

"123"

UInt

"0"

UDInt

12345678

"12345678"

Real

-INF

"INF"

Real

+INF

"INF"

Real

NaN

"NaN"

S7-1200
, 11/2009, A5E02669003-02

165


6.2

STRG_VAL
IN

FORMAT
(W#16#....)

OUT

OUT

ENO

"123"

0000

Int/DInt

123

"-00456"

0000

Int/DInt

-456

"123.45"

0000

Int/DInt

123

"+2345"

0000

Int/DInt

2345

"00123AB"

0000

Int/DInt

123

"123"

0000

Real

123.0

"-00456"

0001

Real

-456.0

"+00456"

0001

Real

456.0

"123.45"

0000

Real

123.45

"123.45"

0001

Real

12345.0

"123,45"

0000

Real

12345.0

"123,45"

0001

Real

123.45

".00123AB"

0001

Real

123.0

"1.23e-4"

0000

Real

1.23

"1.23E-4"

0000

Real

1.23

"1.23E-4"

0002

Real

1.23E-4

"12,345.67"

0000

Real

12345.67

"12,345.67"

0001

Real

12.345

"3.4e39"

0002

Real

+INF

"-3.4e39"

0002

Real

-INF

"1.1754943e-38"
( )

0002

Real

0.0

"12345"

N/A

SInt

"A123"

N/A

N/A

""

N/A

N/A

"++123"

N/A

N/A

"+-123"

N/A

N/A

S7-1200

166

, 11/2009, A5E02669003-02


6.2

VAL_STRG
OUT, :
"Current Temp = xxxxxxxxxx C"
"x" , .
IN

SIZE

FORMAT PREC OUT


(W#16#....)

ENO

UInt

123

16

10

0000

Current Temp =
xxxxxxx123 C

UInt

16

10

0000

Current Temp =
xxxxxx0.00 C

UDInt

12345678

16

10

0000

Current Temp =
x12345.678 C

UDInt

12345678

16

10

0001

Current Temp =
x12345,678 C

Int

123

16

10

0004

Current Temp =
xxxxxx+123 C

Int

-123

16

10

0004

Current Temp =
xxxxxx-123 C

Real

-0.00123

16

10

0004

Current Temp =
xxx-0.0012 C

Real

-0.00123

16

10

0006

Current Temp =
-1.2300E-3 C

Real

-INF

16

10

N/A

Current Temp =
xxxxxx-INF C

Real

+INF

16

10

N/A

Current Temp =
xxxxxx+INF C

Real

NaN

16

10

N/A

Current Temp =
xxxxxxxNaN C

UDInt

12345678

16

N/A

Current Temp =
xxxxxxxxxx C

S7-1200
, 11/2009, A5E02669003-02

167


6.2

6.2.3.3


,
, , ENO = 0 .
, ,
.
ENO

OUT

IN1 IN1,
IN2 IN2
( )

IN1, IN2 OUT



IN1, IN2 OUT 0 255
( )

LEN:

CONCAT:

LEFT:

RIGHT:

MID:

FIND:

INSERT:

DELETE:

REPLACE:

S7-1200

168

, 11/2009, A5E02669003-02


6.2

LEN

IN

IN

String

OUT

OUT

UInt

IN

LEN ( ) IN OUT.
. .
ENO

OUT

CONCAT

IN1

IN

String

IN2

IN

String

OUT

OUT

String

( 1 + 2)

CONCAT ( ) IN1 IN2,


, OUT. IN1
, IN2 .
.
ENO

OUT


OUT


,
OUT

S7-1200
, 11/2009, A5E02669003-02

169


6.2

LEFT

IN

IN

String

IN

Int

, ,
L IN

OUT

OUT

String

LEFT ( ) , L
IN.
L , IN, IN
OUT.
, OUT .
.
ENO

OUT

L 0

(L),
,
OUT

,

OUT

S7-1200

170

, 11/2009, A5E02669003-02


6.2

RIGHT

IN

IN

String

IN

Int

, ,
L IN

OUT

OUT

String

RIGHT ( ) , L
IN.
L , IN, IN
OUT.
, OUT .
.
ENO

OUT

L 0

(L),
,
OUT

,

OUT

S7-1200
, 11/2009, A5E02669003-02

171


6.2

MID

IN

IN

String

IN

Int

, ,
L IN, P

IN

Int

,
:
P= 1, IN

OUT

OUT

String

MID ( ) .
L P ().
L P IN,
, P IN.
.
ENO

OUT

L P 0

P , IN
(L),
,
OUT

,
P,
OUT

S7-1200

172

, 11/2009, A5E02669003-02


6.2

DELETE

IN

IN

String

IN

Int

IN

Int

, :
IN 1

OUT

OUT

String

DELETE ( ) L IN.
P (),
OUT.
L , OUT .
L P , ,
.
.
ENO

OUT

P , IN

IN OUT

L , 0, P 0



OUT


,
OUT

S7-1200
, 11/2009, A5E02669003-02

173


6.2

INSERT

IN1

IN

String

IN2

IN

String

IN

Int

IN1
IN2.
IN1 1.

OUT

OUT

String

INSERT ( ) IN2 IN1.


, P.
.
ENO

OUT

P , IN1

IN2 IN1

IN1

P 0


OUT


,
OUT

S7-1200

174

, 11/2009, A5E02669003-02


6.2

REPLACE

IN1

IN

String

IN2

IN

String

IN

Int

IN

Int

OUT

OUT

String

REPLACE ( ) L
IN1. IN1, P
(), IN2.
L , IN2 P IN1
IN1.
P 1, L IN1
IN2.
.
ENO

OUT

P , IN1

IN2 IN1

IN1

P IN1, IN1
L

IN2 IN1,
P

L , 0, P 0


OUT


,
OUT

FIND

IN1

IN

String

IN2

IN

String

OUT

OUT

Int

IN1

FIND ( ) IN1
, IN2. .
IN2 OUT. IN2 IN1,
. .
ENO

OUT

IN2 , IN1

S7-1200
, 11/2009, A5E02669003-02

175


6.2

6.2.4

6.2.4.1


RE_TRIGR ( )

,
.
RE_TRIGR
.

RE_TRIGR.
CPU RE_TRIGR ,
, OB1, , .
, , ENO = EN,
RE_TRIGR OB, OB .
ENO = , , RE_TRIGR
OB , OB OB .



"Cycle time [ ]".

6000

150


, ,
. OB 80
, OB 80,
. OB 80
, .

(2- ),
, STOP.
STOP ,
.

S7-1200

176

, 11/2009, A5E02669003-02


6.2

6.2.4.2


STP ( )
STOP. STOP,

.
:
STOP CPU (. 56)
EN = , STOP,
, ENO .
EN = ENO = 0.

6.2.4.3



. GetError
GetErrorID ,
.

GET_ERROR
GET_ERROR ,
,
.

ERROR

ErrorStruct

:
, .


ErrorStruct

ERROR_ID

Word

FLAGS

Byte

0.

REACTION

Byte

BLOCK_TYPE

PAD_0

Byte

Byte

0 = ; (
)

1 = :
0 ( )

2 =

, :

1 = OB

2 = FC

3 = FB

,
0

S7-1200
, 11/2009, A5E02669003-02

177


6.2


ErrorStruct

CODE_BLOCK_NUMBER

UInt

ADDRESS

UDInt

MODE

Byte

,
,
STEP 7 Basic

PAD_1

Byte

;
, 0

OPERAND_NUMBER

UInt

POINTER_NUMBER_
LOCATION

UInt

(A)

SLOT_NUMBER_SCOPE

UInt

(B)

AREA

Byte

(C) ,
:

L: 16#40 4E, 86, 87, 8E, 8F, C0 CE

I: 16#81

Q: 16#82

M: 16#83

DB: 16#84, 85, 8A, 8B

PAD_2

Byte

;
, 0

DB_NUMBER

UInt

(D) DB, ,
DB, 0

OFFSET

UDInt

(E) ,
(: 12 = 1, 4)

S7-1200

178

, 11/2009, A5E02669003-02


6.2

GET_ERR_ID
GET_ERR_ID ,
, ID (
) .

ID

Word

ErrorStruct
ERROR_ID

ERROR_ID
ERROR_ID

2503

9475

2522

9506

2523

9507

2524

9508

2525

9509

2528

9512

(
)

2529

9513

(
)

2530

9520

DB

253A

9530

DB

253C

9532

FC

253D

9533

253E

9534

FB

253F

9535

2575

9589

2576

9590

2942

10562

2943

10563

S7-1200
, 11/2009, A5E02669003-02

179


6.2


CPU
STOP. ,
GET_ERROR ERR_ID,
. CPU
STOP .
GET_ERROR GET_ERR_ID.
GET_ERROR
GET_ERR_ID.
,
.
GET_ERROR GET_ERR_ID
, .
GET_ERROR
GET_ERR_ID. GET_ERROR GET_ERR_ID
GET_ERROR GET_ERR_ID.
,
.
ErrorStruct, GET_ERROR,
,
.
ErrorStruct .
ErrorStruct, . ErrorStruct
.

, ENO
EN = GET_ERROR GET_ERR_ID, :
ENO = ,

ENO = ,
ENO ,
. ,
,
.
GET_ERROR GET_ERR_ID
(
) .
,
.

S7-1200

180

, 11/2009, A5E02669003-02


6.2

6.2.5

6.2.5.1

Open Ethernet

Open Ethernet
(TSEND_C TRCV_C)

TSEND_C TRCV_C
. ,
, , OB
, .
OB , OB , OB
, OB - OB .

(. 96).

TSEND_C
TSEND_C TCP ISO on TCP,
.
CPU.
TSEND_C TCON, TDISCON TSEND.
,
TSEND_C, .

LEN (LEN = 0) DATA


. , DATA,
TSEND_C, , DATA
TRCV_C.
TSEND_C:
TSEND_C
CONT = 1.
TSEND_C
DONE.
TSEND_C CONT = 0.
.
. ,
.
TSEND_C
REQ.
TSEND_C 1 DONE.
TSEND_C
CONT =1 REQ = 1. TSEND_C
1 DONE.

S7-1200
, 11/2009, A5E02669003-02

181


6.2

TRCV_C
TRCV_C CPU TCP ISO on TCP,
.
CPU.
TRCV_C TCON, TDISCON, TRCV.
,
TRCV_C, . TRCV_C
.

LEN (LEN = 0) DATA


. , DATA,
TSEND_C, , DATA
TRCV_C.
TRCV_C:
TRCV_C
CONT = 1.
TRCV_C EN_R = 1. TRCV_C
, EN_R = 1 CONT = 1.
TRCV_C CONT = 0.
, .

S7-1200

182

, 11/2009, A5E02669003-02


6.2


TRCV_C , TRCV.
, .

"connection_type [
]"

TCP

B#16#11

ISO on TCP

B#16#12

- TSEND_C
, DONE
ERROR .
TSEND_C DONE ,
. , CPU
.
- TRCV_C
, DONE = 1.
BUSY, DONE
ERROR.
BUSY

DONE

ERROR

.
STATUS.

S7-1200
, 11/2009, A5E02669003-02

183


6.2

TSEND_C

REQ

INPUT

Bool

REQ

, CONNECT.

CONT

INPUT

Bool

0:

1:

LEN

INPUT

Int

, .
( = 0, ,
DATA ,
.).

CONNECT

IN_OUT

TCONParam

DATA

IN_OUT

Variant

; ,
.

COM_RST

IN_OUT

Bool

1: ,
.

DONE

OUTPUT

Bool

0:
.

1: .

0: .

1: .
.
1: .
STATUS
.

BUSY

OUTPUT

Bool

ERROR

OUTPUT

Bool

STATUS

OUTPUT

Word

TRCV_C

S7-1200

184

, 11/2009, A5E02669003-02


6.2

EN_R

IN

Bool

,
: EN_R = 1, TRCV_C
. .

CONT

IN

Bool

CONT:

0:

1:

LEN

IN

Int

. (
= 0, , DATA
, .).

CONNECT

IN_OUT

TCONParam

DATA

IN_OUT

Variant

COM_RST

IN_OUT

Bool

1: ;
.

DONE

OUT

Bool

0:
.

1: .

0: .

1: .
.
1: .
STATUS
.

BUSY

OUT

Bool

ERROR

OUT

Bool

STATUS

OUT

Word

RCVD_LEN

OUT

Int

S7-1200
, 11/2009, A5E02669003-02

185


6.2

Error Status
ERROR

STATUS
(W#16#...)

0000

7000

7001

, ,

7002

7003

7004

8085

LEN

8086

CONNECT

8087

8088

LEN ,
DATA;

8089

CONNECT .

8091

809A

CONNECT ,
.

809B

local_device_id CPU.

80A1

80A3

80A4

IP- . , IP IP-
.

80A7

: TDISCON,
TCON (TDISCON
, ID)

80B2

CONNECT ,
UNLINKED

80B3

( local_tsap_id)

ID ID,

S7-1200

186

, 11/2009, A5E02669003-02


6.2

ERROR

STATUS
(W#16#...)

80B4

ISO on TCP (connection_type = B#16#12)


80B4
, TSAP
:

TSAP 2 ID
, E0 E1 (),
00 01.

TSAP 3 ID
E0 E1 (),
00 01,
ASCII.

TSAP 3 , ID
TSAP E0 E1 (),
ID TSAP ASCII.
ASCII 20
7E ().

80C3

80C4

, :


TDISCON

8722

CONNECT: :
DB

873A

CONNECT:
(., DB )

877F

CONNECT: , ,
ANY

Open Ethernet

TSEND_C TRCV_C
. ,
, , OB
, .
OB , OB , OB
, OB - OB .

S7-1200
, 11/2009, A5E02669003-02

187


6.2

Ethernet TCP ISO on TCP


:
TCON .
TSEND TRCV .
TDISCON .
,
TSEND TRCV, . TRCV
.
(. 96).

LEN (LEN = 0) DATA


. , DATA,
TSEND, , DATA
TRCV.
TCON,
.
.

CPU.
, , -
,
. TCON.
TDISCON CPU STOP,
, .
TCON.


TCON, TDISCON, TSEND TRCV , ,
.
,
TCON REQ = 1.
TCON
DONE.
BUSY, DONE ERROR.
.
BUSY

DONE

ERROR

.
STATUS.

S7-1200

188

, 11/2009, A5E02669003-02


6.2

TCON

REQ

IN

Bool

REQUEST
,
ID.
.

ID

IN

CONN_OUC
(Word)

,


. ID
ID
.
: W#16#0001 W#16#0FFF

CONNECT

IN_OUT

TCON-Param

DONE

OUT

Bool

DONE:

0:

1:

BUSY

OUT

Bool

BUSY = 1:
BUSY = 0:

ERROR

OUT

Bool

ERROR:
ERROR = 1:
. STATUS
.

STATUS

OUT

Word

STATUS:

S7-1200
, 11/2009, A5E02669003-02

189


6.2

TDISCON
TCP ISO on TCP: TDISCON
CPU .

REQ

IN

Bool

REQUEST
,
ID.
.

ID

IN

CONN_OUC
(Word)




, . ID
ID
.
: W#16#0001 W#16#0FFF

DONE

OUT

Bool

DONE:

0:

1:

BUSY

OUT

Bool

BUSY = 1:
BUSY = 0:

ERROR

OUT

Bool

ERROR = 1:
.

STATUS

OUT

Word

S7-1200

190

, 11/2009, A5E02669003-02


6.2

TSEND

REQ

IN

Bool

REQUEST
.
,
DATA LEN.

ID

IN

CONN_OUC
(Word)

. ID
ID
.
: W#16#0001 W#16#0FFF

LEN

IN

Int

DATA

IN_OUT

Variant

,
: ;
. :

DONE

BUSY

OUT

OUT

Bool

Bool

DONE:

0:
.

1: .

BUSY = 1: .
.

BUSY = 0: .

ERROR

OUT

Bool

ERROR:
ERROR = 1:
. STATUS

STATUS

OUT

Word

STATUS:

S7-1200
, 11/2009, A5E02669003-02

191


6.2

TRCV

EN_R

IN

Bool

,
: EN_R = 1 TRCV
. .

ID

IN

CONN_OUC
(Word)

. ID
ID
.
: W#16#0001 W#16#0FFF

LEN

IN

Int

(
= 0, , DATA
, .).

DATA

IN_OUT

Variant

:
, .
:

NDR

BUSY

OUT

OUT

Bool

Bool

NDR:

NDR = 0:
.

NDR = 1: .

BUSY = 1: .
.

BUSY = 0: .

ERROR

OUT

Bool

ERROR=1: .
STATUS
.

STATUS

OUT

Word

RCVD_LEN

OUT

Int

S7-1200

192

, 11/2009, A5E02669003-02


6.2


TRCV ,
:

LEN (LEN = 0) DATA


. , DATA,
TSEND, , DATA
TRCV.
, TRCV
.

TCP

B#16#11

ISO on TCP

B#16#12

, TRCV
NDR 1.

TCON
ERROR

STATUS
(W#16#...)

0000

7000

7001

7002

(REQ ),

8086

ID .

8087

809B

local_device_id CPU.

80A1

80A2

80A3

80A4

IP- ; ,
IP-

80A7

: TDISCON,
TCON. TDISCON
, ID.

80B3

:
W#16#80A0 W#16#80A2, W#16#80A4, W#16#80B4
W#16#80B9

S7-1200
, 11/2009, A5E02669003-02

193


6.2

ERROR

STATUS
(W#16#...)

80B4

ISO on TCP (connection_type = B#16#12)


80B4
, TSAP
:

TSAP 2 ID
, E0 E1 (),
00 01.

TSAP 3 ID
E0 E1 (),
00 01,
ASCII.

TSAP 3 , ID
TSAP E0 E1 (),
ID TSAP ASCII.
ASCII 20
7E ().

80B5

active_est

80B6

connection_type

80B7

: block_length,
local_tsap_id_len, rem_subnet_id_len, rem_staddr_len, rem_tsap_id_len,
next_staddr_len

80B8

ID

80C3

80C4

, :


TDISCON.

TDISCON
ERROR

STATUS
(W#16#...)

0000

7000

7001

7002

(REQ ),

8086

ID .

80A3

80C4

, :

.

S7-1200

194

, 11/2009, A5E02669003-02


6.2

TSEND
ERROR

STATUS
(W#16#...)

0000

7000

7001

, :

DATA.

7002

(REQ ),
:
DATA..

8085

LEN .

8086

ID

8088

LEN , , DATA

80A1

.
.

80C3

: ID
.

80C4

, :

TRCV
ERROR

STATUS
(W#16#...)

0000

:
RCVD_LEN.

7000

7001

, .

7002

, :
.
.

8085

LEN ,
LEN DATA .

8086

ID

8088

: LEN ,
, DATA.

S7-1200
, 11/2009, A5E02669003-02

195


6.2

6.2.5.2

ERROR

STATUS
(W#16#...)

80A1

80C3

: ID
.

80C4

, :


, (Point-to-Point, PTP)(. 279)
PtP .

S7-1200

196

, 11/2009, A5E02669003-02


6.2

6.2.6

6.2.6.1

Attach Detach
ATTACH DETACH
,
, .
ATTACH
OB ,
.
DETACH
OB ,
.

OB_NR

IN

Int

:
OB
,
"Add new block [ ]".
,

, OB.

EVENT

IN

DWord

:
,
,


.
,
,
.

ADD
(
ATTACH)

IN

Bool

ADD = 0 ( ):

OB.
ADD = 1:

OB.

RET_VAL

OUT

Int

S7-1200
, 11/2009, A5E02669003-02

197


6.2

,
CPU , :
( CPU
)
,

, .
( CPU
)
,
.
(HSC) =
(CV = RV) (HSC 1 6)
CV = RV HSC ,
,
.
HSC (HSC 1 6)
, ,
HSC .
HSC (HSC 1 6)
HSC
HSC .
HSC, .

, ,


.
HSC,
.
:



(HSC)

S7-1200

198

, 11/2009, A5E02669003-02


6.2

OB

OB. "<not connected [ ]>"
"HW interrupt: [ :]". ,
,
OB . OB
"HW interrupt:". OB ,
OB "Hardware interrupt [ ]"
. "Program blocks [ ]" :
1. "Add new block [ ]", "Organization
block [ ] (OB)", "Hardware interrupt".
2. OB, (LAD
FBD) (
).
3. OB .
OB FC FB
.

OB_NR
OB
"HW interrupt: [ ]"
OB_NR ATTACH / DETACH.

EVENT
, ,
.
, "Event name [ ]:",
.
"Constants []"
EVENT ATTACH DETACH.
,
.


OB
, ,
, .
OB
.
OB
. OB
"HW interrupt [
]:" ( ) OB
OB . OB
"<not connected [ ]>"
.
,
, .
ATTACH DETACH ( ) ,
, OB. OB
(- "<not connected>"
DETACH),
, , .

S7-1200
, 11/2009, A5E02669003-02

199


6.2

DETACH
DETACH
OB. EVENT ,
OB_NR; ,
OB_NR, .
EVENT , OB_NR .


RET_VAL
(W#16#....)

6.2.6.2


ENO

0000

0001

( DETACH)

8090

OB

8091

OB

8093



SRT_DINT CAN_DINT.
, .
, , ,
, .
SRT_DINT ,
OB (
) ,
DTIME.
CAN_DINT ,
. OB
.

S7-1200

200

, 11/2009, A5E02669003-02


6.2

SRT_DINT

OB_NR

IN

Int

(OB),
:
OB ,
"Add new
block [ ]".
,
,
OB.

DTIME

IN

Time

( 1 60000 )

, , OB
.

SIGN

IN

Word

S7-1200;

RET_VAL

OUT

Int

CAN_DINT

OB_NR

IN

Int

OB .
OB
.

RET_VAL

OUT

Int


SRT_DINT , ,
, , ,
OB .
,
OB .
,
, CAN_DINT. ,
,
.

S7-1200
, 11/2009, A5E02669003-02

201


6.2

OB
SRT_DINT CAN_DINT OB
. OB .
OB . OB
, :
1. "Add new block [ ]" "Program
blocks [ ]" , "Organization block
[ ] (OB)", "Time delay interrupt [
]".
2. OB, .
, ,
, .
3. OB
,
. OB
FC FB .
4. OB
OB_NR SRT_DINT
CAN_DINT.


RET_VAL
(W#16#...)

0000

8090

OB_NR

8091

DTIME

80A0

6.2.6.3

S7-1200

202

, 11/2009, A5E02669003-02


6.2

6.2.6.4



DIS_AIRT EN_AIRT.
DIS_AIRT
. DIS_AIRT
OB. DIS_AIRT
. ,
EN_AIRT OB
.
, DIS_AIRT,
, ,
OB.
EN_AIRT ,
DIS_AIRT.
DIS_AIRT
EN_AIRT. , ,
DIS_AIRT,
EN_AIRT.
EN_AIRT OB
FC FB, OB, OB
.
RET_VAL ,
,
DIS_AIRT. ,
RET_VAL = 0.

6.2.7

RET_VAL

OUT

Int

=
DIS_AIRT .

PID-
"PID_Compact"
PID-
.
PID_Compact
TIA.

S7-1200
, 11/2009, A5E02669003-02

203


6.2

6.2.8



PTO
( ) CPU.
STEP 7 Basic.

100
CPU 20 . STEP 7
Basic , ,
.
, ,
.

MC_Power

.

MC_Reset

.

,
,
.

MC_Home



.

MC_Halt


.
.

MC_MoveJog



.

S7-1200

204

, 11/2009, A5E02669003-02


6.2

MC_MoveAbsolute

.
,
.

MC_MoveRelative



.

MC_MoveVelocity

.



CPU
( PWM )
(Q0.0, Q0.1, Q4.0 Q4.1) Q-
.
,
, CPU .

S7-1200
, 11/2009, A5E02669003-02

205


6.2

6.2.9

6.2.9.1

CTRL_PWM
CTRL_PWM (Pulse Width Modulation
[- ] (PWM []))

,
.
PWM
( ).
,

(0 100),
(0 1000), (0 10000)
S7. 0 ( ,
) ( , ).
PWM 0 ,
, . ,
PWM

.

: (PTO). PTO
.
PWM PTO, .

, .
CPU , , .
(
). ,
, . PTO1/PWM1
, PTO2/PWM2 , CPU,
. , PWM
, PTO , , .
,
.

PTO 1
PWM 1
PTO 2
PWM 2

CPU
Q0.0
Q0.1

Q4.0
Q4.1
CPU
Q0.0
-
Q4.0
- CPU
Q0.2
Q0.3

Q4.2
Q4.3
CPU
Q0.2
-
Q4.2
--

S7-1200

206

, 11/2009, A5E02669003-02


6.2

PWM
PWM,
, CPU,
(PTO/PWM), PWM1 PWM2.
( ). ,
.
, "Name []:",
.
"constant",
PWM CTRL_PWM.

100
CPU 20 . STEP 7
Basic , ,
.
, ,
.
,
:
: PWM PTO ( PWM)
: CPU
:
:
( 0 100)
( 0 1000)
( 0 10000)
S7 ( 0 27648)
: .
.
:
. .

S7-1200
, 11/2009, A5E02669003-02

207


6.2


: (Q) ,
.
QW1000 PWM1 QW1002
PWM2.

"Initial pulse width [ ]:"
CPU STOP RUN.
(Q) ,
.

PWM

IN

Word

PWM:


"constant"

PWM.

ENABLE

IN

Bool

BUSY

OUT

Bool

STATUS

OUT

Word

1=
0 =


CTRL_PWM
(DB). CTRL_PWM ,
DB.
, CTRL_PWM.
,
PWM.
EN , PWM_CTRL
PWM ENABLE.
(Q) .
S7-1200 , CTRL_PWM ,
BUSY CPU S7-1200 .
, ENO , STATUS
.
,
, RUN.
, (Q) ,
("Output addresses [ ]" / "Start
address [ ]:").
(Q) , , , ,
, PID.
Q- (, ,
S7).

S7-1200

208

, 11/2009, A5E02669003-02


6.2


STATUS

80A1

PWM PWM

, PWM PTO,

, -
(PWM) (PTO),
.
,
.

, ,

CPU
( PWM
), (Q0.0, Q0.1, Q4.0 Q4.1)
(Q)
.
- , , CPU
.

S7-1200
, 11/2009, A5E02669003-02

209


6.3

6.3

6.3.1

USS
USS Siemens,
USS. ,
USS .
CM 1241 RS485 RS485.
USS ,
.

6.3.1.1

USS
1 FB 3 FC USS.
CM 1241 RS485 16 .

USS,
PtP. USS ,
.

USS_DRV_DB
,

USS.
50 ,

PTP COM
2


16 .
1 16

.

2
2

S7-1200

210

, 11/2009, A5E02669003-02


6.3
( 16), CM 1241 RS485,
USS. , CM 1241 RS485,
USS. S7-1200 CM 1241
RS485, USS, 16 , ,
, 48 USS.
USS (
USS, CM 1241 RS485, ).
, USS,
. USS_DRV, USS_PORT, USS_RPM
USS_WPM, USS.
USS_DRV (FB).
USS_DRV , "Call options [ ]"
DB FB. USS_DRV
USS, DB
( , ), DB . ,
, USS_DRV ,
"Call options",
DB, USS.
USS_PORT, USS_RPM USS_WPM (FC).
, DB .
"USS_DB" DB (
, ,
DB).
USS_PORT CPU
PtP.
.
, .
OB .
USS_DRV
USS.
. 16 ,
16 USS_DRV, .
, .
USS_DRV OB,
.

USS_DRV, USS_RPM, USS_WPM OB,


. USS_PORT OB, OB
.
USS_PORT,
.
USS_RPM USS_WPM
.
.
. ,
,
. USS_RPM USS_WPM
OB, .

S7-1200
, 11/2009, A5E02669003-02

211


6.3

,
S7-1200.
S7-1200 ,
.
USS_PORT , .
USS_PORT
. USS_PORT USS_PORT
.
, , -
3 .
USS 2 .


USS_PORT ()




()

1200

790

2370

2400

405

1215

4800

212.5

638

9600

116.3

349

19200

68.2

205

38400

44.1

133

57600

36.1

109

115200

28.1

85

S7-1200

212

, 11/2009, A5E02669003-02


6.3

6.3.1.2

USS_DRV
USS_DRV ,
.
, USS,
USS PtP,
. DB,
USS_DRV, DB,
.
USS_DRV , USS ( DRIVE),
DB.
USS_PORT .
STOP,
RUN, DB.
USS TX, , ,
"" .
USS_DRV .
, USS_PORT. USS_DRV
, , ,
.
DIR (BOOL)
( ) SPEED_SP (REAL).
,
,
.
SPEED_SP

DIR

> 0

> 0

< 0

< 0

LAD (
)

LAD (
)
,

,
.
,

,

.

S7-1200
, 11/2009, A5E02669003-02

213


6.3

RUN

IN

Bool

:
,
.

OFF2

IN

Bool

:
,
.

OFF3

IN

Bool


,
.

F_ACK

IN

Bool


.
,
,
.

DIR

IN

Bool


,
(
SPEED_SP).

DRIVE

IN

USInt

:
USS.
1 16 .

PZD_LEN

IN

USInt

PZD.
2, 4, 6 8
. 2.

SPEED_SP

IN

Real


.

( DIR ).

CTRL3

IN

UInt

3 ,

.
. .

CTRL4

IN

UInt

4 ,

.
. .

CTRL5

IN

UInt

5 ,

.
. .

CTRL6

IN

UInt

6 ,

.
.

CTRL7

IN

UInt

7 ,

.
. .

S7-1200

214

, 11/2009, A5E02669003-02


6.3

CTRL8

IN

UInt

8 ,

.
. .

NDR

OUT

Bool


, ,
.

ERROR

OUT

Bool


, ,
STATUS .
.

USS_PORT ERROR STATUS.

STATUS

OUT

UInt

.
. ,
.

RUN_EN

OUT

Bool

,
.

D_DIR

OUT

Bool


, .

INHIBIT

OUT

Bool

FAULT

OUT

Bool

,
.
,
F_ACK, .

SPEED

OUT

REAL

(
2)

.

STATUS1

OUT

UInt

1
.

STATUS3

OUT

UInt

3

.

STATUS4

OUT

UInt

4

.

STATUS5

OUT

UInt

5

.

STATUS6

OUT

UInt

6

.

STATUS7

OUT

UInt

7

.

STATUS8

OUT

UInt

8

.

S7-1200
, 11/2009, A5E02669003-02

215


6.3

6.3.1.3

USS_PORT
USS_PORT USS.
USS_PORT
PtP,
. USS_PORT ,
. USS,
USS PtP,
. USS_PORT OB
, USS_DRV
USS.
LAD

FBD

PORT

IN

Port

PtP. :
,
"Constants []"
.

BAUD

IN

DInt

,
USS.

USS_DB

IN

DInt

DB,
USS_DRV
.

ERROR

OUT

Bool

,
, STATUS
.

STATUS

OUT

UInt

.
.

"USS_Extended_Error".

S7-1200

216

, 11/2009, A5E02669003-02


6.3

6.3.1.4

USS_RPM
LAD

FBD
USS_RPM
.
USS,
USS
PtP,

.
USS_RPM
OB,
.

REQ

IN

Bool

: ,
, .
,
.

DRIVE

IN

USInt

:
USS. 1
16 .

PARAM

IN

UInt

: ,
.
0 2047.
,
,
.

INDEX

IN

UInt

: ,
. 16 ,
( 0 255).

. .
.

USS_DB

IN

Variant

DB,
USS_DRV
.

VALUE

IN

Word, Int,
,
UInt,
, DONE
DWord,
.
DInt, UDInt,
Real

S7-1200
, 11/2009, A5E02669003-02

217


6.3

DONE

OUT

: , VALUE

.
, USS_DRV
.
, :

Bool


USS_RPM


USS_DRV

ERROR

OUT

Bool


, ,
STATUS .
.

USS_PORT ERROR STATUS.

STATUS

OUT

UInt

.
.

"USS_Extended_Error".

S7-1200

218

, 11/2009, A5E02669003-02


6.3

6.3.1.5

USS_WPM
LAD

FBD
USS_WPM
.
USS,
USS
PtP,
.
USS_WPM
OB,
.


.
,
.

REQ

IN

Bool

: ,
, .
,
.

DRIVE

IN

USInt

:
USS. 1
16 .

PARAM

IN

UInt

: ,
.
0 2047.
,
,
.

INDEX

IN

UInt

: ,
. 16 ,
( 0 255).

. .
.

EEPROM

IN

Bool

:
,
. ,
,
.

S7-1200
, 11/2009, A5E02669003-02

219


6.3

VALUE

IN

Word, Int,
, .
UInt,

DWord,
REQ.
DInt, UDInt,
Real

USS_DB

IN

Variant

DB,
USS_DRV
.

DONE

OUT

Bool

: , VALUE
.
, USS_DRV
.
,
, ,
USS_WPM
USS_DRV.

ERROR

OUT

Bool

:
, ,
STATUS .
.

USS_PORT ERROR STATUS.

STATUS

OUT

UInt

.
.

"USS_Extended_Error".

S7-1200

220

, 11/2009, A5E02669003-02


6.3

6.3.1.6

USS
USS STATUS USS.

STATUS
(W#16#....)

0000

8180

, . ,
, "USS_Extended_Error".
. .

8181

VALUE Word, Real DWord

8182

Word, DWord Real

8183

DWord Real, Word

8184

. ,
, "USS_Extended_Error".
. .

8185

( : 1-16)

8186

(
: -200% 200%)

8187

. ,
, "USS_Extended_Error".
. .

8188

PZD ( = 2, 4, 6 8 )

8189

818A

818B

. , ,
"USS_Extended_Error". .
.

818C

.
. .

818D

. .
, ,

818E

: USS_RPM USS_WPM,
USS_DRV .
USS_DRV
, .
USS_DRV .

80Ax-80Fx

, FB (PtP, Point-to-Point),
USS: USS,
PtP.

S7-1200
, 11/2009, A5E02669003-02

221


6.3

USS
USS
.
.
- ,
.
, "USS_Extended_Error"
DB USS_DRV.
USS_RPM USS_WPM.
"USS_Extended_Error", STATUS
818C. "USS_Extended_Error"
.

.

6.3.2

MODBUS

6.3.2.1

MB_COMM_LOAD
LAD

FBD
MB_COMM_LOAD

(Point-to-Point,
PtP) CM 1241 RS485 CM 1241
RS232
Modbus RTU.

PORT

IN

UInt

:
CM

PORT .
"Constants []"
.

BAUD

IN

UDInt

:
300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 76800, 115200

PARITY

IN

UInt

S7-1200

222

, 11/2009, A5E02669003-02


6.3

FLOW_CTRL

IN

UInt

:
0 ( )
1 RTS
( RS485)
2 - RTS

RTS_ON_DLY

IN

UInt

RTS:
0 ( ) RTS

1 65535 RTS
(
RS485). RTS
FLOW_CTRL.

RTS_OFF_DLY

IN

UInt

RTS:
0 ( )
RTS
1 65535
RTS (
RS485). RTS
FLOW_CTRL.

RESP_TO

IN

UInt

:
, MB_MASTER
slave-. slave-
, MB_MASTER
,
.
5 65535 ( = 1000 ).

MB_DB

IN

Variant

,
MB_MASTER MB_SLAVE. MB_SLAVE
MB_MASTER DB
MB_DB
.

ERROR

OUT

Bool

:
0
1 ,
STATUS

STATUS

OUT

Word

MB_COMM_LOAD
Modbus RTU.
Modbus, MB_SLAVE MB_MASTER.
MB_COMM_LOAD .
MB_COMM_LOAD ,
.
MB_COMM_LOAD OB ,

.
,
Modbus,
MB_COMM_LOAD.
MB_COMM_LOAD ,
. CPU S7-1200 3 .

S7-1200
, 11/2009, A5E02669003-02

223


6.3
, MB_MASTER
MB_SLAVE. ,
MB_DB MB_COMM_LOAD.

STATUS
(W#16#....)

0000

8180

ID

8181

8182

8183

8184

8185

MB_DB DB
MB_MASTER MB_SLAVE

S7-1200

224

, 11/2009, A5E02669003-02


6.3

6.3.2.2

MB_MASTER
LAD

FBD
MB_MASTER

master Modbus,
(Point-toPoint, PtP) CM 1241 RS485 CM
1241 RS232.

slave- Modbus.

, MB_MASTER
. MB_MASTER ,
MB_DB MB_COMM_LOAD.

REQ

IN

Bool

:
0
1 slave-(-) Modbus

MB_ADR

IN

USInt

Modbus RTU: : 0
247
0
slave- Modbus. Modbus 05, 06,
15 16 ,
.

MODE

IN

USInt

: : ,

Modbus.

DATA_ADDR

IN

UDInt

Slave-:
, slave-
Modbus.
Modbus.

DATA_LEN

IN

UInt

: ,
.
Modbus.

DATA_PTR

IN

Variant

: DB CPU
. DB
"NOT symbolic access only [ ]".
. DATA_PTR.

NDR

OUT

Bool

:
0
1 , MB_MASTER
slave-(-) Modbus

BUSY

OUT

Bool

:
0 MB_MASTER
1 MB_MASTER

ERROR

OUT

Bool

:
0
1 ,
STATUS

STATUS

OUT

Word

S7-1200
, 11/2009, A5E02669003-02

225


6.3

master- Modbus
MB_COMM_LOAD
, MB_MASTER .
master-
Modbus, MB_SLAVE.

MB_MASTER.
Modbus , ,
.
MB_MASTER .
master- Modbus
MB_MASTER slave-,
( MB_MASTER) ,
slave-.
MB_MASTER
OB ( OB ).

REQ
REQ =
REQ = slave-(-) Modbus.
,
, MB_MASTER. ,
, .

, .
MB_MASTER , ,
MB_MASTER ,
.
, FB MB_MASTER
REQ, ,
, . ,
, , MB_MASTER
REQ, .

S7-1200

226

, 11/2009, A5E02669003-02


6.3

DATA_ADDR MODE Modbus


DATA_ADDR ( Modbus Slave-):
, slave- Modbus.
MB_MASTER MODE. MODE
Modbus ,
Modbus.
MODE MBUS_MASTER, Modbus
Modbus.
Modbus MB_MASTER
DATA_ADDR

DATA_LEN
Modbus

Modbus
0

Modbus

00001 09999
10001 19999
30001 - 39999
40001 49999
400001 465536
()

1 2000
1 2000
1 125
1 125

01H
02H
04H
03H

00001 09999
40001 49999
400001 465536
()

1 ( )
1 ( )

05H
06H

2 1968
2 123

15H
16H

00001 09999
40001 49999
400001 465536
()

2
slave- Modbus
Modbus 05H 06H. 2
Modbus 15H 16H.

00001 09999

1 1968
15H
40001 49999

1 123
16H

400001

465536()

11
slave- Modbus,
MB_ADDR

slave- Modbus S7-1200 Siemens 1 ,


slave- ( )
master- Modbus.

, DATA_PTR.

DATA_LEN.

S7-1200
, 11/2009, A5E02669003-02

227


6.3

Modbus MB_MASTER
80
slave- Modbus,
MB_ADDR

NDR MB_MASTER , slave- Modbus


.

DATA_LEN.

81
( 11) slave- Modbus,
MB_ADDR

NDR MB_MASTER , slave- Modbus


.

DATA_LEN.

DATA_PTR
DATA_PTR (
CPU S7-1200) , , ,
. MB_MASTER master Modbus, ,
slave- Modbus.

DATA_PTR ,
Symbolic Access Only [
].
"Symbolic address only",
, DB .

S7-1200

228

, 11/2009, A5E02669003-02


6.3

DATA_PTR
Modbus 30001
39999, 40001 49999 400001 465536,
Modbus 40001 49999 400001 465536.
WORD, UINT INT, .
WORD, UINT INT,
16- .
,
16- 32- .
Modbus 00001 09999 10001
19999.
Bool.

Bool.
, ,
MB_MASTER
. ,
, MB_MASTER
.
, DATA_PTR
.
Modbus,
Modbus .
1 [1
##]. 0 [0 ###]
0 1.

S7-1200
, 11/2009, A5E02669003-02

229


6.3

MB_MASTER, DATA_PTR
4
6 Modbus.
,
.
,
.
HR_DB
(. 237).
MB_MASTER
DATA_PTR, .
, , MB_MASTER
DATA_PTR.
,
MB_MASTER.

S7-1200

230

, 11/2009, A5E02669003-02


6.3

Modbus.
.
1: MB_MASTER 3
Modbus 40001 slave- Modbus,
.
40001 "Data".Array_1[1].
40002 "Data".Array_1[2].
40003 "Data".Array_1[3].
2: MB_MASTER 4
Modbus 40015 slave- Modbus,
.
40015 "Data".Array_1[1].
40016 "Data".Array_1[2].
40017 "Data".Array_1[3].
40018 "Data".Array_1[4].
3: MB_MASTER 2
Modbus 30033 slave- Modbus,
.
30033 "Data".Array_2[1].
30034 "Data".Array_2[2].
4: MB_MASTER 4
Modbus 40050 slave- Modbus,
.
"Data".Array_3[1] Modbus 40050.
"Data".Array_3[2] Modbus 40051.
"Data".Array_3[3] Modbus 40052.
"Data".Array_3[4] Modbus 40053.
5: MB_MASTER 3
Modbus 40001 slave- Modbus,
.
"Data".Array_3[1] Modbus 40001.
"Data".Array_3[2] Modbus 40002.
"Data".Array_3[3] Modbus 40003.
6: MB_MASTER 11 (
) slave Modbus, .
"Data".Array_4[1].

S7-1200
, 11/2009, A5E02669003-02

231


6.3

, DATA_PTR
6-1. 7: 4 , Modbus 00001

MB_MASTER

slave- Modbus

MB_ADDR

27 ( slave)

00001

ON

MODE

0 ()

00002

ON

DATA_ADDR

00001 ()

00003

OFF

DATA_LEN

00004

ON

DATA_PTR

"Data".Array_4

00005

ON

00006

OFF

00007

ON

00008

OFF

"Data".Array_4[1] Modbus

xxxx-1011

xxxx-xxxx

x ,

6-2. 8: 12 , Modbus 00003



MB_MASTER

slave- Modbus

MB_ADDR

27 ( slave)

00001

MODE

0 ()

DATA_ADDR

00003 ()

DATA_LEN

12

00004

ON

00013

ON

DATA_PTR

"Data".Array_4

00005

ON

00014

OFF

00006

OFF

00015

ON

00007

ON

00016

ON

ON

00010

ON

00002

ON

00011

OFF

00003

OFF

00012

OFF

00008

ON

00017

OFF

00009

OFF

00018

ON

"Data".Array_4[1] Modbus

1011-0110

xxxx-0100-

x ,

S7-1200

232

, 11/2009, A5E02669003-02


6.3
6-3. 9: 5 , Modbus 00001

MB_MASTER
MB_ADDR
27 ( slave)
MODE
1 ()
DATA_ADDR
00001 ()
DATA_LEN
5
DATA_PTR
"Data".Array_4

slave
00001
ON

slave
OFF

00002
00003
00004
00005
00006
00007
00008
00009

ON
ON
OFF
ON



ON
OFF
ON
ON
OFF
ON
ON
OFF

"Data".Array_4[1] Modbus


xxx1-0110
xxxxx-xxxx
x , Modbus

6-4. 10: 22 , Modbus 00003



MB_MASTER
MB_ADDR
27 ( slave)
MODE
0 ()
DATA_ADDR
00003 ()
DATA_LEN
22
DATA_PTR
"Data".Array_4

slave- Modbus
00001

ON

00014

ON

00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013

ON
OFF
ON
ON
OFF
ON
ON
ON
OFF
OFF
ON
OFF

00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026

OFF
ON
ON
OFF
ON
ON
OFF
ON
ON
OFF
OFF
ON

"Data".Array_4[1] Modbus

0111-0110

0110-1010

"Data".Array_4[2] Modbus

xx01-1011

xxxx-xxxx

x ,

S7-1200
, 11/2009, A5E02669003-02

233


6.3

,
DATA_PTR
Modbus
, DATA_PTR
, ,
, 1 1,
MB_MASTER.
, ,
8 ( ). ,
10 , STEP 7 Basic
16 (2 ) 10 .
1 [xxxx xxxx] 2 [---- --xx], x
, . Modbus
16 , 6
2, .

.
.

16 , 0.
1. ,
MB_MASTER.

S7-1200

234

, 11/2009, A5E02669003-02


6.3
11 12 Modbus .
6- 5 11: 5 , Modbus 00001

MB_MASTER

slave

DATA_PTR

slave

MB_ADDR

27 ( slave)

00001

ON

"Data".Bool[0]=

OFF

MODE

1 ()

00002

ON

"Data".Bool[1]=

ON

DATA_ADDR

00001 ()

00003

OFF

"Data".Bool[2]=

ON

DATA_LEN

00004

ON

"Data".Bool[3]-

OFF

DATA_PTR

"Data".Bool

00005

ON

"Data".Bool[4]=

00006

OFF

OFF

00007

ON

00008

OFF

6- 6 12: 15 , Modbus 00004


MB_MASTER

slave Modbus

MB_ADDR

27 ( slave)

00001

ON

MODE

0 ()

00002

ON

DATA_ADDR

00003 ()

00003

OFF

"Data".Bool[0]=

DATA_LEN

15

00004

ON

"Data".Bool[1]=

DATA_PTR

"Data".Bool

00005

ON

"Data".Bool[2]=

00006

OFF

"Data".Bool[3]-

00007

ON

Data".Bool[4]=

00008

ON

Data".Bool[5]=

00009

ON

Data".Bool[6]=

00010

OFF

Data".Bool[7]=

00011

OFF

Data".Bool[8]=

00012

ON

Data".Bool[9]=

00013

OFF

Data".Bool[10]=

00014

ON

Data".Bool[11]=

00015

OFF

Data".Bool[12]=

00016

ON

Data".Bool[13]=

00017

ON

Data".Bool[14]=

00018

OFF

00019

ON

DATA_PTR

S7-1200
, 11/2009, A5E02669003-02

235


6.3

STATUS
(W#16#....)

0000

80C8

(. RCVTIME MSGTIME) 0.

80D1

,
.
,
(CTS)
.

80D2

,
(DSR) (DCE).

80E0

, .

80E1

80E2

80E3

80E4

,
.

8180

8186

Modbus

8188

MODE slave,

8189

818A

818B

818C

DB DATA_PTR ( DB
)

8200

S7-1200

236

, 11/2009, A5E02669003-02


6.3

6.3.2.3

MB_SLAVE
MB_SLAVE
slave- Modbus,
(Point-to-Point, PtP) CM 1241 RS485 CM 1241 RS232. Master- Modbus
RTU , ,
MB_SLAVE.
MB_SLAVE ,
. ,
MB_DB MB_COMM_LOAD.
Modbus (1, 2, 4, 5 15)
.
Modbus CPU.

01
02
04
05
15

Modbus MB_SLAVE

10001

30001


8192

S7-1200
CPU

18192


Q0.0 Q1023.7

I0.0 I1023.7

30512

IW0 IW1022

8192

8192

Q0.0 Q1023.7
Q0.0 Q1023.7

Modbus (3, 6, 16)


Modbus . DB
, MB_HOLD_REG
MB_SLAVE.
Modbus DB MB_HOLD_REG .
Modbus MB_SLAVE

03

S7-1200

DB
CPU

DB
CPU

40001
49999

MB_HOLD_REG

1
9999

400001
465535
06

40001
49999

1
65535
MB_HOLD_REG

400001
465535
16

40001
49999
400001
465535

1
9999
1
65535

MB_HOLD_REG

1
9999
1
65535

S7-1200
, 11/2009, A5E02669003-02

237


6.3
, Modbus.
Modbus MB_SLAVE S7-1200


08
0000H
: MB_SLAVE master Modbus .
08
000AH
: MB_SLAVE
, 11 Modbus.
11
: MB_SLAVE

Modbus , slave Modbus. 8, 11
. ,
(,
CRC).

MB_SLAVE master Modbus, .


, , MB_SLAVE
master- Modbus .
LAD

FBD

MB_ADDR

IN

USINT

Modbus RTU ( 1 247):


slave- Modbus.

MB_HOLD_REG

IN

VARIANT

DB
Modbus. DB

DB. .
MB_HOLD_REG.

NDR

OUT

BOOL

:
0
1 , master-
Modbus

DR

OUT

BOOL

:
0
1 ,
master- Modbus

ERROR

OUT

BOOL

:
0
1 ,
STATUS .

STATUS

OUT

WORD

S7-1200

238

, 11/2009, A5E02669003-02


6.3

slave- Modbus
MB_COMM_LOAD ,
MB_SLAVE .
slave- master- Modbus,
MB_MASTER.
MB_SLAVE.
Modbus , ,
.
MB_SLAVE
.
MB_SLAVE ,
master- Modbus.
MB_SLAVE OB .


MB_SLAVE ,
master- Modbus, .
MB_SLAVE
, master- Modbus.
.

master-

= 3,5 1

slave-

- , master-
Modbus slave- Modbus.
Modbus, master Modbus. ( )
MB_SLAVE master Modbus. , MB_SLAVE
master- Modbus.

S7-1200
, 11/2009, A5E02669003-02

239


6.3

MB_HOLD_REG
MB_HOLD_REG
Modbus. DB ,
( ) master- Modbus.
,
,
MB_SLAVE.

Modbus
,
Symbolic Access Only [
].

"Symbolic address only",

DB:



,
MB_HOLD_REG DB.

S7-1200

240

, 11/2009, A5E02669003-02


6.3

1 -

.
(INT UINT).
:


.
.


( "HR_DB"."Array"[1]
"HR_DB"."Array"[10]),
.
.

.

, MB_HOLD_REG
MB_SLAVE.

S7-1200
, 11/2009, A5E02669003-02

241


6.3
,
.
, Modbus 40002.

, ,
MB_SLAVE
Modbus. , 10 ,
10 Modbus,
MB_SLAVE master Modbus.
Modbus.
"HR_DB".Array[1]
Modbus 40001
" HR_DB ". Array[2]
Modbus 40002
" HR_DB ". Array[3]
Modbus 40003
...
...
" HR_DB ". Array[9]
Modbus 40009
" HR_DB ".Array [10]
Modbus 40010

S7-1200

242

, 11/2009, A5E02669003-02


6.3

2 -

.
:

,
.

.

"HR_DB".Array[0],
"HR_DB".Data.Temp_1.

.
WORD, UINT INT.

,
MB_HOLD_REG MB_SLAVE .

S7-1200
, 11/2009, A5E02669003-02

243


6.3
,
.
, Modbus 40002.

Modbus.
"HR_DB".Data.Temp_1
Modbus 40001
"HR_DB".Data.Temp_2
Modbus 40002
"HR_DB".Data.Temp_3
Modbus 40003
"HR_DB".Data.Good_Count
Modbus 40004
"HR_DB".Data.Bad_Count
Modbus 40005
"HR_DB".Data.Rework_Count
Modbus 40006
"HR_DB".Data.Line_Stops
Modbus 40007
"HR_DB".Data.Avg_Time
Modbus 40008
"HR_DB".Data.Code_1
Modbus 40009
"HR_DB".Data.Code_2
Modbus 40010

S7-1200

244

, 11/2009, A5E02669003-02


6.3

3 -

.
:


.
,
.

,
.
Master- Modbus
, slave Modbus. ,
Temp_1 4- .
master-

.

.

"HR_DB".Array[0],
"HR_DB".Data.Temp_1.

.
.

Modbus.
"HR_DB".Data.Temp_1
Modbus 40001 40002
"HR_DB".Data.Temp_2
Modbus 40003 40004
"HR_DB".Data.Good_Count
Modbus 40005 40006
"HR_DB".Data.Bad_Count
Modbus 40007 40008
"HR_DB".Data.Rework_Count
Modbus 40009 40010
"HR_DB".Data.Line_Stops
Modbus 400011
"HR_DB".Data.Avg_Time
Modbus 400012
"HR_DB".Data.Long_Code
Modbus 40013 40014
"HR_DB".Data.Code_1
Modbus 40015
"HR_DB".Data.Code_2
Modbus 40016

S7-1200
, 11/2009, A5E02669003-02

245


6.3
CPU S7-1200, master- Modbus,
MB_MASTER
CPU S7-1200, slave- Modbus.
master- Modbus 16
HR_DB slave- ProcessData master, .

slave-
Modbus Data_PTR master Modbus.

S7-1200

246

, 11/2009, A5E02669003-02


6.3

STATUS
(W#16#....)

80C8

(. RCVTIME MSGTIME) 0

80D1

,
.
,
(CTS)
.

80D2

,
(DSR) (DCE)

80E0

80E1

80E2

80E3

80E4

8180

8186

Modbus

8187

DB MB_HOLD_REG

818C

DB MB_HOLD_REG ( DB
)
,

master-
Modbus (B#16#..)

8380

CRC

8381

01

8382

8383

02

8384

03

8385

03


( 08)

S7-1200
, 11/2009, A5E02669003-02

247

PROFINET

CPU S7-1200 PROFINET, Ethernet,


TCP/IP. CPU S7-1200
:
(Transport Control Protocol, TCP)
ISO on TCP (RFC 1006)
CPU S7-1200 CPU S7-1200,
STEP 7 Basic, -
,
TCP. PROFINET:

: ,
, -
CPU, CPU.
: ,
(, CPU, ,
).
:
,
CPU S7-1200

:
- ,
CPU S7-1200

: CPU
S7-1200 CPU S7-1200


:
,


Ethernet
CSM1277

S7-1200
, 11/2009, A5E02669003-02

249

PROFINET

Ethernet
- CPU.
Ethernet CPU
- . 4
Ethernet CSM1277 Siemens
CPU - . PROFINET CPU
S7-1200 Ethernet.

PROFINET
PROFINET CPU
.
3 -
CPU
1 (PG)
CPU
8 S7-1200 T (TSEND_C, TRCV_C, TCON, TDISCON, TSEN, TRCV)
3 CPU S7-1200,
CPU S7
CPU S7 GET PUT (S7-300 S7-400)
ETHx_XFER (S7-200).
S7-1200
T-.

(TSAP)
ISO TCP
"TCON"
,
:
ISO TSAP (): 01.00, 01.01, 02.00, 02.01, 03.00, 03.01
TCP (): 5001, 102, 123, 20, 21, 25, 34962, 34963, 34964, 80

S7-1200

250

, 11/2009, A5E02669003-02

PROFINET
7.1

7.1


CPU STEP 7
Basic.
CPU

:
/:

.

Ethernet;
Ethernet
.

7.1.1


PROFINET
CPU. CPU
(Auto-Cross-Over),
,
Ethernet. CPU
Ethernet .
CPU
:
1. CPU (. 26).
2. Ethernet PROFINET, .
3. Ethernet .

PROFINET

PROFINET .

S7-1200
, 11/2009, A5E02669003-02

251

PROFINET
7.1

7.1.2


CPU, TIA.
, CPU (. 78) .
CPU TIA.

7.1.3

IP-

7.1.3.1

IP-
,
(, , ),
IP- CPU
.
(ID) IP- ( ,
, 211.154.184.16), , IP- .
255.255.255.0; ,
,
(, 255.255.254.0), . ,
IP- ,
IP-.

, ,
IP- ,
IP-
. IP- IT-
, .
Ethernet/USB,
, IP-
CPU Ethernet/USB
.
IP- ( ) (, 211.154.184.16), ,
IP- . 255.255.255.0.
, IP- ,
IP-.

S7-1200

252

, 11/2009, A5E02669003-02

PROFINET
7.1

Ethernet/USB , CPU
.
.

IP-



(, ,
)

CPU

.

255.255.255.0; ,
,

(, 255.255.254.0),
.
,
IP ,
IP-.


Ethernet/USB


CPU



.

IP (
) (,
211.154.184.16),
, IP-
)

CPU
Ethernet/USB


.

IP (
) (,
211.154.184.16),
, IP-
)

CPU
Ethernet/USB
.

255.255.255.0. ,

IP- ,
IP-.

IP- "My
Network Places [ ]" ( )
IP-
:
( ) "My Network Places [ ]"
"Properties []"
( ) "Local Area Connection [ ]"
"Properties []"
"Local Area Connection Properties [ ]"
"This connection uses the following items: [
]" "Internet Protocol (TCP/IP)". "Internet Protocol
(TCP/IP)", "Properties []". "Obtain an IPaddress automatically (DHCP) [ IP- (DHCP)]" "Use the
following IP-address [ IP-]" ( IP).

(Dynamic Host Configuration Protocol,


DHCP) IP-
DHCP.

S7-1200
, 11/2009, A5E02669003-02

253

PROFINET
7.1

IP- "ipconfig"
"ipconfig /all"
IP- , ,
, IP- IP- ()
:
"Start []" ( )
"Run []"
"Run" "Open []" "cmd"
"OK". "C:\WINDOWS\system32\cmd.exe"
"ipconfig". :

"ipconfig /all".
Ethernet-
(MAC):

IP- CPU
IP- CPU :
IP- online
IP-

S7-1200

254

, 11/2009, A5E02669003-02

PROFINET
7.1

7.1.3.2

IP- online
IP- online.
.
IP- online :
1. (Project
tree) , CPU
IP-,
:
"Online access [
]"
<
,
>
"Update accessible devices
[
]"

2.
:
"Online access [
]"
<
,
>
"Update accessible devices
[
]"
< >
"Online & diagnostics
[
]"

S7-1200
, 11/2009, A5E02669003-02

255

PROFINET
7.1

3. "Online &
diagnostics"
:
"Functions []"
"Assign IP address
[ IP-]"

4. "IP-address"
IP-.

5. (Project
tree) ,
IP- CPU,

:
"Online access [
]"
< ,

>
"Update accessible devices
[
]"

S7-1200

256

, 11/2009, A5E02669003-02

PROFINET
7.1

7.1.3.3

IP-

PROFINET
CPU (. 252),
PROFINET.
PROFINET CPU, PROFINET. "Properties
[]" PROFINET.

PROFINET

IP-
Ethernet (MAC-): PROFINET
MAC- (Media Access Control address [
]). MAC-
, (-)
(:) (, 01-23-45-67-89-AB 01:23:45:67:89:AB).
IP-: (Internet
Protocol, IP).
.
IP- 8-
(, 211.154.184.16).
IP- (
?), (
). IP- 192.168.x.y
, ,
.
:
.
(). ( )
IP-.
255.255.255.0 .
, IP- 3 ,
(8-
). 255.255.255.0 IP 192.168.2.0 192.168.2.255
.

. , IP.

S7-1200
, 11/2009, A5E02669003-02

257

PROFINET
7.1
IP-: .
, ,
, , , .
,
,
.
IP-.
IP-:
Properties []

"Ethernet
address [ Ethernet]".
TIA


Ethernet,


IP- CPU,
.

CPU IP-. IP-


CPU . CPU ,
IP- . IP- ,
.
" IP-
".
IP-:

Subnet
[]

IP protocol

, . "Add new
subnet [ ]", .
"Not connected [ ]".
:

"Not connected"
.

, .

IP address [IP-]

IP- CPU

Subnet mask [
]

Use IP router
[ IP]

, IP

Router address [
]

IP- ,

S7-1200

258

, 11/2009, A5E02669003-02

PROFINET
7.1

7.1.4

PROFINET
CPU. IP-
.

S7-1200
, 11/2009, A5E02669003-02

259

PROFINET
7.1

IP- online
CPU S7-1200 IP-. IP- CPU
.
IP- online ,
" IP- online".
IP- IP-
, .
" IP-
".

IP- online, IP-


online, offline.
IP- offline,
IP-, ,
offline.
"Online access [ ]" IP-
CPU, .

Ethernet
IP- CPU S7-1200 Ethernet

.
, IP- CPU S7-1200.

S7-1200

260

, 11/2009, A5E02669003-02

PROFINET
7.1

"Extended download to device"



CPU S7-1200 "Download to device [ ]"
"Extended download to device [ ]"
,
IP-.
MAC- IP- "Show all
accessible devices [ ]".

,
- .
/ .

S7-1200
, 11/2009, A5E02669003-02

261

PROFINET
7.2 -

7.2

-

CPU
PROFINET
- .
CPU
-

:
/:
PROFINET CPU
- .
-
.
-
CPU .
Ethernet; Ethernet
.

4 Ethernet CSM1277
Siemens CPU . PROFINET CPU S7-1200
Ethernet.
:
-
CPU.
, CPU, .

WinCC Basic STEP 7 Basic TIA.


-
WinCC Basic.

S7-1200

262

, 11/2009, A5E02669003-02

PROFINET
7.2 -

,
- CPU


PROFINET
- CPU. CPU
(Auto-Cross-Over),
,
Ethernet. - CPU
Ethernet .
"
: " (. 251).


"
. " (. 252).

CPU
"
- CPU (.
264).

IP-
;
IP- - CPU.
"
: IP- " (. 257).

PROFINET
CPU.
"
: PROFINET (. 259).

S7-1200
, 11/2009, A5E02669003-02

263

PROFINET
7.2 -

7.2.1


- CPU
CPU
.
"Devices & Networks [ ]" "Network
view [ ]"
. Ethernet
(Ethernet) CPU. Ethernet . , Ethernet-
.

"Network view
[ ]"
,
.

,
.

S7-1200

264

, 11/2009, A5E02669003-02

PROFINET
7.3

7.3


CPU
CPU , TSEND_C
TRCV_C.
CPU
:
/: .
: CPU
Ethernet; Ethernet
.

, CPU


PROFINET CPU.
CPU
(Auto-Cross-Over),
, Ethernet. CPU
Ethernet .
"
: ".


CPU .
"
: ".

CPU
"
CPU" (. 266).

IP-
;
IP- CPU (, _1 _2).
"
: IP- ".


TSEND_C TRCV_C CPU
.
"
" (. 267).

PROFINET
CPU.
"
: PROFINET".

S7-1200
, 11/2009, A5E02669003-02

265

PROFINET
7.3

7.3.1

CPU
CPU
.
"Devices & Networks [ ]" "Network
view [ ]"
. PROFINET
(PROFINET) . PROFINET
. , PROFINET- .

"Network view
[ ]"
,
.

,
.

S7-1200

266

, 11/2009, A5E02669003-02

PROFINET
7.3

7.3.2


CPU (T). CPU PROFINET,
.
,
.

7.3.2.1

TSEND_C

TSEND_C
TSEND_C (. 181) .
, ,
. TSEND_C
TCON, TDISCON TSEND.
STEP 7 , TSEND_C
.
"Communications []" "Extended Instructions [ ]".
"Call options [ ]",
DB TSEND_C.

S7-1200
, 11/2009, A5E02669003-02

267

PROFINET
7.3
,
.


Properties
[] TSEND_C.
, TSEND_C.


CPU PROFINET,
PROFINET. Ethernet
:

RFC 1006

ISO on TCP

TCP

Transport Control Protocol [


]

ISO on TCP (RFC 1006)


ISO on TCP - , ISO-
TCP/IP. :
,

( 8192 )
TCP,
.
;
(WAN)
.
- SEND / RECEIVE
.

S7-1200

268

, 11/2009, A5E02669003-02

PROFINET
7.3
(Transport Service Access
Point, TSAP) TCP IP- (
64K ). RFC 1006 TSAP
IP-.
"Address Details [ ]" Connection
Parameters [ ]
TSAP. TSAP CPU "Local TSAP [ TSAP]". TSAP,
CPU, "Partner TSAP
[TSAP ]".

General []
End point: Partner
[ :
]

, CPU ()

Interface []

Subnet []

Address []

IP-

Connection type [
]

Ethernet

Connection ID [ID
]

Connection data
[ ]

CPU

Active connection setup


[
]

CPU

Address details [ ]

TSAP1 (ASCII)

TSAP CPU ASCII

TSAP ID

TSAP CPU

CPU S7-1200 ISO on TCP


TSAP ASCII.

S7-1200
, 11/2009, A5E02669003-02

269

PROFINET
7.3
(Transport Control Protocol, TCP)
TCP , RFC 793: Transmission Control Protocol.
TCP ,
.
:
,

( 8192 )
, :



,
,
TCP

.
.
.
, , TELNET FTP,
TCP.
- SEND / RECEIVE
.

General []
End point: Partner [ : ]

, CPU ()

Interface []

Subnet []

Address []

IP-

Connection type [ ]

Ethernet

Connection ID [ID ]

Connection data [ ]


CPU

Active connection setup [


]


CPU

Address details [ ]
Port (decimal) [ ()]

CPU

S7-1200

270

, 11/2009, A5E02669003-02

PROFINET
7.3

7.3.2.2

TRCV_C

TRCV_C
TRCV_C (. 182) .
, ,
. TRCV_C
TCON, TDISCON, TRCV.
CPU STEP 7 Basic , TRCV_C
.
"Communications []" "Extended Instructions [ ]".
"Call options [ ]",
DB TRCV_C.

,
.

S7-1200
, 11/2009, A5E02669003-02

271

PROFINET
7.3


Properties
[] TRCV_C.
, TRCV_C.


CPU PROFINET,
PROFINET. Ethernet
:

RFC 1006

ISO on TCP

TCP

Transport Control Protocol [


]

ISO on TCP (RFC 1006)


ISO on TCP - , ISO-
TCP/IP. :
,

( 8192 )
TCP,
.
;
(WAN)
.
- SEND / RECEIVE
.
(Transport Service Access
Point, TSAP) TCP IP- (
64K ). RFC 1006 TSAP
IP-.

S7-1200

272

, 11/2009, A5E02669003-02

PROFINET
7.3
"Address Details [ ]" Connection
Parameters [ ]
TSAP. TSAP CPU "Local TSAP [ TSAP]". TSAP,
CPU, "Partner TSAP
[TSAP ]".

General []
End point: Partner
[ :
]

, CPU ()

Interface []

Subnet []

IP-

Connection type [
]

Ethernet

Connection ID [ID
]

Connection data
[
]

CPU

Active connection setup CPU


[
]

TSAP1 (ASCII)

TSAP CPU ASCII

TSAP ID

TSAP CPU

CPU S7-1200 ISO on TCP


TSAP ASCII.

S7-1200
, 11/2009, A5E02669003-02

273

PROFINET
7.3
(Transport Control Protocol, TCP)
TCP , RFC 793: Transmission Control Protocol.
TCP ,
.
:
,

( 8192 )
, :



,
,
TCP

.
.
.
, , TELNET FTP,
TCP.
- SEND / RECEIVE
.

General []
End point: Partner [ : ]

, CPU ()

Interface []

Subnet []

Address []

IP-

Connection type [ ]

Ethernet

Connection ID [ID ]

Connection data [ ]


CPU

Active connection setup [


]


CPU

Address details [ ]
()

CPU

S7-1200

274

, 11/2009, A5E02669003-02

PROFINET
7.4

7.4

7.4.1

Ethernet (MAC-) CPU


PROFINET MAC- (Media Access Control address)
, . MAC-
.
(IEEE 802.3) MAC-
, (-)
(:), (, 01-23-45-67-89-ab
01:23:45:67:89:ab).

CPU , MAC-.
MAC- CPU.
MAC- , CPU.
MAC-, .

MAC-

S7-1200
, 11/2009, A5E02669003-02

275

PROFINET
7.4
CPU IP-, MAC. PROFINET ,
IP-.
CPU
"Download to device [
]"
"Extended download to
device [
]",

,

IP.


MAC IP. MAC-

,

IP-.

S7-1200

276

, 11/2009, A5E02669003-02

PROFINET
7.4

7.4.2

(NTP)
(Network Time Protocol, NTP)

.
.
NTP
, .
NTP ,
, (). 1 ()
.
2 () , ,
1 .


Properties [] "Time synchronization [
]". TIA Time synchronization:

IP- , .
:

Enable time-of-day
,
synchronization using NTP mode
NTP.
[
, NTP]
Server 1

IP- 1

Server 2

IP- 2

Server 3

IP- 3

Server 4

IP- 4

Time synchronization interval


[
]

()

S7-1200
, 11/2009, A5E02669003-02

277

(PtP)

CPU (PtP)
,
. PtP
,
.
PtP
:

, ,
,
, -,

(RFID),



,
,
, GPS,

,
PtP-
(UART),
. RS232
RS485 (CM) PtP.
STEP 7 Basic ,
. PtP-
:
USS
master- Modbus RTU
slave- Modbus RTU

S7-1200
, 11/2009, A5E02669003-02

279

(PtP)
8.1 RS232 RS485

8.1

RS232 RS485
(CM) PtP-: CM 1241
RS485 (. 369) CM 1241 RS232 (. 370). CM
( ). CM CPU CM.
"" (. 30).
RS232 RS485 :






CPU. .

(. 369).

S7-1200

280

, 11/2009, A5E02669003-02

(PtP)
8.2

8.2


:
STEP 7 Basic
( ),
. CPU.

RUN STOP.
PORT_CFG, SEND_CFG
RCV_CFG. , , ,
CPU RUN. STOP

, .
(. 77)
, CM .
"Properties []"

CM. "Port configuration [
]"
:



( RS232)

,
,
,
RS232 RS485.
.
(
) PORT_CFG (.
294).

, PORT_CFG
, , STEP 7
Basic. , S7-1200 ,
PORT_CFG, .

: 9,6
. :
300
2,4 /
19,2 /
76,8 /

S7-1200
, 11/2009, A5E02669003-02

281

(PtP)
8.2

600
1,2 /

4,8 /
9,6 /

28,4 /
57,6 /

115,2 /

S7-1200

282

, 11/2009, A5E02669003-02

(PtP)
8.3
: .
:
No parity [ ]
Even [ ]
Odd [ ]
Mark ( 1)
Space ( 0)
: .
.
: RS232
,
" " (. 282). ,
, RTS RTS .
, ASCII
XON XOFF.
RS485 .
: ,
CTS RTS, XON
XOFF, .
, CTS XON,

. 0
65535 .

8.3



, . ,
,
.
. CM RS232 ,
. CM RS485 .
(. 281)
PORT_CFG.

(Request-to-send, RTS) (Clear-to-send, CTS). CM RS232
RTS 7, CTS 8. CM 1241
(Data Terminal Equipment, DTE),
RTS CTS .

S7-1200
, 11/2009, A5E02669003-02

283

(PtP)
8.3

: RTS
RTS
CM RS232, RTS .
CTS, ,
. CTS , ,
CTS . CTS ,
.
, CTS .
CTS ,
.
(. 281).
RTS ,
, . ,
RTS ""
. RTS
.
"RTS always on [RTS ]".

: RTS
"RTS always on" CM 1241 RTS
. , , RTS
CM .
CM, RTS , ..
CTS. RTS ,
CM.
CM ,
"RTS always on [RTS
]". , CM RTS
. CM ,
. ,
CM.

(Data Terminal Block


Ready, DTR) (Data Set Ready, DSR)
CM DTR
. , DSR
. DSR
. DSR ,



. ASCII,
XON XOFF.
XOFF , . XON ,
.
XOFF ,
. ,
XON. XON
, (. 281), CM
.
,
XOFF
, .
, ASCII.
.

S7-1200

284

, 11/2009, A5E02669003-02

(PtP)
8.4

8.4


PtP-,
. ,

.


CM
,
,
"Transmit message
configuration [
]"
CM.

, SEND_CFG (. 296).

, SEND_CFG
, . , CPU
, SEND_CFG,
.

RTS
. 0 65535 ,
0. ,
(. 281)
. CTS
RTS.
RS232.
RTS
RTS Off delay
. 0 65535 ,
[
0. ,
RTS]
(. 281)
.
RS232.
Send break at message ,
start [ RTS (
) CTS .
]
Number of bit times in a , ,
0. 12,
break [
65535 8 .
]
,
Send idle line after a
.
break [


]
"Idle line after a break" ,
Idle line after a break
[ , 1.
12, 65535 8 .
]
RTS On delay
[
RTS]

S7-1200
, 11/2009, A5E02669003-02

285

(PtP)
8.4



,


.
CM
"Receive message
configuration [
]".


, RCV_CFG (. 298).

, RCV_CFG ,
. , ,
RCV_CFG, CPU
.
RCV_CFG.

S7-1200

286

, 11/2009, A5E02669003-02

(PtP)
8.4


, .
, ,
,
.
.
, . ,
, CM
,
. - (
), CM
.
:



, ,
CM .

Start Character
character [

]

,
.
. ,
, .

Start on Any Character ,


[
.
]
.
Line Break [
]

,
.

Idle Line [
]

,
,
.
, .

Special condition:
Recognize message
start with single
[ :


]

,
. STX.

S7-1200
, 11/2009, A5E02669003-02

287

(PtP)
8.4

Special condition:
Recognize message
start with a character
sequence
[ :

,
.
5 .

,
.

, -
.
, .
5 ,

. ,
.

,
:

,
0x6A, 0x1C.
2, 3 4 .

.

0x6A,
.
0x6A (3
) , 0x6A,
.
,
:

< > 6A 6A

6A 12 14 18 1C

6A 44 A5 D2 1C

S7-1200

288

, 11/2009, A5E02669003-02

(PtP)
8.4


,
. .
, .
.
, . ,
300
, 40
50 . ,
300 ,
40 , 50 .

Recognize message
end by message
timeout [


]
Recognize message
end by response
timeout [


]
Recognize message
end by inter-character
gap [


]
Recognize message
end by max length
[

]
Read message length
from message
[

]
Recognize message
end with a character
[

]

,
.
,
.
200 , 0 65535 .
,
,
.
, .
200 , 0 65535 .
,
.
,

.
12 , 65535
, .
,
. 0
, 1024 .

. ,
.
.

, .

S7-1200
, 11/2009, A5E02669003-02

289

(PtP)
8.4

Recognize message
end with a character
sequence
[

,
.
, .

,
.

.
.

,
0x7A,
. ,
0x7A 0x7A, .
, 0x7A 0x7A,
.
4 5 , ,
.


,
, ,
.
.
:
n: ( 1) ,
Length size [ ]: (, )

Length m [ m]: ,



.

1: ,
:
3 14

STX

Len
(n)

ADR

STX

0x0C

xx

PKE
4

INDEX
5

xxxx

7
xxxx

PWD
8

STW
9

xxxx

10

11
xxxx

HSW
12

13
xxxx

BCC
14
xx

S7-1200

290

, 11/2009, A5E02669003-02

(PtP)
8.5 PtP
:
n = 2 ( 2)
= 1 ( )
m = 0 ( ,
. 12
)
3 14 ,
Len (n).
2: ,
:
SD1

Len
(n)

Len
(n)

SD2

5 10

DA

SA

FA

FCS ED

=3

10

11

12

xx

0x06

0x06

xx

xx

xx

xx

xx

xx

xx

xx

xx

:
n = 3 ( 3)
= 1 ( )
m = 3 ( ,
. SD2,
FCS ED .
; ,
)
5 10 ,
Len (n).

8.5

PtP
STEP 7 Basic ,

(Point-to-Point, PtP) ,
. :



PtP,
.

PORT_CFG

SEND_CFG

RCV_CFG
:

S7-1200
, 11/2009, A5E02669003-02

291

(PtP)
8.5 PtP


PtP
.

(. 96).
PtP .
.
SEND_PTP RCV_PTP .

1024 .
,
PtP,
. ,

.

,
RS232.

8.5.1

SEND_PTP
RCV_PTP

RCV_RST
SGN_GET
SGN_SET


S7-1200
/ .
, .

: master-
master- :
1. SEND_PTP .
2. SEND_PTP ,
.
3. SEND_PTP , ,
.
4. RCV_PTP .
CM RCV_PTP CPU
, .
5. .
6. 1 .

S7-1200

292

, 11/2009, A5E02669003-02

(PtP)
8.6

: slave-
slave- :
1. RCV_PTP .
2. CM , RCV_PTP ,
, CPU.
3. .
4. master- SEND_PTP.
5. SEND_PTP , ,
.
6. 1 .
Slave- RCV_PTP,
master-,
.
RCV_PTP OB,
master-, .
OB , master , ,
.

8.6

8.6.1


(CM) :
: ,
CPU. CPU CM.
. , CPU
CM, .
, CPU. CPU

.
: .
, .
: ,
.

S7-1200
, 11/2009, A5E02669003-02

293

(PtP)
8.6



.
.
, , 65535.
, S7-1200, 8 .

REQ
PtP REQ,
. REQ 1 ()
,
, . ,
REQ, ,
REQ. ,
.
PtP,
DB. DB
PtP. , SEND_PTP
DB, SEND_PTP RCV_PTP
DB. , , , REQ,
.

PORT
( PORT)
CM .
"hardware identifier [ ]"
CM.

NDR, DONE, ERROR, STATUS


DONE , .
.
NDR ( ) ,
.
.
ERROR , .
.
STATUS
.
DONE NDR, STATUS 0
.
ERROR , STATUS .
,
, , ,
"".

S7-1200

294

, 11/2009, A5E02669003-02

(PtP)
8.6


STATUS
(W#16#....)

0000

8.6.2

8x3A

8070

8080

8081

8082

8083

:
CM ,
.

8090

8091

8092

PORT_CFG
PORT_CFG ( )
, , ,
.


.
PORT_CFG
. ,
PORT_CFG,
CPU. ,
, , CPU
RUN STOP,
.

(. 281)
(. 282).

REQ

IN

Bool

PORT

IN

PORT

:
,

"Constants" .

PROTOCOL

IN

UInt

0 -
1..n -

S7-1200
, 11/2009, A5E02669003-02

295

(PtP)
8.6

BAUD

IN

UInt

:
1 - 300
2 - 600
3 - 1200
4 - 2400
5 - 4800
6 - 9600
7 - 19200
8 - 38400
9 - 57600
10 - 76800
11 - 115200

PARITY

IN

UInt

:
1 -
2 -
3 -
4 -
5 -

DATABITS

IN

UInt

:
1 - 8
2 - 7

STOPBITS

IN

UInt

:
1 - 1
2 - 2

FLOWCTRL

IN

UInt

:
1 -
2 - XON/XOFF
3 , RTS
4 - , RTS

XONCHAR

IN

Char

,
XON. DC1 (11H).
,
.

XOFFCHAR

IN

Char

,
XOFF. DC3 (13H).
,
.

XWAITIME

IN

UInt

, XON
XOFF,
CTS RTC
( 0 65535 ).
,
.

DONE

OUT

Bool

ERROR

OUT

Bool

STATUS

OUT

Word

S7-1200

296

, 11/2009, A5E02669003-02

(PtP)
8.6

8.6.3

STATUS
(W#16#....)

80A0

80A1

80A2

80A3

80A4

80A5

80A6

80A7

XON XOFF

SEND_CFG
SEND_CFG ( )

.
,
(CM), ,
SEND_CFG.


.
SEND_CFG .
, SEND_CFG,
. , ,
, RUN STOP,
.
. (. 284).

REQ


IN
Bool

PORT

IN

PORT

RTSONDLY

IN

UInt



:
,

"Constants" .

RTS,
Tx-.
,
. 0 65535 .
0 .

S7-1200
, 11/2009, A5E02669003-02

297

(PtP)
8.6

RTSOFFDLY


IN
UInt

BREAK

IN

UInt

IDLELINE

IN

UInt

DONE

OUT

Bool

ERROR

OUT

Bool

STATUS

OUT

Word

STATUS
(W#16#....)
80B0
80B1
80B2


Tx-, RTS
:
,
. 0 65535 .
0 .
,

.
65535. 0
. 8
,


.
65535. 0 . 8

,

,


(2500 )
(2500 )

S7-1200

298

, 11/2009, A5E02669003-02

(PtP)
8.6

8.6.4

RCV_CFG
RCV_CFG ( )

.
,
. ,
(CM),
, RCV_CFG.

.
RCV_CFG .
, RCV_CFG,
. , ,
, RUN STOP,
.
" " (. 285).

REQ

IN

Bool

PORT

IN

PORT

:
,

"Constants"
.

CONDITIONS

IN

CONDITIONS


.
.

DONE

OUT

Bool

ERROR

OUT

Bool

STATUS

OUT

Word

S7-1200
, 11/2009, A5E02669003-02

299

(PtP)
8.6

RCV_PTP
RCV_PTP , RCV_CFG,
.
.
.
,
. :
" " ,
. .
, , .
" " ,
. .
" " ,
.
" " ,
,
. ,
.

" ":
(
4), ( 5).

, (""),
.
,
.
, : "68 10 aa
68 bb 10 aa 16" ,
. ,
68H.
( 68H) 1.
, .
-
,
. ,
, .

+1

+2

+3

+4

68H

xx

xx

68H

xx

10H

aaH

xx

xx

xx

dcH

aaH

xx

xx

xx

e5H

xx

xx

xx

xx

S7-1200

300

, 11/2009, A5E02669003-02

(PtP)
8.6

RCV_PTP
.

. :
" " ,
, RCVTIME.
, ,
. ,
RCVTIME, RCV_PTP
.
. , -
.
.

" " ,
, MSGTIME.
, .

" " ,
( ) .

, .

S7-1200
, 11/2009, A5E02669003-02

301

(PtP)
8.6

" ": ,
.
.

,
,
. ,
.
"N + + M".
,
.
"N" ( ),
. ( 1)
" " .
1, 2 4 .
" M" ( ),
.
,

,
, , , ,
.
"" N. N 3 ,
.
1, ,
.
" M". " M" 3,
.

M
(N)
(1)
(2)
... (x)
x+1 x+2 x+3
(3)
xx

xx

xx

xx

xx

xx

xx

xx

:
.
( 5).

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

S7-1200

302

, 11/2009, A5E02669003-02

(PtP)
8.6

CONDITIONS, 1 ( )

STARTCOND

IN

UInt

01H

02H

04H -

08H

10H - 1

20H - 2

40H - 3

80H - 4

IDLETIME

IN

UInt


.
" ". 0 65535

STARTCHAR

IN

Byte

"
".

STRSEQ1CTL

IN

Byte

/
1:

01H - 1

02H - 2

04H - 3

08H - 4

10H - 5

,
.
STRSEQ1

IN

Char[5]

1, (5
)

STRSEQ2CTL

IN

Byte

/
2

STRSEQ2

IN

Char[5]

2, (5
)

STRSEQ3CTL

IN

Byte

/
3

STRSEQ3

IN

Char[5]

3, (5
)

STRSEQ4CTL

IN

Byte

/
4

STRSEQ4

IN

Char[5]

4, (5
)

S7-1200
, 11/2009, A5E02669003-02

303

(PtP)
8.6

CONDITIONS, 2 ( )

ENDCOND

IN

UInt

01H

02H

04H

08H

10H - N + + M

20H

MAXLEN

IN

UInt

:
,
.
0 1023

IN

UInt

.

N + + M. 1 1023

LENGTHSIZE

IN

UInt

(1, 2 4 ).
N + + M.

LENGTHM

IN

UInt

,
.

N + + M. 0 255

RCVTIME

IN

UInt

,
, .
,

.
" ". 0 65535
, 8

,
.

.

MSGTIME

IN

UInt

,

.
" ". 0
65535 .

CHARGAP

IN

UInt


.
,
.
"
". 0 65535 .

S7-1200

304

, 11/2009, A5E02669003-02

(PtP)
8.6

ENDSEQ1CTL

IN

Byte

/
1:

. 1
0, 2 1, , 5 4.

,
.

ENDSEQ1

IN

Char[5]

1, (5
)

STATUS
(W#16#....)

80C0

80C1

80C2

80C3

" ",
0 > 1024

80C4

, N >= 1023

80C5

, 1, 2 4

80C6

, M > 255

80C7

, > 1024

80C8

80C9

,
> 2500

80CA

, > 2500

80CB

,
""

80CC

( 4),
""

S7-1200
, 11/2009, A5E02669003-02

305

(PtP)
8.6

8.6.5

SEND_PTP
SEND_PTP (
) . SEND_PTP
CM. CPU
, CM
.

. CM ,
SEND_PTP, CM
.

REQ

IN

Bool


,
.

(CM) .

PORT

IN

PORT

:
,
"Constants"
.

BUFFER

IN

Variant


.

.

LENGTH

IN

UInt



0.

PTRCL

IN

Bool


,
Siemens,
CM.
= ,
(
)

DONE

OUT

Bool

ERROR

OUT

Bool

STATUS

OUT

Word

, DONE ERROR
. , DONE ERROR
,
. DONE ERROR ,
STATUS .

S7-1200

306

, 11/2009, A5E02669003-02

(PtP)
8.6
16#7001, (CM)
. SEND_PTP
16#7002, CM .
, CM 16#0000, .
SEND_PTP REQ = 0 16#7000 ( ).
REQ:
, ,
. ,
( STATUS).

, DONE STATUS
, REQ
( ), .

DONE, ERROR STATUS


.

STATUS
(W#16#....)

80D0

80D1

- CTS

80D2

- DSR
DCE

80D3

- ( 1024 )

7000

7001

( )

7002

(n- )

S7-1200
, 11/2009, A5E02669003-02

307

(PtP)
8.6

LENGTH DATA PTP_SEND


, PTP_SEND,
. DATA ,
. BOOL
BOOL.
LENGTH

DATA

LENGTH = 0

,
DATA. ,
LENGTH = 0.

LENGTH > 0

LENGTH
.
8088H.

LENGTH , ,
.
LENGTH .

LENGTH , ,
.
,
LENGTH.
LENGTH
. STATUS = 8088H, ERROR = 1,
.

.
LENGTH
, .
STRING ()
.
DATA
, LENGTH
.

S7-1200

308

, 11/2009, A5E02669003-02

(PtP)
8.6

8.6.6

RCV_PTP
RCV_PTP (
) , CM.
, CM CPU.

STATUS.
STATUS , NDR ERROR
. STATUS
CM. , ,
.
STATUS (
), , - ,
, , .
CM, ,
1 .
.

EN_R

IN

Bool

,
CM
. ,
CPU. EN_R
, CM
STATUS
, CPU.

PORT

IN

PORT

:
,
"Constants"
.

BUFFER

IN

Variant


.
,
.

.

NDR

OUT

Bool

,
.

ERROR

OUT

Bool

STATUS

OUT

Word

LENGTH

OUT

UInt

( )

STATUS
(W#16#...)

0000

80E0

80E1

80E2

S7-1200
, 11/2009, A5E02669003-02

309

(PtP)
8.6

8.6.7

STATUS
(W#16#...)

80E3

80E4

0094

0095

, -

0096

, -

0097

, -

0098

, "N+LEN+M"

0099

, - ,

RCV_RST
RCV_RST ( )
CM.

REQ

IN

Bool

PORT

IN

PORT

:
,
.

DONE

OUT

Bool


, ,
.

ERROR

OUT

Bool

, ,
.
, ,
STATUS
.

STATUS

OUT

Word

S7-1200

310

, 11/2009, A5E02669003-02

(PtP)
8.6

8.6.8

SGN_GET
SGN_GET ( RS232)
RS232.

RS232 (CM).

REQ

IN

Bool

RS232

PORT

IN

PORT

:
,
"Constants"
.

NDR

OUT

Bool

ERROR

OUT

Bool

STATUS

OUT

Word

DTR

OUT

Bool

, ()

DSR

OUT

Bool

,
()

RTS

OUT

Bool

, ()

CTS

OUT

Bool

,
()

DCD

OUT

Bool

,
( 0, )

RING

OUT

Bool

,
( 0, )

STATUS

(W#16#....)
80F0

CM RS485

80F1

80F2

(DSR) ,
(DTE)

80F3

(DTR) ,
(DCE)

S7-1200
, 11/2009, A5E02669003-02

311

(PtP)
8.6

8.6.9

SGN_SET
SGN_SET ( RS232)

RS232.
RS232 (CM).

REQ

IN

Bool

RS232

PORT

IN

PORT

:
,
"Constants"
.

SIGNAL

IN

Byte

, : (
)

01H = RTS

02H = DTR

04H = DSR

RTS

IN

Bool

,
, ( )

DTR

IN

Bool

,
, ( )

DSR

IN

Bool

(
DCE) ( )

DONE

OUT

Bool

ERROR

OUT

Bool

STATUS

OUT

Word

STATUS
(W#16#....)

80F0

CM RS485

80F1

80F2

(DSR) ,
(DTE)

80F3

(DTR) ,
(DCE)

S7-1200

312

, 11/2009, A5E02669003-02

(PtP)
8.7

8.7

PtP
PtP , :

DONE

Bool

,
.

ERROR

Bool

,
,
STATUS.

STATUS

Word

, ,
. STATUS

.

80Ax

80Bx

80Cx

80Dx

80Ex

80Fx

0x80A0

0x80A1

0x80A2

0x80A3

0x80A4

0x80A5

S7-1200
, 11/2009, A5E02669003-02

313

(PtP)
8.7

0x80B0

0x80B1

0x80B2

0x80B3

0x80B4

0x80B5

0x80C0

0x80C1

0x80C3

0x80C4

N (. N+LEN+M)

0x80C5

(. MAXLEN N+LEN+M)

0x80C6

M (. N+LEN+M)

0x80C7

N- LEN -M (. N+LEN+M)

0x80C8

,
. (. RCVTIME
MSGTIME)

0x80C9

(. CHARGAP)

0x80CA

(. )

0x80CB


""

0x80CC


""

0x80F0

RS485

0x80F1

RS232,
,

0x80F2

DSR ,
DTE

S7-1200

314

, 11/2009, A5E02669003-02

(PtP)
8.7

CP

0x80D0

0x80D1

,
(CTS)

0x80D2

,
(DSR) DCE

0x80D3

CP

0x7000

0x7001

0x7002

(
)

0x80E0

0x80E1

0x80E2

0x80E3

0x80E4

0x0094

,
(MAXLEN)

0x0095

,
(MSGTIME)

0x0096

,
(CHARGAP)

0x0097

,
(RCVTIME)

0x0098

, "n+len+m"
(N+LEN+M)

0x0099

,
(ENDSEQ)

S7-1200
, 11/2009, A5E02669003-02

315

(PtP)
8.7

0x8n3A

0x8070

0x8080

0x8082

0x8083

. CM , .

0x8085

LEN 0 ,

0x8088

LEN , , DATA

S7-1200

316

, 11/2009, A5E02669003-02



9.1


CPU /
/. CPU
:
STOP/RUN
STOP
RUN
( ) , CPU

ERROR
, , CPU,
( )

MAINT () , .
CPU STOP. CPU STOP,
,
:
CPU RUN
(MRES)
CPU

STOP/RUN
/

ERROR

MAINT

(
)

STOP

()

RUN

()

()

(
)

(
)

()

(
)

, ,


CPU

S7-1200
, 11/2009, A5E02669003-02

317


9.1
CPU ,
PROFINET. ,
PROFINET.
Link [] () , ,

Rx/Tx () ,
CPU (SM)
/ .
/ () ,
.
, SM DIAG,
:
,
,
SM /
.
,

, SM DIAG,
:
,
,
SM ( ,
).

DIAG
( /
)

/
( /
)

()

()

/ ( )

/ (
)

()

S7-1200

318

, 11/2009, A5E02669003-02


9.2 CPU

9.2

CPU

, ,
, :

CPU
CPU




"Online tools [
]".




.

.
"Accessible Nodes
[ ]",
CPU,
.

"Go online [ ]", CPU


.

S7-1200
, 11/2009, A5E02669003-02

319


9.3 IP-

9.3

IP-

CPU IP- .
CPU
"Online & diagnostics
[ ]"
IP.

IP- (. 84).


CPU.

9.4

CPU
"CPU operator panel [ CPU]"
(STOP RUN) CPU:
, CPU
.
CPU
CPU.

S7-1200

320

, 11/2009, A5E02669003-02


9.5

9.5






CPU.

CPU


:

S7-1200
, 11/2009, A5E02669003-02

321


9.6 CPU

9.6

CPU
CPU.
:

CPU ( STOP RUN)

.


.

CPU.
50 .
10


. CPU

, .

S7-1200

322

, 11/2009, A5E02669003-02


9.7

9.7


, CPU .
(I Q),
(I_:P Q_:P), M DB
.
.
CPU.

.
.
.
, STOP.

:



, :
:

:

:
1. "Add new watch table
[ ]",
.
2. ,
.

:
Monitor all [ ]:

.
Monitor now [ ]:

.

.

S7-1200
, 11/2009, A5E02669003-02

323


9.7
:
"Modify to 0 [ 0]" "0".
"Modify to 1 [ 1]" "1".
"Modify now [ ]"
.
"Modify with trigger [ ]"
.
, ,
.
, "Modify now [ ]".
"Enable peripheral outputs [ ]"
, CPU
STOP.
CPU.


.

. CPU
"Monitor []"
"Monitor value [ ]".


,
.

:
, CPU
:
, CPU

:
, CPU
:
, CPU

STOP

: CPU STOP
: CPU
STOP

S7-1200

324

, 11/2009, A5E02669003-02


9.7

.
:
, CPU .
, ,
. ,
CPU ,
.
:
, , CPU ,
, .
,
, ,
. ,
, , .
, CPU STOP,
"Transition to STOP [ STOP]",
.

STOP
,
CPU STOP.
, ,
, ,
.

CPU STOP,
, .
STOP,
. ,
STOP.
STOP
"Enable peripheral outputs [ ]"
"Modify []" "Online"
.
CPU RUN "Enable peripheral outputs".
, CPU
STOP.
.

S7-1200
, 11/2009, A5E02669003-02

325


9.7

CPU
CPU
( ), (I_:P
Q_:P) .

.
. ,
.
.

, . ,
,
, CPU,
,
.
, CPU ,
, .
CPU ,
/
,
. ,
, .
,
CPU .

, HSC, PWM PTO,



, ,
(HSC), - (PWM)
(PTO), .
,

.

S7-1200

326

, 11/2009, A5E02669003-02


9.7

RUN
A

(Q)

CPU

,
(I).
.
B

CPU




.

(I).

C
OB CPU
(OB ), CPU

,
,



.
.

D




.
.

E


.
.

S7-1200
, 11/2009, A5E02669003-02

327


A.1


S7-1200
.
S7-1200
.

CE
S7-1200
EC
(EN)
,
.
2006/95/EC ( ) "
,
"
EN 61131-2:2007 -

2004/108/EC ( ) "
"

EN 61000-6-4:2007:

EN 61000-6-2:2005:
94/9/EC (ATEX) " ,

"
EN 60079-15:2005: 'n'

:
Siemens AG
IA AS RD ST Amberg
Werner-von-Siemens-Str. 50
D92224 Amberg
Germany

S7-1200
, 11/2009, A5E02669003-02

329


A.1

cULus

(Underwriters Laboratories Inc.)
Underwriters Laboratories [ ], Inc.:
UL 508 (
)
Canadian Standards Association [
]: CSA C22.2 142 (
)

SIMATIC S7-1200 CSA.


cULus , S7-1200
(Underwriters Laboratories, UL)
UL 508 CSA 22.2 No. 142.

FM
Factory Mutual Research [ ] (FM):
3600 3611
:
I, 2, A, B, C, D, T4A Ta
= 40 C
I, 2, IIC, T4 Ta = 40 C

ATEX
EN 60079-0:2006:
EN 60079-15:2005:
;
'n'
II 3 G Ex nA II T4

S7-1200:
,
IP54 EN 60529,
, .
70 C
, 80 C ,

.
,
40%
.

S7-1200

330

, 11/2009, A5E02669003-02


A.1

C-Tick
S7-1200
AS/NZS 2064 (Class A)


S7-1200
, ,
.
,
Siemens.
:
ABS (American Bureau of Shipping [ ])
BV (Bureau Veritas ( )
DNV (Det Norske Veritas [ ])
GL (Germanischer Lloyd [ ])
LRS (Lloyds Register of Shipping [ ])
Class NK (Nippon Kaiji Kyokai [ - ])


S7-1200
.

EN 61000-6-4:2007

EN 61000-6-2:2005

S7-1200
, 11/2009, A5E02669003-02

331


A.1


()
,
,
.
EN 61000-6-2
EN 61000-4-2

8
6

EN 61000-4-3

80 1000 , 10 /, 80%- 1
1-4 2,0 , 3 /, 80%- 1
2,0 2,7 , 1 /, 80%- 1

EN 61000-4-4

2 , 5
2 , 5

EN 6100-4-5

2 ,
1
- 2 ,
1
( /,
) .

EN 61000-4-6

150 80 , 10 , 80%- 1

EN 61000-4-11


0% 1 , 40% 12 70% 30
60

EN 61000-6-4

EN 55011, A, 1
0,15 0,5
0.5 5
5 30

<79 () ; <66 ()
<73 () ; <60 ()
<73 () ; <60 ()


EN 55011, A, 1
30 230
230 1

<40dB (/) ; 10
<47dB (/) ; 10

S7-1200

332

, 11/2009, A5E02669003-02


A.1


-
EN 60068-2-2, Bb,
EN 60068-2-1, Ab,

-40 C +70 C

EN 60068-2-30, Db,

25 C 55 C, 95%

EN 60068-2-14, Na,

-40 C +70 C, 3 , 2

EN 60068-2-32,

0,3 , 5 ,

1080 660 ( -1000 3500 )

-

( 25 )

0 C 55 C
0 C 45 C
95%

1080 795 ( -1000 2000 )

S02: < 0,5 ; H2S: < 0,1 ; . < 60%

EN 60068-2-14, Nb,

5 C 55 C, 3 C/.

EN 60068-2-27

15 g, 11 , 6 3

EN 60068-2-6

: 3,5 , 5-9 , 1 g, 9 - 150


: 7,0 , 5-9 , 2 g, 9 150
10 , 1


24 /5
115/230

115/230
115/230
115/230
24 /5

520 . (
)
1500 . /
1950 .
1500 . /
1950 .
1500 . /
3250 .


II EN 61131-2 ( )


IP20 , EN 60529
, ,
. ,
, < 12,5 .

S7-1200
, 11/2009, A5E02669003-02

333


A.1

24 .

20,4 . 28,8 .

120/230 .

85 . 264 . , 47 63

CPU S7-1200
, "1"
50 . , ,
, .


,
, .
. ,
, .
(x 103 )
250 . , ,
30 . ,
250 . ,
( = 0,4)
30 . ,
(L/R = 7 )
(A)

S7-1200

334

, 11/2009, A5E02669003-02


A.2 CPU

A.2

CPU

A.2.1

CPU 1211C

CPU 1211C
AC/DC/Relay

CPU 1211C
DC/DC/Relay

CPU 1211C
DC/DC/DC

(MLFB)

6ES7 211-1BD300XB0

6ES7 211-1HD300XB0

6ES7 211-1AD30-0XB0

370


()

90 x 100 x 75

420

380

10

( CM)

. 750 (5 . )

(24 . )

. 300 ( )


(24VDC)

4 /

CPU

25 / 1 /
2

6 /4

1024 (I) /1024 (Q)

(M)

4096

. 1 SB

. 3 CM

3
: 3 100
: 3 80

4 1

6 6 (10 10
)

SIMATIC ()

+/- 60 /

10 /. 6 40C (
)

0,1

12

18

S7-1200
, 11/2009, A5E02669003-02

335


A.2 CPU


(
)





CPU .
CPU

CPU
.
(.)

CPU 1211C
AC/DC/Relay

CPU 1211C
DC/DC/Relay

CPU 1211C
DC/DC/DC

1
Ethernet
3 -
1
8 Ethernet
3 CPU CPU
10/100 /
, 1500 .
CAT5e
85 264
.
47 63

20,4 28,8 .

60 120
.
30 240
.
180 120
.
90 240
.
20 A 264
.
1500 .

300 24 .

--

900 24 .

12 A 28,8 .

(

)
,
0,5 .

( ) 20 120
10 24 .
.
80 240
.
,
3 A, 250 ,



20,4 28,8
L+ . 4 .
.
(.)
300 ( )
< 1

(<10 )
( CPU

)


6

/ (IEC 1, )

24 . 4 ,

30 . , .

35 . 0,5 .
1 (.)
15 . 2,5
0 (.)
5 . 1

S7-1200

336

, 11/2009, A5E02669003-02


A.2 CPU

(
)


HSC
(.)
( 1 15 26
. )

( )

( )
(
)
( )



(
)
(25C / 0 55C)


( )


1 .
0 10

(.)




(
)

CPU 1211C
CPU 1211C
AC/DC/Relay
DC/DC/Relay
500 . 1

CPU 1211C
DC/DC/DC

1
0,2; 0,4; 0,8; 1,6; 3,2; 6,4 12,8 ( 4
)
: 100
: 80
6
500 , 300 , 50
HSC
2
()
0 10
0 27648 (.
(. 361))
27,649 32,511 (.
(. 361))
32,512 32767 (.
(. 361))
10
35 .
, , (.
(. 360) )
10, 50 60 (. (. 360)
)
100

3,0% / 3,5%
40 , 60
+12
-12
10 ,
4
,
5 30 . 5 250
.
---

- MOSFET
20,4 28,8 .
. 20 .
. 0,1 .

2,0 A
30 . / 200 .
. 0,2 ,

0,5 A
5
. 0,6

-7 A

. 10
. 8 100

1500 . 1
( )
( )

500 .
1

S7-1200
, 11/2009, A5E02669003-02

337


A.2 CPU

CPU 1211C
AC/DC/Relay

CPU 1211C
DC/DC/Relay

CPU 1211C
DC/DC/DC

. 100 ,

--

750 . 1

--

--

L+ 48 . ,
1

( Qa.0 Qa.3) . 10

. 1,0 , .
.
. 3,0 , .
.


(Qa.0 Qa.2)

. 100 ,
. 2

(
)

10 000 000 ./.

--

100 000 ./.

--

RUN
STOP

(
0)

( )

500 , 150

S7-1200

338

, 11/2009, A5E02669003-02


A.2 CPU

24 .
. A-1. CPU 1211C AC/DC/Relay (6ES7 211-1BD30-0XB0)

24 .
. A-2. CPU 1211C DC/DC/Relay (6ES7 211-1HD30-0XB0)

S7-1200
, 11/2009, A5E02669003-02

339


A.2 CPU

24 .
. A-3. CPU 1211C DC/DC/DC (6ES7 211-1AD30-0XB0)

A.2.2

CPU 1212C

(MLFB)

()


(SM
CM)
(24 .
)

(24 . )
CPU


/

/

(M)

CPU 1212C
AC/DC/Relay
6ES7 212-1BD30-0XB0

CPU 1212C
DC/DC/Relay
6ES7 212-1HD30-0XB0

90 x 100 x 75
425
385
11
9
. 1000 (5 . )

CPU 1212C
DC/DC/DC
6ES7 212-1AD30-0XB0

370

300 . ( )
4 /

25 / 1 /
2
8 /6
2
1024 (I)/1024 (Q)
4096
. 2 SM
. 1 SB

S7-1200

340

, 11/2009, A5E02669003-02


A.2 CPU

CPU 1212C
AC/DC/Relay
. 3 CM

CPU 1212C
DC/DC/Relay

CPU 1212C
DC/DC/DC

4
: 3 100 1 30
: 3 80 1 20

2
8

4 1


8 8 (12 12
)

SIMATIC ()
+/- 60 /
10 /. 6 40C (

)


0,1


12


18

Ethernet

3 -
1
8 Ethernet
3 CPU CPU

10/100 /
( , 1500 .
)

CAT5e


85 264 .
20,4 28,8 .


47 63
-80 120 . 400 24 .

CPU .
40 240 .
CPU

240 120 . 1200 24 .


CPU

.
120 240 .

(.)
20 A 264 .
12 A 28,8 .

( 1500 .

)
. 0,5
,


(
20 120 .
10 24 .
)

80 240 .

S7-1200
, 11/2009, A5E02669003-02

341


A.2 CPU

CPU 1212C
CPU 1212C
AC/DC/Relay
DC/DC/Relay
3 A, 250 ,

CPU 1212C
DC/DC/DC

20,4 28,8 .
L+ . 4 .

(.) 300 ( )

< 1

(<10 )

(
CPU
)


8

/ (IEC 1, )

24 . 4 ,

. 30 .


35 . 0,5 .
1 (.)
15 . 2,5
0 (.)
5 . 1
(
500 . 1
)
1

0,2; 0,4; 0,8; 1,6; 3,2; 6,4 12,8 ( 4 )
: 100 ( Ia.0 Ia.5) 30 ( Ia.6 Ia.7)
HSC
: 80 ( Ia.0 Ia.5) 20 ( Ia.6 Ia.7)
(.)
( 1 15 26
. )

8

( )
500 , 300 , 50
HSC


2

()

0 10
( )
0 27648 (
(361))

27,649 32,511 (
( )
(. 361))
( )
32,512 32767 (
(. 361))

10

35 .

, , (.
(. 358) )

10, 50 60 (. (. 360)
)

100
(

)
(25C / 0 55C)
3.0% / 3.5%

40 , 60

S7-1200

342

, 11/2009, A5E02669003-02


A.2 CPU


( )


1 .
0 10

(.)




(
)

CPU 1212C
CPU 1212C
CPU 1212C
AC/DC/Relay
DC/DC/Relay
DC/DC/DC
+12
-12
10,
6
,
5 30 . 5 250 .

---

MOSFET
20,4 28,8 .

. 20 .
. 0,1 .

2,0 A
30 DC / 200 AC
. 0,2 ,

0,5 A
5
. 0,6

-7 A

. 10
. 8 100

1500 . 1 (
)
( )
. 100 ,
750 . 1




2

-
( Qa.0
. 10
Qa.3)

500 .
1
---

10 000 000 ./.

1
L+ 48 . ,
1
. 1,0 , .
.
. 3,0 , .
.
. 50 , .
.
. 200 , .
.
. 100 ,
. 2
--

100 000 ./.

--

( Qa.4
Qa.5)

. 10


(Qa.0 Qa.2)
(
)


RUN
STOP

( )

( 0)
6
500 , 150

S7-1200
, 11/2009, A5E02669003-02

343


A.2 CPU

24 .
. A-4.CPU 1212C AC/DC Relay (6ES7 212-1BD30-0XB0)

24 .
. A-5. CPU 1212C DC/DC/Relay (6ES7 212-1HD30-0XB0)

S7-1200

344

, 11/2009, A5E02669003-02


A.2 CPU

24 .
. A-6. CPU 1212C DC/DC/DC (6ES7 212-1AD30-0XB0)

A.2.3

CPU 1214C

(MLFB)

()


(SM
CM)
(24 .
)

(24VDC)
CPU


/

/

(M)

CPU 1214C
AC/DC/Relay
6ES7 214-1BE30-0XB0

CPU 1214C
DC/DC/Relay
6ES7 214-1HE30-0XB0

110 x 100 x 75
475
435
14
12
. 1600 (5 . )

CPU 1214C
DC/DC/DC
6ES7 214-1AE30-0XB0

415

. 400 ( )
4 /

50 / 2 /
2
14 /10
2
1024 (I)/1024 (Q)
8192

. 8 SM

. 1 SB

S7-1200
, 11/2009, A5E02669003-02

345


A.2 CPU

CPU 1214C
AC/DC/Relay
. 3 CM

CPU 1214C
DC/DC/Relay

CPU 1214C
DC/DC/DC

6
: 3 100 3 30
: 3 80 3 20

2
14

4 1


12 12 (14 14
)

SIMATIC ()
+/- 60 /
10 /. 6 40C (

)


0,1


12


18

Ethernet

3 -
1
8 Ethernet
3 CPU CPU

10/100 /
( , 1500 .
)

CAT5e


85 264 .
20,4 28,8 .


47 63
-
CPU .
100 120 . 500 24 .
CPU

50 240 .

300 120 . 1500 24 .


CPU

.
150 240 .

(.)
20 A 264 .
12 A 28,8 .

( 1500 .

)
. 0,5
,


10 24 .
(
20 120 .
)

80 240 .

S7-1200

346

, 11/2009, A5E02669003-02


A.2 CPU

CPU 1214C
CPU 1214C
AC/DC/Relay
DC/DC/Relay
3 A, 250 ,

CPU 1214C
DC/DC/DC

20,4 28,8 .
L+ . 4 .

(.) 400 ( )

< 1

(<10 )
(

CPU
)


14

/ (IEC 1, )

24 . 4 ,

. 30 .


35 . 0,5 .
1 (.)
15 . 2,5
0 (.)
5 . 1
(
500 . 1
)
1

0,2; 0,4; 0,8; 1,6; 3,2; 6,4 12,8 ( 4 )
: 100 ( Ia.0 Ia.5) 30 ( Ia.6 Ib.5)
HSC
: 80 ( Ia.0 Ia.5) 20 ( Ia.6 Ib.5)
(.)
( 1 15 26
. )

14

( )
500 , 300 , 50
HSC


2

()

0 10
( )
0 27648 (
(. 361))

27,649 32,511 (
( )
(. 361))
( )
32,512 32767 (
(. 361))

10

35 .

, , (.
(. 360) )

10, 50 60 (. (. 360)
)

100

(
)

(25C / 0 55C)

3.0% / 3.5%

40 , 60

S7-1200
, 11/2009, A5E02669003-02

347


A.2 CPU

CPU 1214C
AC/DC/Relay

CPU 1214C
DC/DC/Relay

CPU 1214C
DC/DC/DC

+12
-12

( )

10,

10

MOSFET

5 30 . 5 250 .

20,4 28,8 .

1 .

--

. 20 .

0 10

--

. 0,1 .

(.)

2,0 A

0,5 A

30 . / 200 .

. 0,2 ,

. 0,6

--

. 10

7 A

. 8 100

(
)

1500 . 1 (
)
( )

500 .
1

. 100 ,

--

750 . 1

--

--

L+ 48 . ,
1

( Qa.0
Qa.3)

. 10

. 1,0 , .
.
. 3,0 , .
.

( Qa.4
Qb.1)

. 10

. 50 , .
.
. 200 , .
.


(Qa.0 Qa.2)

. 100 ,
. 2

(
)

10 000 000 ./.

--

100 000 ./.

--

RUN
STOP

( 0)

10

( )

500 , 150

S7-1200

348

, 11/2009, A5E02669003-02


A.2 CPU

24 .
. A-7. CPU 1214C AC/DC/Relay (6ES7 214-1BE30-0XB0)

24 .
. A-8. CPU 1214C DC/DC/Relay (6ES7 214-1HE30-0XB0)

S7-1200
, 11/2009, A5E02669003-02

349


A.2 CPU

24 .
. A-9. CPU 1214C DC/DC/DC (6ES7 214-1AE30-0XB0)

S7-1200

350

, 11/2009, A5E02669003-02


A.3 (SM)

A.3

(SM)

A.3.1

SM 1221

SM 1221 DI 8x24VDC

SM 1221 DI 16x24VDC

(MLFB)

6ES7 221-1BF30-0XB0

6ES7 221-1BH30-0XB0


()

45 x 100 x 75

170

210

1,5

2,5

( SM)

105

130

(24 . ) 4 /

4 /

/ (IEC 1, )

16

24 . 4 ,

. 30 .

35 . 0,5 .

1 (.)

15 . 2,5

0 (.)

5 . 1

(
)

500 . 1

0,2; 0,4; 0,8; 1,6; 3,2; 6,4 12,8 ( 4 )

( )

500 , 300

16

S7-1200
, 11/2009, A5E02669003-02

351


A.3 (SM)


SM 1221 DI 8 x 24 VDC

SM 1221 DI 16 x 24 VDC

6ES7 221-1BF30-0XB0
6ES7 221-1BH30-0XB0

S7-1200

352

, 11/2009, A5E02669003-02


A.3 (SM)

A.3.2

SM 1222

(MLFB)

()


( SM)
(24 . )


1 .
0 10

(.)




(
)




(.)


(
)


RUN
STOP

SM 1222
DQ 8xRelay
6ES7 222-1HF300XB0

SM1222
DQ 16xRelay
6ES7 222-1HH300XB0

45 x 100 x 75
190
260
4,5
8,5
120
135
11 /

SM1222
DQ 8x24VDC
6ES7 222-1BF300XB0

SM1222
DQ 16x24VDC
6ES7 222-1BH300XB0

180
1,5
120
--

220
2,5
140

8
16
,
5 30 . 5
250 .
---

8
16
- MOSFET
20,4 28,8 .

2,0 A
30 . /200 .
. 0,2 ,

0,5 A
5
. 0,6

-7 A

1500 . 1
(
)
( )
. 100 ,
750 . 1

2
4
10 A
--

. 10
. 8 100

. 10

. 20 .
. 0,1 .

500 . 1

--1
1
4A
8A
L+ 48 , 1

10 000 000 ./.

. 50 , . .
. 200 , . .
--

100 000 ./.

--

( 0)

16

( )

500 , 150

16

S7-1200
, 11/2009, A5E02669003-02

353


A.3 (SM)


SM 1222 DQ 8 x Relay

SM 1222 DQ 8 x 24 VDC

6ES7 222-1HF30-0XB0

6ES7 222-1BF30-0XB0

SM 1222 DQ 16 x Relay

SM 1222 DQ 16 x 24 VDC

6ES7 222-1HH30-0XB0

6ES7 222-1BH30-0XB0

S7-1200

354

, 11/2009, A5E02669003-02


A.3 (SM)

A.3.3

/ SM 1223

SM 1223 DI 8x24
VDC, DQ 8xRelay

SM 1223 DI 16x24 SM 1223 DI 8x24


VDC, DQ
VDC, DQ 8x24
16xRelay
VDC

(MLFB)

6ES7 223-1PH30- 6ES7 223-1PL300XB0


0XB0
()
45 x 100 x 75
70 x 100 x 75

230
350

5,5
10
( SM)
145
180
(24 . ) 4 /
11 /

SM 1223 DI 16x24
VDC, DQ16x24
VDC

6ES7 223-1BH30- 6ES7 223-1BL300XB0


0XB0
45 x 100 x 75
70 x 100 x 75
210
310
2,5
4,5
145
185
4 /

8
16
8
16
/ (IEC 1, )




1 (.)
0 (.)
(
)

24 . 4 ,
30 . .
35 . 0,5 .
15 . 2,5
5 . 1
500 . 1

( )

2
2
2
2
0,2; 0,4; 0,8; 1,6; 3,2; 6,4 12,8 ( 4 )
8
16
8
16
500 , 300
8
16
,
5 30 . 5
250 .

8
16
- MOSFET
20,4 28,8 .

1 .
0 10

---

20 . , .
0,1 . , .

(.)




(
)

2,0 A
30 DC / 200 AC
. 0,2 ,

0,5 A
5
. 0,6

-7 A

1500 . 1
(
)
( )

. 10
. 8 100

. 100 ,

500 . 1

--

S7-1200
, 11/2009, A5E02669003-02

355


A.3 (SM)

SM 1223 DI 8x24
VDC, DQ 8xRelay

SM 1223 DI 16x24 SM 1223 DI 8x24


VDC, DQ
VDC, DQ 8x24
16xRelay
VDC

750 . 1

--

10A

8A

4A

8A

--

L+ 48 , 1

. 10

. 50 . .
. 200 , . .

(
)

10 000 000 ./.

--

100 000 ./.

--

RUN
STOP

( 0)

( )

500 , 150

16

SM 1223 DI 16x24
VDC, DQ16x24
VDC

16

S7-1200

356

, 11/2009, A5E02669003-02


A.3 (SM)


SM 1223 DI 8 x 24 VDC, DQ 8 x Relay

SM1223 DI 16 x 24 VDC, DQ 16 x Relay

6ES7 223-1PH30-0XB0

6ES7 223-1PL30-0XB0

SM 1223 DI 8 x 24 VDC, DQ 8 x 24 VDC

SM 1223 DI 16 x 24 VDC, DQ 16 x 24 VDC

6ES7 223-1BH30-0XB0

6ES7 223-1BL30-0XB0

S7-1200
, 11/2009, A5E02669003-02

357


A.4 (SM)

A.4

(SM)

A.4.1

SM 1231, SM
1232, SM 1234

(MLFB)

()


( SM)
(24 .
)

( )
/

( )
/
( )



(
)
(25C / 0 55C)


SM 1231 AI 4x13bit

SM 1231 AI 8x13bit

6ES7 231-4HD30-0XB0

6ES7 231-4HF30-0XB0

SM 1234 AI 4x13bit
AQ 2x14bit
6ES7 234-4HE30-0XB0

45 x 100 x 75
180
1,5
80
45

45 x 100 x 75
180
1,5
90
45

45 x 100 x 75
220
2,0
80
60 ( )

4
8
4
(): 2
10 , 5 , 2,5 0 20
-27,648 27,648
: 32,511 27,649 / -27,649 -32,512
: 32,511 27,649 / 0 -4864
(
,
(. 361))
: 32,767 32,512 / -32,513 -32,768
: 32,767 32,512 / -4865 -32,768
(
,
(. 361))
12 +
35 / 40
, , (.
(. 360) )
400, 60, 50 10 (. (. 360)
)
9 () / 250 ()

0,1% / 0,2%
625 ( 400 )
40 , 60
+12
-12
100 ,

( )

/
1
1
1

,
)
(

,
)
24 .

1
+30 . -15 . ,
, , ,
.
S7-1200

358

, 11/2009, A5E02669003-02


A.4 (SM)

SM 1231 AI 4x13bit

SM 1231 AI 8x13bit

SM 1234 AI 4x13bit
AQ 2x14bit

SM 1232 AQ 2x14bit

SM 1232 AQ 4x14bit

SM 1234 AI 4x13bit
AQ 2x14bit

(MLFB)

6ES7 232-4HB30-0XB0

6ES7 232-4HD30-0XB0

6ES7 234-4HE30-0XB0

()

45 x 100 x 75

45 x 100 x 75

45 x 100 x 75

180

180

220

1,5

1,5

2,0

( SM)

80

80

80

45 ( )

60 ( )

(24 . ) 45 ( )

10 0 20

: 14 ; : 13

( )

: -27,648 27,648; : 0 27,648


(

) (. 362)

(25C / 0 55C)

0,3% / 0,6%

(95%
)

: 300 (R), 750 (1 ) ; : 600 (1 ), 2 (10 )

: 1000 ; : 600

RUN
STOP

( 0)

(
)

( )

100 ,

(
)

(
)

24 .

+30 . -15 . ,
, , ,
.

S7-1200
, 11/2009, A5E02669003-02

359


A.4 (SM)


()
0 10 , 95%

400

60

50

10

18

22

100

52

63

320

32

203

241

1200

61

400

483

2410

0,625

4,17

25

1,25

4,17

25

CPU ()
0 10 , 95%


60

50

10

63

65

130

84

93

340

221

258

1210

424

499

2410

4,17

25

S7-1200

360

, 11/2009, A5E02669003-02


A.4 (SM)

10

2,5

32767

7FFF

11,851

5,926

2,963

11,851

11,759

5,879

2,940

11,759

10

32512

7F00

32511

7EFF

0 10

27649

6C01

27648

6C00

10

2,5

20736

5100

7,5

3,75

1,875

361,7

180,8

90,4

-1

FFFF

-20736

AF00

-7,5

-3,75

-1,875

-27648

9400

-10

-5

-2,5

-11,759

-5,879

-2,940

-11,851

-5,926

-2,963

-27649

93FF

-32512

8100

-32513

80FF

-32768

8000

7,5
361,7

0 20
32767

7FFF

23.70

32512

7F00

32511

7EFF

23.52

27649

6C01

27648

6C00

20

20736

5100

15

723.4 nA

-1

FFFF

-4864

ED00

-4865

ECFF

-32768

8000


-3.52

S7-1200
, 11/2009, A5E02669003-02

361


A.4 (SM)

10

32767

7FFF

. . 1

32512

7F00

. . 1

32511

7EFF

11,76

27649

6C01

27648

6C00

10

20736

5100

7,5

361,7

-1

FFFF

-361,7

-20736

AF00

-7,5

-27648

9400

-10

-27649

93FF

-32512

8100

-11,76

-32513

80FF

. .1

-32768

8000

. . 1


,
. "Reaction to CPU STOP [
CPU STOP]" Use substitute value [
] Keep last value [ ].

20
32767

7FFF

. . 1

32512

7F00

. . 1

32511

7EFF

23.52

27649

6C01

27648

6C00

20

20736

5100

15

723.4

-1

FFFF

-32512

8100

-32513

80FF

. .1

-32768

8000

. . 1


,
. "Reaction to CPU STOP [
CPU STOP]" Use substitute value [
] Keep last value [ ].

S7-1200

362

, 11/2009, A5E02669003-02


A.4 (SM)


SM 1231 AI 4 x 13 Bit

SM 1231 AI 8 x 13 Bit

6ES7 231-4HD30-0XB0
6ES7 231-4HF30-0XB0
SM 1232 AQ 2 x 14 Bit

SM 1232 AQ 4 x 14 Bit

6ES7 232-4HB30-0XB0
6ES7 232-4HD30-0XB0

S7-1200
, 11/2009, A5E02669003-02

363


A.4 (SM)

SM 1234 AI 4 x 13 / AQ 2 x 14

6ES7 234-4HE30-0XB0

A.4.2 SM 1231 RTD TC


SM 1231 RTD
SM 1231 RTD
S7-1200.

SM 1231 AI 4 x RTD x 16 bit


6ES7 231-5PD30-0XB0

SM 1231 RTD ,
. .
, ,
27648.
, , 10.
(, 25,3 253).

S7-1200

364

, 11/2009, A5E02669003-02


A.4 (SM)
SM 1231 RTD

(MLFB)
()


( SM)
(24 . )
1

( )
/

( )
/
( )

24 VDC
24 VDC



( )

/
2
3
24 .

SM 1231 AI 4 x RTD x 16bit


6ES7 231-5PD30-0XB0
45 x 100 x 75
220
1.5 .
80 A
40
4
RTD
. RTD
. RTD
. RTD
. RTD
0.1 C/0.1 F
15
35 V
85 dB (10 , 50 , 60 , 60
400 )
10 M

500 VAC
500 VAC
500 VAC

. RTD
0.05%
0.5

.
100
20 , 2.7 10 RTD max.
> 120dB

20.4 28.8 VDC (Class 2, CPU)

S7-1200
, 11/2009, A5E02669003-02

365


A.4 (SM)
2

,
,
.
3
,
.
RTD

1231 RTD , :

RTD

Alpha

10
50
0.003850
100
ITS90
Pt
200
DIN EN 60751
500
1000
100
0.003902
200
Pt
0.003916
500
0.003920
1000
10
50
Pt
0.003910
100
500
100
120
0.006720
Ni
200
0.006180
500
1000
LG-Ni 0.005000
1000
Ni
0.006170
100
Cu
0.004270
10
10
Cu
0.004260
50
100
10
Cu
0.004280
50
100

150

300
600
:

-243.0C

-200.0C

850.0C

1000.0C

-243.0C

-200.0C

850.0C

1000.0C

25C


0C ..
55C

1.0C

2.0C

0.5C

1.0C

0.5C

1.0C

1.0C

2.0C

0.8C

1.6C

-273.2C

-240.0C

1100.0C

1295C

-105.0C

-60.0C

250.0C

295.0C

0.5C

1.6C

-105.0C
-240.0C

-60.0C
-200.0C

180.0C
280.0C

212.4C
312.0C

0.5C
0.7C
1.0C

1.0C
1.4C
2.0C

-60.0C

-50.0C

200.0C

240.0C

0.6C

1.2C

1.0C

2.0C

-240.0C

-200.0C

200.0C

240.0C

0.7C

1.4C

n/a
n/a
n/a

0
0
0

150
300
600

176.383 0.05%
352.767 0.05%
705.534 0.05%

0.1%
0.1%
0.1%

S7-1200

366

, 11/2009, A5E02669003-02


A.4 (SM)
32767 .
,
.

()

()

10
50
60
4001

100
20
16.67
10

4/2 ,
4- ,
()

3 ,
4- ,
()

1.222
0.262
0.222
0.142

2.444
0.524
0.444
0.284

, 400 ,
10 . 100
200 .
:
, -
. , 32767
.
.
SM 1231 AI 4 x RTD x 16bit
1. RTD
2. 2- RTD
3. 3- RTD
4. 4- RTD

S7-1200
, 11/2009, A5E02669003-02

367


A.4 (SM)
SM 1231 TC
SM 1231 TC
S7-1200.


SM 1231 TC 4 x 16 bit
6ES7 231-5QD30-0XB0
SM 1231 RTD ,
. .
, ,
27648.
, , 10.
(, 25,3 253).
SM 1231 TC
SM 1231 AI 4 x 16 Bit Thermocouple

6ES7 231-5QD30-0XB0
(MLFB)
45 x 100 x 75
()
180 .

1.5

80 A
( SM)
(24 . )
1

( )
/

( )
/
( )

24 VDC
24 VDC


( )

4
TC
.

: -27,648 27,648
: 32,511 27,649 / -27,49 -32,512
: 32,767 32,512 / -32,513 -32,768
0.1 C/0.1 F
15 +
35
85 dB 50 Hz/60 Hz/400 Hz
> 120dB 120 VAC
1 M
500 VAC
500 VAC
500 VAC
120 AC
.

0.5% FS
.

1.5C
100
S7-1200

368

, 11/2009, A5E02669003-02


A.4 (SM)
100

/
2
3
24 .
2

20.4 28.8 VDC (Class 2, CPU)


,
,
.
3
,
.
2



. .
; .
,

.
EM 1231 Thermocouple,
, , .
, , .
,
. ,
.
, .
.
,
.
. ,
. .
, .

.
SM 1231 Thermocouple

1231 , :

J
K
T
E

-210.0C
-270.0C
-270.0C
-270.0C

-150.0C
-200.0C
-200.0C
-100.0C

1200.0C
1300.0C
400.0C
1000.0C



25C
0C .. 55C

1200.0C
1372.0C
400.0C
1000.0C

0.3C
0.4C
0.5C
0.3C

0.6C
1.0C
1.0C
0.6C

S7-1200
, 11/2009, A5E02669003-02

369


A.4 (SM)
R&S
N
C
TXK/XK(L)

-50.0C
-200.0C
1768.0C
1768.0C
1.0C
2.5C
-270.0C
0.0C
1300.0C
1300.0C
1.0C
1.6C
0.0C
100.0C
2315.0C
2315.0C
0.7C
2.7C
-200.0C
-150.0C
800.0C
800.0C
0.6C
1.2C
-32511
-27648
27648
32511

0.05%
0.1%
-94.0715mV -80mV
80mV
94.071mV
1
1.5C . ,
.

()
()
10
50
60
400

100
20
16.67
10 1

4- , ()
1.205
0.245
0.205

, 400 ,
10 . 100
200
-100,
. , .
.
:
, . ,
32767 .
.
SM 1231 4 AI Thermocouple

S7-1200

370

, 11/2009, A5E02669003-02


A.5 (SB)

A.5

(SB)

A.5.1

SB 1223 2 X 24 VDC Input / 2 X 24 VDC Output

SB 1223 DI 2x24VDC, DQ 2x24VDC

(MLFB)

6ES7 223-0BD30-0XB0


()

38 x 62 x 21

40

1,0

( SM)

50

(24 . )

4 /

IEC 1,

24 . 4 ,

. 30 .

35 . 0,5 .

1 (.)

15 . 2,5

0 (.)

5 . 1

HSC (.)

20 ( 15 30 . )
30 ( 15 26 . )

(
)

500 . 1

0,2; 0,4; 0,8; 1,6; 3,2; 6,4 12,8 ,


2

( )

500 , 300

- MOSFET

20,4 28,8 .

1 .

. 20 .

0 10

. 0,1 .

(.)

0,5 A

. 0,6

. 10

. 20 , . 2

S7-1200
, 11/2009, A5E02669003-02

371


A.5 (SB)

SB 1223 DI 2x24VDC, DQ 2x24VDC

. 5 100

(
)

500 . 1

1A

L+ 48 , 1

. 2 . .
. 10 . .

RUN STOP


( 0)

( )

500 , 150

SB 1223 2 x 24 VDC Input / 2 x 24 VDC Output

S7-1200

372

, 11/2009, A5E02669003-02


A.5 (SB)

A.5.2

SB 1232 1

SB 1223 AQ 1x12bit

(MLFB)

6ES7 232-4HA30-0XB0


()

38 x 62 x 21

40

1,5

( SM)

15

(24 . )

40 ( )

10 0 20

: 12
: 11

( )

: -27,648 27,648
: 0 27,648

(25C / 0 55C)

0,5% / 1%

(95% )

: 300 (R), 750 (1 )


: 600 (1 ), 2 (10 )

: 1000
: 600

RUN STOP


( 0)

(
)

( )

10 ,

( )

( )

S7-1200
, 11/2009, A5E02669003-02

373


A.5 (SB)

SB 1232 1

S7-1200

374

, 11/2009, A5E02669003-02


A.6 (CM)

A.6

(CM)

A.6.1

CM 1241 RS485

A-1. CM 1241 RS485



(MLFB)

6ES7 241-1CH30-0XB0

30 x 100 x 75

150

-7 +12 , 1 , 3 V

. 2 RL = 100
. 1,5 RL = 54

10 +5 B, PROFIBUS Pin 3
10 GND A, PROFIBUS Pin 8

. 5,4 ,

. +/- 0,2 , . 60


RS485
RS485 CPU

500 . , 1

. 1000

1.1

+5 .

220

()

1 GND

6 PWR

+5
100 :

3 TxD+

B (RxD/TxD+): /

8 TXD-

A (RxD/TxD-): /

4 RTS

( TTL):

5 GND

SHELL

S7-1200
, 11/2009, A5E02669003-02

375


A.7 SIMATIC

A.6.2

CM 1241 RS232

CM 1241 RS232

(MLFB)

6ES7 241-1AH30-0XB0

30 x 100 x 75

150

. +/- 5 RL = 3

. +/- 15 .

. 3

. 0,8 , . 2,4
. 0,5

. +/- 30 .


RS 232
RS 232 CPU

500 . , 1

10 .

1,1

+5 .

220

()

1 DCD

6 DSR

2 RxD

, DCE:

7 RTS

3 TxD

, DCE:

8 CTS

4 DTR

9 RI

( )

5 GND

SHELL

A.7

SIMATIC

6ES7 954-8LF00-0AA0

24

6ES7 954-8LB00-0AA0

S7-1200

376

, 11/2009, A5E02669003-02


A.8

A.8

(MLFB)
()


CPU

8-
6ES7 274-1XF30-0XA0
43 x 35 x 23
20
8
CPU 1211C, CPU 1212C

14-
6ES7 274-1XH30-0XA0
67 x 35 x 23
30
14
CPU 1214C


I, 2, I, 2.
I, 2, I, 2,
.

8-
24
.

6ES7 274-1XF30-0XA0

S7-1200
, 11/2009, A5E02669003-02

377


A.9 /

14-

24 .

6ES7 274-1XH30-0XA0

A.9

/

(MLFB)

6ES7 290-6AA30-0XA0

200

/ .
1.
.
2.
.

.

S7-1200

378

, 11/2009, A5E02669003-02

CPU ,
CPU,
24 . .
:
(SM) CPU.
CPU
.
CPU 1214 8
CPU 1212 2
CPU 1211
(CM) CPU.
CPU 3
.
(SB) CPU. CPU
1 .
, CPU
.
CPU 5 . 24 . :
CPU 5 . ,
. 5 .
, CPU ,
, .
CPU 24 . ,

. 24 . ,
CPU ,
24 . , .
24 .
.

24 .
,

.


.
, /
.
CPU
.
.

S7-1200
, 11/2009, A5E02669003-02

379

24
, M.
24 CPU, SM
,
, ,
.
M
.

M
,
.
,
/ .

M .
CPU
(. 329).

CPU , , ,
, CPU.

S7-1200

380

, 11/2009, A5E02669003-02


B.1

B.1


,
CPU 1214C AC/DC/Relay, 3 SM 1223 8 8
SM 1221 8 .
46 34 .

CPU ,
.
.
CPU 5 .
, 24 .
.
448 , CPU 400 .
48 24 .
24 . .
CPU

5 .

24 .

CPU 1214C AC/DC/Relay

1600

400

5 .

24 .

CPU 1214C, 14

14 * 4 = 56

3 SM 1223, 5

3 * 145 = 435

1 SM 1221, 5

1 * 105 = 105

3 SM 1223, 8

3 * 8 * 4 = 96

3 SM 1223, 8

3 * 8 * 11 = 264

1 SM 1221, 8

8 * 4 = 32

540

448

5 .

24 .

1060

(48 )

S7-1200
, 11/2009, A5E02669003-02

381


B.2

B.2


( ), CPU S7-1200
, .
(. 329)
CPU
.
CPU

5 .

24 .

5 .

24 .

5 .

24 .

S7-1200

382

, 11/2009, A5E02669003-02

CPU
CPU 1211C

CPU 1212C

CPU 1214C


CPU 1211C DC/DC/DC

6ES7 211-1AD30-0XB0

CPU 1211C AC/DC/Relay

6ES7 211-1BD30-0XB0

CPU 1211C DC/DC/Relay

6ES7 211-1HD30-0XB0

CPU 1212C DC/DC/DC

6ES7 212-1AD30-0XB0

CPU 1212C AC/DC/Relay

6ES7 212-1BD30-0XB0

CPU 1212C DC/DC/Relay

6ES7 212-1HD30-0XB0

CPU 1214C DC/DC/DC

6ES7 214-1AE30-0XB0

CPU 1214C AC/DC/Relay

6ES7 214-1BE30-0XB0

CPU 1214C DC/DC/Relay

6ES7 214-1HE30-0XB0

, ,

SM 1221 8 x 24 VDC Input

6ES7 221-1BF30-0XB0

SM 1221 16 x 24 VDC Input

6ES7 221-1BH30-0XB0

SM 1222 8 x 24 VDC Output

6ES7 222-1BF30-0XB0

SM 1222 16 x 24 VDC Output

6ES7 222-1BH30-0XB0

SM 1222 8 x Relay Output

6ES7 222-1HF30-0XB0

SM 1222 16 x Relay Output

6ES7 222-1HH30-0XB0

SM 1223 8 x 24 VDC Input / 8 x 24 VDC Output

6ES7 223-1BH30-0XB0

SM 1223 16 x 24 VDC Input / 16 x 24 VDC Output

6ES7 223-1BL30-0XB0

SM 1223 8 x 24 VDC Input / 8 x Relay Output

6ES7 223-1PH30-0XB0

SM 1223 16 x 24 VDC Input / 16 x Relay Output

6ES7 223-1PL30-0XB0

SM 1231 4 x Analog Input

6ES7 231-4HD30-0XB0

SM 1231 8 x Analog Input

6ES7 231-4HF30-0XB0

SM 1232 2 x Analog Output

6ES7 232-4HB30-0XB0

SM 1232 4 x Analog Output

6ES7 232-4HD30-0XB0

SM 1234 4 x Analog Input / 2 x Analog Output

6ES7 234-4HE30-0XB0

CM 1241 RS232

6ES7 241-1AH30-0XB0

CM 1241 RS485

6ES7 241-1CH30-0XB0

SB 1223 2 x 24 VDC Input / 2 x 24 VDC Output

6ES7 223-0BD30-0XB0

SB 1232 1 Analog Output

6ES7 232-4HA30-0XB0

S7-1200
, 11/2009, A5E02669003-02

383

KTP400 Basic (, PN)

6AV6 647-0AA11-3AX0

KTP600 Basic (, PN)

6AV6 647-0AB11-3AX0

KTP600 Basic (, PN)

6AV6 647-0AD11-3AX0

KTP1000 Basic (, PN)

6AV6 647-0AF11-3AX0

TP1500 Basic (, PN)

6AV6 647-0AG11-3AX0

STEP 7 Basic v10.5

6ES7 822-0AA0-0YA0

SIMATIC MC 2 MB

6ES7 954-8LB00-0AA0

SIMATIC MC 24 MB

6ES7 954-8LF00-0AA0

PSU 1200

6EP1 332-1SH71

CSM 1277 Ethernet - 4

6GK7 277-1AA00-0AA0

(1214C/1211C - 8 )

6ES7 274-1XF30-0XA0

(1214C - 14 )

6ES7 274-1XH30-0XA0

/, 2

6ES7 290-6AA30-0XA0

, 7 ,

6ES7 292-1AG30-0XA0

, 8 , (4 )

6ES7 292-1AH30-0XA0

, 11 , (4 )

6ES7 292-1AL30-0XA0

, 12 , (4 )

6ES7 292-1AM30-0XA0

, 14 , (4 )

6ES7 292-1AP30-0XA0

, 20 , (4 )

6ES7 292-1AV30-0XA0

, 3 , (4 )

6ES7 292-1BC0-0XA0

, 6 , (4 )

6ES7 292-1BF30-0XA0

, 7 , (4 )

6ES7 292-1BG30-0XA0

, 11 , (4 )

6ES7 292-1BL30-0XA0

S7-1200

384

, 11/2009, A5E02669003-02

S7-1200,

6ES7 298-8FA30-8AH0

6ES7 298-8FA30-8BH0

6ES7 298-8FA30-8CH0

6ES7 298-8FA30-8DH0

6ES7 298-8FA30-8EH0

6ES7 298-8FA30-8FH0

S7-1200 Easy Book [ ]

6ES7 298-8FA30-8AQ0

6ES7 298-8FA30-8BQ0

6ES7 298-8FA30-8CQ0

6ES7 298-8FA30-8DQ0

6ES7 298-8FA30-8EQ0

6ES7 298-8FA30-8FQ0

S7-1200
, 11/2009, A5E02669003-02

385

S7-1200

386

, 11/2009, A5E02669003-02

, 58, 60
, 282
, 291
master-, 291
slave-, 291
, 127

, 134

, 23, 373
, 375, 376

, 99
, 58
CPU, 57
USS, 210

, 39

, 58, 95
(OB), 92
, 58
(DB), 95
(T-), 267

(DB), 39
(OB), 39, 45
(FC), 39
(FB), 39

, 63

/, 318

/, 318
, 37
(PTO), 206

-
, 112
, 39
, 94


USS, 210
, 58, 95
, 3
, 133

, 103
, 279
, 54, 322

, 288
, 288
m, 289
n, 289

CPU, 79
, 17
ATEX, 330
CE, 329
C-Tick, 331
cULus, 330
, 15

RTS, 283
(RET), 145
PtP, 312
, 282
, 50, 51
, 17

CPU, 70
/

, 261
RTS, 284
RTS, 284
, 22
-, 99
, 99

, 99
, 58

S7-1200
, 11/2009, A5E02669003-02

387

, 58
CPU, 57
,
CPU, 320
, , 314

, 371
(TP), 112

, 318

, 318
, 37
PROFINET
Ethernet, 85, 258
, 277
, 16
, 19
, 18

, 18
, 18
, 39
, 46
FB DB
, 95


, 70
, 71
, 73
, 58
, 58
, 333

, 45

, 33
, 33
, 90

-, 99
DB ( ), 95
FB ( ), 94
FC (), 93
USS, 221
EN_AIRT, 203


(HSC), 119
(MOVE_BLK), 136
(SEL), 148
(SUB), 127
DIS_AIRT, 191
(DECO), 147
DIV, 127
(TON), 112

(TONR), 112
(TOF), 112
(FILL_BLK), 138
(INV), 146
(ENCO), 147
(SCALE_X), 143
(MUX), 148
, 126
, 126

(UFILL_BLK), 138

(UMOVE_BLK), 136
(NORM), 143

() , 109
()
, 109

(ABS), 131
, 142

(CEIL), 142

(FLOOR), 142
(JMP), 144

(TRUNC), 142
CAN_DINT, 200
SRT_DINT, 200
, 106
(RT), 112
(SHL), 150
(SHR), 150
(ADD), 127
(MUL), 127
, 106
(ROL), 151
(ROR), 151
AND, 146
ATTACH, 197
CTRL_PWM, 206

S7-1200

388

, 11/2009, A5E02669003-02

DEC ( 1), 130


DETACH, 197
INC ( 1), 130
JMPN, 144
MAX (), 132
MIN (), 132
MOD (modulo), 128
MOVE, 136
NEG (), 129
Not OK, 126
OK, 126
OR, 146
PID_Compact, 203
PORT_CFG (
), 294
RCV_CFG (
), 298
RCV_PTP (
), 308
RCV_RST ( ), 309
RE_TRIGR, 176
RT ( ), 112
S_CONV, 157
SEND_CFG (
), 296
SEND_PtP (
), 305
SGN_GET ( RS232), 310
SGN_SET (
RS232), 311
STP ( ), 177
STRG_VAL, 157
SWAP ( ), 140
T_ADD, 153
T_CONV, 153
T_DIFF, 153
T_SUB, 153
TCON, 188
TDISCON, 188
TRCV, 188
TRCV_C, 181, 271
TSEND, 188
TSEND_C, 181, 267
USS_DRV, 213
USS_PORT, 216
USS_RPM, 217
USS_WPM, 219
VAL_STRG, 157
XOR ( ), 146

, 134
(MOVE_BLK), 136

(RET), 145
, 153
(SEL), 148
(SUB), 127
, 133
, 153
, 103
(DECO), 147
(DIV), 127
(FILL_BLK), 138
: S_CONV, 157
: VAL_STRG, 157
(INV), 146
, 153
(ENCO), 147
USS, 221
(SCALE_X), 143
, 144
(MUX), 148
() , 109
(UFILL_BLK), 138
(UMOVE_BLK), 136
(NORM), 143
, 140
(ABS), 131

, 142
, 142

(FLOOR), 142
(TRUNC), 142
() , 109
, 136
(JMP), 144
, 141
: ATTACH, 197
: CAN_DINT, 300
: DETACH, 197
: DIS_AIRT, 203
: EN_AIRT, 203
: SRT_DINT, 200
, 106
(SHL), 150
(SHR), 150
(HSC), 119
(ADD), 127
, 125
: S_CONV, 157
: STRG_VAL, 157
, 116
, 112
: RT ( ), 112

S7-1200
, 11/2009, A5E02669003-02

389

: TOF ( ), 112
: TON ( ), 112
: TONR (
), 112
: TP (), 112
(MUL), 127
, 106
(ROL), 151
(ROR), 151
, 155
:
(WR_SYS_T), 155
:
(RD_LOC_T), 155
:
(RD_SYS_T), 155
AND, 146
CTRL_PWM, 206
DEC ( 1), 130
GET_ERROR, 181
INC ( 1), 130
IN_RANGE, 126
MAX (), 132
MIN (), 132
MOD (modulo), 128
NEG (), 129
Not OK, 126
OK, 126
OR, 147
OUT_RANGE, 126
PID_Compact, 203
PORT_CFG ( ), 284
RCV_CFG ( ), 298
RCV_PtP (
), 308
RCV_RST ( ), 309
RE_TRIGR, 50, 176
SEND_CFG ( ), 296
SEND_PTP (
), 282
SGN_GET ( RS232), 310
SGN_SET ( RS232), 311
STP ( ), 177
T_ADD, 153
T_CONV, 153
T_DIFF, 153
T_SUB, 153
TCON, 188
TDISCON, 188
TRCV, 188
TRCV_C, 181, 271
TSEND, 188

TSEND_C, 181, 267


USS_DRV, 213
USS_PORT, 216
USS_RPM, 217
USS_WPM, 219
XOR ( ), 146
, 153
, , 153
, 153
(WR_SYS_T), 155
(RD_LOC_T), 155

(RD_SYS_T), 155
, 141

, 157
, 125
, 116
Ethernet
TCON, 188
TDISCON, 188
TRCV, 188
TRCV_C, 181
TSEND, 188
TSEND_C, 181

, 265
, 291
, 279
, 51
, 284
, 282
IP-, 84, 252
TCP/IP, 249

, 281
, 290

RS232 RS485, 259
(CM), 292
, 81
, 78
, 77
, 14
, 308
, 373
, 369
, 30
, 30
(CM),
USS, 210
, 288

S7-1200

390

, 11/2009, A5E02669003-02

, 3
- , 17
, 176
, CPU, 321
,
CPU, 321
, 102
, 282
, 77, 252
, 79
, 81
, 78
, 81
CPU, 80
Ethernet, 84, 257
, 83
PROFINET, 84, 257

, 51
, 281

- CPU, 264
, 265
, 41, 70
Industrial Ethernet, 84, 257
, 281
, 264
HSC ( ), 124
IP-, 84, 257
PROFINET, 82, 239
, 77
, 81
, 78
, 81
CPU, 80
Ethernet, 84, 287
, 81
PROFINET, 84, 287
TRCV_C, 272
TSEND_C, 249

, 82
Ethernet, 84, 257
CPU, 80
PROFINET, 84, 257
, 268
, 272

, 268
, 272
, 281
, 290

, 284
, 285

, 290
, 284
, 285

, 38
, 48
, 89

, 288
, 84, 257
, 144

(CM), 14
, 82
(SB), 13
(SM), 14
, 12
/
, 323

, 35
, 22
, 37
, 33
(CM), 30
, 38
, 24
, 21
, 35
(SB), 32
(SM), 28
, 21
, 34, 38
CPU, 26
, 331

, 361
, 286
CPU, 79
, 334

S7-1200
, 11/2009, A5E02669003-02

391

M ( ), 61
Q ( ), 61
Ethernet, 188
, 94
PtP, 312
, 41, 70
, 329
, 58

, 284, 286
, 331

, 17
, 17
, 19
, 17
, 18
, 17

- , 17
, 18
, 17
, 18
, 17
CPU, 319
, 16
, 321
, 71
, 321
, 70
, 320
, 58
, , 319
, 58

, , 305
, 45
(AC)
, 45
, 37

RUN STOP, 56
, 93

OB, 93
, 88
, 92
, 11
, 93
, 87
, 45
, 3
, 46

, 18
, 289

, 3
( ), 18
, 16

, 19
, 49
, 18
PtP, 312

, 48
, 18
, 314
, 18
, 313
, 15
, 312
, 81
, 313
, 78
, 313
, 82
Ethernet, 84, 257
CPU, 80

PROFINET, 84, 257


TIA

, 81
, 62
, 78
, 52
, 77
, 52
, 82
, 55
CPU, 80
, 52
, 16
, 53
Ethernet, 84, 257
I ( ), 60
, 16
L ( ), 58

S7-1200

392

, 11/2009, A5E02669003-02

, 83
, 15
PROFINET, 84, 257

, 288
, 286
, 279

, 37

, 375, 376
, 157

, 45
, 46

PtP, 290
, 89
CPU, 79
(EN ENO), 98
, 89
FBD ( -,
), 98
LAD ( , ), 97
PtP, 290

, 73
, 283

, 99
CPU, 57
, 71
, 73
, 58
, 58
, 87
, 16
, 81
, 78
, 82
CPU, 80
Ethernet, 84, 257
, 77
, 83
PROFINET, 84, 257
, 288
, 284

, 279
, 279
, 25

, 19
S7-1200, 12
RUN, 42, 44

, 292, 317
, 251
FM, 330
, 32
(SB)
, 81
, 78
, 77
, 13
, 373
, 13
, 32
, 32

SM 1221, 351
SM 1222, 353
SM 1223, 355
(SM)
, 81
, 78
, 77
, 14
, 373
, 13
, 28
, 28
, 288
, 286
(NTP), 277
, 121
, 281
, 83
STOP, 42, 325

CPU, 12
- , 20
, 13
, 334
, 282
, 90
, 89, 90

SM 1221, 352
SM 1222, 354

S7-1200
, 11/2009, A5E02669003-02

393

SM 1223, 357
CPU 1211C, 339
CPU 1212C, 344
CPU 1214C, 349
SB 1223, 366
SB 1232, 368
SM 1231, 1232, 1234, 363

(HSC), 121
(HSC): , 124

, 102, 323
TOF (
), 112
TON (
), 112
TONR (
), 112
TP (), 112
, 112
, 102
, 3
, 329

, 358
ATEX, 330
CE, 329
C-Tick, 331
cULus, 330
, 307
, 371
, 343
CM 1241 RS232, 370
CM 1241 RS485, 369
, 331

, 360
, 308
, 329
, 331
FM, 330
SM 1221, 351
SM 1222, 353
SM 1223, 355
, 334
SM 1221, 352
SM 1222, 354
SM 1223, 357
: SM 1231, 1232, 1234, 363
, 333

(SB), 364
(), 332
CPU 1211C, 335
CPU 1212C, 340
CPU 1214C, 345
SB 1223, 364
SB 1223, 367

, 358
, 370

(SB), 364
CM 1241 RS232, 370
CM 1241 RS485, 369
DTL (Data and Time Long), 67
STRING, 65
, 64
, 66
DTL, 67
STRING, 65

, 35
, 37
, 38
, 21
, 25
, 34, 36
, 35
, 35

, 36
, 34
, 282
, 282

, 99
, 58
CPU, 57
, 288
, 286
, 333
-

PROFINET, 262
, 20
, 83
, 58

S7-1200

394

, 11/2009, A5E02669003-02

(FB)
, 94
, 94
, 94
(FC), 93

, 53

, 65
, 65

(- )
CTRL_PWM, 206
, 13

, 58
(), 332

C
CPU
, 23
, 58
, 51
, 81
, 78
, 261
, 35
, 57
, 37
, 40
, 77
, 80

- , 262
, 38
CPU, 79
, 11
, 43
, 320
CPU, 320
, 41, 70

, 71
, 319
Ethernet, 84, 257
, 26
, 373
, 73
, 58
, 42
(SB), 13
, 71
, 73
, 83
STOP, 325
, 12
1211C, 339
1212C, 344
1214C, 349
, 323
1211C, 335
1212C, 340
1214C, 345
, 35
, 34, 36
, 57
, 58
IP-, 84, 257
MAC-, 275
PROFINET, 84, 257
CTS, 282

D
DB ( ), 95

E
EN ENO ( ), 98
Ethernet
IP-, 84, 257
, 83

F
FB ( ), 94
FBD ( -,
), 98
FC (), 93

S7-1200
, 11/2009, A5E02669003-02

395

H
HSC ( ), 121
, 124

I
IP-, 84, 85, 257, 258
, 84, 257
, 252, 260
, 255
IP- , 85, 258
IP-, CPU, 320
IP-, 85, 258

L
LAD ( ,
), 97

M
MAC-, 84, 257, 275
MB_COMM_LOAD, 222
MB_MASTER, 225
MB_SLAVE, 237
MODBUS, 222
MB_Master, 225
MB_SLAVE, 237

P
PROFINET, 249
, 83
, 259
IP-, 84, 257
PTO ( ), 206
PtP-, 279

R
RTS, 282
RTS , 282

S
S7-1200
, 23
, 51
, 81

, 78
, 35
, 22
, 57
, 37
, 33
(CM), 14
, 77
, 82
CPU, 80
, 38
, 24
, 41, 70
, 71
Ethernet, 84, 257
, 73
, 58
, 13
(SB), 13
(SM), 14
, 83
CPU, 12
, 35
, 34, 36
CPU, 26
, , 25
CM, 30
SB, 32
SM, 28
- , 20
, 58
IP-, 84 257
PROFINET, 84, 257
CPU, 11
SB 1223, , 366
SB 1223, , 364, 367
SB 1232 , 368
STEP 7
, 81
, 78
, 77
, 82
CPU, 80
, 16
Ethernet, 84, 257
, 16
, 83
, 15
PROFINET, 84, 257

S7-1200

396

, 11/2009, A5E02669003-02

T
TSAP (
), 369, 272

X
XON / XOFF, 283

S7-1200
, 11/2009, A5E02669003-02

397

SIMATIC S7 S7-1200 Programmable controller


System Manual, 11/2009, A5E02669003-02

398