show the entry list
Industrial Ethernet S7-300/400 CPs -- Configuring and programming communication -- Using communication blocks
How do you enable the ad-hoc mode when you call the TRCV instruction?
How do you use the blocks for MODBUS/TCP communication over an Industrial Ethernet CP of S7-300 and S7-400 in STEP 7 Professional (TIA Portal)?
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 do 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")
S7-300 CPU 31x -- Configuring and programming communication -- Using communication blocks
How do you cyclically read out the 8 channels of the FM 350-2 counter module as quickly as possible?
How do you read out the IP address of the S7-300 CPU in the user program at runtime?
How do you enable the ad-hoc mode when you call the TRCV instruction?
How do you use the blocks for MODBUS/TCP communication over the integrated PROFINET interface of the S7-300 and S7-400 CPUs and IM151-8 PN/DP CPU in STEP 7 Professional (TIA Portal)?
Which security modules can be reached with SOFTNET Security Client V4 over a secure IPsec tunnel connection?
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?
Which blocks for Modbus TCP can you rename or re-wire when the block numbers of the Modbus blocks are already being used in the user program?
How do you implement chronological messaging with S7-300 CPUs and WinCC?
How do you program communication blocks FB14 "GET" and FB15 "PUT" for data exchange in the S7 program of an S7-300 CPU?
How can you read out diagnostics data from a SIRIUS 3RK3 modular safety system using a S7-300/400 CPU?
Which ports are released for Modbus/TCP communication and how many Modbus clients can communicate with a SIMATIC S7 CPU as Modbus server?
How do you configure a specified and an unspecified S7 connection for data exchange between S7-300 and/or S7-400 by way of Industrial Ethernet CPs?
What restrictions are there for active jobs when communicating with SFC 58 / SFC 59 and SFB 52 / SFB 53 via PROFIBUS DP and PROFINET IO?
How do you program communication blocks FB12 "BSEND" and FB13 "BRCV" for data exchange in the S7 program of an S7-300 CPU?
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 the communication blocks FB63 "TSEND", FB64 "TRCV", FB65 "TCON" and FB66 "TDISCON" in order to use the TCP protocol for data exchange by means of the integrated PROFINET interface of an S7-300 or S7-400 CPU?
How do you establish OPEN MODBUS / TCP communication from a SIMATIC S7 and where can you find further information?
How do you program the communication blocks FB67 "TUSEND", FB68 "TURCV", FB65 "TCON" and FB66 "TDISCON" in order to use the UDP protocol for data exchange by means of the integrated PROFINET interface of a CPU?
How does data communication work between S7-300/S7- 400 and S7-200 via MPI using S7 basic communication?
How great is data consistency in the PUT and GET S7 communication functions for the individual S7-300 CPUs and C7 complete devices?
How can you access via PROFIBUS DP another CPU, which is connected to the PROFIBUS DP as a slave, from a DP master using basic communication with SFC72 "I_GET" and SFC73 "I_PUT"?
How can you access consistent data without SFC14/15 as part of the process image?
PROFIBUS S7-300/400 CPs -- Configuring and programming communication -- Using communication blocks
How do you program the communication blocks FC50 and FC60?
How do you program communication blocks FB12 "BSEND" and FB13 "BRCV" for data exchange in the S7 program of an S7-300 CPU?
How do you program communication blocks FB14 "GET" and FB15 "PUT" for data exchange in the S7 program of an S7-300 CPU?
Which blocks for Modbus TCP can you rename or re-wire when the block numbers of the Modbus blocks are already being used in the user program?
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 using the PROFIBUS DP protocol for data communication between SIMATIC S5 modules and SIMATIC S7 modules?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules by way of PROFIBUS using the free Layer 2 of the FDL protocol?
Where can you find sample programs and documentation for communication from SIMATIC S5 modules to SIMATIC S7 modules by way of PROFIBUS using the FDL protocol?
Where can you find sample programs and documentation for using the PROFIBUS FMS protocol for data communication between SIMATIC S5 modules and SIMATIC S7 modules as well as for data communication between SIMATIC S5 modules and PCs?
Notes on using an instance for multiple connection IDs
Processing the data from DP slaves via CP342-5 on CPU31x
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"?
How do you program the communication blocks FC5 and FC6?
What properties and special features does S7 Basis Communication offer?
PROFIBUS: diagnostics of S7 connections with STEP 7
Repeating the "BSEND" job (SFB12) when the "BRCV" block (SFB13) is in the "disabled" state ("EN_R = 0")
How do you program communication blocks FB8 "USEND" and FB9 "URCV" for data exchange on the S7-300?
Particularities when assigning parameters of the communication blocks of CP 342 / CP 343
What should you watch out for when upgrading the CP 342-5 or fitting spare parts?
Which version of the function blocks do you need to operate a CP 342-5?
CP 342-5 -- How can you tell that the CP 342-5 has withdrawn from the PROFIBUS?
CP 342-5 -- How do you program data communications when your DP slave only has outputs?
CP 342-5 -- How can you read and write consistent data of a DP slave via the CP 342-5?
How do you program communication blocks FB14 "GET" and FB15 "PUT" for data exchange in the S7 program of an S7-300 CPU?
Part number:

Instructions
Communication blocks FB14 "GET" and FB15 "PUT" have to be called in the program in order to transfer data between two S7-300 stations by way of an S7 connection configured in NetPro. The S7 connection does not have to be configured on both sides, because the S7 communication via FB14 "GET" and FB15 "PUT" is based on the server-client principle.

