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

16 SFC

S7-300 S7-400
A5E00261410-01

16-1

16 SFC

16.1 DP SFC7 "DP_PRAL"

SFC7 "DP_PRAL"
DP-
slave-. OB40 DP-.
,
AL_INFO.
master- DP, OB40
( OB40_POINT_ADDR).

IOID LADDR.

.

SFC
SFC7 "DP_PRAL" , ,
SFC.
, SFC7 REQ=1.
RET_VAL BUSY, . "
REQ, RET_VAL BUSY SFC".
, OB40
DP-.

DP-
slave-, ,
DP.

16-2

S7-300 S7-400
A5E00261410-01

16 SFC


IOID LADDR .
SFC7 "DP_PRAL" slave- DP
SFC ,
, SFC
, ;
IOID LADDR ,
, SFC ,
AL_INFO, RET_VAL
W#16#7002.

REQ

INPUT

IOID

INPUT

LADDR

INPUT

AL_INFO

INPUT

RET_VAL

OUTPUT

BUSY

OUTPUT

BOOL
I, Q, M, D, L,
REQ=1:

DP-,
slave-.
BYTE
I, Q, M, D, L,

(
DP-):
B#16#54= (PI)
B#16#55= (PQ)
,
,
.
, B#16#54.
WORD
I, Q, M, D, L,

(
DP-). ,
,
.
DWORD I, Q, M, D, L,

OB40,
DP- (
OB40_POINT_ADDR).

slave-
, master
. (. /70/ ).
INT
I, Q, M, D, L

,
.
BOOL
I, Q, M, D, L
BUSY=1:


DP.

S7-300 S7-400
A5E00261410-01

16-3

16 SFC


