show the entry list
Industrial Ethernet S7-300/400 CPs -- Configuring and programming communication -- Using communication blocks
How do you copy the CFC chart "Modbus" from the sample project for OPEN MODBUS / TCP into your user project?
What is the difference between the initialization and runtime parameters on the blocks for Modbus TCP?
Why is the status value A090 (hex) output for Modbus TCP although you have entered the correct license?
What are the differences between the licensed version and the downloadable demo version of the blocks for Modbus TCP?
Why is the value A083 (hex) output permanently at the STATUS output parameter of the block for Modbus TCP when the ENQ_ENR=true input parameter has been set?
How is data with variable message length transferred via the TCP protocol and received by an S7-300 station via the Industrial Ethernet CP?
How do you program the function blocks FB14 "GET" and FB15 "PUT" in the S7 program of the S7-300 in order to transfer more than 160 bytes of data?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the UDP protocol?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the TCP protocol?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules via Industrial Ethernet using the ISO transport protocol?
How do you program the FC10 "AG_CNTRL"?
Which commands (CMD) of the FC10 "AG_CNTRL" are supported by the IE CPs?
How many communication jobs may be used simultaneously in an S7-300 CPU for S7 communication via a CP343-1?
Which ports are released for Modbus/TCP communication and how many Modbus clients can communicate with a SIMATIC S7 CPU as Modbus server?
Notes on using an instance for multiple connection IDs
Internal call of FC5 (AG_SEND) with FTP client blocks (FC 40-44) for the CP343-1 IT (6GK7 343-1GX11-0XE0)
How do you program the communication blocks FB63 "TSEND", FB64 "TRECV", FB65 "TCON" and FB66 "TDISCON" in order to use the ISO-on-TCP protocol for data exchange by way of the integrated PROFINET interface of a CPU or by way of the CP443-1 Advanced?
How do you program communication blocks FC11 and FC12 for the PROFINET IO device?
Block calls for communications processors in multiple runtime layers
Changing the input parameter of the user blocks "AG_SEND" and "AG_RECV" during the runtime of a job
What should you watch out for if you transfer variables with the data type "REAL" when calling the communication blocks FC5/50 "AG_SEND/AG_LSEND" and FC6/60 "AG_RCV/AG_LRCV"?
What should you pay attention to when using the communication blocks FC53 "AG_SSEND" and FC63 "AG_SRECV"?
What points do you need to remember when calling communication blocks FC5/50 and FC6/60 in the STEP 7 user program of the CPU?
How do you program communication blocks FC11 and FC12 for the PROFINET IO controller?
How can you establish OPEN MODBUS / TCP communication from a SIMATIC S7 and where can you find further information?
How do you program the communication blocks FC50 and FC60?
Error STATUS "0x7000" on function block FC6 / FC60 (AG_SEND) with Send/Receive communication on the S7-400 controller
How do you program the communication blocks FC5 and FC6?
Sample program: S7 communication with the blocks SFB14 ("GET") and SFB15 ("PUT") with S7-400
Sample Program: S7 Communication with blocks FB14 ("GET") und FB15 ("PUT") of the CPU 317-2PN/DP
How do you program communication blocks FB8 "USEND" and FB9 "URCV" for data exchange on the S7-300?
"STATUS = 27" (0x001B) with the loadable S7 communication on the S7-300
How do you program communication blocks FB14 "GET" and FB15 "PUT" for data exchange in the S7 program of an S7-300 CPU?
How do you program communication blocks FB12 "BSEND" and FB13 "BRCV" for data exchange in the S7 program of an S7-300 CPU?
Repeating the "BSEND" job (SFB12) when the "BRCV" block (SFB13) is in the "disabled" state ("EN_R = 0")
Sample program: S7 communication with the blocks SFB14 ("GET") and SFB15 ("PUT") with S7-400
Part number:

QUESTION:
How do you program the communication blocks SFB14 ("GET") and SFB15 ("PUT") for data communication on the S7-400?

