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

7 SFC

S7-300 S7-400
A5E00261410-01

7-1

7 SFC

7.1


,
. 0
240. (.
).
,
, .
0 240.
(. ).

, .
,
.

,
,
. ,
SFC
.

S7-300:
2 14

2 127

S7-300:
2 14
0 1
16
.
, 240

128 240

7-2

, 240

S7-400
-


SFC
56 "WR_DPARM"
57 "PARM_MOD"

55 "WR_PARM"
56 "WR_DPARM"
57 "PARM_MOD"

55 "WR_PARM"
56 "WR_DPARM"
57 "PARM_MOD"
58 "WR_REC"
55 "WR_PARM"
56 "WR_DPARM"
57 "PARM_MOD"
58 "WR_REC"

S7-300 S7-400
A5E00261410-01

7 SFC

,
,
. ,
SFC
.



(, ,
)


( 0)

2 127
128
240


SFC
51 "RDSYSST"
(SSL_ID 00B1H)
59 "RD_REC"

S7-300: 16 51 "RDSYSST"
S7-400: 7
(SSL_ID 00B2H 00B3H)
220
59 "RD_REC"
59 "RD_REC"
, 240

, 240

59 "RD_REC"



,
,
.
,
RET_VAL.
.
SFC
CPU. /70/ /101/.

S7-300 S7-400
A5E00261410-01

7-3

7 SFC

7.2 SFC54
"RD_DPARM"

SFC54 "RD_DPARM" (read defined parameter [


])
RECNUM SDB1xy.
,
RECORD.

IOID

INPUT

BYTE

I, Q, M, D, L,

LADDR

INPUT

WORD

I, Q, M, D, L,

RECNUM

INPUT

BYTE

RET_VAL

OUTPUT

INT

I, Q, M, D, L,

I, Q, M, D, L

RECORD

OUTPUT

ANY

I, Q, M, D, L

(ID) :
B#16#54 = (PI)
B#16#55 = (PQ)
, ID
.
, B#16#54.
.

.
(
: 0 240)
, ,
,
.
:
,
,
.

.
BYTE.


. " SFC57
"PARM_MOD".

7-4

S7-300 S7-400
A5E00261410-01

7 SFC

7.3
SFC102 "RD_DPARA"

SFC102 "RD_DPAR" (read predefined parameters [


])
RECNUM SDB1xy.
,
RECORD.


SFC102 "RD_DPARA" , ..
. SFC102
REQ =1.

RET_VAL BUSY.
REQ,
RET_VAL BUSY.

REQ
LADDR

INPUT
INPUT

BOOL
WORD

I, Q, M, D, L
I, Q, M, D, L,

RECNUM

INPUT

BYTE

RET_VAL

OUTPUT

INT

I, Q, M, D, L,

I, Q, M, D, L

BUSY
RECORD

OUTPUT
OUTPUT

BOOL
ANY

I, Q, M, D, L
I, Q, M, D, L

REQ = 1:
.

.
(
: 0 240)
, ,
,
.
:
,
,
.
BUSY = 1: .

.
BYTE.


. " SFC57
"PARM_MOD".

S7-300 S7-400
A5E00261410-01

7-5

7 SFC

7.4 SFC55
"WR_PARM"

SFC55 WR_PARM (write parameter [ ])


RECORD . ,
,
SDB, .

:
0 ( 0
).
SDB 100 129,
.

/71/ /101/.

REQ

INPUT

BOOL

IOID

INPUT

BYTE

LADDR

INPUT

WORD

I, Q, M, D, L,

RECNUM

INPUT

BYTE

RECORD
RET_VAL

INPUT
OUTPUT

ANY
INT

I, Q, M, D, L,

I, Q, M, D, L
I, Q, M, D, L

BUSY

OUTPUT

BOOL

I, Q, M, D, L

I, Q, M, D, L,

I, Q, M, D, L,

REQ = 1:
:
B#16#54 = (PI)
B#16#55 = (PQ)
,

.
, B#16#54.
.

.



,
.
BUSY = 1:
.

RECORD
RECORD
SFC. , ,
RECORD
SFC ( ).