Features of the communication blocks FB14 "GET" and FB15 "PUT"

  • The FB14 and FB15 function blocks are asynchronous communication functions.
  • In this example, the blocks are called in the OB1 cycle (see also Entry ID: 2795485).
  • The FB14 and FB15 function blocks run for several OB1 cycles.
  • The FB14 and FB15 function blocks are activated by the "REQ" input parameter.
  • The end of the job is indicated by "DONE", "NDR" or "ERROR".
  • PUT and GET can communicate simultaneously by way of one connection.
  • The latest version of the FB14 "GET" and FB15 "PUT" communication blocks for data exchange by way of a CP343-1 or CP342-5 is available in the SIMATIC_NET_CP library under "CP 300 > Blocks".
  • The latest version of the FB14 "GET" and FB15 "PUT" communication blocks with the "CPU_300" family for data exchange by way of the integrated PROFINET interface of a S7-300 CPU, IM151-8 PN/DP CPU or IM154-8 CPU is available in the Standard Library under "Communication Blocks > Blocks".

Description of the sample program
The S7 program contains the call of the communication blocks FB14 "GET" and FB15 "PUT" from the Standard Library. Function block FB14 "GET" is for reading data out of a remote CPU and function block FB15 "PUT" is for writing data to a remote CPU.
The sample program shows the functions of the FB14 "GET" and FB15 "PUT" communication blocks using an S7 connection.

First create the hardware configuration for your S7-300 station.

Note
Configure the Marker byte 10 as clock marker. The read and write job is triggered by this clock marker. Save and compile the hardware configuration of your S7-300 station and load it into the CPU.
The timer resource T10 is used in this sample program.

Configure an S7 connection for the CPU in NetPro. You can configure a specified S7 connection if the communication partners are configured together in a STEP 7 project. If the communication partner is not configured in the same STEP 7 project as the S7-300 station, then an unspecified S7 connection is configured. Make sure you assign the IP address or PROFIBUS address correctly when you configure the S7 connection. You also need to make sure you assign the rack/slot and connection resource correctly. These are for clearly identifying the S7 connection between the communication partners.

You find the value that must be specified for the "ID" input parameter of communication blocks FB14 "GET" and FB15 "PUT" in the Properties dialog of the S7 connection -> tab "General".


Fig. 01

The STEP 7 program consists of blocks OB100, OB1, FB115, DB115, DB200, DB201, FB14 and FB15.

OB100
The OB100 is a restart OB and is run when the CPU is restarted (warm start). In this OB, the first communication trigger is enabled with marker 0.3 "START-UP".

OB1
OB1 is called cyclically. FB115 is called in this OB (instance data block: DB115) with M0.3 "START-UP" as parameter (INIT_COM). After FB115 has been run the M0.3 "START-UP" is reset.


Fig. 02

FB115
FB115 is called in the OB1 cycle. The FB14 "GET" and FB15 "PUT" communication block calls are in FB115.

At the "ID" input parameter of the communication blocks you must specify the connection number of the S7 connection configured in NetPro. The value for the "ID" input parameter must be taken from the Properties dialog of the S7 connection configured in NetPro (see Fig. 01).
You can change the connection number separately in FB115. Change the connection number in network 1 of FB115 in accordance with your configuration. The connection number is stored in a static tag and so in the instance data block DB115.
The connection number "1" is defined in this example.


Fig. 03

FB14 is activated by the input parameter "REQ" when the M10.6 clock marker has a positive edge and no job is running. The "REQ" input parameter is reset only when the read job is completed either successfully or with an error. This means that a new read job can only be triggered once the running job has been completed.
This locking of the function call is important, because the function is asynchronous and can last several cycles. Continual activation of the function block without waiting for the end of the active job can cause a communication overload.

The "ADDR_1" parameter refers to a data area in the remote CPU that is written to or read from, for instance: P#DB201.DBX0.0 BYTE 200. For the "RD_1" parameter you must specify the data area for the data read, for instance: P#DB200.DBX0.0 BYTE 100. The output parameters "NDR", "ERROR" and "STATUS" are required for the job evaluation and are only valid in the same cycle.


Fig. 04

If the read job is completed with an error, then the value of the output parameter "STATUS" of FB14 is saved for error analysis.


Fig. 05

FB15 is activated by the input parameter "REQ" when the M10.6 clock marker has a positive edge and no job is running. The "REQ" input parameter is reset only when the write job is completed either successfully or with an error. This means that a new write job can only be triggered once the running job has been completed.
This locking of the function call is important, because the function is asynchronous and can last several cycles. Continual activation of the function block without waiting for the end of the active job can cause a communication overload.

The "ADDR_1" parameter refers to a data area in the remote CPU that is written to or read from, for instance: P#DB200.DBX0.0 BYTE 20. For the "SD_1" parameter you must specify the data area for the data to be sent, for instance: P#DB201.DBX0.0 BYTE 20. The output parameters "DONE", "ERROR" and "STATUS" are required for the job evaluation and are only valid in the same cycle.


Fig. 06

If the write job is completed with an error, then the value of the output parameter "STATUS" of FB15 is saved for error analysis.


Fig. 07

Additional information

  • The manual "System and Standard Functions for S7-300/400 Volume 1/2", Chapter 22 "S7 Communication" provides information, for example, about the volume of data you can transfer using the FB14 "GET" and FB15 "PUT" communication blocks. This manual is available for downloading in Entry ID 44240604. ".
  • Entry ID 17628518 includes a description of how to configure a specified and unspecified S7 connection.

The STEP 7 project as download
The STEP 7 project contains a sample program for calling the FB14 and the FB15 communication blocks. It was created with STEP 7 V5.5.

Sample_S7-300_PUT_GET.zip ( 197 KB )

Note
Copy the latest version of the communication blocks FB14 and FB15 from the SIMATIC_NET_CP library or from the Standard Library into your user program and then call it in your user program.

 Entry ID:18610307   Date:2012-04-18 
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 
Topics
Help
Online Help
Guided Tour