![SEW-Eurodrive DHF41B Скачать руководство пользователя страница 61](http://html.mh-extra.com/html/sew-eurodrive/dhf41b/dhf41b_manual_1250085061.webp)
Manual – MOVI-PLC® advanced DHF41B DeviceNet and PROFIBUS DP-V1 Fieldbus Interfaces
61
10
Process data exchange with MOVI-PLC® advanced DHF41B
PROFIBUS DP-V1 Operating Characteristics
Control example
for Simatic S7
Process data exchange with MOVI-PLC
®
advanced
DHF41B is controlled using Simatic
S7 in accordance with the selected process data configuration either directly using load
and transfer commands or by means of special system functions,
SFC 14 DPRD_DAT
and
SFC15 DPWR_DAT
.
STEP7 example
program
In this example, MOVI-PLC
®
advanced
DHF41B is configured with the process data
configuration
10 PD
on input addresses PIW512... and output addresses POW512....
A data block DB3 is created with about 50 data words.
When SFC14 is called, the process input data is copied to data block DB3, data words
0 to 18. When SFC15 is called after the control program has been processed, the
process output data are copied from data words 20 - 38 to the output address
POW 512 ...
Note the length information in bytes for the
RECORD
parameter. The length information
must correspond to the configured length.
Refer to the online help for STEP7 for further information about the system functions.
//Start of cyclical program processing in OB1
BEGIN
NETWORK
TITLE = Copy PI data from the DHF41B control card to DB3, words 0...18
CALL SFC 14 (DPRD_DAT)
//Read DP slave record
LADDR := W#16#240 //Input address 512
RET_VAL:= MW 30
//Result in flag word 30
RECORD := P#DB3.DBX 0.0 BYTE 20 //Pointer
NETWORK
TITLE =PLC program with drive application
// PLC program uses the process data in DB3 for data exchange
// with the DHF41B control card
L DB3.DBW 0
//Load PE1
L DB3.DBW 2
//Load PE2
L DB3.DBW 4
//Load PE3
// etc.
L W#16#0006
T DB3.DBW 20
//Write 6hex to PO1
L 1500
T DB3.DBW 22
//Write 1500dec to PO2
L W#16#0000
T DB3.DBW 24
//Write 0hex to PO3
// etc.
NETWORK
TITLE = Copy PO data from DB3, words 20...38 to DHF41B control card
CALL SFC 15 (DPWR_DAT)
//Write DP slave record
LADDR := W#16#200
//Output address 512 = 200hex
RECORD := P#DB3.DBX 20.0 BYTE 20
//Pointer to DB/DW
RET_VAL:= MW 32
//Result in flag word 32
TIP
This sample program is a free service that demonstrates only the basic approach to
generating a PLC program as a non-binding sample. SEW is not liable for the contents
of the sample program.
0
0
I
Содержание DHF41B
Страница 2: ...SEW EURODRIVE Driving the world ...
Страница 123: ...SEW EURODRIVE Driving the world ...