7-6

S7-300 S7-400
A5E00261410-01

7 SFC


. " SFC57
"PARM_MOD".

( S7-400)
W#16#8544, ,

/, .

S7-300 S7-400
A5E00261410-01

7-7

7 SFC

7.5 , ,
SFC56 "WR_DPARM"

SFC56 WR_DPARM (write default parameter [ ,


])
RECNUM SDB1xy .
,
.

REQ

INPUT


BOOL
I, Q, M, D, L,

BYTE
I, Q, M, D, L,

IOID

INPUT

LADDR

INPUT

WORD

I, Q, M, D, L,

RECNUM

INPUT

BYTE

RET_VAL

OUTPUT

INT

I, Q, M, D, L,

I, Q, M, D, L

BUSY

OUTPUT

BOOL

I, Q, M, D, L

REQ = 1:
:
B#16#54 = (PI)
B#16#55 =
(PQ)
,

.
,
B#16#54.
.

.


,

.
BUSY = 1:
.


. " SFC57
"PARM_MOD".

7-8

S7-300 S7-400
A5E00261410-01

7 SFC

7.6 SFC57
"PARM_MOD"

SFC57 PARM_MOD (parametrize module [


]) ,
STEP 7 SDB.
,
.

REQ

INPUT

BOOL

I, Q, M, D, L,

I, Q, M, D, L,

IOID

INPUT

BYTE

LADDR

INPUT

WORD

I, Q, M, D, L,

RET_VAL

OUTPUT

INT

I, Q, M, D, L

BUSY

OUTPUT

BOOL

I, Q, M, D, L

REQ = 1:
:
B#16#54 = (PI)
B#16#55 =
(PQ)
,

.
, B#16#54.
.

.
,
,
.
BUSY = 1:
.


"" ( W#16#8xyz)
:
( : W#16#80A2 80A4, 80Cx):
,
, , SFC
( , ).
,
(W#16#80C3).
( : W#16#809x, 80A1, 80Bx, 80Dx):
.
SFC .

RECORD (W#16#80B1).

S7-300 S7-400
A5E00261410-01

7-9

7 SFC

SFC54 "RD_DPARM", SFC55


"WR_PARM", SFC56 "WR_DPARM" SFC57 "PARM_MOD".

(W#16#...)

7000

REQ=0:
; BUSY 0.
REQ=1:
; BUSY 1.
(REQ ):
; BUSY
1.

: SDB1/SDB2x
.
ANY , BYTE.

7001
7002

8090

8092

8093

80A1

80A2

80A3
80A4

80B0
80B1

80B2
80B3
80C1

80C2

80C3

7-10

SFC ,
LADDR IOID ( :
S7-300 S7-300, S7-400 S7400, S7-DP S7-300 S7-400).

(
).
DP 2, ,
/ slave DP
DP
/
.

SFC ,
.

. SFC54 "RD_PARM":
, RECORD,
.
.

SDB1.


.

CPU
.

( ..) .

S7-400
SFC54 "RD_PARM"
SFC55 "WR_PARM"
-

1)

1)

1)

CPU

DP 1)
1)
-

1)
1)
1)

1)

1)

S7-300 S7-400
A5E00261410-01

7 SFC


(W#16#...)
80C4

80C5
80C6

80D0
80D1

80D2
80D3
80D4
80D5
8xyy

.
.

.

.
.
-

( ).
SDB .

SDB.
( 241 STEP
7).

.
SDB ,
.
SDB:
SDB SDB.
.
, .
RET_VAL

1)

1)

1)
-

S7-300
SFC55
"WR_PARM"
8xyy

1) SFC54 "RD_DPARM"

S7-300 S7-400
A5E00261410-01

7-11

7 SFC

7.7 SFC58 "WR_REC"

SFC58 WR_REC (write record [ ])


, RECORD, .
, REQ
1 SFC58.
, SFC BUSY 0.
BUSY 1, .

REQ

INPUT

BOOL

I, Q, M, D, L,

I, Q, M, D, L,

IOID

INPUT

BYTE

LADDR

INPUT

WORD

I, Q, M, D, L,

RECNUM

