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

2 SFC

S7-300 S7-400
A5E00261410-01

2-1

2 SFC

2.1
RET_VAL

(SFC),
, CPU SFC.

:
BR
RET_VAL ( )

, SFC,
:
BR .
RET_VAL.
BR , , RET_VAL
,
SFC!


(SFC) 0 (BR)
,
.
,
(RET_VAL). RET_VAL
( . ),
0 BR .
(INT).
0 ,
.
CPU SFC
()

2-2

BR
0
1


, "0"
"0"


( "1")
( "0")

S7-300 S7-400
A5E00261410-01

2 SFC


RET_VAL:
, ,
, SFC
.
,
, .
,
.


(RET_VAL)
:
, ,
.
,
.
RET_VAL (INT),

.
,
, .

.

, , W#16#8081
15

8 7

1
X

x = 0 , SFC.
, " ",
.
x > 0 , SFC.
SFC, .
.

= 1, , .

S7-300 S7-400
A5E00261410-01

2-3

2 SFC


,
.
:
1 111, 1
, 2 - SFC ..
0 127. ,
.

.

15
1

RET_VAL ,
:
, ,
SFC.
,
SFC. ,
,
.


(SFC) ,
.
, ,
(. ).
:
0 7.
0 15.

15
1

7
4 3
0
1

2-4

S7-300 S7-400
A5E00261410-01

2 SFC


.
. x
-
, .
(W#16#...)

8x7F


x.
.
.
.
, x

ANY 8.

.
, x ,
.
.
.
, , x,
.
(
).
, , x,
.
.
.
, x
, 0.
DB.
DB.
, x
.
,
W#16#8x30.
DB ( DB).
FC ( FC).
FB ( FB).
, x ,
, .
DB.
FC.
FB.
,
.
,
.
n (n > 1) .
n (n > 1) .
,
.

8x22
8x23

8x24
8x25

8x26

8x27

8x28
8x29

8x30
8x31

8x32
8x34
8x35

8x3A
8x3C
8x3E
8x42
8x43
8x44
8x45

S7-300 S7-400
A5E00261410-01

2-5

2 SFC

2.2 REQ, RET_VAL BUSY


SFC
SFC
SFC SFC,
, . SFC
:
SFC7 "DP_PRAL"
SFC11 "DPSYC_FR"
SFC12 "D_ACT_DP"
SFC13 "DPNRM_DG"
SFC51 "RDSYSST"
SFC55 "WR_PARM"
SFC56 "WR_DPARM"
SFC57 "PARM_MOD"
SFC58 "WR_REC"
SFC59 "RD_REC"
SFC65 "X_SEND"
SFC67 "X_GET"
SFC68 "X_PUT"
SFC69 "X_ABORT"
SFC72 "I_GET"
SFC73 "I_PUT"
SFC74 "I_ABORT"
SFC82 "CREA_DBL"
SFC83 "READ_DBL"
SFC84 "WRIT_DBL"
SFC90 "H_CTRL"
SFC102 "RD_DPARA"

2-6

S7-300 S7-400
A5E00261410-01

2 SFC


,
DP-,

SFC, SFC ,
SFC ,
.
,
SFC.
, SFC
(follow-on) .
SFC
7 "DP_PRAL"
11"DPSYC_FR"
13 "DPNRM_DG"
51 "RDSYSST"
55 "WR_PARM"
56 "WR_DPARM"
57 "PARM_MOD"
58 "WR_REC"
59 "RD_REC"
65 "X_SEND"
67 "X_GET"
68 "X_PUT"
69 "X_ABORT"
72 "I_GET"
73 "I_PUT"
74 "I_ABORT"
82 "CREA_DBL"
83 "READ_DBL"
84 "WRIT_DBL"
90 "H_CTRL"
102 "RD_DPARA"

...
IOID, LADDR
LADDR, GROUP, MODE
LADDR
SSL_ID, INDEX
IOID, LADDR, RECNUM
IOID, LADDR, RECNUM
IOID, LADDR
IOID, LADDR, RECNUM
IOID, LADDR, RECNUM
DEST_ID, REQ_ID
DEST_ID, VAR_ADDR
DEST_ID, VAR_ADDR
DEST_ID
IOID, LADDR, VAR_ADDR
IOID, LADDR, VAR_ADDR
IOID, LADDR
LOW_LIMIT, UP_LIMIT, COUNT, ATTRIB, SRCBLK
SRCBLK, DSTBLK
SRCBLK, DSTBLK
MODE, SUBMODE
LADDR, RECNUM

REQ
REQ (request [])
:
SFC ,
, REQ = 1 (
1).
,
SFC , (,
), SFC REQ ( 2).

S7-300 S7-400
A5E00261410-01

2-7

2 SFC

RET_VAL BUSY
RET_VAL BUSY
.
1 ( REQ=1) RET_VAL W#16#7001,
.
BUSY.

, RET_VAL
, BUSY 0.
2 (, ) RET_VAL
W#16#7002 ( ,
), BUSY .
:
-

, SFC13 "DPNRM_DG,"
SFC67 "X_GET" SFC72 "I_GET" RET_VAL
. BUSY
0.
, RET_VAL
, BUSY 0.

, SFC59 "RD_REC"
RET_VAL 0.
BUSY 0.
, RET_VAL , BUSY
0.

SFC, ,
RET_VAL 0, BUSY 0.
, RET_VAL , BUSY
0.

,
RET_VAL BUSY , .

. ,
,
SFC.

2-8

S7-300 S7-400
A5E00261410-01

2 SFC

, REQ, RET_VAL BUSY .




1

2 (n - 1)
N

REQ

RET_VAL

W#16#7001

W#16#7002
W#16#0000 (: SFC59 "RD_REC",
,
, SFC13
"DPNRM_DG," SFC67 "X_GET" SFC72
"I_GET", )
,

S7-300 S7-400
A5E00261410-01

BUSY
1
0
1

2-9

2 SFC

2-10

S7-300 S7-400
A5E00261410-01