(W#16#...)
0000

7000

REQ=0. ;
BUSY 0.
REQ=1.
master- DP; BUSY 1.
(REQ ):
DP; BUSY
1.
.

7001
7002

8090
8091

80B5

(,
).
IOID LADDR ,
.
DP-.

80C6

8093

16-4

S7-300 S7-400
A5E00261410-01

16 SFC

16.2 DP-
SFC11 "DPSYC_FR"

SFC11 "DPSYC_FR"
DP-.

:
SYNC (
slave- DP)
UNSYNC ( SYNC)
FREEZE ( slave- DP,
)
UNFREEZE ( FREEZE).

SYNC FREEZE ,
.

,
DP-, STEP 7 (. /231/).
, DP-
, SYNC/FREEZE.

SFC
SFC11 "DPSYC_FR" SFC, ,
SFC. ,
SFC11 REQ=1.
RET_VAL
BUSY, . " REQ, RET_VAL BUSY
SFC".


SYNC/FREEZE SFC11 ,
, SFC ,
.
LADDR, GROUP MODE , SFC
.

S7-300 S7-400
A5E00261410-01

16-5

16 SFC

DP
DP :
/ DP,

( OB1 SFC27
"UPDAT_PO"),
SFC15 "DPWR_DAT".
DP (
PROFIBUS DP) DP.
, (,
slave-)
,
master- DP SYNC, SFC11
"DPSYC_FR".

SYNC?
SYNC DP-
(Sync), ,
DP
slave- DP .
DP-
, .
SYNC DP-

.
,
UNSYNC, SFC11 "DPSYC_FR".

DP- ()

, SYNC.
SFC.

16-6

S7-300 S7-400
A5E00261410-01

16 SFC

ET 200M ET 200X
IM 153-1 (Order No. ...-1AA01 ...-1AA02 [ ]),
BM 141, BM 142, BM 143 BM 147 ()
, I/O-, ,
SFC 11.
SFC 11 .

DP
DP :
/ DP,
(
OB1 SFC26 "UPDAT_PI"),
SFC14 "DPRD_DAT".
DP (
PROFIBUS DP) DP CPU.
, (,
slave-)
, master DP FREEZE, SFC11 "DPSYC_FR".

FREEZE?
FREEZE DP , ,
DP slave- DP
.
CPU.
FREEZE DP-
.
DP
,
UNFREEZE SFC11 "DPSYC_FR".

DP- ()

, FREEZE.
SFC.

S7-300 S7-400
A5E00261410-01

16-7

16 SFC


SFC11 "DPSYC_FR"
, ,
SFC11 "DPSYC_FR"
.
,
:

" (SYNC) " " (FREEZE) "
( S7-400). SFC27 "UPDAT_PO"
SYNC. SFC26
"UPDAT_PI" FREEZE.
:
/ , SYNC, ,
FREEZE. ,
SYNC, ,
FREEZE.

SFC15 SFC14
SFC15 "DPWR_DAT", SFC
, SYNC .
SFC14 "DPRD_DAT", SFC
, FREEZE .

SFC11 "DPSYC_FR"

SYNC FREEZE OB .
,
, ,

SFC11 "DPSYC_FR" SYNC.
, FREEZE,
, SFC11
"DPSYC_FR" FREEZE
.

REQ

INPUT

LADDR

INPUT

16-8

BOOL
I, Q, M, D, L,

WORD
I, Q, M, D, L,


REQ=1: SYNC/FREEZE
DP-

S7-300 S7-400
A5E00261410-01

16 SFC

GROUP

INPUT

MODE

INPUT

BYTE
I, Q, M, D, L,

BYTE

I, Q, M, D, L,

RET_VAL

OUTPUT

INT

I, Q, M, D, L

BUSY

OUTPUT

BOOL

I, Q, M, D, L


0 = 1: 1
1 = 1: 2
:
7 = 1: 8

. B#16#0 .
(ID) (
EN 50 170, 2, PROFIBUS)
0: ( 0)
1: ( 0)
2 = 1: UNFREEZE
= 0:
3 = 1: FREEZE
= 0:
4 = 1: UNSYNC
= 0:
5 = 1: SYNC
= 0:
6: ( 0)
7: ( 0)
:
ID :
- B#16#04 (UNFREEZE)
- B#16#08 (FREEZE)
- B#16#10 (UNSYNC)
- B#16#20 (SYNC)
ID :
- B#16#14 (UNSYNC, UNFREEZE)
- B#16#18 (UNSYNC, FREEZE)
- B#16#24 (SYNC, UNFREEZE)
- B#16#28 (SYNC, FREEZE)
, ,
,
.
RET_VAL
, .
BUSY=1:
SYNC/FREEZE .

S7-300 S7-400
A5E00261410-01

16-9

16 SFC



(W#16#...)
0000
7000

8094

REQ =0. , LADDR, GROUP


MODE, ; BUSY 0.
REQ=1. , LADDR, GROUP
MODE, ; BUSY 1.
(REQ ).
SYNC/FREEZE ; BUSY 1.
, LADDR,
DP.
SFC , LADDR
( DP-).
GROUP.

8095

MODE.

80B0

, GROUP .

80B1

, GROUP CPU.

80B2

SYNC, MODE, ,
GROUP.
FREEZE, MODE, ,
GROUP.
DP-:
DP CPU
.
SYNC/UNSYNC
,
SYNC/UNSYNC. .
FREEZE/UNFREEZE
,
FREEZE/UNFREEZE.
.
: DP

7001
7002
8090
8093

80B3
80C2

80C3

80C4

80C5
80C6
80C7
8xyy

16-10

- /
.
- DP.
, .
RET_VAL

S7-300 S7-400
A5E00261410-01

16 SFC

16.3 (slave)
DP- SFC12 D_ACT_DP

SFC12 "D_ACT_DP, (deactivate and reactivate configured DP slaves)


slave DP. ,
.
SFC12 PROFIBUS PA ,
DP- DP/PA
.

DP- CPU

, , CPU
. SFC12 ,
CPU .
DP-, .



.
DP-
,
. SFC12 DP, .
,
,
.
DP-. SFC12

, , , .

SFC
SFC12 D_ACT_DP SFC, ,
SFC. ,
SFC12 REQ=1.
RET_VAL BUZY;
. S7-300/400.
.

S7-300 S7-400
A5E00261410-01

16-11

16 SFC


() ()
, SFC12 , ,
SFC ,
. LADDR ,
SFC .

DP-
DP- SFC12,

0 ( ). DP-
DP-.
DP-
DP CPU.
DP 0, ,
DP-.
,
DP, OB (OB 122) I/O,
.
DP SFC (.., SFC 59 RD_REC),
RET_VAL,
DP-.
DP- OB (OB 85)
,
,
.
.
DP- OB (OB 86)
" ",
.
DP- ,
SFC12, .
OB86
.
, ,
RET_VAL.
DP-,
() ,
, (
), DP.
DP-- ,
.

16-12

S7-300 S7-400
A5E00261410-01

16 SFC

DP-
() DP-
SFC12,
D- (
DP-). DP- ,
DP- .
DP- OB (OB 85)
,
.
.
DP- OB (OB 86)
" ",
.
SFC12,
DP-,
() DP-, "DP-BUSF" CPU
. , , SFC
W#16#80A2
. DP- .
DP- DP, ()
SFC12.

DP-
. ,
, SFC12 LADDR
MODE = 2. SFC12,
RET_VAL 0.

DP-,
, , DP ().
DP-- ,
.

S7-300 S7-400
A5E00261410-01

16-13

16 SFC

CPU
CPU
DP-:
DP-
.
, DP-
, DP- ,
DP-
.
CPU,
DP-,
, .

OB SFC12.

REQ

INPUT

BOOL

MODE

INPUT

BYTE

LADDR

INPUT

WORD

RET_VAL

OUTPUT

INT

I, Q, M, D, L,

I, Q, M, D, L

BUSY

OUTPUT

BOOL

I, Q, M, D, L

16-14

I, Q, M, D, L,

I, Q, M, D, L,

REQ=1:

.
ID:
0:
DP-
(/).
1: DP-
2: DP
DP.
,
,
.
:
BUSY=1:
BUSY=0: .

S7-300 S7-400
A5E00261410-01

16 SFC



(W#16#...)
0000
0001

80A2

DP- . (
MODE=0).
DP- . (
MODE=0).
REQ =0. , LADDR
; BUSY 0.
REQ=1. , LADDR,
; BUSY 1.
(REQ ).
; BUSY 1.
, LADDR.
CPU I-Slave LADDR
"I-Slave".
DP-
(
MODE = -1.)
DP- ,
LADDR, MODE .
DP-
( MODE = 1).
:
CPU ,
DP-
().
SFC W#16#0000.
DP- .

80A3

DP- . .

80A4

CPU DP.
DP-:
( MODE = 1).
:
SFC ,
DP-
SFC. SFC W#16#0000,
.
SFC12
( MODE = 1).
: CPU
(
MODE = 1 MODE = 2).

0002
7000
7001
7002
8090

8092

8093
80A1

80A6

80C1
80C3

8xyy

, .
RET_VAL

S7-300 S7-400
A5E00261410-01

16-15

16 SFC

16.4 DP ( slave-)
SFC 13 DPNRM_DG
slave-
DP- ,
EN 50 170 Volume 2,
PROFIBUS. SFC 13
DPNRM_DG.
slave-
,
slave- DP.

master

( )

5
6 ...

( )
, slave

SFC 13 DPNRM_DG (read diagnosis data of a DPslave [


DP-])
DP- ,
EN 50 170 Volume 2, PROFIBUS.

,
RECORD.
, 1 REQ
SFC13.


, ..
SFC 13.
RET_VAL BUSY, . " REQ,
RET_VAL BUSY SFC".

16-16

S7-300 S7-400
A5E00261410-01

16 SFC

REQ

INPUT

BOOL

LADDR

INPUT

WORD

RET_VAL

OUTPUT

INT

I, Q, M, D, L,

I, Q, M, D, L,

I, Q, M, D, L

RECORD

OUTPUT

ANY

I, Q, M, D, L

BUSY

OUTPUT

BOOL

I, Q, M, D, L

REQ=1:

DP-.
,
,
. ,

RET_VAL.

.
BYTE.

6.

240. slave 240
(
244 ). 240
,

.
BUSY=1:
.

RECORD
CPU
:
, RECORD, ,
, , RET_VAL
.
, RECORD,
, ,
RET_VAL
.

, RECORD
, .
LADDR.

S7-300 S7-400
A5E00261410-01

16-17

16 SFC

slave- 240

slave-,
241 244
:
, RECORD, 240 ,
,
RET_VAL.
, RECORD, 240 ,
240
, .

RET_VAL
,
.
, RET_VAL
.

DP-
.


RET_VAL,
2. SFC.
SFC 13
SFC 59 RD_REC,

S7-400
SFC 13 DPNRM_DG ,
, S7400 CPU ( ).
SFC 13
DP- ,
CPU
SFC 13. /101/.
"",
, .
,
RET_VAL. .

16-18

S7-300 S7-400
A5E00261410-01

16 SFC

16.5
DP- SFC14 "DPRD_DAT"

S7 S7
.

SFC14
SFC 14 DPRD_DAT, ,

, .


.
,
CPU .

SFC14 "DPRD_DAT" (read consistent data of a DP standard slave)


DP-.
,
CPU.
CPU.
,
, RECORD.
,
STEP 7 .
DP-,
, DP,
DP
SFC14, .

S7-300 S7-400
A5E00261410-01

16-19

16 SFC

LADDR

INPUT

WORD

I, Q, M, D, L,


(I) ,
.

RET_VAL

OUTPUT

INT

I, Q, M, D, L

,
,
.

RECORD

OUTPUT

ANY

I, Q, M, D, L


.
,
STEP 7 .

BYTE.


(W#16#...)
.

8090


.
ANY , BYTE.

8092
9093
80A0

LADDR DP,
.
.

80B0

slave- DP.

80B1


STEP 7 .
DP.

80B2

16-20

0000

80B3

DP.

80C0

DP.

80C2

DP.

80Fx

DP.

87xy

DP.

808x

DP.

8xyy

, .
RET_VAL

S7-300 S7-400
A5E00261410-01

16 SFC

16.6
DP- SFC15 "DPWR_DAT"

S7 S7
.

SFC15
SFC15 "DPWR_DAT", ,

,

SFC15 "DPWR_DAT"
RECORD slave- DP.

,
CPU. CPU.
, .. SFC
.
,
STEP 7 .
DP- ,
DP-.

LADDR

INPUT

WORD

RECORD

INPUT

ANY

I, Q, M, D, L

RET_VAL

OUTPUT

INT

I, Q, M, D, L

I, Q, M, D, L,

S7-300 S7-400
A5E00261410-01


,
.

.
,
STEP 7
.
BYTE.
,
,
.

16-21

16 SFC

DPV1-,
DP-
SFC. , .
DP- SFB 54
"RALRM" STATUS[3].

(W#16#...)
0000

808x

DP.

8090


.
ANY , BYTE.

8092
9093
80A1

LADDR DP,
.
.

80B0

slave- DP.

80B1
80B2


STEP 7 .
DP.

80B3

DP.

80C1


.
DP.

80C2

16-22

80Fx

DP.

85xy

DP.

8xyy

, .
RET_VAL

S7-300 S7-400
A5E00261410-01