INPUT

BYTE

RECORD

INPUT

ANY

I, Q, M, D, L,

I, Q, M, D, L

RET_VAL

OUTPUT

INT

I, Q, M, D, L

BUSY

OUTPUT

BOOL

I, Q, M, D, L

REQ = 1:
:
B#16#54 = (PI)
B#16#55 = (PQ)
,

. ,
B#16#54.
.

.
( :
2 240)
.
BYTE.
,
,
.
BUSY = 1: .

RECORD
RECORD
SFC. , ,
RECORD
SFC ( ).

. " SFC 59
"RD_REC".
( S7-400)
W#16#8544, ,

/, .
.
7-12

S7-300 S7-400
A5E00261410-01

7 SFC

7.8 SFC59 "RD_REC"

SFC59 "RD_REC" (read record [ ])


RECNUM .
, SFC59 REQ
1. ,
SFC BUSY 0. BUSY
1, .
, RECORD,
.

1 FM CP,
1997 ( " "),
SFC59 .
" FM CP S7-300
1".

DPV1 GSD (GSD . 3), DP- DP-


"S7 compartible",
/ SFC59
. , DP-
( + 3).
: DP- DP "DPV1".

S7-300 S7-400
A5E00261410-01

7-13

7 SFC

REQ

INPUT

BOOL

I, Q, M, D, L,

REQ = 1:

IOID

INPUT

BYTE

I, Q, M, D, L,

(ID) :
B#16#54 = (PI)
B#16#55 = (PQ)
, ID
.
, B#16#54.

LADDR

INPUT

WORD

I, Q, M, D, L,

.

.

RECNUM

INPUT

BYTE

I, Q, M, D, L,

(
0 240)

RET_VAL

OUTPUT

INT

I, Q, M, D, L

, ,
,
.
,
,
,

( : +1
+240).

BUSY

OUTPUT

BOOL

I, Q, M, D, L

BUSY = 1: .

RECORD

OUTPUT

ANY

I, Q, M, D, L


.
SFC59 ,
RECORD

.
BYTE.

RET_VAL
,
.
, RET_VAL :
-

7-14

0:
(
).
(
: +1 + 240), ,
.

S7-300 S7-400
A5E00261410-01

7 SFC

W#16#8545, ,
, , /,
.
/.

RECORD

,
, 241 .
, RET_VAL
.

FM CP S7-300 1
SFC59 "RD_REC"
1 FM S7-300 CP S7-300,
:
,
, RECORD.
RET_VAL W#16#80B1.
,
, CPU ,
, RECORD,
RECORD.
RET_VAL 0.
, RECORD,
, CPU RECORD.
RET_VAL 0.