ANSWER:
In order to be able to communicate data between two S7-400 stations via an S7 connection configured in NetPro, you have to invoke communication functions in the S7 program. SFB14 ("GET") is for reading out the data from a remote CPU and SFB15 ("PUT") for writing data to a remote CPU.

Features of the communication blocks SFB14 ("GET") and SFB15 ("PUT")

  • SFB14 / SFB15 are system function blocks and therefore included in the firmware of the CPU.
  • SFB14 and SFB15 are asynchronous communication functions.
  • They can run over several OB1 cycles.
  • SFB14 and SFB15 are enabled with the input parameter ("REQ").
  • The end of job is indicated by "DONE", "NDR" or "ERROR".

The sample program includes an S7 connection via which data is read from a remote CPU with SFB14 and read to a remote CPU with SFB15.

Description of the sample program

The STEP 7 project includes two S7-400 stations with CPU 416-2DP and CP 443-1 for communication via Industrial Ethernet. The basis for communication is an S7 connection set up between the two stations. If you open the properties of the S7 connection in NetPro via "Right-click > Object Properties", you can view the block parameter "ID" of the communication function blocks. You must observe the specification accordingly when invoking SFB14 or SFB15 in order to permit data communication via the S7 connection.


Fig. 1: Properties of the S7 connection

The STEP 7 program consists of the blocks OB100, OB1, FB100, DB100, DB200, DB201,  SFB14 and SFB15.

  • OB100
    OB100 is a startup OB and is run when the CPU is restarted. In this OB the enable signal for triggering the first communication is given with M1.0 and M0.1.


Fig. 2: OB100

  • OB1
    OB1 is invoked cyclically. This OB contains the call of the FB100 (instance DB: DB100) with M1.0 and M0.1. Once FB100 has run, M1.0 is reset.


Fig. 3: OB1

  • FB100
    FB100 is invoked in the OB1 cycle. This FB contains the call of SFB14 ("GET") and SFB15 ("PUT"). SFB14 is enabled via input parameter "REQ" when clock marker M10.6 has a positive edge and there is no job running.
    This blocking of the function call is important, because the function is asynchronous and can last several cycles. Constant enabling of the system function block without waiting for the active job to finish can cause a communication overload. The input parameter "ID" from the Properties dialog of the S7 connection in NetPro has to be adopted (see Fig.1). The parameter "ADDR_1" specifies the data area to be read from the remote CPU. For parameter "RD_1" you have to specify the data area for the data read. The output parameters "NDR", "ERROR" and "STATUS" are required for evaluating the job and are valid only in the same cycle.


Fig. 4: FB100: invoking SFB14

If the block is run with an error, the status word of the block is saved for error analysis.


Fig. 5: FB100: saving the status word

SFB15 is enabled via the input parameter "REQ" when the clock marker M10.6 has a positive edge and no job is running. This blocking of the function call is important, because the function is asynchronous and can last several cycles. Constant enabling of the system function block without waiting for the active job to finish can cause a communication overload. The input parameter "ID" has to be adopted from the Properties dialog of the S7 connection in NetPro (see Fig. 1). For the parameter "ADDR_1" you have to specify the data area in the remote CPU to which the values are to be written. For the parameter "SD_1" you must specify the address of the data to be sent. The output parameters "DONE", "ERROR" and "STATUS" are required for evaluating the job and are valid only in the same cycle.


Fig. 6: FB100: invoking SFB15

If the block is run with an error, the status word of the block is saved for error analysis.


Fig. 7: FB100: saving the status word

The STEP 7 project for downloading:
The STEP 7 project contains a sample program for invoking SFB14 and the call of SFB15 with status evaluation. It was created with STEP 7 V5.2.

Sample_S7-400_PUT-GET-01.exe ( 389 KB )  

Copy the "Sample_S7-400_PUT-GET-01.exe" file into a separate directory and then start the file with a double-click. The STEP 7 project unpacks with all the associated subdirectories. Now you can use the SIMATIC Manager to open and process the project.

 Entry ID:1819293   Date:2004-07-12 
I regard this article....as helpfulas not helpful                                 
mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour