![SEW-Eurodrive DFE32B PROFINET IO Manual Download Page 60](http://html1.mh-extra.com/html/sew-eurodrive/dfe32b-profinet-io/dfe32b-profinet-io_manual_1250328060.webp)
60
Manual – DFE32B Fieldbus Interface PROFINET IO
6
SIMATIC S7 Sample program
Operating Behavior in Conjunction with PROFINET
6.6
SIMATIC S7 Sample program
In this example, the project planning for MOVIDRIVE
®
B or MOVITRAC
®
B has the pro-
cess data configuration "3 PD" on input addresses PIW576... and output addresses
POW576....
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, 2 and 4. When SFC15 is called after the control program has been processed, the
process output data are copied from data words 20, 22 and 24 to the output address
POW 576 ...
Note the length specification in bytes for the RECORD parameter. The length informa-
tion must correspond to the configured length.
Refer to the online help for STEP 7 for further information about the system functions.
INFORMATION
This example is a special and free service that demonstrates only the basic approach
to generating a PLC program. SEW is not liable for the contents of the sample pro-
gram.
//Start of cyclical program processing in OB1
BEGIN
NETWORK
TITLE = Copy PI data from inverter to DB3, words 0/2/4
CALL SFC 14 (DPRD_DAT)
//READ IO DeviceRecord
LADDR := W#16#240 //Input address 576
RET_VAL:= MW 30
//Result in flag word 30
RECORD := P#DB3.DBX 0.0 BYTE 6 //Pointer
NETWORK
TITLE =PLC program with drive application
// PLC program uses the process data in DB3 for
// drive control
L DB3.DBW 0//Load PI1 (status word 1)
L DB3.DBW 2
//Load PI2 (actual speed value)
L DB3.DBW 4
//Load PI3 (no function)
L W#16#0006
T DB3.DBW 20//Write 6hex to PO1 (control word = enable)
L 1500
T DB3.DBW 22//Write 1500dec to PO2 (speed setpoint = 300 rpm)
L W#16#0000
T DB3.DBW 24//Write 0hex to PO3 (however, it has no function)
//End of cyclical program processing in OB1
NETWORK
TITLE =Copy PO data from DB3, word 20/22/24 to inverter
CALL SFC 15 (DPWR_DAT)
//WRITE IO Device Record
LADDR := W#16#240
//Output address 576 = 240hex
RECORD := P#DB3.DBX 20.0 BYTE 6
//Pointer to DB/DW
RET_VAL:= MW 32
//Result in flag word 32
0
0
I
Summary of Contents for DFE32B PROFINET IO
Page 2: ...SEW EURODRIVE Driving the world...
Page 131: ......