"" ( W#16#8xyz)
:
( W#16#80A2 80A4, 80Cx):
,
- , ,
SFC ( ).
,
(W#16#80C3).
( W#16#809x, 80A1, 80Bx, 80Dx):
.
SFC , .

RECORD (W#16#80B1).
S7-300 S7-400
A5E00261410-01

7-15

7 SFC

DPV1
SFC58 "WR_REC" ,
DPV1 SFC59 "RD_REC",
DPV1 DPV1, DP
,
DPV1, :
W#16#8000 W#16#80FF
W#16#F000 W#16#FFFF, DP
SFC.
, CPU W#16#80A2 SFC
.
, DPV1-,
. " DP
SFB 54 "RALRM" STATUS () [3].

SFC58 "WR_REC" SFC59


"RD_REC".

(W#16#...)
7000
7001
7002

8090

8092
8093

80A0

7-16

REQ=0:
; BUSY 0.
REQ=1:
; BUSY 1.
(REQ ):
; BUSY
1.

: SDB1/SDB2X
.
, ANY, BYTE.
SFC ,
LADDR IOID (
: S7-300 S7-300,
S7-400 S7-400, S7-DP S7300 S7-400).


;
-: I/
CPU (., CPU
STOP).

S7-400
-

SFC59
"RD_REC"

S7-300 S7-400
A5E00261410-01

7 SFC


(W#16#...)
80A1

80A2
80A3

80A4

80B0

80B1




;
-: I/
CPU (., CPU
STOP).
DP 2, ,
.
DP

/.
, .

SFC .
.
241 .
SFC58 (WR_REC) 0
1 .
RECORD
.

SFC58
"WR_REC"


CPU
DP.
-

80B2
80B3
80C0

80C1

80C2

80C3

.

, SDB1.
SFC59 (RD_REC):
, ,
.
SFC13 (DPNRM_DG):
.


.

CPU
.

( ..)
.

S7-300 S7-400
A5E00261410-01

SFC58 "WR_REC":

SFC59 "RD_REC"
(
FM S7-300 CP
S7-300): >

SFC13 "DPNRM_DG":
<
-

SFC59
(RD_REC) SFC13
"DPNRM_DG"

7-17

7 SFC


(W#16#...)
80C4

80C5

7-18

.
.
.


.
.

80C6



( ).

8xyy

, .
RET_VAL

S7-300 S7-400
A5E00261410-01

7 SFC

7.9 SFC59 "RD_REC"


CPU S7-300

SFC59 "RD_REC" CPU,


:
CPU

CPU 312 IFM

6ES7312-5AC00-0AB0

CPU 313

6ES7313-1AD00-0AB0

CPU 314

6ES7314-1AE01-0AB0

CPU 314 IFM

6ES7314-5AE00-0AB0

CPU 315

6ES7315-1AF00-0AB0

CPU 315-2DP

6ES7315-2AF00-0AB0

CPU 614

6ES7614-1AH00-0AB3

SFC59 "RD_REC" (read data record [ ])


RECNUM .
,
RECORD, .

REQ

INPUT

BOOL

I, Q, M, D, L,

I, Q, M, D, L,

IOID

INPUT

BYTE

LADDR

INPUT

WORD

I, Q, M, D, L,

RECNUM

INPUT

BYTE

RET_VAL

OUTPUT

INT

I, Q, M, D, L,

I, Q, M, D, L

BUSY
RECORD

OUTPUT
OUTPUT

BOOL
ANY

I, Q, M, D, L
I, Q, M, D, L

REQ = 1: .
(ID) :
B#16#54 = (PI)
B#16#55 = (PQ)
, ID
.
, B#16#54.
.

.
(
0 240).

,
.
BUSY = 1: .

.
SFC59 ,
RECORD

.
BYTE.

S7-300 S7-400
A5E00261410-01

7-19

7 SFC

RECORD
RECORD
:
, .
, RECORD ,
.
RECORD ,
.


CPU
RECORD. ,
DP :
.
, RECORD,
, CPU
, RECORD,
RECORD. RET_VAL 0.
RECORD
, CPU RET_VAL .
RECORD ,
, CPU
RECORD. RET_VAL 0.
slave- DP S7.
DP- S7
, CPU.
RECORD ,
DP- S7-300 CPU
.
RECORD ,
DP- S7-300 CPU
. CPU
, DP- S7:
DP- S7 ,
RET_VAL.
DP- S7 ,
RECORD.
RET_VAL
RECORD . ( , ,
.)

SFC59 ,
RECORD
.

7-20

S7-300 S7-400
A5E00261410-01

7 SFC



(W#16#...)
7000
7001
7002
8090
8093

80A0
80A2
80A3
80A4
80B0
80B1
80B2
80B3
80C0
80C2
80C3
80C4

80C5
80C6

REQ=0:
; BUSY 0.
REQ=1:
; BUSY 1.
(REQ
): ;
BUSY 1.

:
SDB1/SDB2x .
SFC ,
LADDR IOID (
: S7-300
S7-300 DP).

(
).
DP 2

DP
/

CPU

DP.
-

SFC .
.
241 .
RECORD >

.

, SDB1.
,
, .

CPU
.
( ..)
.
.
.
.



.
.

( ).

S7-300 S7-400
A5E00261410-01

7-21

7 SFC

7.10 SFC 5559


S7-400
S7-400 SFC 5559
W#16#80Fx. , ,
. .


(W#16#...)

7-22

0000

8080

8081

8xyy

, .
RET_VAL

S7-300 S7-400
A5E00261410-01